/* =========================================================
   Bulk QR Generator — Tema Hijau Tua Elegan
   Palette:
     --deep:   #0B2E23  (background utama)
     --forest: #114B36  (permukaan/panel)
     --moss:   #1F6F52  (aksen sedang)
     --sage:   #6FCF97  (aksen terang / hover)
     --gold:   #C9A24B  (aksen mewah, tombol utama)
     --cream:  #F6F4EC  (teks di atas gelap / kartu terang)
   Font: 'Fraunces' (display) + 'Inter' (body)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --deep:   #0B2E23;
    --forest: #114B36;
    --moss:   #1F6F52;
    --sage:   #6FCF97;
    --gold:   #C9A24B;
    --cream:  #F6F4EC;
    --ink:    #0A1F17;
    --radius: 14px;
    --shadow: 0 12px 30px rgba(6, 30, 22, 0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--cream);
    background:
        radial-gradient(circle at 15% -10%, rgba(111, 207, 151, 0.18), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(201, 162, 75, 0.12), transparent 40%),
        linear-gradient(160deg, var(--deep) 0%, #0E3B2C 45%, var(--ink) 100%);
    min-height: 100vh;
}

h1, h2, h3, .brand {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    letter-spacing: 0.2px;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout: Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(20, 61, 46, 0.55);
    border: 1px solid rgba(201, 162, 75, 0.25);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.auth-card .brand {
    font-size: 1.6rem;
    margin: 0 0 4px;
    background: linear-gradient(90deg, var(--sage), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-card p.subtitle {
    color: #C7DED2;
    margin: 0 0 24px;
    font-size: 0.92rem;
}

/* ---------- Form elements ---------- */
label {
    display: block;
    font-size: 0.82rem;
    color: #BFE0CD;
    margin: 14px 0 6px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea, select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(10, 31, 23, 0.55);
    color: var(--cream);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(111, 207, 151, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.93rem;
    font-family: 'Inter', sans-serif;
    transition: transform .12s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(120deg, var(--gold), #E4C878);
    color: var(--ink);
    width: 100%;
    margin-top: 22px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--cream);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid #E08585;
    color: #F3B8B8;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.form-error {
    background: rgba(224, 133, 133, 0.15);
    border: 1px solid rgba(224, 133, 133, 0.4);
    color: #F3B8B8;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.form-success {
    background: rgba(111, 207, 151, 0.15);
    border: 1px solid rgba(111, 207, 151, 0.4);
    color: var(--sage);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: rgba(9, 26, 20, 0.75);
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    font-size: 1.25rem;
    margin: 0 6px 30px;
    background: linear-gradient(90deg, var(--sage), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #CFE7DB;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(111,207,151,0.18), rgba(201,162,75,0.12));
    color: var(--sage);
}

.sidebar .user-box {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.82rem;
    color: #A9C9BA;
}

.main {
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head p { margin: 4px 0 0; color: #A9C9BA; font-size: 0.9rem; }

/* ---------- Cards / Grid ---------- */
.card {
    background: rgba(17, 75, 54, 0.4);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(31,111,82,0.45), rgba(11,46,35,0.6));
    border: 1px solid rgba(201,162,75,0.2);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-card .num { font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--gold); }
.stat-card .lbl { font-size: 0.8rem; color: #B9D8C6; margin-top: 2px; }

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.qr-item {
    background: var(--cream);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
}

.qr-item img { width: 100%; border-radius: 8px; margin-bottom: 10px; background:#fff; }

.qr-item .title { font-weight: 700; font-size: 0.95rem; margin: 0 0 2px; }
.qr-item .desc { font-size: 0.78rem; color: #52695D; margin: 0 0 10px; min-height: 16px; }

.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 600;
}
.badge-kosong { background: #FDE7C8; color: #8A5A0A; }
.badge-terisi { background: #D6F5E1; color: #157A46; }

.qr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td {
    text-align: left; padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
table.data-table th { color: #A9C9BA; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }

/* Public scan-result page */
.scan-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.scan-card {
    max-width: 460px;
    width: 100%;
    background: var(--cream);
    color: var(--ink);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.scan-card .cover { width: 100%; max-height: 260px; object-fit: cover; background: #DDEAE2; }
.scan-card .body { padding: 24px 26px 30px; }
.scan-card h1 { font-size: 1.4rem; margin: 0 0 8px; color: var(--forest); }
.scan-card p { color: #47594E; line-height: 1.55; }

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
    .sidebar .user-box { display: none; }
    .main { padding: 22px 18px; }
}