/* ============================================================================
   ATLAS HOSPITALITY — Design System
   A late-night, venue-operations aesthetic: deep charcoal canvas, a violet/pink
   duotone accent pulled from stage lighting, Sora for display type (confident,
   geometric — reads like a marquee), Inter for body copy (quiet, legible).
   ============================================================================ */

:root {
  --atlas-bg:        #0E1016;
  --atlas-surface:   #161923;
  --atlas-surface-2: #1D2130;
  --atlas-border:    #2A2F42;
  --atlas-text:      #ECEDF3;
  --atlas-text-dim:  #9498AC;
  --atlas-violet:    #7C5CFF;
  --atlas-violet-dim:#4A3A9E;
  --atlas-pink:      #FF4D8D;
  --atlas-amber:     #FFB020;
  --atlas-green:     #2ECC8F;
  --atlas-red:       #FF5D5D;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-bs-theme="light"] {
  --atlas-bg:        #F5F5FA;
  --atlas-surface:   #FFFFFF;
  --atlas-surface-2: #F0F0F7;
  --atlas-border:    #E2E2ED;
  --atlas-text:      #16171F;
  --atlas-text-dim:  #6B6C7E;
}

* { box-sizing: border-box; }

body {
  background: var(--atlas-bg);
  color: var(--atlas-text);
  font-family: var(--font-body);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-name, .stat-value, .party-name {
  font-family: var(--font-display);
}

a { text-decoration: none; }

/* ---------------------------------------------------------------------- */
/* SHELL LAYOUT                                                            */
/* ---------------------------------------------------------------------- */
.atlas-shell {
  display: flex;
  min-height: 100vh;
}

.atlas-sidebar {
  width: 264px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--atlas-surface) 0%, var(--atlas-bg) 100%);
  border-right: 1px solid var(--atlas-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.5rem 1.25rem 1rem;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--atlas-violet), var(--atlas-pink));
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 18px rgba(124,92,255,.45);
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
}

.sidebar-nav { padding: .5rem .75rem; flex: 1; }

.nav-section-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--atlas-text-dim);
  font-weight: 600;
  padding: 1rem .6rem .35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--atlas-text-dim);
  font-size: .89rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}

.nav-link i { width: 18px; text-align: center; opacity: .85; }

.nav-link:hover { background: var(--atlas-surface-2); color: var(--atlas-text); }

.nav-link.active {
  background: linear-gradient(90deg, rgba(124,92,255,.18), rgba(255,77,141,.10));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--atlas-violet);
}

.sidebar-footer {
  padding: 1rem 1.1rem 1.25rem;
  border-top: 1px solid var(--atlas-border);
}

.user-chip { display: flex; align-items: center; gap: .6rem; }

.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--atlas-surface-2);
  border: 1px solid var(--atlas-border);
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700;
  color: var(--atlas-violet);
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: .85rem; font-weight: 600; }
.user-role { font-size: .72rem; color: var(--atlas-text-dim); }

/* ---------------------------------------------------------------------- */
/* MAIN / TOPBAR                                                           */
/* ---------------------------------------------------------------------- */
.atlas-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.atlas-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--atlas-border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--atlas-bg) 85%, transparent);
  backdrop-filter: blur(10px);
  z-index: 40;
}

.topbar-title { font-size: 1.15rem; font-weight: 700; margin: 0; flex: 1; }

.topbar-actions { display: flex; gap: .5rem; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  color: var(--atlas-text-dim);
  transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--atlas-text); border-color: var(--atlas-violet); }

.sidebar-toggle {
  background: none; border: none; color: var(--atlas-text); font-size: 1.2rem;
}

.atlas-content { padding: 1.75rem; flex: 1; }

