/* =====================================================
   BUKU TAMU DIGITAL — Stylesheet
   Tema: Biru profesional / Putih / Abu-abu
   ===================================================== */
:root {
    --blue:      #1e5eff;
    --blue-dark: #1746c9;
    --blue-50:   #eef3ff;
    --teal:      #0fb3a5;
    --dark:      #1c2434;
    --slate:     #64748b;
    --line:      #e5e9f2;
    --bg:        #f4f6fb;
    --white:     #ffffff;
    --danger:    #e5484d;
    --warning:   #f5a524;
    --success:   #16a34a;
    --radius:    14px;
    --shadow:    0 6px 24px rgba(28, 36, 52, 0.08);
    --shadow-sm: 0 2px 8px rgba(28, 36, 52, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--blue); color: #fff; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 22px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; }
.brand-text strong { color: var(--blue); }
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(30,94,255,0.35);
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 1.3rem; margin: 0 auto 10px; }
.brand-logo { height: 44px; width: auto; display: block; border-radius: 8px; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { padding: 8px 14px; border-radius: 9px; color: var(--slate); font-weight: 600; font-size: 0.95rem; transition: color .2s, background-color .2s; }
.nav-links a:hover { color: var(--blue); background: var(--blue-50); }
.nav-links a.is-active { color: var(--blue); background: var(--blue-50); }
.nav-user { color: var(--slate); font-size: 0.9rem; padding: 0 6px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--dark); border-radius: 2px; transition: .3s; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 34px 22px 60px; }

.hero { text-align: center; padding: 26px 0 34px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.5px; }
.subtitle { color: var(--slate); font-size: 1.05rem; margin-top: 6px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.4px; }

/* ---------- Card ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 24px;
}
.card-head { margin-bottom: 20px; }
.card-head h2 { font-size: 1.3rem; font-weight: 700; }
.card-head p { color: var(--slate); font-size: 0.95rem; margin-top: 4px; }
.form-card { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- Form ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 0.95rem; }
.req { color: var(--danger); }
.hint { color: var(--slate); font-size: 0.82rem; margin-top: 5px; display: block; }

input, textarea, select {
    width: 100%;
    padding: 13px 15px;
    border: 1.6px solid var(--line);
    border-radius: 11px;
    font-size: 1rem;
    font-family: inherit;
    background: #fbfcfe;
    color: var(--dark);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30,94,255,0.12);
}
textarea { resize: vertical; }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.center-actions { text-align: center; margin: 18px 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 20px;
    border: 1.6px solid transparent;
    border-radius: 11px;
    font-family: inherit; font-weight: 600; font-size: 0.95rem;
    cursor: pointer;
    transition: transform .12s ease, background-color .2s, box-shadow .2s, border-color .2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 8px 15px; font-size: 0.88rem; }
.btn-xs { padding: 6px 11px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(30,94,255,0.3); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-50); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info    { background: var(--teal); color: #fff; }
.btn-wa      { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1da851; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-icon {
    flex: 0 0 26px; width: 26px; height: 26px;
    border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; color: #fff;
}
.alert-success { background: #e8f8ef; color: #14713a; border-color: #b6ebca; }
.alert-success .alert-icon { background: var(--success); }
.alert-error { background: #fdecec; color: #b42318; border-color: #f6c9c6; }
.alert-error .alert-icon { background: var(--danger); }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card {
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.stat-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.stat-label { font-size: 0.9rem; opacity: 0.9; font-weight: 500; }
.stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.stat-blue { background: linear-gradient(135deg, #1e5eff, #1746c9); }
.stat-teal { background: linear-gradient(135deg, #0fb3a5, #068a80); }
.stat-dark { background: linear-gradient(135deg, #2b3650, #1c2434); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .search-input { flex: 1 1 240px; }
.toolbar .select { flex: 0 0 auto; width: auto; min-width: 160px; }
.range-box { display: flex; align-items: center; gap: 8px; }
.range-box input { width: auto; }
.range-box span { color: var(--slate); }
.hidden { display: none; }

.export-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; background: var(--blue-50);
    border-radius: 12px; margin-bottom: 20px;
}
.export-label { font-weight: 600; color: var(--dark); margin-right: 4px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table thead th {
    background: var(--dark); color: #fff;
    text-align: left; padding: 14px 16px;
    font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--blue-50); }
.data-table .empty { text-align: center; color: var(--slate); padding: 34px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.locked { color: var(--slate); font-style: italic; font-size: 0.88rem; }

/* ---------- Detail ---------- */
.detail-card { max-width: 680px; }
.detail-list > div { display: grid; grid-template-columns: 220px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--slate); font-weight: 600; }
.detail-list dd { font-weight: 500; }
.detail-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 62vh; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 1.5rem; font-weight: 800; }
.auth-head p { color: var(--slate); margin-top: 4px; }
.back-link { display: block; text-align: center; margin-top: 18px; color: var(--slate); font-weight: 600; }
.back-link:hover { color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 26px; color: var(--slate); font-size: 0.88rem; border-top: 1px solid var(--line); background: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .stats-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute; top: 66px; left: 0; right: 0;
        background: #fff; flex-direction: column; align-items: stretch;
        gap: 4px; padding: 14px 22px;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links .btn { width: 100%; text-align: center; }
    .nav-user { text-align: center; padding: 6px 0; }
}

@media (max-width: 680px) {
    .detail-list > div { grid-template-columns: 1fr; gap: 3px; padding: 11px 0; }

    /* Tabel jadi kartu di HP */
    .data-table { min-width: 0; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tbody tr {
        margin-bottom: 14px; border: 1px solid var(--line);
        border-radius: 12px; overflow: hidden; background: #fff;
    }
    .data-table tbody td {
        display: flex; justify-content: space-between; align-items: center; gap: 14px;
        padding: 11px 15px; text-align: right;
    }
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 700; color: var(--slate);
        text-align: left; flex: 0 0 46%;
    }
    .actions { justify-content: flex-end; }
    .table-wrap { border: none; overflow: visible; }
}
