:root {
    --brand: #1d4ed8;
}

body {
    background-color: #f3f4f6;
}

.navbar-brand span {
    opacity: 0.85;
}

/* Menu grid dengan icon di atas, judul di bawah */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.menu-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: #111827;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    color: var(--brand);
}

.menu-card i {
    font-size: 1.8rem;
    color: var(--brand);
    display: block;
    margin-bottom: 0.5rem;
}

.menu-card span {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-role {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

/* ================================================
   TEMA ALA EXTJS: panel bertitle, toolbar compact, grid tegas
   ================================================ */

body {
    font-size: 0.875rem; /* ExtJS klasik itu font-nya kecil & padat, bukan lega kayak Bootstrap default */
    background-color: #d9e3ee; /* abu-kebiruan khas ExtJS classic theme */
}

/* ---- Panel ala ExtJS: ada header bar bergradasi + border tegas ---- */
.ext-panel {
    background: #fff;
    border: 1px solid #a3bad9;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    overflow: hidden;
}

.ext-panel-header {
    background: linear-gradient(to bottom, #f5f9fd 0%, #dceaf7 50%, #c7dcf0 100%);
    border-bottom: 1px solid #a3bad9;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #15395b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ext-panel-header i {
    margin-right: 0.4rem;
    color: #2b6cb0;
}

.ext-panel-body {
    padding: 1rem;
}

/* ---- Toolbar ala ExtJS: baris tombol compact di atas grid/table ---- */
.ext-toolbar {
    background: linear-gradient(to bottom, #f5f9fd 0%, #e4edf7 100%);
    border-bottom: 1px solid #c3d4e8;
    padding: 0.4rem 0.6rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.ext-toolbar .btn {
    font-size: 0.78rem;
    padding: 0.28rem 0.65rem;
    border-radius: 3px;
}

.ext-toolbar .divider {
    width: 1px;
    height: 20px;
    background: #c3d4e8;
    margin: 0 0.2rem;
}

.ext-toolbar .search-box {
    margin-left: auto;
    max-width: 220px;
}

/* ---- Grid ala ExtJS: header abu-biru, border tegas antar cell, zebra stripe ---- */
.ext-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ext-grid thead th {
    background: linear-gradient(to bottom, #f5f9fd 0%, #dceaf7 100%);
    border: 1px solid #c3d4e8;
    padding: 0.45rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: #15395b;
    white-space: nowrap;
    user-select: none;
}

.ext-grid thead th.sortable {
    cursor: pointer;
}

.ext-grid thead th.sortable:hover {
    background: linear-gradient(to bottom, #eaf3fb 0%, #cfe3f5 100%);
}

.ext-grid tbody td {
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
}

.ext-grid tbody tr:nth-child(even) {
    background: #f4f8fc;
}

.ext-grid tbody tr:hover {
    background: #dbeafe;
    cursor: default;
}

.ext-grid tbody tr.selected {
    background: #bfdbfe;
}

/* ---- Status pill kecil, khas ExtJS grid ---- */
.ext-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.12rem 0.5rem;
    border-radius: 3px;
}
.ext-pill-success { background: #dcfce7; color: #166534; }
.ext-pill-danger  { background: #fee2e2; color: #991b1b; }
.ext-pill-warning { background: #fef9c3; color: #854d0e; }
.ext-pill-info    { background: #dbeafe; color: #1e40af; }

/* ---- Pagination bar ala ExtJS, nempel di bawah grid ---- */
.ext-pagebar {
    background: linear-gradient(to bottom, #f5f9fd 0%, #e4edf7 100%);
    border-top: 1px solid #c3d4e8;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #475569;
}

/* ================================================
   DASHBOARD: stat cards & grid grafik
   ================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    margin-bottom: 0;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon-green  { background: #dcfce7; color: #16a34a; }
.stat-icon-orange { background: #fef3c7; color: #d97706; }
.stat-icon-red    { background: #fee2e2; color: #dc2626; }

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   LAYOUT: area konten utama (elemen <main class="container">)
   ================================================ */

/* Container Bootstrap default mentok progresif sampai ~1320px di layar
   >=1400px — dilebarin di sini biar panel gak keliatan kekecilan pas
   dibuka di monitor gede. Di bawah breakpoint ini, container tetap 100%
   lebar seperti biasa (behavior asli Bootstrap gak berubah). */
main.container {
    max-width: 1600px;
}

/* ================================================
   NAVBAR: icon di atas, label di bawah — warna selaras sama panel
   ================================================ */

.siap-navbar {
    background: linear-gradient(to bottom, #2b4c7e 0%, #1e3a5f 100%);
    border-bottom: 2px solid #16304f;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1030; /* di atas konten halaman, tapi tetap di bawah modal/dropdown Bootstrap (1050+) */
}

.siap-navbar-inner {
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    min-height: 64px;
    flex-wrap: wrap;
}

.siap-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.siap-brand-logo {
    height: 36px;
    width: auto;
    display: block;
}

.siap-nav-divider {
    width: 1px;
    align-self: stretch;
    margin: 14px 1.25rem;
    background: rgba(255,255,255,0.2);
}

.siap-toggler {
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    display: none;
}

.siap-nav-icons {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: stretch;
}

.siap-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.55rem 0.9rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.15s ease;
    min-width: 74px;
}

.siap-nav-item i {
    font-size: 1.15rem;
    line-height: 1;
}

.siap-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.siap-nav-item.active {
    color: #fff;
    border-bottom-color: #60a5fa;
    background: rgba(255,255,255,0.06);
}

.siap-nav-item.dropdown-toggle::after {
    display: none; /* hilangin panah default bootstrap biar rapi di layout vertikal */
}

.siap-dropdown {
    border: 1px solid #a3bad9;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    font-size: 0.85rem;
    padding: 0.3rem;
}

.siap-dropdown .dropdown-item {
    border-radius: 4px;
    padding: 0.45rem 0.7rem;
}

.siap-dropdown .dropdown-item:hover {
    background: #eaf3fb;
}

@media (max-width: 991px) {
    .siap-toggler { display: block; }
    .siap-nav-icons { flex-direction: column; width: 100%; }
    .siap-nav-item { flex-direction: row; justify-content: flex-start; gap: 0.5rem; min-width: 0; padding: 0.6rem 0.5rem; font-size: 0.8rem; }
    .collapse:not(.show) { display: none; }
}

/* ================================================
   FILTER: Tom Select (dropdown pegawai dengan search) -- disamain tinggi
   & ukuran font-nya sama field .form-select-sm lain di baris filter yang
   sama, soalnya tema bootstrap5 bawaan Tom Select defaultnya lebih besar.
   ================================================ */
#saFilterPegawai ~ .ts-wrapper {
    min-width: 220px;
}

.ts-wrapper.form-select-sm .ts-control,
.ts-wrapper .ts-control {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.ts-dropdown {
    font-size: 0.875rem;
}