:root {
    --primary: #0f6e5e;
    --primary-dark: #0b5346;
    --sidebar-bg: #0d3b32;
}

body {
    background: #f4f6f8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.sidebar-nav a {
    color: rgba(255,255,255,0.8);
    padding: 11px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    transition: background 0.15s;
}

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

.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.sidebar-section {
    padding: 14px 20px 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
}

.sidebar-nav .has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.sidebar-nav .has-submenu .submenu-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav .has-submenu .submenu-caret {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.sidebar-nav .submenu-group.open .has-submenu .submenu-caret {
    transform: rotate(180deg);
}

.sidebar-nav .submenu-group.open .has-submenu {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-nav .submenu-group.open .sidebar-submenu {
    max-height: 800px;
}

.sidebar-submenu a {
    padding-left: 48px;
    font-size: 0.88rem;
}

.app-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    background: #fff;
    padding: 14px 24px;
    border-bottom: 1px solid #e5e9ec;
    position: sticky;
    top: 0;
    z-index: 10;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-card {
    border-radius: 14px;
    padding: 20px;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-card.bg-1 { background: linear-gradient(135deg, #0f6e5e, #14a085); }
.stat-card.bg-2 { background: linear-gradient(135deg, #b8860b, #d4a017); }
.stat-card.bg-3 { background: linear-gradient(135deg, #8a3b3b, #b85450); }
.stat-card.bg-4 { background: linear-gradient(135deg, #2c5f8a, #3a7bb0); }

.table thead th {
    background: #eef2f1;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4a5a56;
    border-bottom: none;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* =========================================================
   LOGIN PAGE — SPLIT LAYOUT (gambar di kiri, form di kanan)
   Untuk mengganti gambar, edit variabel $login_banner_image
   di file login.php — tidak perlu menyentuh CSS ini.
   ========================================================= */
.login-split-wrapper {
    min-height: 100vh;
    display: flex;
    background: #fff;
}

/* ---- Panel gambar (kiri) ---- */
.login-image-panel {
    flex: 1 1 50%;
    position: relative;
    background-color: var(--sidebar-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,59,50,0.55) 0%, rgba(13,59,50,0.75) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-image-content {
    color: #fff;
    text-align: center;
    max-width: 420px;
}

.login-image-logo {
    width: 90px;
    height: auto;
    margin-bottom: 18px;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
}

.login-image-content h2 {
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.login-image-content > p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.login-image-divider {
    width: 56px;
    height: 3px;
    background: #f7c948;
    border-radius: 2px;
    margin: 20px auto;
}

.login-image-tagline {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
}

/* ---- Panel form (kanan) ---- */
.login-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #fff;
}

.login-form-box {
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.92rem;
    margin-bottom: 24px;
}

.login-form-box .form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #333;
}

.login-form-box .input-group-text {
    border-right: none;
    color: var(--primary);
}
.login-form-box .input-group .form-control {
    border-left: none;
}
.login-form-box .input-group .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}
.login-form-box .input-group:focus-within .input-group-text,
.login-form-box .input-group:focus-within .form-control {
    border-color: var(--primary);
}

@media (max-width: 991px) {
    .login-image-panel {
        display: none;
    }
    .login-form-panel {
        flex: 1 1 100%;
    }
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 1000;
        transition: left 0.2s;
    }
    .sidebar.show {
        left: 0;
    }
}

@media print {
    .sidebar, .topbar, .no-print, footer {
        display: none !important;
    }
    .app-content {
        width: 100% !important;
    }
    main {
        padding: 0 !important;
        margin: 0 !important;
    }
    .app-wrapper, .app-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #fff;
    }
}
