/* ============================================================
   JapanCar Pro — Modern Light Theme
   Clean white · fintech-grade · professional
   ============================================================ */

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

:root {
  /* ── Light palette ───────────────────────────────────── */
  --bg:          #F4F6F9;
  --surface:     #FFFFFF;
  --surface-2:   #F0F2F5;
  --surface-3:   #E8EBF0;
  --sidebar-bg:  #0D1F3C;   /* deep premium navy */
  --topbar-bg:   rgba(255,255,255,0.96);

  /* ── Borders ─────────────────────────────────────────── */
  --border:        rgba(0,0,0,0.07);
  --border-mid:    rgba(0,0,0,0.11);
  --border-strong: rgba(0,0,0,0.18);

  /* ── Text ────────────────────────────────────────────── */
  --text:        #0D1020;
  --text-2:      #3D4153;
  --text-muted:  #8B90A0;

  /* ── Brand Red ───────────────────────────────────────── */
  --red:    #E8192C;
  --red-d:  #C4121F;
  --red-l:  rgba(232,25,44,0.09);
  --red-glow: 0 0 18px rgba(232,25,44,0.18);

  /* ── Green ───────────────────────────────────────────── */
  --green:    #1A9E3E;
  --green-d:  #147A30;
  --green-l:  rgba(26,158,62,0.10);
  --green-glow: 0 0 16px rgba(26,158,62,0.18);

  /* ── Amber ───────────────────────────────────────────── */
  --amber:    #CC7800;
  --amber-d:  #A86400;
  --amber-l:  rgba(204,120,0,0.10);

  /* ── Blue ────────────────────────────────────────────── */
  --blue:    #0062CC;
  --blue-d:  #004EA3;
  --blue-l:  rgba(0,98,204,0.10);

  /* ── Purple ──────────────────────────────────────────── */
  --purple:   #7B2FBE;
  --purple-l: rgba(123,47,190,0.10);
  --purple-d: #6322A0;

  /* ── Gray ────────────────────────────────────────────── */
  --gray:   #8B90A0;
  --gray-l: rgba(0,0,0,0.04);
  --gray-d: #5A5E6E;

  /* ── Shadows (light mode — subtle) ──────────────────── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.13), 0 4px 12px rgba(0,0,0,0.07);

  /* ── Geometry ────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* ── Layout ──────────────────────────────────────────── */
  --sidebar-w: 236px;
  --topbar-h:  54px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Base reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════ */

.app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 12px rgba(0,0,0,0.18);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Sidebar — deep navy, white text ── */
.sidebar {
  color: rgba(255,255,255,0.78);
  background: linear-gradient(180deg, #0D1F3C 0%, #091628 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar .logo-name { color: #fff; font-weight: 700; }
.sidebar .logo-sub  { color: rgba(255,255,255,0.38); letter-spacing: 0.4px; }
.sidebar .nav-section {
  color: rgba(255,255,255,0.28);
  letter-spacing: 1.2px;
  font-size: 9px;
}
.sidebar .nav-item { color: rgba(255,255,255,0.65); border-left-color: transparent; }
.sidebar .nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-left-color: rgba(255,255,255,0.3);
}
.sidebar .nav-item.active {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-left-color: #000 !important;
  box-shadow: none !important;
}
.sidebar .nav-item.active .nav-icon { background: rgba(255,255,255,0.15); }
.sidebar .nav-item.active .nav-icon i { color: #fff; }
.sidebar .nav-item:hover .nav-icon { background: rgba(255,255,255,0.1); }
.sidebar .nav-item:hover .nav-icon i { color: #fff; }
.sidebar .nav-item .nav-icon i { color: rgba(255,255,255,0.45); }
.sidebar .user-area { border-top-color: rgba(255,255,255,0.07); }
.sidebar .user-area > div > div { color: rgba(255,255,255,0.78) !important; }
.sidebar .user-area .avatar {
  background: rgba(255,59,78,0.22);
  color: #FF8A90;
  border-color: rgba(255,59,78,0.35);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ──────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
}

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

/* ══════════════════════════════════════════════════════════
   SIDEBAR COMPONENTS
══════════════════════════════════════════════════════════ */

/* Logo */
.logo {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.logo-mark { display: flex; align-items: center; gap: 10px; }

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #FF3B4E 0%, #CC1428 100%);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(255,59,78,0.45);
  flex-shrink: 0;
  letter-spacing: -1px;
}

.logo-name {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
  letter-spacing: 0.3px;
}

/* Nav sections */
nav { padding: 10px 8px 6px; flex: 1; }

.nav-section {
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 10px 5px;
}

/* Nav item */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px; font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.12s;
  margin-bottom: 1px;
  position: relative;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-left-color: var(--border-mid);
}

.nav-item.active {
  background: var(--red-l);
  color: var(--red);
  font-weight: 600;
  border-left-color: var(--red);
  box-shadow: inset 0 0 0 0.5px rgba(255,59,78,0.2);
}

/* Icon wrapper handled by layout_header inline styles */

/* Live indicator on bidding nav item */
.nav-item.nav-live { position: relative; }
.nav-item.nav-live::after {
  content: 'LIVE';
  font-size: 8px; font-weight: 800;
  letter-spacing: 0.8px;
  background: var(--red);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  position: absolute;
  right: 32px;
  animation: pulse-live 2s infinite;
}

/* Nav badge */
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* User area at bottom of sidebar */
.user-area {
  padding: 12px 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   AVATAR
══════════════════════════════════════════════════════════ */

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--red-l);
  color: var(--red);
  flex-shrink: 0;
  border: 1px solid rgba(255,59,78,0.3);
  letter-spacing: -0.5px;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn:active { transform: scale(0.97); opacity: 0.88; }
.btn i { font-size: 15px; }

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255,59,78,0.35);
}
.btn-primary:hover {
  background: var(--red-d);
  box-shadow: 0 4px 16px rgba(255,59,78,0.45);
  color: #fff;
}

.btn-success {
  background: var(--green);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(48,209,88,0.30);
}
.btn-success:hover {
  background: var(--green-d);
  box-shadow: 0 4px 16px rgba(48,209,88,0.40);
  color: #fff;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(10,132,255,0.30);
}
.btn-blue:hover { background: var(--blue-d); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-sm i { font-size: 13px; }

/* Icon-only button */
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-mid);
}
.icon-btn:active { transform: scale(0.92); }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-mid); }

