/* ============================================================
   Audit Dashboard - Gaya Sistem
   Bootstrap 5 + penyesuaian tema
   ============================================================ */

:root {
    --sidebar-w: 260px;
    --brand: #1f3a93;
    --brand-dark: #16285f;
    --accent: #f1c40f;
    --bg-soft: #f4f6fb;
    --border: #e3e8f0;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-soft);
    color: #2c3e50;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ---------- Layout ---------- */
.app-shell { min-height: 100vh; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content { padding: 1.5rem 1.5rem 1rem; flex: 1; }

.app-footer {
    padding: .75rem 1.5rem;
    font-size: .8rem;
    color: #7f8c9b;
    border-top: 1px solid var(--border);
    background: #fff;
    text-align: center;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--brand-dark), var(--brand));
    color: #dfe6f5;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand-logo {
    width: 132px; height: 40px;
    border-radius: 10px;
    background: #fff;
    display: grid; place-items: center;
    padding: 5px 10px;
    overflow: hidden;
}
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-title { font-weight: 700; color: #fff; line-height: 1.15; }
.brand-sub { font-size: .72rem; opacity: .7; }

.sidebar-nav { padding: .75rem .75rem 0; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .7rem;
    color: #c9d4ec;
    padding: .65rem .9rem;
    border-radius: .55rem;
    margin-bottom: .2rem;
    text-decoration: none;
    font-size: .92rem;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.16);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-section {
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .12em;
    color: rgba(255,255,255,.45);
    padding: .9rem .9rem .3rem;
}
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent); color: var(--brand-dark);
    display: grid; place-items: center; font-weight: 700;
    flex-shrink: 0;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .8rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-date { font-size: .75rem; color: #7f8c9b; }

/* ---------- Kad statistik ---------- */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .9rem;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(20,40,80,.05);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(20,40,80,.10);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .82rem; color: #6b7a90; }

/* ---------- Kad umum ---------- */
.card { border: 1px solid var(--border); border-radius: .9rem; box-shadow: 0 1px 3px rgba(20,40,80,.04); }
.card-header { background: #fff; font-weight: 700; border-bottom: 1px solid var(--border); }
.card-header.bg-soft { background: #f8fafd; }

/* ---------- Jadual ---------- */
.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .06em;
    color: #5c6b84;
    background: #f8fafd;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { vertical-align: middle; }

/* ---------- Lain-lain ---------- */
.btn-rounded { border-radius: 50px; }

.issue-title { font-weight: 600; color: var(--brand); }
.issue-title:hover { text-decoration: underline; }

.badge { font-weight: 600; }

.page-header { margin-bottom: 1.25rem; }

/* Ikon pengepala halaman (corporate) */
.page-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #2c5fd8);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 14px rgba(31,58,147,.25);
    flex-shrink: 0;
}

/* Kad statistik dengan aksen kiri */
.stat-card.border-start { border-radius: .9rem; }
.stat-card.border-start.border-primary { --bs-border-opacity: 1; }

/* Deskripsi ringkas dalam laporan */
.report-desc { max-width: 380px; white-space: nowrap; }

/* Progress kadar selesai */
.progress { background: #eef1f6; }

/* Jadual penapis & header laporan */
.card-header .btn-light { border-color: var(--border); }

/* Dropdown eksport */
.dropdown-item i { width: 1.15rem; text-align: center; }

.deadline-chip { white-space: nowrap; font-size: .82rem; }

.chart-box { height: 320px; position: relative; }

.pill-list { list-style: none; padding: 0; margin: 0; }
.pill-list li { padding: .35rem 0; border-bottom: 1px dashed #eef1f6; }
.pill-list li:last-child { border-bottom: 0; }

.attachment-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    margin-bottom: .5rem;
    background: #fbfcfe;
}

/* Mobile */
@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -100%; z-index: 1050; transition: left .2s ease; }
    .sidebar.show { left: 0; }
    .app-content { padding: 1rem; }
}

/* Login */
.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15,28,70,.42) 0%, rgba(31,58,147,.28) 55%, rgba(44,95,216,.22) 100%),
        url('../img/mcorp-building.jpg') center / cover no-repeat;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.login-card {
    width: 100%; max-width: 420px;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(5,15,50,.45);
}
.login-head {
    background: linear-gradient(135deg, #1f3a93, #2c5fd8);
    color: #fff;
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
}
.login-logo {
    width: 232px; height: 96px; margin: 0 auto 1rem;
    display: grid; place-items: center;
    padding: 8px 20px;
}
.login-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.login-body-box { padding: 2rem 2.25rem 2.5rem; }

/* Suis status pengguna */
.switch { display:inline-block; padding:0; border:0; background:none; cursor:pointer; vertical-align:middle; }
.switch-track { width:44px; height:24px; border-radius:999px; background:#dc3545; display:inline-block; position:relative; transition:background .2s; box-shadow:inset 0 0 0 1px rgba(0,0,0,.15); }
.switch-thumb { position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:left .2s; box-shadow:0 1px 3px rgba(0,0,0,.35); }
.switch.is-active .switch-track { background:#198754; }
.switch.is-active .switch-thumb { left:23px; }
.switch:hover .switch-track { filter:brightness(1.08); }
.switch:focus-visible { outline:2px solid var(--brand, #1f3a93); outline-offset:2px; }

/* Hubungi sokongan (login) */
.login-support { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed #d0d5e0; text-align: center; font-size: .85rem; color: #4a5568; }
.login-support-title { font-weight: 600; color: var(--brand-dark, #16285f); margin-bottom: .35rem; }
.login-support a { color: #1f3a93; text-decoration: none; }
.login-support a:hover { text-decoration: underline; }

/* Manual Pengguna */
.manual-list { padding-left: 1.4rem; margin: 0; }
.manual-list li { padding: .35rem 0 .35rem .35rem; }
.manual-list li + li { border-top: 1px dashed #e5e8f0; }
.manual-list li::marker { font-weight: 700; color: var(--brand, #1f3a93); }
