/* ============================================================
   STYLE.CSS — Restaurant Inventaire Dashboard
   Thème : Orange & Noir
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:       #F97316;
  --orange-light: #FB923C;
  --orange-dark:  #EA580C;
  --orange-glow:  rgba(249, 115, 22, 0.15);
  --orange-dim:   rgba(249, 115, 22, 0.08);

  --bg:           #0A0A0A;
  --surface:      #141414;
  --surface2:     #1C1C1C;
  --surface3:     #242424;
  --border:       #2A2A2A;
  --border-light: #333333;

  --text:         #F5F5F5;
  --text-muted:   #888888;
  --text-dim:     #555555;

  --green:        #22C55E;
  --yellow:       #EAB308;
  --red:          #EF4444;
  --blue:         #3B82F6;

  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-orange:0 0 24px rgba(249,115,22,0.2);

  --sidebar-w:    260px;
  --topbar-h:     64px;
  --transition:   0.2s ease;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-dark); }

/* ── LOGIN ────────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 420px;
  box-shadow: var(--shadow), var(--shadow-orange);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(249,115,22,0.5));
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--orange);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.btn-login:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-dim);
}

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ── APP SHELL ────────────────────────────────────────────── */
#app {
  display: none;
  height: 100vh;
  flex-direction: column;
}

#app.visible { display: flex; }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(var(--sidebar-w) - 24px);
  flex-shrink: 0;
}

.topbar-brand .brand-icon { font-size: 24px; }

.topbar-brand .brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.5px;
}

.topbar-brand .brand-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}

.topbar-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: var(--transition);
}

.user-chip:hover { border-color: var(--orange); }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: white;
  flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── MAIN LAYOUT ──────────────────────────────────────────── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 8px 8px 6px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  border: 1px solid transparent;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }

.nav-item.active {
  background: var(--orange-dim);
  color: var(--orange);
  border-color: var(--orange-glow);
}

.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-count {
  background: var(--surface3);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.nav-item.active .nav-count {
  background: var(--orange-glow);
  color: var(--orange);
}

/* category in sidebar */
.nav-category {
  margin-bottom: 4px;
}

.nav-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  border: 1px solid transparent;
}

.nav-category-header:hover { background: var(--surface2); }
.nav-category-header.active { background: var(--orange-dim); border-color: var(--orange-glow); color: var(--orange); }

.nav-category-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-dim);
  transition: transform var(--transition);
}

.nav-category-header.open .nav-category-arrow { transform: rotate(90deg); }

.nav-subcategories {
  display: none;
  padding-left: 12px;
  padding-bottom: 4px;
}

.nav-subcategories.open { display: block; }

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-subitem:hover { background: var(--surface2); color: var(--text); }
.nav-subitem.active { background: var(--orange-dim); color: var(--orange); border-color: var(--orange-glow); }
.nav-subitem::before { content: '─'; color: var(--text-dim); font-size: 10px; }

/* stock alerts in sidebar */
.sidebar-alerts {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.alert-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  cursor: pointer;
}

.alert-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── VIEWS ────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header-left p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249,115,22,0.3); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--border-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* ── STAT CARDS ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--orange); box-shadow: var(--shadow-orange); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--orange);
}

.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-value.orange { color: var(--orange); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.yellow { color: var(--yellow); }

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 28px;
  opacity: 0.15;
}

/* ── CATEGORY OVERVIEW CARDS ──────────────────────────────── */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.cat-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-orange); }

