/* ============================================================
   Novaro — theme layer on Bootstrap 5
   Built by Jafar / ITS
   ============================================================ */

:root {
  --brand-navy:       #0A1F44;
  --brand-navy-700:   #0E2A5C;
  --brand-navy-600:   #143a7a;
  --brand-navy-900:   #06152F;
  --brand-ink:        #0B1526;
  --brand-slate:      #5B6B85;
  --brand-slate-300:  #8A97AD;
  --brand-line:       #E7ECF3;
  --brand-mist:       #F4F7FB;
  --brand-white:      #FFFFFF;
  --brand-accent:     #2E6BFF;
  --brand-accent-50:  #EAF0FF;

  --ok:      #1B7F3B;   --ok-50:   #E7F6EC;
  --warn:    #B26A00;   --warn-50: #FFF4E5;
  --info:    #2E6BFF;   --info-50: #EAF0FF;
  --muted-50:#EEF1F6;   --muted-600:#64748B;

  --bs-primary: #0A1F44;
  --bs-primary-rgb: 10, 31, 68;
  --bs-body-color: #0B1526;
  --bs-body-font-family: "Inter", system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 2px rgba(11,21,38,0.04), 0 1px 3px rgba(11,21,38,0.06);
  --shadow-md: 0 4px 16px rgba(11,21,38,0.06);
  --shadow-lg: 0 12px 40px rgba(10,31,68,0.10);
}

