/* ==========================================================================
   PDI Eligibility & Auth Console — Mockup design system
   Clean light SaaS. Teal/blue accent. Dense data tables + status chips.
   ========================================================================== */

:root {
  --teal-50:  #eefcfb;
  --teal-100: #d2f5f2;
  --teal-200: #a8ebe6;
  --teal-300: #6fdad3;
  --teal-400: #34bfb8;
  --teal-500: #14a39c;  /* primary accent */
  --teal-600: #0c8480;
  --teal-700: #0d6a68;
  --teal-800: #105453;
  --teal-900: #0f4645;

  --blue-500: #2f6df6;
  --blue-600: #1d54d4;

  --ink-900: #0f1b2d;
  --ink-700: #2b3a4f;
  --ink-600: #46586e;
  --ink-500: #647489;
  --ink-400: #8a98ab;
  --ink-300: #b9c3cf;

  --surface:   #ffffff;
  --canvas:    #f4f7fa;
  --panel:     #fbfdfe;
  --line:      #e4eaf0;
  --line-soft: #eef2f6;

  --green-50:#e9f9f0; --green-500:#16a34a; --green-700:#137a39;
  --amber-50:#fef4e3; --amber-500:#e0930f; --amber-700:#b4730a;
  --red-50:#fdecec;   --red-500:#dc3545;   --red-700:#b02530;
  --blue-50:#e9f1ff;  --bluechip-500:#2f6df6;
  --slate-50:#eef1f5; --slate-500:#64748b;
  --violet-50:#f1ecfd; --violet-500:#7c4ddb;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16,30,54,.06), 0 1px 3px rgba(16,30,54,.04);
  --shadow-md: 0 4px 14px rgba(16,30,54,.08);
  --shadow-lg: 0 16px 48px rgba(16,30,54,.18);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--canvas);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0f4645 0%, #0c3635 100%);
  color: #d7efed;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  display: grid; place-items: center; color: #fff; font-weight: 800;
  box-shadow: 0 4px 12px rgba(20,163,156,.5);
}
.sidebar .brand .name { font-weight: 700; color: #fff; font-size: 14.5px; letter-spacing: .2px; }
.sidebar .brand .sub  { font-size: 11px; color: var(--teal-200); }

.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav .group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(215,239,237,.5); padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0; border-radius: 8px;
  color: #cfe8e6; text-decoration: none; font-weight: 500; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(52,191,184,.20); color: #fff; }
.nav a.active i { color: var(--teal-300); }
.nav a i { width: 18px; height: 18px; }
.nav a .pill {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.nav a .pill.alert { background: var(--red-500); }

.sidebuser {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.sidebuser .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal-400); color: #07302e; font-weight: 700;
  display: grid; place-items: center; font-size: 12.5px;
}
.sidebuser .who { line-height: 1.2; }
.sidebuser .who b { color: #fff; font-size: 13px; display: block; }
.sidebuser .who span { color: var(--teal-200); font-size: 11.5px; }

/* ---------- Main column ---------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .page-title small { display:block; font-size: 12px; color: var(--ink-500); font-weight: 500; }
.search {
  margin-left: 8px; flex: 1; max-width: 460px; position: relative;
}
.search input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px 0 36px; background: var(--canvas); font-size: 13.5px; color: var(--ink-900);
}
.search input:focus { outline: none; border-color: var(--teal-400); background: #fff; box-shadow: 0 0 0 3px var(--teal-50); }
.search i { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--ink-400); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-600);
  position: relative;
}
.icon-btn:hover { background: var(--canvas); color: var(--ink-900); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-500); border: 2px solid #fff; }

.content { padding: 22px 24px 40px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-700);
  padding: 8px 13px; border-radius: 8px; font-weight: 600; font-size: 13px;
  transition: .12s; white-space: nowrap;
}
.btn:hover { background: var(--canvas); }
.btn i { width: 16px; height: 16px; }
.btn.primary { background: var(--teal-500); border-color: var(--teal-500); color: #fff; }
.btn.primary:hover { background: var(--teal-600); }
.btn.blue { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.btn.blue:hover { background: var(--blue-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--canvas); }
.btn.danger { color: var(--red-700); border-color: var(--red-500); }
.btn.danger:hover { background: var(--red-50); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon { padding: 8px; }

/* ---------- Status & generic chips ---------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
  line-height: 1.7; white-space: nowrap;
}
.chip .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.green  { background: var(--green-50); color: var(--green-700); }
.chip.amber  { background: var(--amber-50); color: var(--amber-700); }
.chip.red    { background: var(--red-50);   color: var(--red-700); }
.chip.blue   { background: var(--blue-50);  color: var(--bluechip-500); }
.chip.slate  { background: var(--slate-50); color: var(--slate-500); }
.chip.violet { background: var(--violet-50);color: var(--violet-500); }
.chip.teal   { background: var(--teal-50);  color: var(--teal-700); }
.chip.outline{ background: #fff; border: 1px solid var(--line); color: var(--ink-600); font-weight: 600; }

.prio { font-weight: 700; font-size: 11.5px; }
.prio.high { color: var(--red-600,#c8323f); }
.prio.med  { color: var(--amber-700); }
.prio.low  { color: var(--ink-400); }

/* ---------- Cards / panels ------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-head .sub { font-size: 12px; color: var(--ink-500); }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px; }

.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .label { font-size: 12px; color: var(--ink-500); font-weight: 600; display:flex; align-items:center; gap:7px;}
.kpi .label i { width: 15px; height: 15px; }
.kpi .value { font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.kpi .trend { font-size: 11.5px; font-weight: 700; margin-top: 4px; display:flex; align-items:center; gap:4px; }
.kpi .trend.up { color: var(--green-700); }
.kpi .trend.down { color: var(--red-700); }
.kpi .trend.flat { color: var(--ink-400); }
.kpi .accent { position:absolute; left:0; top:0; bottom:0; width:4px; }
.kpi.t-teal .accent{background:var(--teal-500);} .kpi.t-red .accent{background:var(--red-500);}
.kpi.t-amber .accent{background:var(--amber-500);} .kpi.t-blue .accent{background:var(--blue-500);}
.kpi.t-green .accent{background:var(--green-500);} .kpi.t-violet .accent{background:var(--violet-500);}

/* ---------- Tables --------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-500); font-weight: 700;
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0;
}
table.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--teal-50); cursor: pointer; }
table.tbl tbody tr.norow:hover { background: transparent; cursor: default; }
table.tbl .muted { color: var(--ink-500); }
table.tbl .strong { font-weight: 700; }
.cellsub { font-size: 11.5px; color: var(--ink-500); }

.av-sm { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; }

/* ---------- Filter rail ---------------------------------------------------- */
.layout-split { display: grid; grid-template-columns: 232px 1fr; gap: 16px; align-items: start; }
.rail .panel-body { padding: 8px; }
.rail .filter-group { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); }
.rail .filter-group:last-child { border-bottom: 0; }
.rail .fg-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); font-weight: 700; margin: 2px 4px 8px; }
.rail .opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ink-700); }
.rail .opt:hover { background: var(--canvas); }
.rail .opt.active { background: var(--teal-50); color: var(--teal-700); font-weight: 600; }
.rail .opt .count { margin-left: auto; font-size: 11.5px; color: var(--ink-400); }
.rail .opt.active .count { color: var(--teal-600); }