.card-title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.card-title i { color: var(--text-muted); }

/* Accent top-border variants */
.card-accent-red   { border-top: 2px solid var(--red); }
.card-accent-green { border-top: 2px solid var(--green); }
.card-accent-blue  { border-top: 2px solid var(--blue); }
.card-accent-amber { border-top: 2px solid var(--amber); }

/* ══════════════════════════════════════════════════════════
   PILLS / STATUS BADGES
══════════════════════════════════════════════════════════ */

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.pill-green  { background: var(--green-l);  color: var(--green);  }
.pill-amber  { background: var(--amber-l);  color: var(--amber-d); }
.pill-red    { background: var(--red-l);    color: var(--red);    }
.pill-blue   { background: var(--blue-l);   color: var(--blue);   }
.pill-gray   { background: var(--gray-l);   color: var(--gray-d); }
.pill-purple { background: var(--purple-l); color: var(--purple); }

/* ══════════════════════════════════════════════════════════
   FORMS — Dark style
══════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-mid);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,98,204,0.14);
}

/* Select arrow for light bg */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B90A0' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 5px 0; cursor: pointer;
  color: var(--text-2);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--blue);
  width: 17px; height: 17px;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   GRID LAYOUTS
══════════════════════════════════════════════════════════ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ══════════════════════════════════════════════════════════
   STAT CARDS (dashboard widgets)
══════════════════════════════════════════════════════════ */

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-mid);
  border-radius: 2px 2px 0 0;
}

.stat-card.stat-green::before { background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.5); }
.stat-card.stat-red::before   { background: var(--red);   box-shadow: 0 0 8px rgba(255,59,78,0.5); }
.stat-card.stat-blue::before  { background: var(--blue);  box-shadow: 0 0 8px rgba(10,132,255,0.5); }
.stat-card.stat-amber::before { background: var(--amber); box-shadow: 0 0 8px rgba(255,214,10,0.5); }

.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; color: var(--text); }
.stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.stat-sub.up   { color: var(--green); }
.stat-sub.down { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   DATA TABLE
══════════════════════════════════════════════════════════ */

.data-table {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

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

.data-table th {
  padding: 10px 16px;
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-mid);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-2);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td {
  background: rgba(255,255,255,0.025);
  color: var(--text);
  transition: background 0.1s;
}

/* ══════════════════════════════════════════════════════════
   AI SIGNAL INDICATORS
══════════════════════════════════════════════════════════ */

.ai-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}

.ai-dot.green {
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 12px rgba(48,209,88,0.3);
}
.ai-dot.amber {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber), 0 0 12px rgba(255,214,10,0.3);
}
.ai-dot.red {
  background: var(--red);
  box-shadow: 0 0 6px var(--red), 0 0 12px rgba(255,59,78,0.3);
}

