:root {
    --sidebar-width: 230px;

    --emerald-900: #1120ea;
    --emerald-800: #1120ea;
    --emerald-700: #1120ea;
    --emerald-100: #d1fae5;
    --emerald-050: #ecfdf5;

    --ink-900: #111827;
    --ink-700: #374151;
    --ink-500: #6b7280;
    --ink-400: #9ca3af;

    --line: #e5e7eb;
    --line-soft: #eef0f2;
    --bg-page: #f6f7f8;
    --bg-card: #ffffff;

    --red-600: #dc2626;
    --red-050: #fef2f2;
    --amber-600: #d97706;
    --amber-050: #fffbeb;
    --slate-600: #475569;
    --slate-050: #f1f5f9;

    --radius-sm: 3px;
    --radius-md: 5px;
}

* { box-sizing: border-box; }

/* PENTING: jangan pakai height:100% di sini, cukup min-height */
html, body {
    min-height: 100%;
    margin: 0;
    background: var(--bg-page);
    color: var(--ink-700);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .925rem;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink-900);
    font-weight: 700;
    letter-spacing: -0.015em;
}

a { text-decoration: none; }

.btn, .dropdown-menu, .accordion-button, .accordion-item {
    border-radius: var(--radius-sm) !important;
}

/* =====================================================================
   WRAPPER — kunci utama full height
   ===================================================================== */
.app-wrapper {
    display: flex;
    align-items: stretch;   /* default flexbox, tapi ditegaskan */
    min-height: 100vh;      /* boleh vh di sini karena ini WRAPPER, bukan sidebar */
}

/* =====================================================================
   SIDEBAR — TIDAK ADA height/min-height/position eksplisit
   Tinggi sidebar sepenuhnya diserahkan ke flexbox stretch dari .app-wrapper
   ===================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--emerald-800);
    color: #d1fae5;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: margin-left .2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.25rem 1.25rem 1.1rem;
    /* border-bottom: 1px solid rgba(255, 255, 255, .12); */
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -0.01em;
}

.brand-tag {
    color: rgba(255, 255, 255, .55);
    font-size: .7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-nav {
    flex-grow: 1;
    padding: .75rem .75rem 1rem;
}

.sidebar-section-label {
    color: rgba(255, 255, 255, .45);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1rem .6rem .4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .6rem;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    font-size: .875rem;
    border-left: 2px solid transparent;
    border-radius: var(--radius-sm);
}

.sidebar-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, .1);
    /* border-left-color: #6ee7b7; */
    color: #fff;
}

.accordion-item {
    background: transparent;
    border: none;
}

.accordion-button {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    font-size: .875rem;
    box-shadow: none !important;
    padding: .62rem .6rem;
}

.accordion-button i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.accordion-button:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.accordion-button::after {
    width: .8rem;
    height: .8rem;
    background-size: .8rem;
    filter: invert(1) brightness(1.6);
}

.accordion-body {
    padding: .15rem 0 .5rem;
}

.sidebar-sublink {
    display: block;
    padding: .48rem .6rem .48rem 2.5rem;
    color: rgba(255, 255, 255, .62);
    font-size: .84rem;
    border-left: 2px solid transparent;
    border-radius: var(--radius-sm);
}

.sidebar-sublink:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.sidebar-sublink.active {
    color: #fff;
    font-weight: 600;
    border-left-color: #6ee7b7;
    background: rgba(255, 255, 255, .08);
}

.sidebar-footer {
    padding: .9rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .14);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: rgba(255, 255, 255, .55);
    font-size: .72rem;
}

/* =====================================================================
   CONTENT
   ===================================================================== */
.app-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-500);
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--slate-050);
    color: var(--ink-900);
}

.breadcrumb {
    font-size: .82rem;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--ink-500);
}

.breadcrumb-item.active {
    color: var(--ink-900);
    font-weight: 600;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .35rem .7rem .35rem .35rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-900);
}

.topbar-user-btn:hover {
    background: var(--slate-050);
}

.topbar-avatar {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--emerald-800);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
}

/* =====================================================================
   MAIN
   ===================================================================== */
.app-main {
    padding: 1.75rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.4rem;
    margin-bottom: .2rem;
}

.page-subtitle {
    color: var(--ink-500);
    font-size: .87rem;
    margin-bottom: 0;
}

.btn-primary-flat {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--emerald-800);
    border: 1px solid var(--emerald-800);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    padding: .55rem 1rem;
}

