/* SCIVS / DVS Case Management — premium UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --sidebar-w: 260px;
  /* Brand surface */
  --bg: #F6F4EF;          /* warm off-white, complements scivs cream */
  --surface: #FFFFFF;
  --surface-2: #FAFAF7;
  --line: #E5E1D7;
  --line-strong: #CFC9BB;
  /* Text */
  --ink: #1B1F26;
  --ink-2: #4A5060;
  --ink-3: #7A8090;
  /* Brand accents */
  --scivs-orange: #E89A3D;
  --scivs-brown: #3D2818;
  --dvs-green: #8FBE21;
  --dvs-black: #1A1A1A;
  /* Default app accent (uses scivs orange) */
  --accent: var(--scivs-orange);
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(232,154,61,.12);
  /* Sidebar */
  --side-bg: #15171C;
  --side-bg-2: #1B1E25;
  --side-fg: #E8E3D6;
  --side-fg-muted: #8B8A82;
  --side-line: rgba(255,255,255,.06);
  /* Status hues */
  --good: #2E7D5B;
  --warn: #C97A18;
  --bad: #B83A3A;
  --info: #2C6FB6;
  /* Radii / shadows */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20,16,8,.04), 0 1px 3px rgba(20,16,8,.04);
  --shadow-md: 0 2px 6px rgba(20,16,8,.05), 0 8px 24px rgba(20,16,8,.06);
  --shadow-lg: 0 4px 12px rgba(20,16,8,.07), 0 24px 60px rgba(20,16,8,.10);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
h1, h2, h3, h4, h5, h6, .display, .brand-name {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  color: var(--ink);
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
code { font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .85em; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-fg);
  flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,.4);
}
.sidebar .brand-block {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--side-line);
}
.sidebar .brand-logos {
  display: flex; align-items: center; justify-content: center; gap: .85rem;
  background: #fff;
  border: 1px solid var(--side-line);
  border-radius: var(--r-md);
  padding: .65rem .85rem;
  margin-bottom: .85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.10);
}
.sidebar .brand-logos img {
  height: 40px; width: auto; max-width: 90px;
  object-fit: contain; display: block;
}
.sidebar .brand-logos .vbar {
  width: 1px; height: 28px;
  background: rgba(0,0,0,.14);
}
.sidebar .brand-illustration {
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid var(--side-line);
  border-radius: var(--r-md);
  padding: .5rem;
  margin-bottom: .85rem;
}
.sidebar .brand-illustration img { width: 100%; height: auto; max-height: 110px; object-fit: contain; }
.sidebar .brand-name {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  margin: 0;
  letter-spacing: -.01em;
}
.sidebar .brand-tag {
  color: var(--side-fg-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-top: .15rem;
  font-weight: 600;
}
.sidebar .nav-section {
  color: var(--side-fg-muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 700;
  padding: 1rem 1.25rem .35rem;
}
.sidebar .nav-link {
  color: var(--side-fg-muted);
  padding: .6rem 1.25rem;
  display: flex; align-items: center; gap: .7rem;
  border-left: 2px solid transparent;
  font-size: .9rem;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 1.1rem; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(232,154,61,.10);
  border-left-color: var(--scivs-orange);
  font-weight: 600;
}
.sidebar .nav-link.active i { color: var(--scivs-orange); opacity: 1; }
.sidebar .user-block {
  margin-top: auto;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--side-line);
  font-size: .85rem;
}
.sidebar .user-block .name { color: #fff; font-weight: 600; }
.sidebar .user-block .role {
  color: var(--side-fg-muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: .15rem;
}
.sidebar .signout {
  margin-top: .85rem;
  width: 100%;
  background: transparent;
  border: 1px solid var(--side-line);
  color: var(--side-fg);
  padding: .5rem .75rem;
  border-radius: var(--r-sm);
  font-size: .82rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sidebar .signout:hover { color: #fff; border-color: rgba(255,255,255,.25); }

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.topbar .page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
}
.topbar .user-meta { color: var(--ink-3); font-size: .85rem; }
.topbar .user-meta strong { color: var(--ink-2); font-weight: 600; }

/* Content */
.content { padding: 2rem; max-width: 1500px; }

/* Buttons (override bootstrap a touch for premium feel) */
.btn {
  font-weight: 600;
  letter-spacing: -.005em;
  border-radius: var(--r-sm);
  padding: .5rem 1rem;
  font-size: .88rem;
}
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover, .btn-primary:focus {
  background: #C9842F; border-color: #C9842F; color: #fff;
  box-shadow: 0 4px 12px rgba(232,154,61,.25);
}
.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-outline-secondary {
  color: var(--ink-2);
  border-color: var(--line-strong);
  background: var(--surface);
}
.btn-outline-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }

/* Forms */
.form-control, .form-select {
  border-radius: var(--r-sm);
  border-color: var(--line-strong);
  font-size: .9rem;
  padding: .55rem .8rem;
  background: var(--surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-label { font-weight: 600; font-size: .8rem; color: var(--ink-2); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
textarea.form-control { line-height: 1.55; }

/* Cards */
.card-clean {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.card-clean:hover { box-shadow: var(--shadow-md); }

/* Stat cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
}
.stat-card .label {
  color: var(--ink-3);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: .35rem;
}
.stat-card .value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--ink);
  line-height: 1;
}

/* Company cards on dashboard */
.company-card {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
}
.company-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.company-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md); }
.company-card .logo-frame {
  flex-shrink: 0;
  width: 86px; height: 86px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
.company-card .logo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.company-card .stack { flex: 1; min-width: 0; }
.company-card .name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.015em;
  margin-bottom: .15rem;
}
.company-card .nums { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .5rem; }
.company-card .num { display: flex; flex-direction: column; line-height: 1.1; }
.company-card .num .v {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.015em;
}
.company-card .num .l { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; margin-top: .15rem; }
.company-card .num.danger .v { color: var(--bad); }
.company-card .num.info .v { color: var(--info); }
.company-card.scivs::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--scivs-orange);
}
.company-card.dvs::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dvs-green);
}

/* Case header banner */
.case-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 1.25rem; align-items: center;
}
.case-header .logo-frame {
  flex-shrink: 0;
  width: 92px; height: 92px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 10px;
}
.case-header .logo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.case-header .case-meta { flex: 1; min-width: 0; }
.case-header .claim-no {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--ink);
  margin-bottom: .35rem;
}
.case-header .insured { color: var(--ink-2); font-size: 1.02rem; font-weight: 600; }
.case-header .meta-line { color: var(--ink-3); font-size: .85rem; margin-top: .15rem; }
.case-header .actions { flex-shrink: 0; display: flex; gap: .5rem; }

