@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #fbf7ef;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --text: #122338;
    --muted: #5f6d7c;
    --border: rgba(20, 35, 56, 0.12);
    --primary: #d59c1f;
    --primary-dark: #b57d06;
    --navy: #102038;
    --navy-soft: #1f3b63;
    --success: #1d8f54;
    --danger: #b33535;
    --warning: #d67b1f;
    --info: #2d5fbd;
    --radius: 22px;
    --shadow: 0 18px 50px rgba(16, 32, 56, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(213, 156, 31, 0.20), transparent 28%),
        radial-gradient(circle at bottom left, rgba(31, 59, 99, 0.10), transparent 32%),
        var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.container { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.page-shell { min-height: calc(100vh - 110px); }
.page-stack { padding-top: 1rem; }
.section { padding: 4rem 0; }
.section-tight { padding: 2rem 0 4rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: grid; gap: 1rem; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 25;
    backdrop-filter: blur(16px);
    background: rgba(251, 247, 239, 0.78);
    border-bottom: 1px solid rgba(16, 32, 56, 0.08);
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand img {
    width: 54px;
    height: 54px;
    padding: 0.35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(213, 156, 31, 0.2), rgba(255,255,255,0.95));
    box-shadow: var(--shadow);
}
.brand strong {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
}
.brand span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    background: white;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}
.top-nav > a { font-weight: 500; color: var(--muted); }
.top-nav > a.active,
.top-nav > a:hover { color: var(--text); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #edbf57);
    color: #fff;
    box-shadow: 0 14px 30px rgba(213, 156, 31, 0.25);
}
.btn-outline {
    border-color: var(--border);
    background: rgba(255,255,255,0.72);
    color: var(--navy);
}
.btn-danger {
    background: linear-gradient(135deg, #cc4d4d, #a82a2a);
    color: #fff;
}
.btn-ghost { background: transparent; color: var(--navy); }

.hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}
.hero-banner {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    padding: 2rem;
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(16, 32, 56, 0.98), rgba(31, 59, 99, 0.92)),
        url('../images/hero-bg.png') center/cover no-repeat;
    color: white;
    box-shadow: var(--shadow);
}
.hero-copy h1, .page-head h1, .dashboard-topbar h1, .card-title, .section-title {
    margin: 0 0 0.75rem;
    font-family: 'Cinzel', serif;
    line-height: 1.15;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.hero-copy p { color: rgba(255,255,255,0.78); max-width: 55ch; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    position: relative;
}
.hero-visual::before {
    content: '';
    position: absolute;
    inset: 12% 16%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213,156,31,0.35), transparent 64%);
    filter: blur(14px);
}
.hero-visual img { max-height: 420px; position: relative; z-index: 1; }

.card,
.stat-card,
.table-card,
.feature-card,
.info-card,
.dashboard-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(18px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.feature-card, .info-card, .dashboard-card, .table-card { padding: 1.4rem; }
.feature-card h3, .info-card h3, .dashboard-card h3 { margin-top: 0; }
.feature-icon, .stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba(213,156,31,0.14);
    color: var(--primary-dark);
    font-size: 1.4rem;
    font-weight: 700;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.section-head p, .page-head p, .dashboard-topbar p { margin: 0; color: var(--muted); }

.news-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 1rem;
}

.page-head {
    padding: 3rem 0 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.form-group { display: grid; gap: 0.45rem; }
.form-group label {
    font-size: 0.95rem;
    font-weight: 700;
}
.input, .select, .textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    color: var(--text);
}
.textarea { min-height: 120px; resize: vertical; }

.auth-card, .panel-card, .table-card, .info-card { padding: 1.6rem; }
.auth-card { max-width: 640px; margin: 0 auto 4rem; }

.alert {
    margin: 0 auto 1rem;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    border: 1px solid transparent;
}
.alert-success { background: rgba(29,143,84,0.12); border-color: rgba(29,143,84,0.2); color: #165b37; }
.alert-warning { background: rgba(214,123,31,0.12); border-color: rgba(214,123,31,0.2); color: #88501a; }
.alert-danger { background: rgba(179,53,53,0.12); border-color: rgba(179,53,53,0.2); color: #7a2525; }
.alert-info { background: rgba(45,95,189,0.12); border-color: rgba(45,95,189,0.2); color: #21468d; }

.dashboard-body {
    background:
        linear-gradient(160deg, rgba(16, 32, 56, 0.06), transparent 35%),
        var(--bg);
}
.admin-theme {
    background:
        linear-gradient(160deg, rgba(16, 32, 56, 0.10), transparent 35%),
        #f7f7fb;
}
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}
.dashboard-sidebar {
    background: linear-gradient(180deg, var(--navy), #172f52);
    color: white;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.dashboard-sidebar.admin {
    background: linear-gradient(180deg, #0d1322, #233958);
}
.sidebar-brand {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 1rem;
}
.sidebar-brand img {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    padding: 0.45rem;
    background: rgba(255,255,255,0.12);
}
.sidebar-brand strong { display: block; }
.sidebar-brand span { color: rgba(255,255,255,0.72); font-size: 0.9rem; }

.dashboard-nav { display: grid; gap: 0.55rem; }
.dashboard-nav a {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(255,255,255,0.82);
}
.dashboard-nav a.active,
.dashboard-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.dashboard-main { padding: 1.5rem; }
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    padding-bottom: 1rem;
}

.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-card { padding: 1.25rem; }
.stat-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.stat-label { margin: 0.3rem 0 0; color: var(--muted); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.badge-success { color: #165b37; background: rgba(29,143,84,0.14); }
.badge-danger { color: #7a2525; background: rgba(179,53,53,0.14); }
.badge-warning { color: #88501a; background: rgba(214,123,31,0.14); }
.badge-info { color: #21468d; background: rgba(45,95,189,0.14); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid rgba(16, 32, 56, 0.08);
    text-align: left;
    vertical-align: top;
}
th {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.split-card {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.2fr 0.8fr;
}

.id-card {
    max-width: 720px;
    border-radius: 28px;
    overflow: hidden;
    color: white;
    background:
        linear-gradient(135deg, rgba(16,32,56,0.96), rgba(31,59,99,0.96)),
        url('../images/card-bg.png') center/cover no-repeat;
}
.id-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.id-card-head img { width: 56px; height: 56px; }
.id-card-body {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: 160px 1fr;
    padding: 1.4rem;
}
.id-card-photo {
    width: 160px;
    height: 190px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.14);
}
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card-foot {
    padding: 1rem 1.4rem 1.35rem;
    background: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.12);
}
.id-number {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.22em;
}

.site-footer {
    margin-top: 4rem;
    padding: 1.4rem 0 2rem;
    border-top: 1px solid rgba(16,32,56,0.08);
}
.footer-grid {
    display: grid;
    gap: 0.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.qr-box {
    background: white;
    padding: 0.75rem;
    border-radius: 18px;
    width: 130px;
    height: 130px;
    display: grid;
    place-items: center;
}

.kpi-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.kpi-pill {
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.7rem 1rem;
}

@media (max-width: 960px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar {
        position: static;
        height: auto;
    }
    .split-card, .id-card-body { grid-template-columns: 1fr; }
    .id-card-photo { width: 100%; max-width: 240px; }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .top-nav {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 1rem;
        left: 1rem;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 20px;
        background: rgba(255,255,255,0.98);
        box-shadow: var(--shadow);
    }
    .top-nav.open { display: flex; }
    .hero-banner, .dashboard-topbar { padding: 1.4rem; }
    .dashboard-main { padding: 1rem; }
    .id-number { letter-spacing: 0.08em; font-size: 1.35rem; }
}

