/* ============================================================================
   TVSL SALES MANAGEMENT SYSTEM — Theme
   Navy / Gold — Sora (display) + Inter (body) + IBM Plex Mono (data)
   ============================================================================ */

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

:root {
  /* Core palette */
  --navy-900: #14213d;
  --navy-800: #1f3864;
  --navy-700: #2a4a80;
  --navy-600: #3a5f9e;
  --gold-500: #e8c96d;
  --gold-400: #f0d78c;
  --gold-600: #cba64f;

  /* Neutrals */
  --paper: #f7f8fb;
  --surface: #ffffff;
  --line: #e4e7ee;
  --ink-900: #14213d;
  --ink-700: #3f4a63;
  --ink-500: #6b7590;
  --ink-300: #a4acc0;

  /* Semantic */
  --success: #1e8e5a;
  --success-bg: #e6f5ee;
  --warning: #b8791a;
  --warning-bg: #fbf0dd;
  --danger: #c0392b;
  --danger-bg: #fbe9e7;
  --info: #2a6fb0;
  --info-bg: #e8f1fb;

  /* Type */
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --sidebar-w: 248px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 33, 61, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 33, 61, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; color: var(--navy-900); margin: 0 0 4px; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }
.mono { font-family: var(--font-mono); }
code, .code { font-family: var(--font-mono); font-size: 12.5px; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, #0f1930 100%);
  color: #dfe4f0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; color: var(--navy-900); font-size: 15px;
  flex-shrink: 0;
}
.sidebar-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.sidebar-brand .sub { font-size: 10.5px; color: var(--gold-400); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.nav-group { margin-bottom: 4px; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(223,228,240,0.4); padding: 14px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(223,228,240,0.82); font-size: 13.5px; font-weight: 500;
  cursor: pointer; margin-bottom: 1px; transition: background 0.12s, color 0.12s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(232,201,109,0.14); color: var(--gold-400); }
.nav-item.active svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto; background: var(--gold-500); color: var(--navy-900);
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
}

.sidebar-footer {
  padding: 12px 20px 18px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.sidebar-footer .who { font-size: 12.5px; color: #fff; font-weight: 600; line-height: 1.3; }
.sidebar-footer .role { font-size: 11px; color: rgba(223,228,240,0.55); }

/* Main column */
.main-col { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy-900); }
.topbar-crumb { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; color: var(--ink-700);
}
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

.content { padding: 24px; flex: 1; }

/* ===== Cards / surfaces ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}

.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.page-header .eyebrow { font-size: 11.5px; color: var(--gold-600); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.page-header p.desc { color: var(--ink-500); font-size: 13px; }

/* ===== Stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card .label { font-size: 11.5px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--navy-900); margin: 6px 0 2px; }
.stat-card .delta { font-size: 12px; font-weight: 600; }
.stat-card .delta.up { color: var(--success); }
.stat-card .delta.down { color: var(--danger); }
.stat-card .accent-bar { height: 3px; border-radius: 2px; background: var(--gold-500); width: 32px; margin-bottom: 10px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: filter 0.12s, background 0.12s; line-height: 1;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: var(--surface); color: var(--navy-800); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy-600); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-500); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--paper); white-space: nowrap;
}
table.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tbody tr:hover { background: #fafbfd; }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== Badges / pills ===== */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.pill-navy { background: #eaeff8; color: var(--navy-800); }
.pill-gold { background: #fbf3de; color: var(--gold-600); }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-muted { background: #f1f2f6; color: var(--ink-500); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13.5px; color: var(--ink-900); background: var(--surface);
}
.form-control:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(58,95,158,0.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab-item { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-item.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }

/* ===== Kanban ===== */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 260px; flex: 1; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.kanban-col-head { padding: 12px 14px; font-size: 12.5px; font-weight: 700; color: var(--navy-800); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: 0.03em; }
.kanban-count { background: var(--navy-800); color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 10px; }
.kanban-cards { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm); cursor: grab; }
.kanban-card .title { font-weight: 600; font-size: 13px; color: var(--navy-900); margin-bottom: 4px; }
.kanban-card .meta { font-size: 11.5px; color: var(--ink-500); }
.kanban-card .value { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold-600); font-weight: 600; margin-top: 6px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state svg { width: 44px; height: 44px; color: var(--ink-300); margin-bottom: 12px; }
.empty-state .title { font-family: var(--font-display); color: var(--navy-800); font-weight: 700; font-size: 15px; margin-bottom: 4px; }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--ink-500); }
.text-right { text-align: right; }
.w-full { width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-col { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
}
