/* =========================
   RESET
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

/* =========================
   CSS VARIABLES
========================= */

:root {
    --bg:        #F4EDE4;
    --surface:   #FFFAF5;
    --dark:      #1E2D3A;
    --accent:    #D4622A;
    --muted:     #7A6E65;
    --border:    #E8DDD4;
    --shadow:    0 12px 30px rgba(30,45,58,.08);
    --radius:    18px;
    --radius-sm: 10px;
}

/* =========================
   BASE
========================= */

body{
    font-family:'Poppins',sans-serif;
    background-color: var(--bg);

    background-image:
        radial-gradient(circle at 20% 20%, rgba(212,98,42,.08) 0, transparent 300px),
        radial-gradient(circle at 80% 10%, rgba(30,45,58,.05) 0, transparent 250px),
        radial-gradient(circle at 50% 80%, rgba(212,98,42,.06) 0, transparent 350px);

    color: var(--dark);
    min-height:100vh;
}

h1, h2, h3,
.hero h1,
.sidebar h2 {
    font-family: 'Merriweather', serif;
}

/* =========================
   SIDEBAR
========================= */

#menu-toggle {
    display: none;
}

.menu-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 6px 18px rgba(212,98,42,.35);
    transition: background .2s, transform .15s;
    user-select: none;
}

.menu-btn:hover {
    background: #bf5522;
    transform: scale(1.05);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    background: var(--dark);
    transition: left .3s cubic-bezier(.4,0,.2,1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#menu-toggle:checked ~ .sidebar {
    left: 0;
}

.sidebar h2 {
    color: #F4EDE4;
    text-align: center;
    font-size: 26px;
    padding: 80px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: background .2s, color .2s, padding-left .2s;
}

.sidebar a:hover {
    background: rgba(212,98,42,.18);
    color: #fff;
    padding-left: 32px;
}

/* =========================
   CONTENT
========================= */

.content {
    padding: 20px 32px 48px;
    max-width: 960px;
    margin: 0 auto;
}

/* =========================
   HERO
========================= */

.hero {
    background:
        linear-gradient(
            135deg,
            #fffaf5,
            #fff4eb
        );

    padding: 52px 48px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(212,98,42,.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(212,98,42,.06);
    bottom: -120px;
    left: -120px;
    pointer-events: none;
}

.hero h1 {
    font-size: 38px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -.5px;
    color: var(--accent);
    margin-bottom: 18px;
}

.hero p,
.card p,
.card li {
    font-size: 15px;
    line-height: 1.85;
    color: var(--muted);
}

/* =========================
   BUTTON
========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    margin: 5px 4px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 3px 10px rgba(212,98,42,.25);
}

.btn:hover {
    background: #bf5522;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212,98,42,.32);
}

form > .btn {
    width: 100%;
    margin-top: 24px;
    padding: 15px;
    font-size: 15px;
}

/* =========================
   CARD
========================= */

.card {
    background: var(--surface);
    padding: 30px 32px;
    margin-top: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h2 {
    color: var(--accent);
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.card h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 10px;
}

/* =========================
   FORM
========================= */

.card label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dark);
}

.card input,
.card select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14.5px;
    color: var(--dark);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.card select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A6E65' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.card input:focus,
.card select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,98,42,.12);
}

.card input[readonly] {
    background: #F9F4EF;
    color: var(--muted);
    cursor: not-allowed;
}

/* =========================
   INFO BOX
========================= */

.info-box {
    background: #FFF1E8;
    border-left: 4px solid var(--accent);
    padding: 16px 18px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* =========================
   STATS GRID
========================= */

/* Base stats - dashboard (7 cards = 4 kolom) */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

/* Index page - 3 cards biasa = 3 kolom */
.stats-index {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--surface);
    padding: 22px 16px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--accent),
        #e98c5d
    );
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(30,45,58,.13);
}

.stat-card h3 {
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-family: 'Poppins', sans-serif;
}

.stat-card p {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.favorit-card {
    grid-column: 1 / -1;
}

/* =========================
   TABLE
========================= */

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
    font-size: 13.5px;
}

table th {
    background: var(--dark);
    color: rgba(255,255,255,.9);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    vertical-align: middle;
    background: var(--surface);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) td {
    background: #FDFAF7;
}

table tr:hover td {
    background: #FFF1E8;
}

table td .btn {
    padding: 7px 14px;
    font-size: 12px;
    margin: 2px;
}

/* =========================
   FOOTER
========================= */

.footer {
    text-align: center;
    margin-top: 48px;
    padding: 20px 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 2;
}

.footer .admin-link {
    color: var(--accent) !important;
    text-decoration: none !important;
    font-weight: 600;
}

.footer .admin-link:hover {
    text-decoration: underline !important;
}

.email-link {
    color: var(--accent);
    word-break: break-all;
    overflow-wrap: break-word;
    font-weight: 500;
}

/* =========================
   RESPONSIVE — Tablet
========================= */

@media (max-width: 900px) {
    .stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stats-index {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .favorit-card {
        grid-column: 1 / -1 !important;
    }
}

/* =========================
   RESPONSIVE — Mobile
========================= */

@media (max-width: 600px) {

    .content {
        padding: 60px 14px 40px;
    }

    .hero {
        padding: 28px 20px 32px;
    }

    .hero h1 {
        font-size: 22px;
        line-height: 1.35;
    }

    .hero p {
        font-size: 13.5px;
    }

    .card {
        padding: 20px 16px;
    }

    .card h2 {
        font-size: 20px;
    }

    /* STATISTIK 1 KOLOM */
    .stats,
    .stats-index {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .stat-card {
        width: 100%;
        padding: 18px;
    }

    .favorit-card {
        grid-column: auto !important;
    }

    .stat-card h3 {
        font-size: 12px;
    }

    .stat-card p {
        font-size: 26px;
    }
}

    /* Table scroll hint */
    .table-container {
        position: relative;
    }
    .table-container::before {
        content: '⟵ Geser untuk lihat selengkapnya ⟶';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 11.5px;
        color: var(--muted);
        background: #FFF5EE;
        border-bottom: 1px solid var(--border);
    }

    /* Sidebar */
    .sidebar {
        width: 240px;
    }
    .sidebar h2 {
        font-size: 22px;
        padding: 72px 20px 16px;
    }
    .sidebar a {
        font-size: 14px;
        padding: 13px 20px;
    }

    /* Buttons */
    .btn {
        padding: 11px 18px;
        font-size: 13.5px;
    }
    form > .btn {
        padding: 14px;
        font-size: 14.5px;
    }

    /* Footer */
    .footer {
        font-size: 12.5px;
        margin-top: 32px;
    }
}