/* Badges — refined */
.badge {
  font-weight: 700;
  letter-spacing: .03em;
  padding: .35em .7em;
  border-radius: 6px;
  font-size: .72rem;
  text-transform: uppercase;
}
.company-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.company-pill.scivs { background: rgba(232,154,61,.12); color: #B26A12; }
.company-pill.dvs { background: rgba(143,190,33,.15); color: #5A7B14; }

/* Tabs */
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link {
  color: var(--ink-3);
  border: none;
  border-bottom: 2px solid transparent;
  padding: .75rem 1rem;
  font-weight: 600;
  font-size: .9rem;
}
.nav-tabs .nav-link:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* Tables */
.table thead { background: var(--surface-2); }
.table thead th {
  color: var(--ink-3);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding: .8rem 1rem;
}
.table tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }

/* Notes */
.note-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .9rem 1.1rem;
  background: var(--surface);
  margin-bottom: .7rem;
  box-shadow: var(--shadow-sm);
}
.note-card .meta { font-size: .75rem; color: var(--ink-3); margin-bottom: .35rem; font-weight: 600; }

/* Timeline */
.timeline { border-left: 2px solid var(--line); padding-left: 1.1rem; margin-left: .5rem; }
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item::before {
  content:''; position:absolute; left:-1.45rem; top:.4rem;
  width:.7rem; height:.7rem; border-radius:50%;
  background: var(--accent); border:2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Login */
.auth-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, #1B1F26 0%, #0F1115 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: ''; position: absolute; top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,154,61,.15) 0%, transparent 60%);
  pointer-events: none;
}
.auth-shell::after {
  content: ''; position: absolute; bottom: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(143,190,33,.10) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  width: 420px; max-width: 100%;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.2rem;
  position: relative;
  z-index: 1;
}
.auth-logos {
  display: flex; align-items: center; justify-content: center; gap: 1.1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.auth-logos img { height: 44px; width: auto; object-fit: contain; }
.auth-logos .vbar { width: 1px; height: 36px; background: var(--line-strong); }
.auth-card h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 .25rem;
  letter-spacing: -.02em;
}
.auth-card .sub { color: var(--ink-3); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-footer { margin-top: 1.5rem; text-align: center; color: var(--ink-3); font-size: .78rem; }

/* Alerts */
.alert {
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: .88rem;
  padding: .65rem 1rem;
}
.alert-success { background: #E8F4ED; border-color: #B6DBC4; color: #1F5F40; }
.alert-danger { background: #FBE8E8; border-color: #E5B8B8; color: #862828; }
.alert-info { background: #E6F0FA; border-color: #B5D0EE; color: #1F4E80; }
.alert-warning { background: #FBF1DE; border-color: #E8CFA0; color: #7C570F; }

/* Mobile */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar .nav { display: flex; flex-wrap: wrap; }
  .sidebar .nav-link { border-left: none; border-bottom: 2px solid transparent; }
  .sidebar .nav-link.active { border-left: none; border-bottom-color: var(--scivs-orange); }
  .sidebar .nav-section { display: none; }
  .case-header { flex-direction: column; align-items: flex-start; }
  .content { padding: 1.25rem; }
  .topbar { padding: .85rem 1.25rem; }
}
