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

:root {
  --blue:    #3b82f6;
  --blue-d:  #2563eb;
  --blue-l:  #eff6ff;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --green:   #22c55e;
  --green-d: #16a34a;
  --green-l: #f0fdf4;
  --orange:  #f59e0b;
  --orange-l:#fffbeb;
  --red:     #ef4444;
  --red-d:   #dc2626;
  --red-l:   #fef2f2;
  --purple:  #8b5cf6;
  --purple-l:#f5f3ff;
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
}

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--slate-100);
  color: var(--slate-800);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--slate-900);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}
.sidebar-brand svg { flex-shrink: 0; }
.sidebar-logo { max-height: 32px; max-width: 140px; object-fit: contain; flex-shrink: 0; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--slate-400);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--slate-500); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.logout-btn { color: var(--slate-500); padding: 6px; border-radius: 6px; transition: color .15s; flex-shrink:0; }
.logout-btn:hover { color: var(--red); text-decoration: none; }

/* ── Main content ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.content-body { padding: 24px 28px; flex: 1; }

/* ── Page actions ───────────────────────────────────────────────────────────── */
.page-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--slate-800); }
.card-body { padding: 20px; }
.p-0 { padding: 0 !important; }

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

.stat-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-card-highlight { border-color: var(--orange); }
.stat-card-highlight::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--orange); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-blue   { background: var(--blue-l);   color: var(--blue); }
.stat-green  { background: var(--green-l);  color: var(--green-d); }
.stat-orange { background: var(--orange-l); color: var(--orange); }
.stat-purple { background: var(--purple-l); color: var(--purple); }

.stat-number { font-size: 26px; font-weight: 800; color: var(--slate-900); line-height: 1; }
.stat-label  { font-size: 13px; color: var(--slate-500); margin-top: 4px; }
.stat-action {
  position: absolute;
  bottom: 12px; right: 14px;
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-100);
  background: var(--slate-50);
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--slate-50); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: .9; }
.btn.disabled { opacity: .5; pointer-events: none; }

.btn-primary   { background: var(--blue);   color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-secondary { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200); }
.btn-secondary:hover { background: var(--slate-200); }
.btn-success   { background: var(--green);  color: #fff; }
.btn-success:hover { background: var(--green-d); }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-danger:hover { background: var(--red-d); }
.btn-warning   { background: var(--orange); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.badge-secondary { background: var(--slate-100); color: var(--slate-600); }
.badge-success   { background: var(--green-l);   color: var(--green-d); }
.badge-warning   { background: var(--orange-l);  color: #92400e; }
.badge-danger    { background: var(--red-l);      color: var(--red-d); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--slate-700); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  font-size: 14px;
  color: var(--slate-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-control::placeholder { color: var(--slate-400); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--slate-400); margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.required { color: var(--red); }

/* ── Auth page ──────────────────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--slate-200);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 { font-size: 30px; font-weight: 700; margin-top: 10px; color: var(--slate-900); }
.auth-logo p  { color: var(--slate-500); font-size: 14px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: slideUp .15s ease;
}
.modal-lg { max-width: 680px; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--slate-100);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--slate-900); }
.modal-close {
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  border: none;
  background: none;
  transition: color .15s;
  display: flex;
}
.modal-close:hover { color: var(--slate-700); text-decoration: none; }

.modal-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-l);  color: var(--green-d);  border-color: #bbf7d0; }
.alert-error   { background: var(--red-l);    color: var(--red-d);    border-color: #fecaca; }
.alert-warning { background: var(--orange-l); color: #92400e;         border-color: #fde68a; }
.alert-info    { background: var(--blue-l);   color: var(--blue-d);   border-color: #bfdbfe; }

/* ── Empty states ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--slate-400);
}
.empty-state svg { display: block; margin: 0 auto 16px; }
.empty-state p { font-size: 15px; }
.empty-state-sm { padding: 24px; text-align: center; color: var(--slate-400); font-size: 14px; }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--slate-400) !important; }
.text-sm      { font-size: 12px; margin-top: 2px; }
.text-danger  { color: var(--red-d) !important; }
.two-col      { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.action-btns  { display: flex; align-items: center; gap: 4px; }
.user-inline  { display: flex; align-items: center; gap: 8px; }
.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tab-group {
  display: flex;
  gap: 4px;
  background: var(--slate-100);
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--slate-200);
}
.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  transition: background .15s, color .15s;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.tab:hover { color: var(--slate-800); text-decoration: none; }
.tab.active { background: #fff; color: var(--slate-800); box-shadow: var(--shadow); }

/* ── Rep checklist (assign reps) ────────────────────────────────────────────── */
.rep-checklist { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.rep-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.rep-check-item:hover { background: var(--slate-50); border-color: var(--blue); }
.rep-check-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.rep-check-info { display: flex; flex-direction: column; }
.rep-check-name  { font-weight: 600; font-size: 14px; color: var(--slate-800); }
.rep-check-email { font-size: 13px; color: var(--slate-400); }

/* ── Inventory grid ─────────────────────────────────────────────────────────── */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.inventory-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.inventory-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.inv-category { font-size: 11px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; }
.inv-name  { font-size: 15px; font-weight: 700; color: var(--slate-900); }
.inv-sku   { font-size: 12px; color: var(--slate-400); }
.inv-desc  { font-size: 13px; color: var(--slate-500); line-height: 1.4; }
.inv-stock { font-size: 13px; font-weight: 500; color: var(--slate-500); margin-top: 4px; }
.inv-stock-low { color: var(--red-d) !important; }

/* ── Detail grid (request details) ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--slate-400);
  margin-bottom: 6px;
}
.detail-section p { font-size: 14px; color: var(--slate-700); margin-bottom: 2px; }

/* ── Event meta ─────────────────────────────────────────────────────────────── */
.event-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--slate-500);
  align-items: center;
  flex-wrap: wrap;
}
.event-meta span { display: flex; align-items: center; gap: 6px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .two-col    { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .content-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .inventory-grid { grid-template-columns: 1fr; }
}


/* CUSTOM STYLES */

.logo {
  width:100px;
}