/* =========================================================
   COOP Central — Portal UI (Administrator + Cooperative)
   ========================================================= */
:root {
  --navy: #0A2A66; --navy-2: #0B3F9A; --blue: #0B57D0; --blue-600: #0A4DBA; --blue-soft: #E8F0FC;
  --green: #2E8B2E; --green-btn: #3A9E3A; --green-soft: #EAF6E8; --green-ink: #1E5A20;
  --amber: #B45309; --amber-soft: #FEF3E2; --red: #C5221F; --red-soft: #FDECEA; --purple: #6D28D9; --purple-soft: #F1EAFE;
  --ink: #1F3157; --muted: #56627A; --line: #E1E8F3; --bg: #F4F7FC; --card: #FFFFFF;
  --radius: 16px; --shadow: 0 6px 24px rgba(10, 42, 102, .06);
  --font-head: 'Poppins', 'Segoe UI', Arial, sans-serif; --font-body: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  --sb-w: 264px; --top-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.nowrap { white-space: nowrap; } .text-right { text-align: right; } .text-center { text-align: center; }
.text-green { color: var(--green); } .text-red { color: var(--red); }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 16px }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: .92rem; line-height: 1.2;
  padding: 10px 16px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; background: var(--blue); color: #fff; text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--blue-600); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-outline { background: #fff; color: var(--blue); border-color: #C7D7F2; }