/* ---------------------------------------------------------------------- */
/* CARDS / SURFACES                                                        */
/* ---------------------------------------------------------------------- */
.atlas-card {
  background: var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.atlas-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.atlas-card-header h3 { font-size: 1rem; margin: 0; font-weight: 700; }

/* Stat widgets */
.stat-card {
  background: var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--atlas-violet), var(--atlas-pink));
}
.stat-label { font-size: .78rem; color: var(--atlas-text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.9rem; font-weight: 800; margin-top: .2rem; }
.stat-sub { font-size: .78rem; color: var(--atlas-text-dim); margin-top: .15rem; }

/* Buttons */
.btn-atlas-primary {
  background: linear-gradient(135deg, var(--atlas-violet), #6845e6);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(124,92,255,.35);
}
.btn-atlas-primary:hover { color: #fff; filter: brightness(1.08); }

.btn-atlas-outline {
  background: transparent;
  border: 1px solid var(--atlas-border);
  color: var(--atlas-text);
  font-weight: 500;
}
.btn-atlas-outline:hover { border-color: var(--atlas-violet); color: var(--atlas-text); }

/* Party template chip / card */
.party-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--atlas-surface-2);
  border: 1px solid var(--atlas-border);
}
.party-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.party-template-card {
  background: var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform .15s ease, border-color .15s ease;
  height: 100%;
}
.party-template-card:hover { transform: translateY(-2px); border-color: var(--atlas-violet); }
.party-template-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: .6rem;
}
.party-name { font-weight: 700; font-size: 1rem; margin-bottom: .15rem; }
.party-meta { font-size: .78rem; color: var(--atlas-text-dim); }

/* Tables */
.table-atlas { --bs-table-bg: transparent; color: var(--atlas-text); }
.table-atlas thead th {
  border-bottom: 1px solid var(--atlas-border);
  color: var(--atlas-text-dim);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.table-atlas td { border-color: var(--atlas-border); vertical-align: middle; }

/* Badges */
.badge-status-active { background: rgba(46,204,143,.15); color: var(--atlas-green); }
.badge-status-sick { background: rgba(255,176,32,.15); color: var(--atlas-amber); }
.badge-status-holiday { background: rgba(124,92,255,.15); color: var(--atlas-violet); }
.badge-status-suspended,
.badge-status-inactive { background: rgba(255,93,93,.15); color: var(--atlas-red); }

/* Schedule grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, minmax(140px, 1fr));
  border: 1px solid var(--atlas-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--atlas-surface);
}
.schedule-grid .grid-cell {
  border-right: 1px solid var(--atlas-border);
  border-bottom: 1px solid var(--atlas-border);
  padding: .5rem;
  min-height: 90px;
}
.schedule-grid .grid-header {
  background: var(--atlas-surface-2);
  font-weight: 700;
  font-size: .82rem;
  padding: .65rem .75rem;
  text-align: center;
  position: sticky; top: 0; z-index: 5;
}
.schedule-grid .employee-cell {
  background: var(--atlas-surface-2);
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600;
  position: sticky; left: 0; z-index: 4;
}

.shift-block {
  border-radius: 8px;
  padding: .35rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: .3rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.shift-block small { display: block; font-weight: 400; opacity: .85; }

.add-shift-btn {
  width: 100%; height: 100%;
  min-height: 40px;
  border: 1.5px dashed var(--atlas-border);
  border-radius: 8px;
  background: transparent;
  color: var(--atlas-text-dim);
  font-size: .8rem;
  transition: border-color .15s, color .15s;
}
.add-shift-btn:hover { border-color: var(--atlas-violet); color: var(--atlas-violet); }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, rgba(124,92,255,.25), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(255,77,141,.2), transparent 45%),
              var(--atlas-bg);
  padding: 1rem;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--atlas-surface);
  border: 1px solid var(--atlas-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
}
.login-brand {
  display: flex; align-items: center; gap: .6rem; margin-bottom: 1.75rem;
}

.form-control, .form-select {
  background: var(--atlas-surface-2);
  border: 1px solid var(--atlas-border);
  color: var(--atlas-text);
}
.form-control:focus, .form-select:focus {
  background: var(--atlas-surface-2);
  color: var(--atlas-text);
  border-color: var(--atlas-violet);
  box-shadow: 0 0 0 .2rem rgba(124,92,255,.25);
}
.form-control::placeholder { color: var(--atlas-text-dim); }
label.form-label { font-size: .84rem; font-weight: 600; color: var(--atlas-text-dim); }

/* Modal dark theming inherits via data-bs-theme on <html> */

@media (max-width: 991px) {
  .atlas-sidebar {
    position: fixed;
    left: -280px;
    transition: left .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .atlas-sidebar.open { left: 0; }
  .schedule-grid { grid-template-columns: 140px repeat(7, minmax(120px, 1fr)); }
}