.btn-primary-flat:hover {
    background: var(--emerald-900);
    color: #fff;
}

/* Panel */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.3rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1rem;
    margin-bottom: .1rem;
}

.panel-subtitle {
    color: var(--ink-500);
    font-size: .8rem;
}

.table-tools .form-control {
    border-radius: var(--radius-sm);
    font-size: .85rem;
    max-width: 220px;
}

/* Table */
.table-flat {
    margin-bottom: 0;
    font-size: .87rem;
}

.table-flat thead th {
    color: var(--ink-500);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
    padding: .7rem .6rem;
    white-space: nowrap;
}

.table-flat tbody td {
    padding: .65rem .6rem;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-700);
    vertical-align: middle;
}

.table-flat tbody tr:last-child td {
    border-bottom: none;
}

.table-flat tbody tr:hover {
    background: var(--bg-page);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    padding: .25rem .55rem;
    border-radius: var(--radius-sm);
    font-size: .72rem;
    font-weight: 600;
}

.badge-status-aktif { background: var(--emerald-050); color: var(--emerald-800); }
.badge-status-lulus { background: var(--slate-050); color: var(--slate-600); }

.action-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-500);
    margin-right: 4px;
}

.action-icons a:hover {
    background: var(--bg-page);
    color: var(--ink-900);
}

/* Panel tall (contoh 600px) */
.panel-tall {
    height: 100%;
}

.tall-content {
    height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Bar chart sederhana */
.bar-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.bar-label {
    width: 32px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-700);
    flex-shrink: 0;
}

.bar-track {
    flex-grow: 1;
    height: 10px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--emerald-700);
    border-radius: var(--radius-sm);
}

.bar-value {
    width: 28px;
    text-align: right;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink-900);
    flex-shrink: 0;
}

/* Activity list */
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-list li {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line-soft);
}

.activity-list li:last-child { border-bottom: none; padding-bottom: 0; }
.activity-list li:first-child { padding-top: 0; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: .4rem;
    flex-shrink: 0;
}

.activity-dot-emerald { background: var(--emerald-700); }
.activity-dot-amber   { background: var(--amber-600); }
.activity-dot-slate   { background: var(--slate-600); }

.activity-text {
    font-size: .84rem;
    color: var(--ink-700);
    margin-bottom: .1rem;
}

.activity-time {
    font-size: .74rem;
    color: var(--ink-400);
}

/* =====================================================================
   MOBILE
   ===================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 30, 22, .45);
    z-index: 1040;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        height: 100vh;
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.show {
        margin-left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* custom */
.btn{
    font-size: 0.9rem !important;
    border-radius: 0.3rem !important;
}
.form-control{
    border-radius: 0.3rem !important;
}
.grid-view{
    font-size: 0.9rem !important;
}
.grid-view .filters td{
    padding-top: 0px !important;
    border-top: 1px solid transparent !important;
}
.grid-view a{
    color: var(--theme) !important;
}
form .form-group{
    margin-bottom: 0.375rem !important;
}
.btn-success{
    background: var(--theme) !important;
    border-color: var(--theme) !important;
}
.bg-theme{
    background: var(--theme);
}
.bg-theme-dark{
    background: var(--theme-dark);
}
.breadcrumb{
    padding: 0.7rem 0rem;
    background: #fff;
}
.help-block{
    color: red;
}
.table thead tr {
    background: #1a1a2e;
    color: #fff;
}
.table thead th {
    border: none;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
    color: var(--theme);
}
.table tbody td {
    font-size: 13px;
    padding: 9px 14px;
    vertical-align: middle;
    border-color: #f0f0f0;
}
.table tbody tr:hover {
    background: #f8f9ff;
}
.form-control{
    padding: 0.25rem 0.5rem !important;
}

/* ==========================================================
   demo.css — dipakai bersama oleh semua view DemoController
   Hanya berisi utility kecil yang tidak tersedia di Bootstrap 5
   ========================================================== */

   .text-money {
    font-variant-numeric: tabular-nums;
}

.cell-right {
    text-align: right;
}

.table-demo thead th {
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6b7280;
    background-color: #f8f9fa;
}

.table-demo td, .table-demo th {
    vertical-align: middle;
}

.nav-tabs .nav-link {
    color: #374151;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
}

.card-summary .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
}

.card-summary .value {
    font-size: 1.4rem;
    font-weight: 700;
}