/* ============================================================
   GastronomiX — Modern Dark UI  v2.0
   Design: Deep slate base · Indigo/violet accent · Glass cards
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #0d0f14;
  --surface:     #13151c;
  --surface2:    #1a1d27;
  --surface3:    #22263a;
  --accent:      #7c6af7;        /* indigo-violet */
  --accent2:     #6254e8;
  --accent-glow: rgba(124,106,247,.18);
  --accent-line: rgba(124,106,247,.45);
  --text:        #e4e6f0;
  --text2:       #7a7f99;
  --text3:       #4e5268;
  --green:       #34d399;
  --green-bg:    rgba(52,211,153,.12);
  --red:         #f87171;
  --red-bg:      rgba(248,113,113,.12);
  --yellow:      #fbbf24;
  --yellow-bg:   rgba(251,191,36,.12);
  --blue:        #60a5fa;
  --blue-bg:     rgba(96,165,250,.12);
  --purple:      #c084fc;
  --purple-bg:   rgba(192,132,252,.12);
  --border:      rgba(255,255,255,.07);
  --border2:     rgba(255,255,255,.04);
  --sidebar-w:   256px;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:   0 2px 10px rgba(0,0,0,.3);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { color-scheme:dark; scroll-behavior:smooth; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Brand header */
.sidebar h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  padding: 4px 10px 0;
  margin-bottom: 2px;
}
.sidebar h2 img {
  width: 30px;
  height: 30px;
  border-radius: 8px !important;
  object-fit: cover;
  flex-shrink: 0;
}

/* Slogan under brand */
.sidebar > p.slogan {
  font-size: .72rem;
  color: var(--text3);
  padding: 0 10px;
  margin-bottom: 18px;
  line-height: 1.4;
}

/* Section label */
.sidebar .nav-section {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 14px 10px 4px;
}

/* Nav links */
.sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text2);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 450;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar a .nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: .75;
}
.sidebar a:hover {
  background: var(--surface2);
  color: var(--text);
}
.sidebar a:hover .nav-icon { opacity: 1; }
.sidebar a.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}
.sidebar a.active .nav-icon { opacity: 1; }

/* Logout */
.sidebar a.logout {
  color: var(--red);
  margin-top: 4px;
}
.sidebar a.logout:hover { background: var(--red-bg); color: var(--red); }

/* Divider */
.sidebar hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 10px 4px;
}

/* User chip */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text2);
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 6px 0 2px;
}
.user-info .u-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex-shrink: 0;
}

/* Footer version string */
.sidebar .sidebar-footer {
  font-size: .67rem;
  color: var(--text3);
  text-align: center;
  padding: 10px 6px 0;
  line-height: 1.5;
}

/* ── Main content ────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  padding: 40px clamp(20px, 4vw, 60px);
  overflow-x: auto;
}

/* Page title row */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.content h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text);
  margin-bottom: 28px;
}
.content h2 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 28px 0 14px;
}

/* ── Stat cards (dashboard) ──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.stat-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card h3 {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.05em;
  line-height: 1;
}
.stat-card .stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 1.5rem;
  opacity: .18;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-frueh, .badge-genehmigt  { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(52,211,153,.25); }
.badge-spaet                    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(96,165,250,.25); }
.badge-nacht                    { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(192,132,252,.25); }
.badge-frei                     { background: rgba(255,255,255,.06); color: var(--text2); border: 1px solid var(--border); }
.badge-beantragt                { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(251,191,36,.25); }
.badge-abgelehnt                { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(248,113,113,.25); }

/* ── Data table ──────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: .875rem;
}
.data-table th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--text2);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface2); }
.low-stock { background: rgba(248,113,113,.07); }

/* Status text colours */
.status-beantragt, .status-offen  { color: var(--yellow); }
.status-genehmigt, .status-geliefert { color: var(--green); }
.status-abgelehnt, .status-storniert { color: var(--red); }
.status-bestellt                  { color: var(--blue); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 20px var(--accent-glow); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); }
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.2);
}
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 6px; }

/* legacy compat */
.btn-ok  { @extend .btn; background: var(--green); color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: .85rem; }
.btn-del { background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: var(--red); opacity: .7; transition: opacity .15s; }
.btn-del:hover { opacity: 1; }

/* ── Forms ───────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
select option { background: var(--surface2); }
label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Add / filter card */
.add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 22px;
  overflow: hidden;
}
.add-form summary {
  cursor: pointer;
  padding: 14px 20px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  list-style: none;
  transition: background .15s;
}
.add-form summary:hover { background: var(--surface2); }
.add-form summary::marker, .add-form summary::-webkit-details-marker { display: none; }
.add-form summary::before {
  content: '+';
  width: 20px;
  height: 20px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
details[open] .add-form summary::before { content: '−'; }
.add-form-body {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 0;
}
.grid-form input, .grid-form select {
  padding: 10px 12px;
}
.grid-form button, .grid-form .btn {
  align-self: end;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: .875rem;
  transition: background .15s;
  min-height: 42px;
}
.grid-form button:hover { background: var(--accent2); }

/* Filter strip */
.filter-section { margin-bottom: 22px; }
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: flex-end;
}
.filter-form > * { flex: 1 1 160px; min-width: 0; }
.filter-form button, .filter-form .btn {
  flex: 0 0 auto;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-size: .875rem;
  min-height: 42px;
}
.filter-form button:hover { background: var(--accent2); }

