:root {
    --navy-950: #04122f;
    --navy-900: #071c47;
    --navy-800: #0b2d61;
    --blue-700: #14548a;
    --blue-600: #1c6ea4;
    --gray-950: #1e2630;
    --gray-700: #596472;
    --gray-500: #8b95a1;
    --gray-300: #d7dde4;
    --gray-200: #e8ecf0;
    --gray-100: #f4f6f8;
    --white: #fff;
    --green: #16824b;
    --green-soft: #e7f6ed;
    --red: #c93636;
    --red-soft: #fdeaea;
    --amber: #a76500;
    --amber-soft: #fff3d9;
    --info: #176a9e;
    --info-soft: #e5f3fb;
    --shadow: 0 16px 42px rgba(5, 22, 55, .10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--gray-950);
    background: var(--gray-100);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--navy-900); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.page-section { padding: 42px 0 64px; flex: 1; }
.muted { color: var(--gray-700); }
.text-small { font-size: .9rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--white);
    background: linear-gradient(120deg, var(--navy-950), var(--navy-800));
    box-shadow: 0 8px 24px rgba(4, 18, 47, .18);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand:hover { color: var(--white); }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; letter-spacing: .04em; }
.brand strong { font-size: 1rem; }
.brand small { color: #9fc7e4; font-size: .72rem; letter-spacing: .18em; }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav > a { color: rgba(255,255,255,.84); font-size: .94rem; }
.main-nav > a:hover { color: var(--white); }
.nav-user { display: flex; flex-direction: column; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.22); font-size: .88rem; }
.nav-user small { color: #a9c8df; font-size: .72rem; }
.nav-toggle { display: none; color: white; border: 0; background: transparent; font-size: 1.5rem; }

.site-footer { margin-top: auto; color: #dbe8f1; background: var(--navy-950); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0; font-size: .9rem; }
.footer-inner span { color: #9db3c7; }

.hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0 88px;
    color: var(--white);
    background:
        radial-gradient(circle at 80% 16%, rgba(39, 126, 183, .35), transparent 34%),
        linear-gradient(130deg, var(--navy-950), var(--navy-800));
}
.hero::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -160px;
    bottom: -250px;
    border: 42px solid rgba(255,255,255,.05);
    border-radius: 50%;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px; }
.hero h1 { margin: 0 0 18px; max-width: 760px; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.06; letter-spacing: -.04em; }
.hero h1 span { color: #71b5df; }
.hero p { max-width: 720px; margin: 0 0 30px; color: #c7d8e7; font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-logo { display: grid; place-items: center; }
.hero-logo img { width: min(100%, 430px); filter: drop-shadow(0 22px 35px rgba(0,0,0,.30)); }

.feature-section { margin-top: -34px; position: relative; z-index: 2; padding-bottom: 70px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.menu-card { display: flex; flex-direction: column; min-height: 260px; padding: 34px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.menu-card:hover { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(5,22,55,.15); }
.menu-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 16px; color: var(--white); background: linear-gradient(135deg, var(--navy-800), var(--blue-600)); font-size: 1.7rem; }
.menu-card h2 { margin: 0 0 10px; font-size: 1.4rem; }
.menu-card p { margin: 0 0 24px; color: var(--gray-700); }
.menu-card .btn { margin-top: auto; align-self: flex-start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; line-height: 1; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white !important; background: var(--blue-700); border-color: var(--blue-700); }
.btn-primary:hover { background: var(--navy-800); }
.btn-secondary { color: white !important; background: var(--gray-700); border-color: var(--gray-700); }
.btn-success { color: white !important; background: var(--green); border-color: var(--green); }
.btn-danger { color: white !important; background: var(--red); border-color: var(--red); }
.btn-outline { color: inherit !important; background: transparent; border-color: currentColor; }
.site-header .btn-outline { color: white !important; border-color: rgba(255,255,255,.5); }
.btn-light { color: var(--navy-900) !important; background: white; border-color: white; }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: .86rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--navy-950); }
.page-heading p { margin: 0; color: var(--gray-700); }

.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(5,22,55,.07); }
.card-header { padding: 22px 24px; border-bottom: 1px solid var(--gray-200); }
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: 24px; }
.card-footer { padding: 18px 24px; border-top: 1px solid var(--gray-200); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }

.stat-card { padding: 22px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 2rem; line-height: 1; color: var(--navy-900); }
.stat-card span { color: var(--gray-700); font-size: .92rem; }
.stat-card small { display: block; margin-top: 8px; color: var(--gray-500); }

