/* =============================================================
   SIM DKM Masjid Al-Mishbah Hunian 68 - Stylesheet
   ============================================================= */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --accent: #f59e0b;
    --bg: #f1f5f9;
    --panel: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --masuk: #10b981;
    --keluar: #ef4444;
    --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f766e 0%, #134e4a 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex; gap: 12px; align-items: center;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand-icon { font-size: 28px; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; opacity: .8; }
.sidebar-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }
.nav-section {
    margin: 14px 14px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .6;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: 16px;
    background: var(--panel);
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 20px; }
.topbar-sub { font-size: 12px; color: var(--muted); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-name { font-weight: 600; font-size: 14px; }
.btn-menu { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }

/* ---------- Cards ringkasan ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
    background: var(--panel);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex; gap: 14px; align-items: center;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
    border-top: 4px solid var(--primary);
}
.card-masuk { border-top-color: var(--masuk); }
.card-keluar { border-top-color: var(--keluar); }
.card-saldo { border-top-color: var(--primary); }
.card-tpq { border-top-color: var(--accent); }
.card-icon { font-size: 30px; }
.card-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Panel ---------- */
.panel {
    background: var(--panel);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.panel-header h2 { font-size: 17px; }
.panel-sub { font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; height: 300px; }
.chart-lg { height: 340px; }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; padding: 10px 12px;
    background: #f8fafc; border-bottom: 2px solid var(--border);
    font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
    white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: #f8fafc; }
.table-jadwal td:not(:first-child) { text-align: center; }
.row-today { background: #ecfdf5 !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-masuk { color: var(--masuk); font-weight: 600; }
.text-keluar { color: var(--keluar); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- Badge ---------- */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-superadmin { background: #ede9fe; color: #6d28d9; }
.badge-admin { background: #dbeafe; color: #1d4ed8; }
.badge-viewer { background: #f1f5f9; color: #475569; }
.badge-status { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #475569; }
.badge-rencana { background: #fef3c7; color: #b45309; }
.badge-berlangsung { background: #dbeafe; color: #1d4ed8; }
.badge-selesai { background: #d1fae5; color: #047857; }
.badge-batal { background: #fee2e2; color: #b91c1c; }

/* ---------- Button ---------- */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; color: var(--text);
    font-size: 14px; cursor: pointer; text-decoration: none;
    transition: all .15s;
}
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.93); }
.btn-danger { background: var(--keluar); border-color: var(--keluar); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
form.inline { display: inline; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea,
.filter-bar input, .filter-bar select {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    outline: 2px solid rgba(13,148,136,.3); border-color: var(--primary);
}
.span-2 { grid-column: span 2; }
.form-actions { grid-column: span 2; display: flex; gap: 10px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }

/* ---------- Alert ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ---------- List ---------- */
.list { list-style: none; }
.list-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* ---------- Jumat ---------- */
.jumat-box {
    margin-top: 16px; padding: 14px 16px;
    background: #ecfdf5; border-left: 4px solid var(--primary);
    border-radius: 8px; font-size: 14px; line-height: 1.7;
}
.jumat-hero {
    background: linear-gradient(135deg, #0d9488, #134e4a);
    color: #fff; border-radius: 16px; padding: 24px 26px; margin-bottom: 22px;
    box-shadow: 0 8px 20px rgba(13,148,136,.25);
}
.jumat-hero-label { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.jumat-hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.jumat-hero-grid span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; }
.jumat-hero-grid strong { font-size: 15px; }

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d9488 0%, #134e4a 100%);
    padding: 20px;
}
.login-card {
    background: #fff; border-radius: 18px; padding: 36px 34px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-icon { font-size: 46px; }
.login-brand h1 { font-size: 21px; margin-top: 6px; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.login-form input {
    padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px;
}
.login-form input:focus { outline: 2px solid rgba(13,148,136,.3); border-color: var(--primary); }
.login-hint {
    margin-top: 18px; padding: 12px; border-radius: 8px;
    background: #f8fafc; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center; padding: 16px; color: var(--muted);
    font-size: 13px; border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .jumat-hero-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .sidebar {
        position: fixed; left: calc(-1 * var(--sidebar-w)); z-index: 100;
        transition: left .25s;
    }
    .sidebar.open { left: 0; }
    .btn-menu { display: block; }
    .cards, .cards-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2, .form-actions { grid-column: span 1; }
    .topbar { flex-wrap: wrap; }
}
