/* =========================================================
   Aplikasi Tabungan Siswa 2026 – Main Stylesheet
   ========================================================= */

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --success:       #16a34a;
    --success-light: #f0fdf4;
    --danger:        #dc2626;
    --danger-light:  #fef2f2;
    --warning:       #d97706;
    --warning-light: #fffbeb;
    --sidebar-bg:    #1e293b;
    --sidebar-text:  #cbd5e1;
    --sidebar-active:#2563eb;
    --body-bg:       #f1f5f9;
    --card-bg:       #ffffff;
    --border:        #e2e8f0;
    --text:          #0f172a;
    --muted:         #64748b;
    --font:          -apple-system, "Segoe UI", system-ui, sans-serif;
    --radius:        8px;
    --sidebar-w:     240px;
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid #334155;
}
.sidebar-brand h1 {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}
.sidebar-brand small {
    font-size: 11px;
    color: #94a3b8;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    padding: 14px 18px 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: #334155; color: #f1f5f9; text-decoration: none; }
.sidebar-nav a.active {
    background: #1e3a6e;
    color: #93c5fd;
    border-left-color: var(--primary);
}
.sidebar-nav a .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid #334155;
    font-size: 12px;
    color: #64748b;
}

/* ── Topbar ── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 56px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    z-index: 99;
}
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-user { font-size: 13px; color: var(--muted); }
.topbar-user strong { color: var(--text); }

/* ── Main wrapper ── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    padding-top: 56px;
    min-height: 100vh;
}
.page-content { padding: 24px; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-header h2 { font-size: 18px; font-weight: 700; }
.page-header .breadcrumb { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 600; }

/* ── Stat cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.purple { background: #f3e8ff; }
.stat-value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #f8fafc; }
table .td-num { font-variant-numeric: tabular-nums; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: 13.5px; font-weight: 500;
    cursor: pointer; transition: opacity .15s, background .15s;
    line-height: 1;
    white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-secondary{ background: #e2e8f0; color: var(--text); }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-xs { padding: 3px 8px;  font-size: 12px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font); font-size: 13.5px;
    background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alert / Flash ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 8px;
}
.alert-success { background: var(--success-light); border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: var(--danger-light);  border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: var(--warning-light); border: 1px solid #fed7aa; color: #b45309; }
.alert-info    { background: var(--primary-light); border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 5px 10px; border-radius: 5px; font-size: 13px;
    border: 1px solid var(--border);
}
.pagination a { color: var(--primary); }
.pagination a:hover { background: var(--primary-light); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
}
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    width: 100%; max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: 13px; color: var(--muted); }
.login-logo .logo-icon {
    width: 60px; height: 60px; background: var(--primary); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff; margin: 0 auto 12px;
}

/* ── Search bar ── */
.search-bar { display: flex; gap: 8px; align-items: center; }
.search-bar .form-control { max-width: 280px; }

/* ── Receipt / Print ── */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0; padding-top: 0; }
    .page-content { padding: 0; }
    body { background: #fff; }
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary{ color: var(--primary); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.fw-600 { font-weight: 600; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.btn.w-100 { justify-content: center; padding-top: 11px; padding-bottom: 11px; }