/* ══════════════════════════════════════════════════════════
   COUNTDOWN
══════════════════════════════════════════════════════════ */

.countdown {
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.5px;
  font-family: 'Inter', monospace;
}
.countdown.urgent { color: var(--red);   text-shadow: 0 0 8px rgba(255,59,78,0.5); }
.countdown.warn   { color: var(--amber); }
.countdown.safe   { color: var(--green); }

/* ══════════════════════════════════════════════════════════
   PROGRESS / PIPELINE STEPS
══════════════════════════════════════════════════════════ */

.steps-bar {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
}

.step-item { flex: 1; text-align: center; position: relative; }

.step-item::after {
  content: '';
  position: absolute;
  top: 14px; left: 50%;
  width: 100%; height: 1px;
  background: var(--border-mid);
}
.step-item:last-child::after { display: none; }

.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  margin: 0 auto 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  position: relative; z-index: 1;
  color: var(--text-muted);
}

.step-dot.done   { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 10px rgba(48,209,88,0.35); }
.step-dot.active { background: var(--red);   border-color: var(--red);   color: #fff; box-shadow: 0 0 12px rgba(255,59,78,0.45); }

.step-label { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* ══════════════════════════════════════════════════════════
   LANGUAGE TOGGLE
══════════════════════════════════════════════════════════ */

.lang-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 2px;
  gap: 1px;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}

.lang-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.lang-btn.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════════════════════
   WHATSAPP BUTTON
══════════════════════════════════════════════════════════ */

.wa-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: #1DA851;
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 10px rgba(29,168,81,0.35);
  transition: all 0.14s;
  font-family: var(--font);
}
.wa-btn:hover { background: #17923E; box-shadow: 0 4px 16px rgba(29,168,81,0.5); }
.wa-btn:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════════
   COST BREAKDOWN
══════════════════════════════════════════════════════════ */

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cost-row:last-child { border-bottom: none; }
.cost-row .label { color: var(--text-muted); }
.cost-row .val   { font-weight: 600; color: var(--text); }

.cost-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--border-mid);
}
.cost-total .label { font-size: 14px; font-weight: 700; color: var(--text); }
.cost-total .val   { font-size: 24px; font-weight: 800; color: var(--red); letter-spacing: -0.5px; }

/* ══════════════════════════════════════════════════════════
   PROFIT SIGNAL BOX
══════════════════════════════════════════════════════════ */

.profit-box {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid;
}

.profit-box.green {
  background: var(--green-l);
  border-color: rgba(48,209,88,0.25);
  box-shadow: var(--green-glow);
}
.profit-box.amber {
  background: var(--amber-l);
  border-color: rgba(255,214,10,0.25);
}
.profit-box.red {
  background: var(--red-l);
  border-color: rgba(255,59,78,0.25);
  box-shadow: var(--red-glow);
}

.profit-value { font-size: 17px; font-weight: 700; line-height: 1.2; }
.profit-value.green { color: var(--green); }
.profit-value.amber { color: var(--amber); }
.profit-value.red   { color: var(--red); }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: var(--green-l); border-color: rgba(48,209,88,0.3);  color: var(--green); }
.alert-error   { background: var(--red-l);   border-color: rgba(255,59,78,0.3);  color: var(--red); }
.alert-info    { background: var(--blue-l);  border-color: rgba(10,132,255,0.3); color: var(--blue); }
.alert-warn    { background: var(--amber-l); border-color: rgba(255,214,10,0.3); color: var(--amber-d); }

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */

.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; align-items: center;
}
.filter-bar .form-select { width: auto; }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Ambient glow background */
.login-page::before {
  content: '';
  position: fixed;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,59,78,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-mid);
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   GRADE BADGE
══════════════════════════════════════════════════════════ */

.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════
   LIST ROWS (iOS-style)