.cat-card-header {
  background: linear-gradient(135deg, #1a0a00 0%, #1C1C1C 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-card-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.4));
}

.cat-card-title { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.cat-card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.cat-card-body { padding: 20px 24px; }

.cat-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cat-stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.cat-stat-label { color: var(--text-muted); }
.cat-stat-value { font-weight: 700; color: var(--text); }
.cat-stat-value.orange { color: var(--orange); }

/* ── TABLE ────────────────────────────────────────────────── */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.table-toolbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.search-input {
  padding: 8px 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: var(--transition);
}

.search-input:focus { border-color: var(--orange); }
.search-input::placeholder { color: var(--text-dim); }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

.td-name { font-weight: 600; }
.td-muted { color: var(--text-muted); }

/* ── STOCK BADGES ─────────────────────────────────────────── */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.stock-badge.ok       { background: rgba(34,197,94,0.12);  color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }
.stock-badge.low      { background: rgba(234,179,8,0.12);  color: var(--yellow); border: 1px solid rgba(234,179,8,0.25); }
.stock-badge.critical { background: rgba(239,68,68,0.12);  color: var(--red);    border: 1px solid rgba(239,68,68,0.25); animation: pulse-border 2s infinite; }

@keyframes pulse-border {
  0%, 100% { border-color: rgba(239,68,68,0.25); }
  50%       { border-color: rgba(239,68,68,0.6); }
}

.stock-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.stock-badge.ok .dot       { background: var(--green); }
.stock-badge.low .dot      { background: var(--yellow); }
.stock-badge.critical .dot { background: var(--red); }

/* ── VALUE DISPLAY ────────────────────────────────────────── */
.value-cell { font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
  width: 80px;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── TASK CHIP ────────────────────────────────────────────── */
.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.task-chip.has-tasks { border-color: var(--orange-glow); color: var(--orange); background: var(--orange-dim); }

/* ── MODALS ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--red); color: white; border-color: var(--red); }

.modal-body { padding: 28px; }
.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.span2 { grid-column: span 2; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-dim); }
.form-control::placeholder { color: var(--text-dim); }

select.form-control { cursor: pointer; }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* ── ITEM DETAIL PANEL ────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.detail-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }
.detail-row-label { color: var(--text-muted); }
.detail-row-value { font-weight: 600; color: var(--text); }

/* ── TASKS ────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.task-item:hover { border-color: var(--border-light); }
.task-item.done { opacity: 0.6; }

.task-checkbox {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-light);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
  transition: var(--transition);
}

.task-checkbox.checked { background: var(--orange); border-color: var(--orange); }
.task-checkbox.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 800; }

.task-content { flex: 1; }
.task-text { font-size: 13px; color: var(--text); }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-dim); }
.task-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 11px; color: var(--text-dim); }

.task-assignee {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-mini-avatar {
  width: 16px; height: 16px;
  background: var(--orange);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: white;
}

.task-delete {
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 14px; padding: 2px;
  transition: var(--transition);
  flex-shrink: 0;
}

.task-delete:hover { color: var(--red); }

.add-task-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-task-form .form-control { flex: 1; }

/* ── FOOD COST ────────────────────────────────────────────── */
.fc-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.recipe-list { display: flex; flex-direction: column; gap: 6px; }

.recipe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.recipe-item:hover { border-color: var(--orange); background: var(--orange-dim); }
.recipe-item.active { border-color: var(--orange); background: var(--orange-dim); }

.recipe-item-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.recipe-item-cost { font-size: 13px; font-weight: 700; color: var(--orange); }

.fc-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fc-result-header {
  background: linear-gradient(135deg, #1a0a00 0%, #1C1C1C 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.fc-result-header h3 { font-size: 17px; font-weight: 800; color: var(--text); }

.fc-result-body { padding: 24px; }

.fc-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.fc-stat-row:last-child { border-bottom: none; }
.fc-stat-label { color: var(--text-muted); }
.fc-stat-value { font-weight: 700; color: var(--text); font-size: 15px; }

.fc-percentage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 20px;
}

.fc-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 4px solid;
  font-size: 22px; font-weight: 800;
}

.fc-circle.good   { border-color: var(--green);  color: var(--green); }
.fc-circle.warn   { border-color: var(--yellow); color: var(--yellow); }
.fc-circle.danger { border-color: var(--red);    color: var(--red); }

.fc-circle small { font-size: 11px; font-weight: 600; color: var(--text-muted); }

.fc-availability {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}

.fc-availability.can    { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.fc-availability.cannot { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }

.ingredient-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.ingredient-row:last-child { border-bottom: none; }

.ing-available { font-weight: 600; }
.ing-available.ok     { color: var(--green); }
.ing-available.low    { color: var(--yellow); }
.ing-available.missing{ color: var(--red); }

/* ── BREADCRUMB ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb-item { cursor: pointer; transition: var(--transition); }
.breadcrumb-item:hover { color: var(--orange); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; cursor: default; }
.breadcrumb-sep { color: var(--text-dim); }

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
}

.tab-btn.active { background: var(--orange); color: white; }
.tab-btn:not(.active):hover { background: var(--surface3); color: var(--text); }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.info    { border-color: rgba(249,115,22,0.4); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

/* ── USERS ───────────────────────────────────────────────── */
.users-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; padding:4px 0; }
.user-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:20px; display:flex; flex-direction:column; gap:12px; transition:border-color 0.2s; }
.user-card:hover { border-color:var(--orange); }
.user-card.inactive { opacity:0.5; }
.user-card-header { display:flex; align-items:center; gap:14px; }
.user-big-avatar { width:52px; height:52px; border-radius:50%; background:var(--surface2); border:2px solid var(--orange); display:flex; align-items:center; justify-content:center; font-size:26px; flex-shrink:0; }
.user-info { flex:1; min-width:0; }
.user-name { font-weight:700; font-size:15px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-email { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role-badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
.role-Admin   { background:rgba(249,115,22,0.2); color:#F97316; border:1px solid rgba(249,115,22,0.4); }
.role-Manager { background:rgba(59,130,246,0.2);  color:#60A5FA; border:1px solid rgba(59,130,246,0.4); }
.role-Employé { background:rgba(34,197,94,0.2);   color:#4ADE80; border:1px solid rgba(34,197,94,0.4); }
.user-status { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); }
.user-status-dot { width:8px; height:8px; border-radius:50%; }
.user-status-dot.active   { background:#4ADE80; box-shadow:0 0 6px #4ADE80; }
.user-status-dot.inactive { background:#6B7280; }
.user-card-actions { display:flex; gap:8px; margin-top:4px; }
.user-card-actions .btn { flex:1; font-size:12px; padding:7px 10px; }

/* ── MISC ─────────────────────────────────────────────────── */
.orange-text { color: var(--orange); }
.muted { color: var(--text-muted); }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.chip.admin   { background: rgba(249,115,22,0.15); color: var(--orange); border: 1px solid var(--orange-glow); }
.chip.manager { background: rgba(59,130,246,0.12); color: var(--blue);   border: 1px solid rgba(59,130,246,0.3); }
.chip.employe { background: rgba(34,197,94,0.1);   color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }

.alert-critical-row { background: rgba(239,68,68,0.04) !important; }
.alert-low-row      { background: rgba(234,179,8,0.04) !important; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Hamburger, Sidebar overlay, Table scroll
═══════════════════════════════════════════════════════════ */

/* ── Hamburger button ─────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger:hover span { background: var(--orange); }

/* ── Sidebar overlay (backdrop mobile) ───────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Sidebar close bar (mobile header inside sidebar) ──────── */
.sidebar-close-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Mobile logout inside sidebar ───────────────────────── */
.sidebar-mobile-footer {
  display: none;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-logout-mobile {
  width: 100%;
  padding: 10px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout-mobile:hover { background: rgba(239,68,68,0.15); }

/* ── TABLETTE ≤ 1024px ────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }

  .topbar-date { font-size: 11px; }
  .topbar { padding: 0 16px; gap: 10px; }

  .dash-grid { grid-template-columns: 1fr 1fr; }

  .inv-table th, .inv-table td { padding: 10px 12px; font-size: 13px; }

  .form-grid { grid-template-columns: 1fr 1fr; }
  .fc-grid   { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ── MOBILE ≤ 768px ───────────────────────────────────────── */
@media (max-width: 768px) {

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; height: 56px; }
  .topbar-brand .brand-sub { display: none; }
  .topbar-divider { display: none; }
  .hamburger { display: flex; }
  .hide-mobile { display: none !important; }

  /* Sidebar — drawer latéral */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 280px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
  }
  .sidebar-close-bar { display: flex; }
  .sidebar-mobile-footer { display: block; }

  /* Main content pleine largeur */
  .main-content { width: 100%; }

  /* Page header stack vertical */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  .page-header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .page-header-right .btn { flex: 1; min-width: 120px; font-size: 12px; padding: 8px 10px; }

  /* Dashboard cards 2 colonnes */
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .dash-card { padding: 14px; }
  .dash-card .card-value { font-size: 22px; }

  /* Catégories dashboard */
  .categories-section { padding: 12px; }
  .category-card { padding: 14px; }

  /* Tabs sous-catégories scrollables */
  .sub-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { white-space: nowrap; flex-shrink: 0; }

  /* Tableau — scroll horizontal */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 12px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  .inv-table { min-width: 560px; }
  .inv-table th, .inv-table td { padding: 10px 12px; font-size: 12px; }

  /* Header de la section inventaire */
  .inv-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
  .inv-header input[type="text"] { width: 100%; }

  /* Formulaires pleine largeur */
  .form-grid    { grid-template-columns: 1fr; }
  .detail-grid  { grid-template-columns: 1fr; }
  .fc-grid      { grid-template-columns: 1fr; }

  /* Modals pleine largeur sur mobile */
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    margin: 16px;
    border-radius: var(--radius);
  }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }

  /* Food Cost */
  .fc-recipe-list { padding: 12px; }
  .fc-result-card { padding: 14px; }

  /* Toast */
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

/* ── TRÈS PETIT MOBILE ≤ 380px ────────────────────────────── */
@media (max-width: 380px) {
  .dash-grid { grid-template-columns: 1fr; }
  .topbar-brand .brand-name { font-size: 14px; }
  #currency-select { font-size: 11px; padding: 4px 6px; }
}