.btn-outline:hover { background: var(--blue-soft); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: #EDF2FA; }
.btn-green { background: var(--green-btn); } .btn-green:hover { background: var(--green); }
.btn-red { background: var(--red); } .btn-red:hover { background: #A51B18; }
.btn-amber { background: #D97706; } .btn-amber:hover { background: var(--amber); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--navy); cursor: pointer; position: relative; }
.icon-btn:hover { background: #EDF2FA; text-decoration: none; }
:focus-visible { outline: 3px solid #7AB0FF; outline-offset: 2px; }

/* ---------- Layout: sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: var(--navy); color: #C9D6EE; display: flex; flex-direction: column; z-index: 60; transition: transform .25s ease; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.sb-brand { background: #fff; border-radius: 12px; padding: 6px 10px; display: inline-flex; }
.sb-brand img { width: 104px; }
.sb-tag { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8FDB7E; }
.sb-close { display: none; margin-left: auto; color: #fff; }
.sb-close:hover { background: rgba(255,255,255,.1); }
.sb-coop { display: flex; gap: 10px; align-items: center; margin: 0 12px 6px; padding: 10px; background: rgba(255,255,255,.07); border-radius: 12px; }
.sb-coop img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; }
.sb-coop strong { display: block; color: #fff; font-size: .9rem; line-height: 1.2; margin-bottom: 3px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.sb-section { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8FA2C6; padding: 12px 10px 4px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: #D5DFF2; font-weight: 500; font-size: .92rem; }
.sb-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sb-link.active { background: var(--blue); color: #fff; }
.sb-link .ic { width: 19px; height: 19px; }
.sb-count { margin-left: auto; font-style: normal; background: #F59E0B; color: #1F1300; font-size: .72rem; font-weight: 700; min-width: 22px; padding: 1px 6px; border-radius: 999px; text-align: center; }
.sb-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-overlay { display: none; }

.main { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.page-title { font-size: 1.15rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.dot-count { position: absolute; top: 4px; right: 3px; background: #E11D48; color: #fff; font-size: .65rem; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; color: var(--ink); }
.user-chip:hover { background: #EDF2FA; text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green-btn)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.uc-text { display: flex; flex-direction: column; line-height: 1.15; max-width: 180px; }
.uc-text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 24px; flex: 1; width: 100%; max-width: 1360px; }
.portal-foot { padding: 16px 24px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid > .card + .card { margin-top: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 1.35rem; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.stat { display: flex; gap: 14px; align-items: center; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.stat-ic.green { background: var(--green-soft); color: var(--green); } .stat-ic.amber { background: var(--amber-soft); color: var(--amber); } .stat-ic.purple { background: var(--purple-soft); color: var(--purple); }
.stat-ic .ic { width: 24px; height: 24px; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; color: var(--navy); line-height: 1.2; word-break: break-word; }
.stat-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.badge-gray { background: #EEF1F6; color: #4B5568; } .badge-blue { background: var(--blue-soft); color: #0A47AA; }
.badge-green { background: var(--green-soft); color: var(--green-ink); } .badge-amber { background: var(--amber-soft); color: #8A4106; }
.badge-red { background: var(--red-soft); color: #9B1C1C; } .badge-purple { background: var(--purple-soft); color: #5B21B6; }
.sb-coop .badge { font-size: .66rem; padding: 1px 7px; }

/* ---------- Alerts ---------- */
.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-weight: 500; }
.alert .ic { margin-top: 1px; }
.alert span { flex: 1; }
.alert-x { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert-x .ic { width: 16px; height: 16px; }
.alert-success { background: var(--green-soft); border-color: #BFE3B9; color: var(--green-ink); }
.alert-error { background: var(--red-soft); border-color: #F5C2BE; color: #9B1C1C; }
.alert-info { background: var(--blue-soft); border-color: #C7D7F2; color: #0A3C8F; }
.alert-warning { background: var(--amber-soft); border-color: #F6D6A8; color: #7A3A05; }
.notice { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--blue-soft); border: 1px solid #C7D7F2; }
.notice.green { background: var(--green-soft); border-color: #BFE3B9; } .notice.amber { background: var(--amber-soft); border-color: #F6D6A8; } .notice.red { background: var(--red-soft); border-color: #F5C2BE; }
.notice .ic { width: 28px; height: 28px; }
.notice h3 { margin: 0 0 2px; } .notice p { margin: 0; color: var(--muted); }
.notice .btn { margin-left: auto; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: .86rem; color: var(--navy); }
.req { color: #D93025; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%; padding: 10px 12px; border: 1px solid #D5DEEC; border-radius: 10px; background: #FBFCFF; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 87, 208, .15); }
textarea { resize: vertical; }
input[type=color] { width: 48px; height: 42px; padding: 2px; border: 1px solid #D5DEEC; border-radius: 10px; background: #fff; cursor: pointer; }
.help { color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field.grow { flex: 2; min-width: 200px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=text] { font-family: ui-monospace, monospace; text-transform: uppercase; }

/* option tiles (services) */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; min-height: 92px; }
.tile:hover { border-color: #A9C2EC; }
.tile input { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; accent-color: var(--blue); }
.tile .ic { width: 28px; height: 28px; color: var(--blue); }
.tile span { font-weight: 600; font-size: .9rem; color: var(--navy); padding-right: 20px; line-height: 1.25; }
.tile:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 87, 208, .1); background: #F7FAFF; }
.tile small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.tiles.methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.methods .tile { min-height: 120px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFE; }
.table td { padding: 12px; border-bottom: 1px solid #EEF2F8; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFCFF; }
.table .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.table .credit { color: var(--green); } .table .debit { color: var(--red); }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.cell-main strong { display: block; color: var(--navy); }
.cell-main small { color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* definition lists */
.dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; font-weight: 600; color: var(--ink); word-break: break-word; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pg { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: .88rem; }
.pg:hover { text-decoration: none; border-color: var(--blue); }
.pg.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pg.disabled { opacity: .4; } .pg.dots { border: 0; background: none; }

/* ---------- Stepper / timeline ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 24px; counter-reset: s; }
.stp { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.stp::before { content: ""; position: absolute; top: 22px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.stp:first-child::before { display: none; }
.stp.done::before, .stp.current::before { background: var(--blue); }
.stp-dot { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #E9EEF7; color: #7B8AA5; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.stp-dot .ic { width: 20px; height: 20px; }
.stp.current { color: var(--navy); } .stp.current .stp-dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(11, 87, 208, .18); }
.stp.done .stp-dot { background: var(--blue); color: #fff; }
.stp.done .stp-dot::after { content: "✓"; position: absolute; right: -6px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-btn); color: #fff; font-size: .65rem; display: grid; place-items: center; border: 2px solid #fff; }
a.stp:hover { text-decoration: none; color: var(--blue); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.timeline li.ok::after { border-color: var(--green-btn); } .timeline li.bad::after { border-color: var(--red); }
.timeline strong { display: block; color: var(--navy); }
.timeline small { color: var(--muted); }
.timeline p { margin: 2px 0 0; font-size: .9rem; }

/* progress tracker (status) */
.track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.track .stp::before { top: 20px; }
.track .stp-dot { width: 42px; height: 42px; }
.track small { font-weight: 500; color: var(--muted); font-size: .76rem; }

/* ---------- Charts ---------- */
.chart { width: 100%; min-height: 220px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text, .chart text { font-family: var(--font-body); font-size: 11px; fill: #6B7891; }
.chart .grid-line { stroke: #EDF1F7; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; pointer-events: none; background: var(--navy); color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 8px; z-index: 100; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.bar-track { height: 10px; background: #EEF2F8; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 999px; }

/* ---------- Misc components ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-ic { width: 44px; height: 44px; color: #A9B6CC; margin: 0 auto 10px; }
.empty h3 { color: var(--navy); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--blue); text-decoration: none; }
.tabs a.active { color: var(--blue); border-color: var(--blue); }
.tabs a em { font-style: normal; background: #EEF1F6; border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 12px 0; border-bottom: 1px solid #EEF2F8; }
.list-plain li:last-child { border-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #EEF3FB; color: var(--navy); font-size: .8rem; font-weight: 600; }
.chip .ic { width: 14px; height: 14px; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.1); vertical-align: middle; }
.logo-box { width: 96px; height: 96px; border-radius: 18px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-box img { max-width: 84%; max-height: 84%; object-fit: contain; }
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 8px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; font-size: .86rem; }
.qa:hover { border-color: var(--blue); text-decoration: none; box-shadow: var(--shadow); }
.qa span.qa-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.qa span.qa-ic .ic { width: 24px; height: 24px; }
.msg { padding: 12px 14px; border-radius: 14px; background: #F4F7FC; margin-bottom: 10px; max-width: 86%; }
.msg.me { background: var(--blue-soft); margin-left: auto; }
.msg small { display: block; color: var(--muted); margin-bottom: 4px; font-size: .76rem; }
.msg p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.preview-phone { width: 230px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 34px; border: 9px solid #111827; background: #fff; overflow: hidden; display: flex; flex-direction: column; margin: 0 auto; box-shadow: 0 24px 50px rgba(10,42,102,.25); }
.pp-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; background: linear-gradient(180deg, #F4F8FF, #fff); }
.pp-top img { width: 86px; height: 86px; object-fit: contain; }
.pp-top strong { font-family: var(--font-head); font-size: 1rem; color: var(--navy); line-height: 1.2; }
.pp-top small { color: var(--muted); font-size: .72rem; }
.pp-btns { padding: 0 16px 18px; display: grid; gap: 8px; }
.pp-btn { border-radius: 10px; padding: 9px; text-align: center; font-size: .78rem; font-weight: 700; color: #fff; }
.pp-btn.out { background: #fff !important; border: 1.5px solid; }
.pp-hero { height: 34%; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(10, 22, 50, .5); }
.modal-card { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.kpi-mini { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi-mini div { min-width: 110px; }
.kpi-mini strong { display: block; font-family: var(--font-head); font-size: 1.15rem; color: var(--navy); }
.kpi-mini span { font-size: .8rem; color: var(--muted); }

/* ---------- Install prompt (iOS) ---------- */
.install-ios { position: fixed; inset: auto 0 0 0; z-index: 95; padding: 16px; }
.ios-card { position: relative; max-width: 420px; margin: 0 auto; background: #fff; border-radius: 18px; padding: 18px 18px 14px; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.ios-card .icon-btn { position: absolute; top: 8px; right: 8px; }
.ios-card h3 { margin: 0 0 6px; }
.ios-card p { margin: 0; color: var(--muted); }

/* ---------- Auth screens ---------- */
.auth-page { background: linear-gradient(135deg, #F4F8FE 0%, #EEF4FC 55%, #E6F4E4 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; background: linear-gradient(140deg, #0A2A66 0%, #0B4FB0 65%, #1E7A5A 100%); color: #D9E4F7; }
.auth-logo { width: 150px; background: #fff; border-radius: 14px; padding: 8px 12px; }
.auth-side h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.3rem); margin: 40px 0 10px; }
.auth-side h2 span { color: #8FDB7E; }
.auth-side p { max-width: 460px; font-size: 1.02rem; }
.auth-phone { height: min(540px, calc(100vh - 420px)); min-height: 260px; width: auto; max-width: 100%; object-fit: contain; margin: 32px auto; align-self: center; filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 80px); background: #fff; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-form { width: 100%; max-width: 440px; }
.auth-links { margin-top: 18px; font-size: .92rem; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; }
.pw-toggle .ic { width: 18px; height: 18px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open { overflow: hidden; }
  body.sb-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(10, 22, 50, .45); z-index: 55; }
  .sb-close { display: inline-grid; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .g-main, .g-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .auth-side { padding: 20px 20px 34px; min-height: auto; }
  .auth-logo { width: 116px; padding: 6px 10px; border-radius: 12px; }
  .auth-side h2 { margin: 14px 0 4px; font-size: 1.35rem; }
  .auth-side p { font-size: .9rem; margin: 0; max-width: 520px; }
  .auth-phone { display: none; }
  .auth-card { justify-content: flex-start; padding: 28px 20px 32px; border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; z-index: 1; }
  .auth-form { margin: 0 auto; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { padding: 0 10px 0 6px; gap: 6px; }
  .uc-text { display: none; }
  .content { padding: 16px 12px 24px; }
  .card { padding: 16px; border-radius: 14px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .grid { gap: 14px; }
  .g-2, .g-4 { grid-template-columns: 1fr; }
  .g-4.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4.stats-2 .stat { flex-direction: column; align-items: flex-start; gap: 10px; }
  .g-4.stats-2 .stat-ic { width: 40px; height: 40px; border-radius: 12px; }
  .g-4.stats-2 .stat-value { font-size: 1.15rem; }
  .form-grid { grid-template-columns: 1fr; }
  .tiles, .tiles.methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .qa { padding: 12px 4px; font-size: .74rem; border-radius: 12px; }
  .qa span.qa-ic { width: 40px; height: 40px; border-radius: 12px; }
  .stepper { gap: 2px; }
  .stp { font-size: .66rem; }
  .stp-dot { width: 36px; height: 36px; }
  .stp::before { top: 17px; }
  .stp-dot .ic { width: 16px; height: 16px; }
  .track .stp-dot { width: 34px; height: 34px; } .track .stp::before { top: 16px; }
  .page-head h2 { font-size: 1.15rem; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .filters .field { min-width: calc(50% - 5px); }
  .filters .field.grow { min-width: 100%; }
  .filters .btn { flex: 1; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .notice { flex-wrap: wrap; }
  .notice .btn { margin-left: 0; width: 100%; }
  .bar-row { grid-template-columns: 90px 1fr auto; }

  /* stacked tables on phones */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: #fff; }
  .table-stack tbody tr:hover { background: #fff; }
  .table-stack td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; flex: none; }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { display: none; }
  .table-stack td.cell-first { display: block; text-align: left; border-bottom: 1px solid #EEF2F8; padding-bottom: 10px; margin-bottom: 4px; }
  .table-stack td .actions { justify-content: flex-end; }
  .table-stack .amt { text-align: right; }
  .table-wrap:has(.table-stack) { margin: 0; padding: 0; overflow: visible; }
}
@media (max-width: 400px) {
  .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles, .tiles.methods { grid-template-columns: 1fr 1fr; }
  .tile { padding: 12px; min-height: 84px; }
}
@media print {
  .sidebar, .topbar, .portal-foot, .btn, .filters, .pagination { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; }
}

@media (max-width: 420px) {
  .auth-side p { display: none; }
  .auth-side h2 { font-size: 1.2rem; }
  .auth-card h1 { font-size: 1.4rem; }
}
