/* ============================================================
   PRARVI LOAN CRM — design system
   Brand: navy #0B0A88 · teal #55D1CB · accent orange #e88421
   Fast, responsive, dependency-free.
   ============================================================ */
:root {
  --navy: #0B0A88;
  --navy-2: #1210a8;
  --navy-dark: #070653;
  --teal: #55D1CB;
  --teal-soft: #e6f7f6;
  --orange: #e88421;
  --orange-soft: #fdf0e0;
  --green: #1e9e5a;
  --green-soft: #e6f6ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --yellow: #d99a00;
  --yellow-soft: #fdf6e0;
  --blue: #2563eb;
  --blue-soft: #e8efff;
  --gray-900: #1a1d2b;
  --gray-700: #4b5163;
  --gray-500: #8a90a3;
  --gray-300: #d9dce8;
  --gray-100: #eef0f6;
  --bg: #f4f5fb;
  --card: #ffffff;
  --sidebar-w: 252px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 18, 40, .06), 0 8px 24px rgba(16, 18, 40, .05);
  --shadow-lg: 0 20px 50px rgba(16, 18, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd2e2; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab1c8; background-clip: content-box; border: 2px solid transparent; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 60%, #1311a0 100%);
  color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  z-index: 60; transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.sidebar-brand .logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), #7fe3de); color: var(--navy-dark); font-weight: 800; font-size: 18px;
}
.sidebar-brand .b-name { font-weight: 700; font-size: 15px; line-height: 1.15; }
.sidebar-brand .b-sub { font-size: 11px; color: #9fe3df; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.45); margin: 18px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-size: 13.5px; cursor: pointer; transition: background .15s, color .15s; margin-bottom: 2px; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.nav-link .ico { width: 20px; height: 20px; flex: 0 0 20px; opacity: .9; }
.nav-link .cnt { margin-left: auto; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar-foot { padding: 12px; }
.sidebar-foot .user-chip { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px; }
.sidebar-foot .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--navy-dark); font-weight: 700; display: grid; place-items: center; font-size: 14px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; gap: 14px; padding: 10px 22px;
}
.topbar .hamburger { display: none; cursor: pointer; border: 0; background: none; padding: 6px; border-radius: 8px; color: var(--gray-700); }
.topbar .hamburger:hover { background: var(--gray-100); }
.topbar-title { font-size: 15px; font-weight: 700; }
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--gray-300); border-radius: 10px; font-size: 13px; background: var(--gray-100);
}
.topbar-search .s-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gray-500); width: 16px; height: 16px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--gray-300);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--gray-700); transition: all .15s;
}
.icon-btn:hover { border-color: var(--navy); color: var(--navy); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 20px; background: var(--red);
  color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; padding: 0 3px;
}
.icon-btn .dot--teal { background: var(--teal); color: var(--navy-dark); }

