/* =========================================================
   Exam Registration System — styles
   Primary colour comes from Settings (--primary).
   ========================================================= */
:root {
  --primary: #0f766e;
  --primary-dark: color-mix(in srgb, var(--primary) 78%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, #fff);
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f4f6fa;
  --card: #fff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --sidebar-w: 250px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg);
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
.h2 { font-size: 1.5rem; }
p { margin: 0 0 .6em; }
code { background: #eef2f7; padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mb-0 { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none !important; transition: background .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: #fff; color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #f1f5f9; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Cards / alerts / badges ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.08rem; }
.card-head.center { flex-direction: column; justify-content: center; }
.card-body { padding: 22px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.alert-success { background: #ecfdf3; border-color: #a7f3c4; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #fff7e6; color: #b45309; }
.badge-approved { background: #e8f8ee; color: #15803d; }
.badge-rejected { background: #fdecec; color: #b91c1c; }
.badge-neutral { background: #eef2f7; color: #475569; }

/* ---------- Forms ---------- */
.grid { display: grid; gap: 16px; }
.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)); }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field label { font-weight: 600; font-size: 14px; }
.field label b { color: var(--danger); }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #cbd5e1; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s;
}
input[type=color] { width: 64px; height: 42px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { resize: vertical; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 0; }
.radio, .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500 !important; cursor: pointer; }
.radio input, .check input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-section { margin-bottom: 26px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px dashed var(--border); }
.section-title .step { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 14px; }
.applying-for { padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 700; border: 1px dashed var(--primary); }
.photo-upload { display: flex; gap: 14px; align-items: center; }
.photo-upload img { width: 90px; height: 108px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-upload > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.logo-preview { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 4px; }

/* payment */
.pay-info { background: var(--primary-soft); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.pay-info p:last-child { margin: 0; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pay-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 14px 44px;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; transition: border .15s, box-shadow .15s;
}
.pay-card input { position: absolute; left: 14px; top: 17px; width: 18px; height: 18px; accent-color: var(--primary); }
.pay-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.pay-name { font-weight: 800; font-size: 16px; }
.pay-bkash .pay-name { color: #e2136e; }
.pay-nagad .pay-name { color: #ec1c24; }
.pay-rocket .pay-name { color: #8c3494; }
.pay-cash .pay-name { color: var(--success); }
.pay-number { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.pay-type { font-size: 12px; color: var(--muted); }
.copy-btn { position: absolute; right: 10px; top: 10px; font-size: 11px; padding: 3px 8px; border: 1px solid var(--border); background: #f8fafc; border-radius: 6px; cursor: pointer; }
.trx-fields { margin-top: 16px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: #f8fafc; font-weight: 600; color: #475569; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.table tr:hover td { background: #fafbfd; }
.table .thumb { width: 38px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #f1f5f9; }
.table input, .table select { padding: 7px 9px; font-size: 14px; min-width: 80px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.info-table th { width: 40%; color: var(--muted); font-weight: 500; }
.info-table th.info-sub { width: auto; color: var(--primary); font-weight: 700; background: var(--primary-soft); text-transform: uppercase; font-size: 12.5px; letter-spacing: .04em; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* =========================================================
   PUBLIC SITE
   ========================================================= */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 9px 14px; border-radius: 8px; color: #334155; font-weight: 500; font-size: 14.5px; text-decoration: none; }
.main-nav a:hover { background: #f1f5f9; }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 9px; background: #fff; flex-direction: column; justify-content: center; align-items: center; gap: 4px; cursor: pointer; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.site-main { min-height: calc(100vh - 220px); padding-bottom: 40px; }

.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 56px 0 90px; }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; }
.hero p { opacity: .92; font-size: 1.05rem; }
.hero .btn { background: #fff; color: var(--primary); border-color: #fff; }
.hero .btn:hover { background: #f1f5f9; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-logo { justify-self: center; background: rgba(255,255,255,.12); border-radius: 24px; padding: 28px; text-align: center; }
.hero-logo img { width: 150px; height: 150px; object-fit: contain; background: #fff; border-radius: 18px; padding: 10px; }
.hero-logo .brand-mark { width: 150px; height: 150px; font-size: 64px; border-radius: 24px; background: rgba(255,255,255,.2); margin: 0 auto; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15); padding: 6px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.status-chip i { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; display: inline-block; }
.status-chip.closed i { background: #f87171; }

.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -54px; }
.quick-link { background: #fff; border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 6px; }
.quick-link:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,23,42,.1); }
.quick-link .ql-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 6px; }
.quick-link .ql-icon svg { width: 24px; height: 24px; fill: var(--primary); }
.quick-link strong { font-size: 16px; }
.quick-link span { color: var(--muted); font-size: 13.5px; }

.section { padding: 36px 0 0; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 16px 46px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: grid; place-items: center; }
.steps li strong { display: block; }
.notice-box { white-space: pre-line; }

.page-head { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 30px 0 64px; }
.page-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 4px; }
.page-head p { margin: 0; opacity: .9; }
.page-body { margin-top: -40px; }
.narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.narrow-sm { max-width: 520px; margin-left: auto; margin-right: auto; }

.success-box { text-align: center; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: #e8f8ee; color: var(--success); display: grid; place-items: center; margin: 0 auto 14px; }
.success-icon svg { width: 38px; height: 38px; fill: currentColor; }
.big-id { display: inline-block; font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--primary); background: var(--primary-soft); padding: 10px 26px; border-radius: 12px; margin: 8px 0 14px; border: 2px dashed var(--primary); }

.site-footer { background: #0f172a; color: #cbd5e1; padding: 30px 0 14px; font-size: 14px; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer strong { color: #fff; font-size: 16px; }
.copyright { border-top: 1px solid #1e293b; margin-top: 18px; padding-top: 14px; font-size: 13px; color: #94a3b8; }

/* ---------- Admit card & result sheet ---------- */
.doc-actions { display: flex; justify-content: center; gap: 10px; margin: 0 0 18px; flex-wrap: wrap; }
.doc { background: #fff; max-width: 820px; margin: 0 auto; border: 2px solid var(--primary); border-radius: 6px; padding: 26px; position: relative; overflow: hidden; }
.doc-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--primary); padding-bottom: 14px; text-align: center; }
.doc-head img, .doc-head .brand-mark { width: 74px; height: 74px; object-fit: contain; flex-shrink: 0; }
.doc-head .brand-mark { font-size: 32px; }
.doc-head .doc-title { flex: 1; }
.doc-head h2 { font-size: 1.45rem; margin: 0; color: var(--primary); }
.doc-head p { margin: 2px 0 0; font-size: 13.5px; color: #475569; }
.doc-head .spacer { width: 74px; flex-shrink: 0; }
.doc-label { text-align: center; margin: 16px 0; }
.doc-label span { display: inline-block; background: var(--primary); color: #fff; font-weight: 800; letter-spacing: 3px; padding: 7px 26px; border-radius: 6px; font-size: 17px; }
.doc-label small { display: block; margin-top: 6px; font-weight: 600; color: #334155; }
.doc-grid { display: grid; grid-template-columns: 1fr 140px; gap: 20px; align-items: start; }
.doc-photo { width: 140px; height: 165px; border: 1px solid #94a3b8; object-fit: cover; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: #f8fafc; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc table th, .doc table td { border: 1px solid #cbd5e1; padding: 8px 10px; text-align: left; }
.doc table th { width: 36%; background: #f8fafc; font-weight: 600; }
.doc-instructions { margin-top: 18px; font-size: 13.5px; }
.doc-instructions ol { margin: 6px 0 0; padding-left: 20px; }
.doc-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 48px; font-size: 13.5px; }
.doc-sign div { border-top: 1px solid #334155; padding-top: 6px; min-width: 180px; text-align: center; }
.doc-watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: .06; }
.doc-watermark img { width: 55%; }
.result-highlight { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 6px; }
.result-highlight div { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; background: #f8fafc; }
.result-highlight small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.result-highlight strong { font-size: 22px; color: var(--primary); }
.result-highlight .fail { color: var(--danger); }

/* =========================================================
   ADMIN
   ========================================================= */
body.admin { background: var(--bg); }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; z-index: 100; transition: transform .25s; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px; border-bottom: 1px solid #1e293b; }
.sidebar-brand img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.sidebar-brand .brand-mark { width: 42px; height: 42px; font-size: 18px; }
.sidebar-brand strong { color: #fff; display: block; font-size: 14px; line-height: 1.25; }
.sidebar-brand small { color: #94a3b8; font-size: 12px; }
.side-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #cbd5e1; font-weight: 500; font-size: 14.5px; text-decoration: none; }
.side-nav a svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; opacity: .85; }
.side-nav a:hover { background: #1e293b; color: #fff; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav .count { margin-left: auto; font-style: normal; background: #f59e0b; color: #111; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.sidebar-backdrop { display: none; }
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--border); height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.topbar-title { font-size: 1.15rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--border); background: #fff; border-radius: 9px; cursor: pointer; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; fill: var(--text); }
.topbar-user { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.admin-content { padding: 22px; flex: 1; }
.admin-footer { padding: 14px 22px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); background: #fff; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px; text-decoration: none !important; color: var(--text); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 26px; height: 26px; fill: currentColor; }
.stat small { color: var(--muted); font-size: 13px; display: block; }
.stat strong { font-size: 24px; font-weight: 800; line-height: 1.2; }
.c-primary { background: var(--primary-soft); color: var(--primary); }
.c-warning { background: #fff7e6; color: var(--warning); }
.c-success { background: #e8f8ee; color: var(--success); }
.c-danger { background: #fdecec; color: var(--danger); }
.c-info { background: #eaf1ff; color: var(--info); }
.c-purple { background: #f3ecff; color: #7c3aed; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-grid.wide-left { grid-template-columns: 2fr 1fr; }
.filters.f2 { grid-template-columns: 1fr auto; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .bar { height: 10px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar-row b { text-align: right; }
.toggle-list { display: flex; flex-direction: column; gap: 12px; }
.toggle-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.toggle-item strong { display: block; font-size: 14.5px; }
.toggle-item small { color: var(--muted); }
.switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(22px); }

.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 10px; align-items: end; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 22px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.pagination { display: flex; gap: 6px; justify-content: center; padding: 18px; flex-wrap: wrap; }
.pagination a { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff; text-decoration: none; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.view-grid { display: grid; grid-template-columns: 240px 1fr; gap: 22px; }
.view-photo { width: 100%; max-width: 220px; aspect-ratio: 5/6; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: #f1f5f9; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .logo { width: 76px; height: 76px; object-fit: contain; margin: 0 auto 10px; display: block; background: #fff; border-radius: 16px; padding: 6px; }
.auth-card .brand-mark { margin: 0 auto 10px; width: 64px; height: 64px; font-size: 28px; }
.install-wrap { width: 100%; max-width: 760px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters .f-search { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90; }
  .admin-main { margin-left: 0; }
  .icon-btn { display: grid; }
  .dash-grid, .dash-grid.wide-left, .view-grid { grid-template-columns: 1fr; }
  .view-photo { max-width: 180px; }
  .nav-toggle { display: flex; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 10px 16px 16px; border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0,0,0,.06); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero .btn-row { justify-content: center; }
  .hero-logo { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .admin-content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .hide-sm { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters.f2 { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 80px; }
  .quick-links { gap: 12px; }
  .quick-link { padding: 16px 14px; }
  .doc { padding: 14px; }
  .doc-head img, .doc-head .brand-mark { width: 54px; height: 54px; }
  .doc-head .spacer { display: none; }
  .doc-head h2 { font-size: 1.1rem; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-photo { order: -1; margin: 0 auto; width: 120px; height: 140px; }
  .doc table { font-size: 13.5px; }
  .result-highlight { grid-template-columns: repeat(2, 1fr); }
  .doc-sign { gap: 14px; }
  .doc-sign div { min-width: 0; flex: 1; font-size: 12.5px; }
  .big-id { font-size: 24px; padding: 8px 16px; }
  .bar-row { grid-template-columns: 90px 1fr 40px; }

  /* tables become cards */
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 12px; padding: 6px 4px; background: #fff; }
  .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 7px 10px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12.5px; text-align: left; flex-shrink: 0; }
  .table.responsive td.td-full { display: block; text-align: left; }
  .table.responsive td.td-full::before { display: block; margin-bottom: 4px; }
  .table.responsive tr:hover td { background: transparent; }
  .table-wrap.cards { padding: 12px; }
}
@media (max-width: 420px) {
  .quick-links { grid-template-columns: 1fr; }
  .brand img { width: 40px; height: 40px; }
  .brand-text strong { font-size: 14.5px; }
  .filters { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; font-size: 13px; }
  .no-print, .site-header, .site-footer, .doc-actions, .page-head { display: none !important; }
  .site-main, .page-body { margin: 0 !important; padding: 0 !important; min-height: 0; }
  .container { max-width: none; padding: 0; }
  .doc { border-width: 2px; max-width: none; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-grid { grid-template-columns: 1fr 140px !important; }
  .doc-photo { order: 0 !important; }
  .doc-head .spacer { display: block !important; }
  .result-highlight { grid-template-columns: repeat(4, 1fr) !important; }
  .card { box-shadow: none; border: 0; }
  .admin-main { margin: 0; }
  .sidebar, .topbar { display: none !important; }
}