/* week form (shifts) */
.week-form { display: flex; flex-direction: column; gap: 16px; }
.week-table input, .week-table select { width: 100%; }
.checkbox-line { display: flex; align-items: center; gap: 8px; color: var(--text2); }

/* Staff selector */
.staff-selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}

/* ── Stats box ───────────────────────────────────────────────── */
.stats-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 22px;
}
.stats-box h3 {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: 12px;
}
.stats-box ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.stats-box li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .85rem;
  color: var(--text2);
}
.stats-box strong { color: var(--text); }

/* ── Login page ──────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-box .login-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
  margin: 0 auto 18px;
  display: block;
  border: 2px solid var(--border);
}
.login-box h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 4px;
}
.login-box .subtitle {
  color: var(--text2);
  font-size: .875rem;
  margin-bottom: 28px;
}
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.login-box input {
  padding: 12px 14px;
  font-size: .95rem;
}
.login-box button {
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s, box-shadow .15s;
  margin-top: 4px;
}
.login-box button:hover {
  background: var(--accent2);
  box-shadow: 0 0 24px var(--accent-glow);
}
.error {
  background: var(--red-bg);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: 8px;
  color: var(--red);
  padding: 10px 14px;
  font-size: .875rem;
  text-align: center;
  margin-bottom: 14px;
}
.hint {
  color: var(--text3);
  font-size: .78rem;
  margin-top: 16px;
}
.btn-staff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 11px 24px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .15s, color .15s, background .15s;
  width: 100%;
}
.btn-staff:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-glow);
}
.login-box .footer {
  color: var(--text3);
  font-size: .72rem;
  margin-top: 20px;
}

/* ── Notifications / flash ───────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash-success { background: var(--green-bg); color: var(--green); border-color: rgba(52,211,153,.25); }
.flash-error   { background: var(--red-bg);   color: var(--red);   border-color: rgba(248,113,113,.25); }
.flash-info    { background: var(--blue-bg);  color: var(--blue);  border-color: rgba(96,165,250,.25); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .layout { flex-direction: column !important; }

  .mobile-header { display: flex !important; }
  .sidebar-backdrop.active { display: block !important; }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 101 !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    display: flex !important;
    flex-direction: column !important;
    background: var(--surface) !important;
    border-right: 1px solid var(--border) !important;
    padding: 24px 12px 20px !important;
    overflow-y: auto !important;
    white-space: normal !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .sidebar h2 {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    padding: 4px 10px 0 !important;
    margin-bottom: 2px !important;
  }
  .sidebar h2 img {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
  }
  .sidebar > p.slogan,
  .sidebar hr,
  .sidebar .user-info,
  .sidebar .sidebar-footer,
  .sidebar .nav-section {
    display: block !important;
    width: 100% !important;
  }
  .sidebar .user-info {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .sidebar a {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    color: var(--text2) !important;
    text-decoration: none !important;
    padding: 9px 10px !important;
    border-radius: 8px !important;
    font-size: .875rem !important;
    font-weight: 450 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    flex-shrink: 0 !important;
    border-left: 0 !important;
  }
  .sidebar a:hover {
    background: var(--surface2) !important;
    color: var(--text) !important;
  }
  .sidebar a.active {
    background: var(--accent-glow) !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
    border-left: 2px solid var(--accent) !important;
    padding-left: 8px !important;
    box-shadow: none !important;
  }
  .sidebar a.logout {
    color: var(--red) !important;
    margin-top: 4px !important;
  }
  .sidebar a.logout:hover {
    background: var(--red-bg) !important;
    color: var(--red) !important;
  }

  .content { padding: 20px 16px !important; }
  .content h1 { font-size: 1.3rem !important; margin-bottom: 18px !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-card { padding: 16px !important; }
  .stat-num { font-size: 1.75rem !important; }
  .grid-form { grid-template-columns: 1fr !important; }
  .data-table { display: block !important; overflow-x: auto !important; white-space: nowrap !important; }
  .data-table th, .data-table td { padding: 10px 12px !important; font-size: .82rem !important; }
  .login-box { padding: 32px 24px 28px !important; }
  .login-wrap { align-items: flex-start !important; padding-top: 40px !important; }
}

@media (max-width: 420px) {
  .sidebar a { padding: 7px 8px; font-size: .76rem; }
  .stats-grid { grid-template-columns: 1fr; }
}


/* --- Off-Canvas Mobile Hamburger Menu --- */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--surface, #1e1e2e);
  color: var(--text, #cdd6f4);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #313244);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
}
.mobile-header .brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.hamburger-btn {
  background: none;
  border: 1px solid var(--border, #313244);
  color: var(--text, #cdd6f4);
  font-size: 1.4rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}


