/* ===== MT AT-TAQWA - Main Stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --primary: #1a5276;
    --primary-light: #2e86c1;
    --primary-dark: #0e3460;
    --secondary: #c0a060;
    --secondary-light: #d4af70;
    --accent: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #2980b9;
    --sidebar-width: 260px;
    --sidebar-bg: #0e2a45;
    --sidebar-text: #a8c5da;
    --sidebar-hover: #1a4a6e;
    --sidebar-active: #2e86c1;
    --topbar-height: 65px;
    --body-bg: #f0f4f8;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--body-bg);
    color: #2c3e50;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(192,160,96,0.4);
}

.brand-name {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.brand-sub {
    display: block;
    font-size: 10px;
    color: var(--sidebar-text);
    margin-top: 1px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 8px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.nav-label {
    padding: 12px 20px 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0 30px 30px 0;
    margin-right: 16px;
    transition: all 0.2s ease;
}

.nav-item a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-item a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    transform: translateX(4px);
}

.nav-item.active a {
    background: linear-gradient(90deg, var(--primary-light), #1a6fa8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46,134,193,0.35);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(231,76,60,0.15);
    color: #ff8a80;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: rgba(231,76,60,0.3);
    color: #fff;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e8edf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.sidebar-toggle:hover { background: var(--body-bg); }

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--body-bg);
    border-radius: 50px;
}

.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.user-name { font-size: 13px; font-weight: 700; color: var(--primary-dark); }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 28px;
    min-height: calc(100vh - var(--topbar-height));
}

/* ===== CARDS ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: none;
    overflow: hidden;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #edf2f7;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i { color: var(--primary-light); }

.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stat-card {
    border-radius: var(--radius);
    padding: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -30px; right: 20px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.stat-card.blue { background: linear-gradient(135deg, #1a5276, #2e86c1); }
.stat-card.green { background: linear-gradient(135deg, #1e8449, #27ae60); }
.stat-card.gold { background: linear-gradient(135deg, #9a7d0a, #d4ac0d); }
.stat-card.red { background: linear-gradient(135deg, #922b21, #e74c3c); }
.stat-card.teal { background: linear-gradient(135deg, #148f77, #17a589); }

.stat-icon {
    font-size: 28px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== TABLES ===== */
.table-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background: #fff;
}

.table { margin: 0; font-size: 13.5px; }
.table thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border: none;
    padding: 13px 16px;
    white-space: nowrap;
}

.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #f8faff; }
.table tbody td { padding: 12px 16px; border-color: #f0f4f8; vertical-align: middle; }
.table-striped tbody tr:nth-of-type(even) { background: #fafbff; }

/* ===== BADGES ===== */
.badge-aktif { background: #d5f5e3; color: #1e8449; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-nonaktif { background: #fadbd8; color: #922b21; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* ===== BUTTONS ===== */
.btn { border-radius: 8px; font-weight: 600; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--accent); border-color: var(--accent); }
.btn-icon { padding: 5px 10px; font-size: 12px; }

.btn-export-pdf { background: #e74c3c; color: #fff; border: none; }
.btn-export-pdf:hover { background: #c0392b; color: #fff; }
.btn-export-excel { background: #27ae60; color: #fff; border: none; }
.btn-export-excel:hover { background: #1e8449; color: #fff; }

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 13.5px;
    padding: 9px 14px;
    transition: border-color 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
}

/* ===== ALERTS ===== */
.alert { border-radius: var(--radius); border: none; font-weight: 600; font-size: 14px; }

/* ===== MODAL ===== */
.modal-content { border-radius: var(--radius); border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { background: var(--primary); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.modal-header .btn-close { filter: invert(1); }
.modal-title { font-weight: 700; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0e2a45 0%, #1a5276 50%, #2e86c1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: bgMove 30s linear infinite;
}

@keyframes bgMove { to { transform: translate(50%, 50%); } }

.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

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

.login-logo {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: white;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(192,160,96,0.45);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar { left: 0; }
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    position: relative;
    height: 260px;
}

/* ===== SALDO BADGE ===== */
.saldo-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.saldo-label { font-size: 12px; opacity: 0.8; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.saldo-value { font-size: 26px; font-weight: 800; }
