/* ===== e-SPMI UI polish ===== */
:root {
    --espmi: #0D47A1;
    --espmi-dark: #093372;
    --espmi-soft: #e8eefb;
    --ink: #223049;
    --muted: #7688a5;
    --line: #e9edf5;
    --bg: #f5f7fb;
}

body {
    background: var(--bg) !important;
    color: var(--ink);
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Main content spacing */
.main-container { padding-bottom: 3rem; }

/* Page heading bar */
.main-container h4 { font-weight: 700; color: var(--ink); letter-spacing: -.2px; }

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(20, 40, 80, .06);
    transition: box-shadow .2s ease, transform .2s ease;
}
.card.hoverable:hover { box-shadow: 0 8px 24px rgba(20, 40, 80, .12); transform: translateY(-2px); }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    padding: .9rem 1.1rem;
    border-radius: 14px 14px 0 0 !important;
}

/* ---- Section title ---- */
.section-title {
    font-weight: 700; color: var(--ink);
    display: flex; align-items: center; gap: .5rem;
    margin: .25rem 0 1rem;
}
.section-title .bar { width: 4px; height: 20px; border-radius: 4px; background: var(--espmi); display: inline-block; }

/* ---- Tables ---- */
.table thead th {
    background: #f3f6fc;
    color: var(--muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .4px;
    font-weight: 700;
    border-bottom: none;
    border-top: none;
    padding: .7rem .85rem;
    vertical-align: middle;
}
.table td { vertical-align: middle; border-color: var(--line); padding: .7rem .85rem; }
.table-hover tbody tr:hover { background: var(--espmi-soft); }
.table-card { border-radius: 14px; overflow: hidden; }

/* ---- Buttons ---- */
.btn { border-radius: 9px; font-weight: 600; }
.btn-theme { background: var(--espmi); color: #fff; border: none; }
.btn-theme:hover { background: var(--espmi-dark); color: #fff; box-shadow: 0 4px 12px rgba(13,71,161,.3); }
.btn-sm { border-radius: 8px; }
.btn-outline-primary { color: var(--espmi); border-color: #cdd8ee; }
.btn-outline-primary:hover { background: var(--espmi); border-color: var(--espmi); }
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- Badges ---- */
.badge { border-radius: 7px; font-weight: 600; padding: .4em .6em; }

/* ---- Forms ---- */
.form-control { border-radius: 9px; border-color: #dbe2ee; }
.form-control:focus { border-color: var(--espmi); box-shadow: 0 0 0 .18rem rgba(13,71,161,.12); }
label { font-weight: 600; font-size: .85rem; color: #4a5a75; }

/* ---- Modal ---- */
.modal-content { border: none; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(15,30,60,.25); }
.modal-header {
    background: linear-gradient(135deg, var(--espmi), var(--espmi-dark));
    color: #fff; border: none; padding: 1rem 1.25rem;
}
.modal-header .close { color: #fff; opacity: .9; text-shadow: none; }
.modal-title { font-weight: 700; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--line); }

/* ---- Stat cards ---- */
.stat-card .icon-box {
    width: 52px; height: 52px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.stat-card h3 { font-weight: 800; margin: 0; color: var(--ink); }

/* ===== Sidebar ===== */
.sidebar-container { padding-left: 0; padding-right: 0; }

.espmi-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 0 .6rem .6rem;
    overflow-y: auto;
    max-height: 100vh;
}
.espmi-sidebar::-webkit-scrollbar { width: 6px; }
.espmi-sidebar::-webkit-scrollbar-thumb { background: #d8e0ee; border-radius: 6px; }

/* Brand */
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.1rem .6rem 1rem;
    margin-bottom: .4rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand img { height: 34px; width: auto; }
.sidebar-brand span { font-size: 1.15rem; font-weight: 600; color: var(--ink) !important; letter-spacing: -.3px; }
.sidebar-brand span b { color: var(--espmi); font-weight: 800; }

/* User block */
.sidebar-user {
    background: var(--espmi-soft);
    border-left: 3px solid var(--espmi);
    border-radius: 10px;
    padding: .6rem .8rem;
    margin: .3rem .1rem 1rem;
}
.sidebar-user .meta { min-width: 0; }
.sidebar-user .name { font-weight: 700; font-size: .9rem; color: var(--ink); line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: .76rem; font-weight: 600; color: var(--espmi); }

/* Nav */
.accordion-menu { margin: 0; padding: 0; }
.accordion-menu li { list-style: none; margin: 2px 0; }
.accordion-menu li a,
.nav-logout button {
    display: flex; align-items: center; gap: .1rem;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: #55617a;
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    transition: background .15s, color .15s;
    width: 100%; border: none; background: none; text-align: left;
}
.accordion-menu li a i,
.nav-logout button i { width: 24px; text-align: center; font-size: 1rem; margin-right: .55rem !important; flex-shrink: 0; }
.accordion-menu li a:hover,
.nav-logout button:hover { background: #f1f4fa; color: var(--ink); text-decoration: none; }

.accordion-menu li.active-page > a {
    background: var(--espmi);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13,71,161,.25);
}
.accordion-menu li.active-page > a i { color: #fff; }

/* Section label */
.nav-section {
    padding: .5rem .8rem .3rem;
    margin-top: .6rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--muted);
}
.nav-divider { border-top: 1px solid var(--line); margin: .6rem .4rem; }

/* Logout */
.nav-logout button { color: #d64550; }
.nav-logout button:hover { background: #fdecee; color: #c62828; }
.nav-logout form { margin: 0; }

/* Badge inside nav */
.accordion-menu li a .badge { margin-left: auto; }

/* ---- Progress ---- */
.progress { border-radius: 20px; background: #eef1f7; }
.progress-bar { border-radius: 20px; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.2rem; opacity: .4; }

/* ---- Periode filter in navbar ---- */
.periode-filter .input-group-text { background: var(--espmi-soft); border-color: #d7e0f3; color: var(--espmi); font-weight: 600; }