.content { flex: 1; padding: 22px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.page-head p { margin: 3px 0 0; color: var(--gray-500); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(16,18,40,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 0; }
.card-head h3 { font-size: 14px; margin: 0; font-weight: 700; }
.card-body { padding: 16px 18px; }
.card + .card, .card { margin-bottom: 18px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); border: 1px solid rgba(16,18,40,.04); display: flex; gap: 13px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, rgba(85,209,203,.18)), transparent 70%); }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 42px; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi .k-label { font-size: 11.5px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.kpi .k-value { font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.4px; }
.kpi .k-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.kpi .k-sub b { color: var(--gray-900); }
.ico-navy { background: var(--navy); color: #fff; }
.ico-teal { background: var(--teal); color: var(--navy-dark); }
.ico-orange { background: var(--orange); color: #fff; }
.ico-green { background: var(--green); color: #fff; }
.ico-red { background: var(--red); color: #fff; }
.ico-blue { background: var(--blue); color: #fff; }
.ico-gray { background: var(--gray-100); color: var(--gray-700); }

/* ---------- Grid helpers ---------- */
.row { display: flex; gap: 18px; }
.col-2 { flex: 1; }
.col-3 { flex: 1; }
@media (min-width: 1100px) { .col-3 { flex: 0 0 calc(33.333% - 12px); } .col-2 { flex: 0 0 calc(50% - 9px); } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; }
.muted { color: var(--gray-500); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.overflow-auto { overflow-x: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1.2;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(11,10,136,.25); }
.btn-primary:hover { background: var(--navy-2); transform: translateY(-1px); }
.btn-teal { background: var(--teal); color: var(--navy-dark); }
.btn-teal:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.96); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-soft { background: var(--navy); color: #fff; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--orange { background: var(--orange-soft); color: var(--orange); }
.badge--yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--teal { background: var(--teal-soft); color: #0c8f88; }
.badge--navy { background: rgba(11,10,136,.1); color: var(--navy); }
.badge--gray { background: var(--gray-100); color: var(--gray-700); }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prio-low { background: var(--gray-300); } .prio-medium { background: var(--blue); } .prio-high { background: var(--orange); } .prio-urgent { background: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th { text-align: left; padding: 10px 12px; color: var(--gray-500); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbff; }
.tbl .row-click { cursor: pointer; }
.tbl .primary { font-weight: 700; color: var(--gray-900); }
.tbl .sub { font-size: 11.5px; color: var(--gray-500); }

/* ---------- Avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: var(--navy); }
.avatar--teal { background: var(--teal); color: var(--navy-dark); }
.avatar--orange { background: var(--orange); }
.avatar--green { background: var(--green); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid #fff; }

/* ---------- Forms ---------- */
.field { margin-bottom: 13px; }
.field .label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.field .label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: 10px; font-size: 13px; font-family: inherit;
  background: #fff; color: var(--gray-900); transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,10,136,.1); }
.textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-line input { accent-color: var(--navy); width: 16px; height: 16px; }

/* ---------- Modals ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,12,30,.5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fadeIn .15s ease; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column; animation: popIn .18s ease; }
.modal--lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px 0; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-close { border: 0; background: var(--gray-100); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; color: var(--gray-700); font-size: 16px; display: grid; place-items: center; }
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-body { padding: 16px 20px 8px; overflow-y: auto; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 9px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 360px; }
.toast { background: #fff; border-radius: 13px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 11px; align-items: flex-start; border-left: 4px solid var(--blue); animation: slideIn .25s ease; }
.toast--success { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }
.toast--info { border-left-color: var(--teal); }
.toast--warning { border-left-color: var(--orange); }
.toast .t-ico { width: 20px; height: 20px; flex: 0 0 20px; }
.toast .t-title { font-weight: 700; font-size: 13px; }
.toast .t-msg { font-size: 12.5px; color: var(--gray-700); margin-top: 1px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty .e-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--gray-100); display: grid; place-items: center; margin: 0 auto 12px; color: var(--gray-500); }
.empty h4 { margin: 0 0 4px; color: var(--gray-700); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { flex: 0 0 268px; background: #eceef6; border-radius: 14px; padding: 10px; }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-weight: 700; font-size: 13px; }
.kanban-head .kb-count { background: #fff; border-radius: 20px; font-size: 11px; padding: 1px 8px; color: var(--gray-500); }
.kanban-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.kcard { background: #fff; border-radius: 11px; padding: 11px 12px; box-shadow: 0 1px 2px rgba(16,18,40,.06); cursor: pointer; transition: box-shadow .15s, transform .15s; border: 1px solid rgba(16,18,40,.05); }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard .k-title { font-weight: 700; font-size: 13px; }
.kcard .k-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--gray-500); flex-wrap: wrap; }
.kcard .k-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.kcard.dragging { opacity: .6; }
.kanban-col.drop { outline: 2px dashed var(--teal); }

/* ---------- Stage track (order pipeline) ---------- */
.stage-track { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stage-step { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--gray-500); }
.stage-step .st-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--gray-100); color: var(--gray-500); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.stage-step.active .st-dot { background: var(--navy); color: #fff; }
.stage-step.done .st-dot { background: var(--green); color: #fff; }
.stage-step .st-bar { width: 26px; height: 2px; background: var(--gray-300); }
.stage-step.done .st-bar, .stage-step.active .st-bar { background: var(--green); }

/* ---------- Charts ---------- */
.chart-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 150px; height: 150px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center b { font-size: 22px; display: block; }
.donut-center span { font-size: 11px; color: var(--gray-500); }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.legend-item .lg { width: 11px; height: 11px; border-radius: 4px; flex: 0 0 11px; }
.legend-item .lg-v { margin-left: auto; font-weight: 700; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 70px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.bar-row .bar-track { background: var(--gray-100); border-radius: 20px; height: 9px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--navy), var(--teal)); }

/* ---------- Activity feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--gray-100); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .f-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--gray-100); color: var(--gray-700); display: grid; place-items: center; flex: 0 0 34px; }
.feed-item .f-txt { font-size: 13px; }
.feed-item .f-txt b { color: var(--gray-900); }
.feed-item .f-time { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }

/* ---------- Dropzone ---------- */
.dropzone { border: 2px dashed var(--gray-300); border-radius: 14px; padding: 26px; text-align: center; cursor: pointer; transition: all .15s; background: #fafbff; }
.dropzone:hover, .dropzone.over { border-color: var(--navy); background: var(--teal-soft); }
.dropzone .dz-ico { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--navy); }
.dropzone p { margin: 0; font-size: 13px; color: var(--gray-700); }
.dropzone .dz-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }

/* ---------- Notifications dropdown ---------- */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: 46px; width: 340px; max-height: 460px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-100); z-index: 80; overflow: hidden; display: none; flex-direction: column;
}
.dropdown.open .dropdown-panel { display: flex; }
.dropdown-panel .dp-head { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.dropdown-panel .dp-list { overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.notif-item:hover { background: #fafbff; }
.notif-item.unread { background: var(--teal-soft); }
.notif-item .n-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 30px; }
.notif-item .n-title { font-size: 12.5px; font-weight: 600; }
.notif-item .n-msg { font-size: 11.5px; color: var(--gray-500); }
.notif-item .n-time { font-size: 10.5px; color: var(--gray-500); }

/* ---------- Login page ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 80% -10%, rgba(85,209,203,.25), transparent), linear-gradient(160deg, var(--navy-dark), var(--navy) 55%, #1a1794); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .25s ease; }
.auth-hero { background: linear-gradient(135deg, var(--navy), #1a1794); color: #fff; padding: 26px 26px 22px; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; inset: auto -40px -70px auto; width: 180px; height: 180px; border-radius: 50%; background: rgba(85,209,203,.2); }
.auth-hero .ah-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.auth-hero .ah-logo .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), #7fe3de); color: var(--navy-dark); display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.auth-hero h2 { margin: 0; font-size: 20px; }
.auth-hero p { margin: 4px 0 0; color: #b9d9ff; font-size: 13px; }
.auth-body { padding: 24px 26px 26px; }
.auth-tabs { display: flex; background: var(--gray-100); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--gray-500); }
.auth-tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(16,18,40,.1); }
.auth-foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--gray-500); }

/* ---------- Portal ---------- */
.portal-hero { background: linear-gradient(135deg, var(--navy), #1a1794); color: #fff; border-radius: var(--radius); padding: 24px 26px; position: relative; overflow: hidden; margin-bottom: 18px; }
.portal-hero::after { content: ""; position: absolute; inset: auto -30px -60px auto; width: 200px; height: 200px; border-radius: 50%; background: rgba(85,209,203,.22); }
.portal-hero h2 { margin: 0; font-size: 20px; }
.portal-hero p { margin: 5px 0 0; color: #bcd9ff; font-size: 13px; }
.checklist-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.chk-item { border: 1px solid var(--gray-100); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.chk-item .chk-cat { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.chk-item .chk-name { font-size: 13px; font-weight: 600; }
.chk-item .chk-status { margin-top: auto; }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-300); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--teal); }
.tl-item .tl-title { font-weight: 600; font-size: 13px; }
.tl-item .tl-meta { font-size: 11.5px; color: var(--gray-500); }

/* ---------- Misc ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 140px; }
.search-input { min-width: 200px; }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, #f7f8fc 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-100); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.money { font-variant-numeric: tabular-nums; }
.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--red); font-weight: 700; }
.divider { height: 1px; background: var(--gray-100); margin: 14px 0; }
.kbd { background: var(--gray-100); border-radius: 6px; padding: 1px 6px; font-size: 11px; border: 1px solid var(--gray-300); }
.clickable { cursor: pointer; }
.uploading-overlay { position: fixed; inset: 0; background: rgba(10,12,30,.5); z-index: 150; display: grid; place-items: center; color: #fff; font-weight: 700; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .topbar .hamburger { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,12,30,.45); z-index: 55; display: none; }
  .sidebar-backdrop.show { display: block; }
}
@media (max-width: 720px) {
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .k-value { font-size: 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-search { display: none; }
  .toast-wrap { left: 12px; right: 12px; max-width: none; }
  .dropdown-panel { width: calc(100vw - 24px); right: -46px; }
  .kanban-col { flex-basis: 82vw; }
}
