/* ============================================
   LunchLink Design System — Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green-900: #0D3D21;
  --green-700: #1B6B3A;
  --green-500: #2E9D57;
  --green-300: #6DC98A;
  --green-100: #E0F4E8;
  --green-50:  #F2FBF5;

  --amber-500: #F5A623;
  --amber-100: #FEF3D6;

  --blue-500:  #3B82F6;
  --blue-100:  #DBEAFE;

  --red-500:   #EF4444;
  --red-100:   #FEE2E2;

  --gray-900:  #111827;
  --gray-700:  #374151;
  --gray-500:  #6B7280;
  --gray-300:  #D1D5DB;
  --gray-200:  #E5E7EB;
  --gray-100:  #F3F4F6;
  --gray-50:   #F9FAFB;

  --white: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --sidebar-width: 240px;
  --header-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--gray-700);
  background: var(--gray-100);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--green-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--green-500);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-weight: 800;
  font-size: 16px;
  color: var(--white);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--green-300);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-section {
  padding: 12px 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--green-300);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px; height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--amber-500);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top header ── */
.topbar {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.topbar-sub {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 1px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-400);
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}
.breadcrumb:hover { color: var(--gray-600); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  position: relative;
}

.icon-btn:hover { background: var(--gray-50); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* ── Notifications dropdown ── */
.notif-wrap { position: relative; }

.notif-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 340px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  z-index: 900;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F3F4F6;
}
.notif-header-title {
  font-size: 13.5px; font-weight: 700; color: #111827;
  display: flex; align-items: center; gap: 7px;
}
.notif-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 20px;
}
.notif-mark-read {
  font-size: 11.5px; font-weight: 600; color: #1B6B3A;
  background: none; border: none; cursor: pointer;
  font-family: inherit; padding: 0;
}
.notif-mark-read:hover { text-decoration: underline; }

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #F9FAFB;
  cursor: pointer; transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #F9FAFB; }
.notif-item.read { opacity: .55; }

.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #1B6B3A; flex-shrink: 0; margin-top: 5px;
}
.notif-item.read .notif-unread-dot { background: transparent; }

.notif-icon-wrap {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.notif-body     { flex: 1; min-width: 0; }
.notif-body-title { font-size: 12.5px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.notif-body-sub   { font-size: 12px; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-body-meta  { font-size: 11px; color: #9CA3AF; margin-top: 3px; }

.notif-footer-link {
  display: block; padding: 10px 16px;
  font-size: 12px; font-weight: 600; color: #6B7280;
  border-top: 1px solid #F3F4F6;
  text-decoration: none; text-align: center;
  transition: color .15s;
}
.notif-footer-link:hover { color: #1B6B3A; }

/* ── Page content ── */
.page {
  padding: 28px;
  flex: 1;
}

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.stat-meta .up { color: var(--green-500); font-weight: 600; }
.stat-meta .down { color: var(--red-500); font-weight: 600; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}

.stat-icon.green { background: var(--green-100); }
.stat-icon.amber { background: var(--amber-100); }
.stat-icon.blue  { background: var(--blue-100); }
.stat-icon.red   { background: var(--red-100); }

.stats-grid-sm .stat-card  { padding: 14px 16px; }
.stats-grid-sm .stat-icon  { width: 28px; height: 28px; font-size: 14px; margin-bottom: 6px; }
.stats-grid-sm .stat-label { font-size: 9px; }
.stats-grid-sm .stat-value { font-size: 20px; }
.stats-grid-sm .stat-meta  { font-size: 9px; }

/* ── Grid layouts ── */
.content-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.content-grid-3-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin-bottom: 20px;
}

.content-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.card-body {
  padding: 18px 22px;
}

.card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
}

.card-link:hover { color: var(--green-500); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

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

th {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  font-size: 13.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

.td-name { font-weight: 600; color: var(--gray-900); }
.td-mono { font-family: monospace; font-size: 12px; color: var(--gray-600); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-amber  { background: var(--amber-100); color: #92640A; }
.badge-red    { background: var(--red-100);   color: #B91C1C; }
.badge-blue   { background: var(--blue-100);  color: #1D4ED8; }
.badge-gray   { background: var(--gray-200);  color: var(--gray-700); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }

.btn-primary   { background: var(--green-700);  color: var(--white); }
.btn-secondary { background: var(--gray-100);   color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-amber     { background: var(--amber-500);  color: var(--white); }
.btn-danger    { background: var(--red-500);    color: var(--white); }
.btn-ghost     { background: transparent;       color: var(--green-700); border: 1px solid var(--green-300); }
.btn-sm        { padding: 5px 11px; font-size: 12px; }

/* ── Alert / banner ── */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13.5px;
}

.alert-warning { background: var(--amber-100); color: #78490A; border: 1px solid #F5C86E; }
.alert-info    { background: var(--blue-100);  color: #1E40AF; border: 1px solid #93C5FD; }
.alert-success { background: var(--green-100); color: var(--green-900); border: 1px solid var(--green-300); }

/* ── Progress bar ── */
.progress-wrap { background: var(--gray-200); border-radius: 6px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 6px; background: var(--green-500); }

/* ── Item list ── */
.item-list { display: flex; flex-direction: column; }

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.item-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.item-name  { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.item-meta  { font-size: 12px; color: var(--gray-500); }
.item-price { margin-left: auto; font-weight: 700; color: var(--gray-900); font-size: 14px; }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-step {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}

.timeline-step:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--white);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.timeline-dot.done  { background: var(--green-500); border-color: var(--green-500); }
.timeline-dot.active { background: var(--amber-500); border-color: var(--amber-500); }

.timeline-step:not(:last-child) .timeline-dot::after {
  content: '';
  position: absolute;
  top: 12px; left: 3px;
  width: 2px;
  bottom: -18px;
  background: var(--gray-200);
}

.timeline-step.done .timeline-dot::after { background: var(--green-300); }

.timeline-label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.timeline-time  { font-size: 11px; color: var(--gray-400); }

/* ── Quick actions ── */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Avatar chip ── */
.avatar-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.empty-state .empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 13.5px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