.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 7px; font-weight: 700; color: var(--gray-950); }
.form-control { width: 100%; min-height: 46px; padding: 10px 13px; color: var(--gray-950); background: var(--white); border: 1px solid #cbd3dc; border-radius: 10px; outline: none; }
.form-control:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(28,110,164,.13); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-help { display: block; margin-top: 6px; color: var(--gray-700); font-size: .84rem; }
.form-error { display: block; margin-top: 6px; color: var(--red); font-size: .84rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.input-group { display: flex; gap: 10px; }
.input-group .form-control { flex: 1; }

.alert { padding: 14px 17px; border: 1px solid transparent; border-radius: 11px; }
.alert-success { color: #0e6338; background: var(--green-soft); border-color: #bde7ce; }
.alert-danger { color: #8e2020; background: var(--red-soft); border-color: #f3c3c3; }
.alert-warning { color: #7c4b00; background: var(--amber-soft); border-color: #f0d396; }
.alert-info { color: #125579; background: var(--info-soft); border-color: #b7dff2; }
.flash-wrap { padding-top: 16px; }

.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge-success { color: #0f6a3b; background: var(--green-soft); }
.badge-danger { color: #9d2727; background: var(--red-soft); }
.badge-warning { color: #855100; background: var(--amber-soft); }
.badge-info { color: #125f8c; background: var(--info-soft); }
.badge-muted { color: var(--gray-700); background: var(--gray-200); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--gray-200); text-align: left; vertical-align: top; }
th { color: var(--gray-700); background: #f8fafb; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #fbfcfd; }
td .title { display: block; color: var(--navy-900); font-weight: 750; }
td .subtitle { color: var(--gray-700); font-size: .84rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state .symbol { font-size: 2.4rem; }
.empty-state h3 { margin: 12px 0 6px; }
.empty-state p { color: var(--gray-700); }

.auth-page { background: linear-gradient(140deg, var(--navy-950), var(--navy-800)); }
.auth-shell { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 42px 0; }
.auth-card { width: min(470px, 100%); }
.auth-card .card-body { padding: 34px; }
.auth-logo { display: block; width: 160px; margin: 0 auto 10px; }
.auth-card h1 { margin: 0 0 6px; text-align: center; color: var(--navy-950); }
.auth-card .intro { margin: 0 0 28px; text-align: center; color: var(--gray-700); }

.verify-shell { max-width: 820px; margin: 0 auto; }
.tabs { display: flex; gap: 8px; padding: 8px; background: var(--gray-200); border-radius: 13px; }
.tab-button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; color: var(--gray-700); background: transparent; font-weight: 800; }
.tab-button.active { color: var(--navy-900); background: white; box-shadow: 0 4px 12px rgba(5,22,55,.08); }
.tab-panel { padding-top: 24px; }
.verify-result { padding: 38px 24px; text-align: center; }
.verify-symbol { width: 112px; height: 112px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: white; font-size: 4.2rem; font-weight: 900; line-height: 1; }
.verify-symbol.valid { background: var(--green); box-shadow: 0 14px 34px rgba(22,130,75,.28); }
.verify-symbol.invalid { background: var(--red); box-shadow: 0 14px 34px rgba(201,54,54,.24); }
.verify-result h2 { margin: 0 0 8px; font-size: 1.8rem; }
.document-facts { max-width: 620px; margin: 26px auto 0; text-align: left; border: 1px solid var(--gray-200); border-radius: 13px; overflow: hidden; }
.fact-row { display: grid; grid-template-columns: 210px 1fr; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--gray-200); }
.fact-row:last-child { border-bottom: 0; }
.fact-row strong { color: var(--gray-700); }
.scanner-box { overflow: hidden; background: #020817; border-radius: 14px; aspect-ratio: 16/10; display: grid; place-items: center; }
.scanner-box video { width: 100%; height: 100%; object-fit: cover; }
.scanner-placeholder { padding: 24px; color: #b9c7d5; text-align: center; }
.scanner-status { margin-top: 12px; }

.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--gray-200); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--gray-700); font-weight: 700; }
.detail-row dd { margin: 0; word-break: break-word; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 22px 28px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-600); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; }
.timeline span { color: var(--gray-700); font-size: .86rem; }

.qr-panel { text-align: center; }
.qr-canvas-wrap { width: min(100%, 460px); margin: 0 auto 22px; padding: 16px; background: white; border: 1px solid var(--gray-200); border-radius: 16px; box-shadow: var(--shadow); }
.qr-canvas-wrap canvas { width: 100%; height: auto; display: block; }
.qr-url { padding: 12px; color: var(--gray-700); background: var(--gray-100); border-radius: 10px; font-size: .82rem; word-break: break-all; }

.filter-bar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-bottom: 20px; }
.account-card { padding: 20px; }
.account-card h3 { margin: 0 0 5px; }
.account-card .meta { color: var(--gray-700); font-size: .88rem; }
.account-card .actions { margin-top: 18px; }

@media (max-width: 900px) {
    .hero-grid, .layout-sidebar { grid-template-columns: 1fr; }
    .hero-logo { order: -1; }
    .hero-logo img { width: 230px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; padding: 18px 16px 24px; flex-direction: column; align-items: stretch; background: var(--navy-950); box-shadow: 0 16px 24px rgba(0,0,0,.18); }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-user { padding: 12px 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
}

@media (max-width: 680px) {
    .container { width: min(100% - 22px, 1160px); }
    .hero { padding: 52px 0 72px; }
    .menu-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .menu-card { min-height: 0; padding: 26px; }
    .page-heading { flex-direction: column; }
    .card-body, .card-header, .card-footer { padding-left: 18px; padding-right: 18px; }
    .filter-bar { grid-template-columns: 1fr; }
    .fact-row, .detail-row { grid-template-columns: 1fr; gap: 3px; }
    .input-group { flex-direction: column; }
    .footer-inner { flex-direction: column; }
}
