:root {
  --brand: #0f5c4d;
  --brand-dark: #0a4036;
  --accent: #f2a541;
  --ink: #1d2430;
  --muted: #6b7380;
  --bg: #f4f6f5;
  --line: #e3e7e5;
  --sidebar-w: 248px;
}

body { background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-accent { background: var(--accent); color: #1d2430; border: 0; font-weight: 600; }
.btn-accent:hover { filter: brightness(.95); color: #1d2430; }
.text-brand { color: var(--brand) !important; }
.bg-orange { background-color: #e8590c !important; }
.badge-st { font-weight: 600; letter-spacing: .02em; }
.form-label { font-weight: 500; }

/* ---------- Auth ---------- */
.auth-bg { min-height: 100vh; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 60%, #062a23 100%); }
.auth-card { max-width: 420px; }

/* ---------- Admin layout ---------- */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--brand-dark); color: #cfe3de; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; gap: .6rem; align-items: center; padding: 1.1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img, .sidebar .brand .logo-dot { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--accent); flex-shrink: 0; display: grid; place-items: center; color: var(--brand-dark); font-weight: 800; }
.sidebar .brand span { font-weight: 700; line-height: 1.15; font-size: .95rem; }
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #8fb3aa; padding: 1rem 1.1rem .35rem; }
.sidebar a.nav-link { color: #d8ebe6; padding: .5rem 1.1rem; display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; font-size: .92rem; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav-link.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--accent); }
.sidebar a.nav-link.disabled { opacity: .45; pointer-events: none; }
.sidebar .soon { margin-left: auto; font-size: .6rem; background: rgba(255,255,255,.12); padding: .1rem .35rem; border-radius: 4px; }
.main { flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.content { padding: 1.25rem; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); z-index: 1040; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .content { padding: 1rem; }
}

.card { border: 1px solid var(--line); border-radius: 12px; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; }
.stat { padding: 1rem 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.stat .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .82rem; margin-top: .35rem; }
.stat .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfa; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #e9eeec; }
.avatar-lg { width: 120px; height: 140px; border-radius: 10px; object-fit: cover; background: #e9eeec; border: 1px solid var(--line); }
.kv dt { color: var(--muted); font-weight: 500; font-size: .82rem; }
.kv dd { margin-bottom: .6rem; }

/* ---------- Public site ---------- */
.site-nav { background: #fff; border-bottom: 1px solid var(--line); }
.site-nav .navbar-brand img { height: 40px; width: 40px; object-fit: cover; border-radius: 8px; }
.hero { background: linear-gradient(120deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 4.5rem 0 4rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(242,165,65,.35), transparent 70%); }
.hero h1 { font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); }
.section { padding: 3.5rem 0; }
.pill { display: inline-block; background: rgba(255,255,255,.14); padding: .3rem .8rem; border-radius: 30px; font-size: .8rem; }
.feature-ico { width: 48px; height: 48px; border-radius: 12px; background: rgba(15,92,77,.1); color: var(--brand); display: grid; place-items: center; font-size: 1.3rem; }
.site-footer { background: #0b1f1b; color: #a9c2bc; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.site-footer a { color: #d6ebe5; }

/* ---------- Verification result ---------- */
.verify-box { max-width: 560px; }
.verify-status { border-radius: 12px; padding: 1rem 1.2rem; display: flex; gap: .9rem; align-items: center; font-weight: 600; }
.verify-status i { font-size: 2rem; }
.verify-status.ok { background: #e6f6ee; color: #146c43; }
.verify-status.warn { background: #fff4e0; color: #8a5300; }
.verify-status.bad { background: #fdecec; color: #b02a37; }

/* ---------- ID card (CR80 ratio 85.6 x 54 mm, portrait) ---------- */
.idcard-sheet { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.idcard { width: 324px; height: 514px; border-radius: 16px; background: #fff; overflow: hidden; position: relative; box-shadow: 0 8px 30px rgba(0,0,0,.12); font-family: "Inter", system-ui, sans-serif; color: #1d2430; }
.idcard .top { background: var(--brand); color: #fff; padding: 14px 14px 52px; text-align: center; position: relative; }
.idcard .top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px; background: #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.idcard .org { display: flex; gap: 8px; align-items: center; justify-content: center; }
.idcard .org img { width: 34px; height: 34px; border-radius: 6px; background: #fff; object-fit: contain; }
.idcard .org-name { font-weight: 800; font-size: 15px; line-height: 1.1; text-transform: uppercase; letter-spacing: .02em; }
.idcard .reg { font-size: 9.5px; opacity: .85; margin-top: 3px; }
.idcard .photo { width: 104px; height: 122px; object-fit: cover; border-radius: 10px; border: 4px solid #fff; position: absolute; left: 50%; transform: translateX(-50%); top: 74px; z-index: 2; background: #e9eeec; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.idcard .body { padding: 112px 16px 0; text-align: center; }
.idcard .name { font-weight: 800; font-size: 17px; line-height: 1.15; }
.idcard .desig { display: inline-block; background: var(--accent); color: #1d2430; font-weight: 700; font-size: 11px; padding: 3px 10px; border-radius: 20px; margin-top: 5px; text-transform: uppercase; letter-spacing: .04em; }
.idcard table { width: 100%; font-size: 11px; margin-top: 10px; text-align: left; }
.idcard table td { padding: 2px 0; vertical-align: top; }
.idcard table td:first-child { color: #6b7380; width: 78px; }
.idcard table td:last-child { font-weight: 600; }
.idcard .bottom { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 14px 12px; }
.idcard .qr { width: 78px; height: 78px; }
.idcard .qr img, .idcard .qr canvas { width: 78px !important; height: 78px !important; }
.idcard .sign { text-align: center; font-size: 9.5px; color: #6b7380; }
.idcard .sign img { height: 30px; max-width: 110px; object-fit: contain; display: block; margin: 0 auto 2px; }
.idcard .strip { position: absolute; bottom: 0; left: 0; right: 0; height: 6px; background: var(--accent); }
.idcard.back .top { padding-bottom: 14px; }
.idcard.back .top::after { display: none; }
.idcard.back .content-b { padding: 14px 16px; font-size: 11px; line-height: 1.5; }
.idcard.back h6 { font-size: 11.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 4px; }


/* ---------- CMS pages ---------- */
.cms h2 { font-weight: 800; margin: 0 0 1rem; }
.cms h3 { font-weight: 700; font-size: 1.25rem; margin: 2rem 0 .75rem; color: var(--brand); }
.cms h4 { font-weight: 700; font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.cms p, .cms li { line-height: 1.75; }

/* ---------- Charts (reports) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e8ecea; stroke-width: 1; }
.chart .base { stroke: #c9d1cd; stroke-width: 1; }
.chart .tick { fill: #6b7380; font-size: 11px; font-family: inherit; }
.chart .val { fill: #1d2430; font-size: 11px; font-weight: 600; font-family: inherit; }
.chart .bar { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .mark:hover .hit { fill: rgba(15, 92, 77, .06); }
.chart .mark:hover .bar { fill: var(--brand-dark); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 10px; align-items: center; font-size: .85rem; }
.hb-l { color: #1d2430; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hb-b { height: 14px; background: var(--brand); border-radius: 0 4px 4px 0; flex-shrink: 0; }
.hb:hover .hb-b { background: var(--brand-dark); }
.hb-v { color: #6b7380; font-size: .8rem; white-space: nowrap; }
.print-head { display: none; }
@media print {
  .print-head { display: block; margin-bottom: 12px; }
  .chart-card, .report-table, .card { break-inside: avoid; }
  .table-responsive { overflow: visible !important; }
}

@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  body, .content { background: #fff !important; padding: 0 !important; }
  .idcard { box-shadow: none; border: 1px solid #ccc; }
  @page { margin: 10mm; }
}