body {
  background: var(--brand-mist);
  color: var(--brand-ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.display-font { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn-primary {
  --bs-btn-bg: var(--brand-navy);
  --bs-btn-border-color: var(--brand-navy);
  --bs-btn-hover-bg: var(--brand-navy-600);
  --bs-btn-hover-border-color: var(--brand-navy-600);
  --bs-btn-active-bg: var(--brand-navy-700);
  --bs-btn-disabled-bg: var(--brand-navy);
  --bs-btn-disabled-border-color: var(--brand-navy);
  font-weight: 600; letter-spacing: .01em; padding: .6rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-navy);
  --bs-btn-border-color: var(--brand-line);
  --bs-btn-hover-bg: var(--brand-navy);
  --bs-btn-hover-border-color: var(--brand-navy);
  font-weight: 600;
}
.btn-lg { padding: .8rem 1.4rem; }
.btn-soft { background: var(--brand-accent-50); color: var(--brand-accent); border: 0; font-weight: 600; }
.btn-soft:hover { background: #dce7ff; color: var(--brand-accent); }

/* ---------- Wordmark ---------- */
.wordmark { font-family: "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: -0.03em; color: var(--brand-navy); }
.wordmark .dot { color: var(--brand-accent); }

/* ============================================================ AUTH ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-brand { display: none; } }
.auth-brand {
  background: radial-gradient(1200px 500px at -10% -10%, rgba(46,107,255,0.25), transparent 55%), linear-gradient(160deg, var(--brand-navy) 0%, var(--brand-navy-900) 100%);
  color: #fff; padding: 3.5rem 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-brand .wordmark { color: #fff; font-size: 1.5rem; }
.auth-brand h1 { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: clamp(2rem, 3vw, 2.9rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 12ch; }
.auth-brand p.lead-sub { color: rgba(255,255,255,0.72); max-width: 34ch; margin-top: 1rem; }
.route-line { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,0.85); font-size: .95rem; margin-top: 2rem; }
.route-line .node { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-accent); flex: none; box-shadow: 0 0 0 4px rgba(46,107,255,0.18); }
.route-line .track { height: 2px; flex: 1; background: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 8px, transparent 8px 16px); }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: var(--brand-white); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-family: "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: -0.02em; color: var(--brand-ink); }
.auth-card .muted { color: var(--brand-slate); }
.form-label { font-weight: 600; font-size: .875rem; color: #29354a; }
.form-control, .form-select { border-color: var(--brand-line); padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 .2rem rgba(46,107,255,0.15); }
.role-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.role-seg input { position: absolute; opacity: 0; }
.role-seg label { border: 1px solid var(--brand-line); border-radius: .6rem; padding: .6rem .4rem; text-align: center; cursor: pointer; font-size: .85rem; font-weight: 600; color: #29354a; transition: all .12s ease; }
.role-seg input:checked + label { border-color: var(--brand-navy); background: var(--brand-navy); color: #fff; }

/* ============================================================ DASHBOARD ============================================================ */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
@media (max-width: 992px) { .app { grid-template-columns: 1fr; } .app-sidebar { display: none; } }
.app-sidebar { background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-900) 100%); color: #cdd6e6; padding: 1.25rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.app-sidebar .brand { color: #fff; font-size: 1.4rem; padding: .35rem .6rem 1.25rem; }
.side-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6b7ba0; font-weight: 700; padding: .5rem .75rem .35rem; margin-top: .5rem; }
.side-link { display: flex; align-items: center; gap: .8rem; color: #b9c4da; text-decoration: none; font-weight: 500; font-size: .93rem; padding: .6rem .75rem; border-radius: .6rem; margin-bottom: .12rem; transition: background .12s ease, color .12s ease; }
.side-link i { width: 18px; text-align: center; font-size: .95rem; color: #8ea0c4; transition: color .12s; }
.side-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-link:hover i { color: #cdd9f2; }
.side-link.active { background: var(--brand-accent); color: #fff; box-shadow: 0 6px 18px rgba(46,107,255,0.35); }
.side-link.active i { color: #fff; }
.side-badge { margin-left: auto; background: rgba(255,255,255,0.16); color: #fff; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: .7rem .6rem; border-top: 1px solid rgba(255,255,255,0.08); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--brand-accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-family: "Space Grotesk", sans-serif; }
.side-user .nm { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.1; }
.side-user .rl { color: #8ea0c4; font-size: .74rem; }
.app-main { padding: 0; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--brand-line); padding: .85rem 1.75rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--brand-slate-300); font-size: .9rem; }
.topbar .search input { width: 100%; border: 1px solid var(--brand-line); background: var(--brand-mist); border-radius: .7rem; padding: .55rem .8rem .55rem 2.3rem; font-size: .9rem; }
.topbar .search input:focus { outline: none; border-color: var(--brand-accent); background: #fff; }
.icon-btn { width: 40px; height: 40px; border-radius: .7rem; border: 1px solid var(--brand-line); background: #fff; color: var(--brand-slate); display: inline-flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.icon-btn:hover { background: var(--brand-mist); color: var(--brand-navy); }
.icon-btn .dot-badge { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #E5484D; border: 2px solid #fff; }
.content { padding: 1.75rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; margin: 0; }
.page-head .sub { color: var(--brand-slate); margin: .25rem 0 0; font-size: .95rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat { background: #fff; border: 1px solid var(--brand-line); border-radius: 1rem; padding: 1.25rem 1.3rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat .ic { width: 44px; height: 44px; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: .9rem; }
.ic.blue { background: var(--info-50); color: var(--info); }
.ic.amber { background: var(--warn-50); color: var(--warn); }
.ic.green { background: var(--ok-50); color: var(--ok); }
.ic.navy { background: #E9EDF6; color: var(--brand-navy); }
.stat .k { color: var(--brand-slate); font-size: .82rem; font-weight: 600; }
.stat .v { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.75rem; color: var(--brand-ink); letter-spacing: -0.02em; margin-top: .15rem; }
.stat .t { font-size: .78rem; font-weight: 600; margin-top: .35rem; display: inline-flex; align-items: center; gap: .3rem; }
.t.up { color: var(--ok); } .t.down { color: #E5484D; } .t.flat { color: var(--brand-slate); }
.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; align-items: start; }
@media (max-width: 1200px) { .grid-2 { grid-template-columns: 1fr; } }
.card2 { background: #fff; border: 1px solid var(--brand-line); border-radius: 1rem; box-shadow: var(--shadow-sm); }
.card2 .hd { padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--brand-line); display: flex; align-items: center; justify-content: space-between; }
.card2 .hd h6 { margin: 0; font-weight: 700; font-size: 1rem; }
.card2 .hd a { font-size: .85rem; font-weight: 600; color: var(--brand-accent); text-decoration: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-slate); font-weight: 700; padding: .8rem 1.35rem; background: var(--brand-mist); }
.tbl td { padding: .9rem 1.35rem; border-top: 1px solid var(--brand-line); font-size: .9rem; vertical-align: middle; }
.tbl tbody tr:hover { background: #FAFCFF; }
.ref { font-family: "Space Grotesk", sans-serif; font-weight: 600; color: var(--brand-navy); }
.route { display: flex; align-items: center; gap: .5rem; color: var(--brand-ink); }
.route i { color: var(--brand-slate-300); font-size: .7rem; }
.route .to { color: var(--brand-slate); }
.amt { font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.pill { font-size: .72rem; font-weight: 700; padding: .28rem .65rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.placed { background: var(--muted-50); color: var(--muted-600); }
.pill.transit { background: var(--warn-50); color: var(--warn); }
.pill.assigned { background: var(--info-50); color: var(--info); }
.pill.done { background: var(--ok-50); color: var(--ok); }
.feed { padding: .5rem 1.35rem 1.1rem; }
.feed-item { display: flex; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--brand-line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 34px; height: 34px; border-radius: .6rem; flex: none; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.feed-item .tx { font-size: .875rem; line-height: 1.3; }
.feed-item .tm { font-size: .75rem; color: var(--brand-slate-300); margin-top: .15rem; }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: 1.1rem 1.35rem; }
.qa a { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; border: 1px solid var(--brand-line); border-radius: .8rem; text-decoration: none; color: var(--brand-ink); transition: all .12s; }
.qa a:hover { border-color: var(--brand-accent); background: var(--brand-accent-50); }
.qa a i { font-size: 1.1rem; color: var(--brand-accent); }
.qa a span { font-size: .82rem; font-weight: 600; }
.mobile-brand { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 992px) { .mobile-brand { display: block; font-size: 1.25rem; } }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============================================================
   MOBILE OVERRIDES (placed last so they win the cascade)
   ============================================================ */
.hamburger { display: none; }
@media (max-width: 992px) {
  .app { grid-template-columns: 1fr; }
  /* Off-canvas sidebar */
  .app-sidebar {
    display: flex;
    position: fixed; top: 0; left: 0; z-index: 1050;
    width: 260px; height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 1040;
    background: rgba(6,21,47,0.45);
  }
  .sidebar-backdrop.show { display: block; }
  .hamburger { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .app-sidebar { transition: none; } }