══════════════════════════════════════════════════════════ */

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.1s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(255,255,255,0.03); }
.list-row:active { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════════
   DIVIDER
══════════════════════════════════════════════════════════ */

.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ══════════════════════════════════════════════════════════
   HAMBURGER (mobile)
══════════════════════════════════════════════════════════ */

.hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════════════════════
   SECTION TITLES (inline page headers)
══════════════════════════════════════════════════════════ */

.page-header {
  margin-bottom: 20px;
}
.page-header-eyebrow {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.page-header-title {
  font-size: 22px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

/* ══════════════════════════════════════════════════════════
   TAB NAVIGATION (in-panel tabs)
══════════════════════════════════════════════════════════ */

.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--border);
}
.tab-bar::-webkit-scrollbar { display: none; }

/* ══════════════════════════════════════════════════════════
   KANBAN / PIPELINE CARDS
══════════════════════════════════════════════════════════ */

.pipeline-lane {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-width: 240px;
  border: 1px solid var(--border);
}

.pipeline-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.pipeline-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ══════════════════════════════════════════════════════════
   GLOW BUTTONS (special CTA)
══════════════════════════════════════════════════════════ */

.btn-glow-red {
  background: var(--red);
  color: #fff;
  border: none;
  box-shadow: 0 0 20px rgba(255,59,78,0.4), 0 4px 12px rgba(255,59,78,0.3);
  font-weight: 700;
}
.btn-glow-red:hover {
  background: var(--red-d);
  box-shadow: 0 0 28px rgba(255,59,78,0.5), 0 6px 18px rgba(255,59,78,0.4);
  color: #fff;
}

.btn-glow-green {
  background: var(--green);
  color: #fff;
  border: none;
  box-shadow: 0 0 20px rgba(48,209,88,0.35), 0 4px 12px rgba(48,209,88,0.25);
  font-weight: 700;
}
.btn-glow-green:hover {
  background: var(--green-d);
  box-shadow: 0 0 28px rgba(48,209,88,0.5), 0 6px 18px rgba(48,209,88,0.35);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════ */

@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes pulse-live {
  0%,100% { opacity: 1; box-shadow: 0 0 6px rgba(255,59,78,0.6); }
  50%      { opacity: 0.7; box-shadow: 0 0 12px rgba(255,59,78,0.9); }
}

@keyframes glow-green {
  0%,100% { box-shadow: 0 0 6px rgba(48,209,88,0.3); }
  50%      { box-shadow: 0 0 14px rgba(48,209,88,0.6); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fade-in 0.25s ease forwards; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .content { padding: 14px; }
  .hamburger { display: flex; }
  .stat-value { font-size: 24px; }
  .data-table { overflow-x: auto; }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
}

/* ══════════════════════════════════════════════════════════
   PRINT — A4
══════════════════════════════════════════════════════════ */

@media print {
  @page { size: A4 portrait; margin: 12mm 10mm; }

  .sidebar, .topbar, .filter-bar, .btn, .icon-btn, .wa-btn,
  .hamburger, .lang-toggle, .nav-item, .tab-nav,
  [onclick], button, .print-hide { display: none !important; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .app { display: block !important; }

  .card {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    color: #000 !important;
  }

  .grid-2, .grid-3, .grid-4 { display: grid !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .print-only { display: block !important; }

  /* Make text legible on white */
  .text-muted, [style*="color:var(--text-muted)"] { color: #666 !important; }
  .pill, .nav-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ══════════════════════════════════════════════════════════
   SCROLLBAR — ultra thin
══════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-d); }

/* ══════════════════════════════════════════════════════════
   SELECTION HIGHLIGHT
══════════════════════════════════════════════════════════ */

::selection { background: rgba(232,25,44,0.2); color: var(--text); }

/* ── Topbar border ─────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE
══════════════════════════════════════════════════════════ */

.sidebar {
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .logo-name,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .user-area > div:nth-child(2) { /* name+role text */
  display: none !important;
}
.sidebar.collapsed .logo-mark { justify-content: center; }
.sidebar.collapsed .user-area { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .user-area a { margin-left: 0; }
.sidebar.collapsed nav { padding: 10px 6px; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 6px;
  border-left: none;
}
.sidebar.collapsed .nav-icon { width: 38px; height: 38px; }
.sidebar.collapsed .nav-item:hover .nav-icon i,
.sidebar.collapsed .nav-item .nav-icon i { font-size: 20px; }
.sidebar.collapsed .live-dot { top: 2px; right: 2px; }

/* Sidebar toggle button */
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.14); color: #fff; }
.sidebar-toggle i { font-size: 12px; transition: transform 0.25s; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }
.sidebar.collapsed .logo { justify-content: center; padding: 14px 8px 12px; }

/* Main area adjusts */
.main { transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1); }
.sidebar.collapsed ~ .main { margin-left: 64px; }

/* ── Hover rows in light theme ─────────────────────────────── */
.data-table tr:hover td { background: rgba(0,0,0,0.025); color: var(--text); }

/* ── Light color-scheme for all inputs ─────────────────────── */
input, select, textarea { color-scheme: light; }