.savedview { display:flex; align-items:center; gap:8px; padding:7px 9px; border-radius:7px; cursor:pointer; font-size:13px; color:var(--ink-700);}
.savedview:hover{ background: var(--canvas);}
.savedview.active{ background: var(--teal-500); color:#fff; font-weight:600;}
.savedview .count{ margin-left:auto; font-size:11.5px; opacity:.8;}

/* ---------- Tabs ----------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tabs button {
  border: 0; background: transparent; padding: 11px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display:flex; align-items:center; gap:7px;
}
.tabs button:hover { color: var(--ink-900); }
.tabs button.active { color: var(--teal-700); border-bottom-color: var(--teal-500); }
.tabs button .pill { background: var(--canvas); color: var(--ink-600); border-radius: 20px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Forms ---------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-600); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; color: var(--ink-900); background: #fff; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal-400); box-shadow: 0 0 0 3px var(--teal-50); }
.field .hint { font-size: 11.5px; color: var(--ink-400); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Drawer / modal ------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(15,27,45,.42); z-index: 60; display: none; }
.overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 94vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 61;
  transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display:flex; align-items:center; gap:12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; background: var(--panel); }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-46%); z-index: 61;
  width: 560px; max-width: 94vw; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: .18s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.modal-head { padding: 18px 20px 0; }
.modal-head h3 { margin: 0 0 4px; font-size: 17px; }
.modal-head p { margin: 0; color: var(--ink-500); font-size: 13px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Misc helpers --------------------------------------------------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--ink-500); }
.tiny { font-size: 11.5px; }
.mt8{margin-top:8px;} .mt12{margin-top:12px;} .mt16{margin-top:16px;} .mt24{margin-top:24px;}
.mb0{margin-bottom:0;} .mb8{margin-bottom:8px;} .mb16{margin-bottom:16px;}
.gap6{gap:6px;} .gap8{gap:8px;} .gap12{gap:12px;} .gap16{gap:16px;}
.flex1{flex:1;}
.divider { height:1px; background: var(--line-soft); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-500); }
.kv dd { margin: 0; font-weight: 600; color: var(--ink-900); }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 80; display:flex; flex-direction:column; gap:10px; }
.toast {
  background: var(--ink-900); color: #fff; padding: 12px 16px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; display:flex; align-items:center; gap:10px;
  animation: toastin .2s ease; max-width: 360px;
}
.toast i { width: 18px; height: 18px; color: var(--teal-300); }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.timeline { position: relative; padding-left: 22px; }
.timeline:before { content:''; position:absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -19px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--teal-400); }
.tl-dot.info{border-color:var(--blue-500);} .tl-dot.warn{border-color:var(--amber-500);} .tl-dot.error{border-color:var(--red-500);} .tl-dot.ok{border-color:var(--green-500);}
.tl-item .t { font-weight: 600; font-size: 13px; }
.tl-item .m { font-size: 12px; color: var(--ink-500); }

.bar-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.bar-track { background: var(--line-soft); height: 9px; border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: var(--teal-500); }

.note { background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 9px; padding: 11px 13px; margin-bottom: 10px; }
.note .nh { display:flex; align-items:center; gap:8px; margin-bottom: 5px; }
.note .nh b { font-size: 12.5px; }
.note .nh .time { font-size: 11px; color: var(--ink-400); margin-left:auto; }
.note .body { font-size: 13px; color: var(--ink-700); }
.mention { color: var(--teal-700); font-weight: 600; background: var(--teal-50); padding: 0 4px; border-radius: 4px; }

.banner { border-radius: 9px; padding: 12px 14px; display:flex; gap:11px; font-size: 13px; align-items:flex-start; }
.banner i { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.banner.warn { background: var(--amber-50); color: var(--amber-700); }
.banner.info { background: var(--blue-50); color: var(--bluechip-500); }
.banner.red { background: var(--red-50); color: var(--red-700); }
.banner.green { background: var(--green-50); color: var(--green-700); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink-600); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--teal-500); color: #fff; }

.matrix td, .matrix th { text-align: center; }
.matrix td.role-cell { text-align: left; }
.check-yes { color: var(--green-500); }
.check-no { color: var(--ink-300); }

.empty { text-align:center; padding: 40px 20px; color: var(--ink-400); }
.empty i { width: 38px; height: 38px; color: var(--ink-300); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2,1fr); }
  .layout-split { grid-template-columns: 1fr; }
}
