/* ==========================================================================
   Bimbingan Tahfiz - SMP Islam PB Soedirman 1 Bekasi
   Mobile-first responsive stylesheet
   ========================================================================== */

:root {
    --hijau-tua: #0f5132;
    --hijau: #157347;
    --hijau-muda: #1e8a5c;
    --emas: #c69214;
    --emas-muda: #e8b93f;
    --bg: #f4f6f5;
    --kartu: #ffffff;
    --teks: #1f2a24;
    --teks-lembut: #5c6b63;
    --garis: #e1e6e3;
    --merah: #b3261e;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(15, 81, 50, 0.12), 0 1px 2px rgba(15, 81, 50, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--teks);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--hijau); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
    flex: 1;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 12% 15%, rgba(255,255,255,0.10) 0, transparent 38%),
        radial-gradient(circle at 88% 85%, rgba(232,185,63,0.18) 0, transparent 42%),
        linear-gradient(135deg, var(--hijau-tua) 0%, var(--hijau) 60%, var(--hijau-muda) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--kartu);
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(6, 36, 22, 0.35), 0 2px 8px rgba(0,0,0,0.12);
    padding: 32px 26px 28px;
    position: relative;
    overflow: hidden;
    animation: authCardIn 0.35s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--emas), var(--hijau-muda), var(--emas-muda));
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 6px auto 14px;
    padding: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(15,81,50,0.22), 0 0 0 4px #eef7f1;
    box-sizing: border-box;
}

.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--hijau-tua);
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--teks-lembut);
    font-size: 0.88rem;
    margin-bottom: 24px;
}

/* ---------- Topbar ---------- */

.topbar {
    background: linear-gradient(90deg, var(--hijau-tua), var(--hijau));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: var(--shadow);
}

.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.user-name {
    display: none;
}

@media (min-width: 560px) {
    .user-name { display: inline; opacity: 0.9; }
}

.btn-logout {
    background: rgba(255,255,255,0.16);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.28);
    text-decoration: none;
}

/* ---------- Cards / Menu ---------- */

.page-title {
    font-size: 1.25rem;
    color: var(--hijau-tua);
    margin: 4px 0 18px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.menu-card {
    background: var(--kartu);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 16px;
    text-align: center;
    color: var(--teks);
    display: block;
    transition: transform .12s ease, box-shadow .12s ease;
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15,81,50,0.18);
    text-decoration: none;
}

.menu-card .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.menu-card .label {
    font-weight: 600;
    color: var(--hijau-tua);
}

.card {
    background: var(--kartu);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--hijau-tua);
}

.info-pendamping {
    background: #eef7f1;
    border: 1px solid #cfe9da;
    color: var(--hijau-tua);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 14px;
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--teks);
    margin-bottom: 6px;
}

input[type=text],
input[type=password],
input[type=tel],
input[type=number],
input[type=date],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--garis);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--teks);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--hijau-muda);
    box-shadow: 0 0 0 3px rgba(30,138,92,0.15);
}

textarea { resize: vertical; min-height: 70px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.combobox {
    position: relative;
}

.combobox-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--garis);
    border-radius: 8px;
    max-height: 230px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    z-index: 30;
}

.combobox-list.show {
    display: block;
}

.combobox-item {
    padding: 9px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.combobox-item:hover,
.combobox-item.active {
    background: #eef7f1;
}

.combobox-empty {
    padding: 9px 12px;
    font-size: 0.85rem;
    color: var(--teks-lembut);
}

.help-text {
    font-size: 0.78rem;
    color: var(--teks-lembut);
    margin-top: 4px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hijau-muda) 0%, var(--hijau) 55%, var(--hijau-tua) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(21,115,71,0.32);
}
.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(21,115,71,0.42);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-emas {
    background: var(--emas);
    color: #fff;
}
.btn-emas:hover { background: #a87b10; text-decoration: none; }

.btn-outline {
    background: transparent;
    color: var(--hijau);
    border: 1px solid var(--hijau);
}
.btn-outline:hover { background: #eef7f1; text-decoration: none; }

.btn-danger {
    background: #fff;
    color: var(--merah);
    border: 1px solid var(--merah);
}
.btn-danger:hover { background: #fdecea; text-decoration: none; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Table ---------- */

.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--garis);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 640px;
}

thead th {
    background: #eef7f1;
    color: var(--hijau-tua);
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--garis);
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--garis);
    vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcfb; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    background: #eef7f1;
    color: var(--hijau-tua);
}

.empty-state {
    text-align: center;
    padding: 30px 14px;
    color: var(--teks-lembut);
}

/* ---------- Alerts ---------- */

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.88rem;
}

.alert-sukses {
    background: #e6f4ea;
    color: #14602f;
    border: 1px solid #b7e0c4;
}

.alert-error {
    background: #fdecea;
    color: #922019;
    border: 1px solid #f5c2be;
}

/* ---------- Misc ---------- */

.breadcrumb {
    font-size: 0.82rem;
    color: var(--teks-lembut);
    margin-bottom: 10px;
}
.breadcrumb a { color: var(--hijau); }

.app-footer {
    text-align: center;
    padding: 18px;
    font-size: 0.78rem;
    color: var(--teks-lembut);
}

.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.link-plain { color: var(--hijau); font-weight: 600; }
