:root {
    --primary: #2563eb;
    --primary-dark: #1e3a8a;
    --sidebar-bg: #0f172a;
    --sidebar-soft: rgba(255,255,255,.10);
    --body-bg: #f4f7fb;
    --card-radius: 22px;
}
* { box-sizing: border-box; }
body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--body-bg);
    color: #172033;
}
a { text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar,
.mobile-sidebar {
    background:
        radial-gradient(circle at top left, rgba(59,130,246,.45), transparent 34%),
        linear-gradient(180deg, #111827 0%, #0f172a 55%, #020617 100%);
    color: #fff;
}
.sidebar {
    width: 292px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 22px;
    z-index: 1030;
}
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 292px;
}
.brand-box { display: flex; align-items: center; gap: 12px; padding: 8px 4px 24px; }
.brand-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    box-shadow: 0 12px 35px rgba(37,99,235,.4);
}
.brand-title { font-weight: 800; font-size: 1.1rem; letter-spacing: .2px; }
.sidebar-menu { display: grid; gap: 8px; }
.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.72);
    padding: 13px 14px;
    border-radius: 16px;
    transition: .2s ease;
    font-weight: 600;
}
.menu-link i { font-size: 1.15rem; }
.menu-label { flex: 1; min-width: 0; }
.menu-count-badge {
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1;
    margin-left: auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.menu-count-badge.has-count {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 10px 24px rgba(239,68,68,.28), inset 0 0 0 1px rgba(255,255,255,.20);
}
.menu-count-badge.zero-count {
    color: rgba(255,255,255,.68);
    background: rgba(255,255,255,.10);
}
.menu-link:hover,
.menu-link.active {
    color: #fff;
    background: rgba(255,255,255,.13);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    transform: translateX(3px);
}
.sidebar-footer {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    padding: 16px;
}
.topbar { min-height: 76px; backdrop-filter: blur(15px); }
.content-area { min-height: calc(100vh - 76px); }
.btn-soft {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
    border-radius: 14px;
}
.user-chip {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 7px 12px 7px 8px;
}
.avatar-sm,
.avatar-lg {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 800;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 58px; height: 58px; font-size: 1.4rem; }
.stat-card,
.panel-card {
    background: #fff;
    border: 1px solid rgba(226,232,240,.85);
    border-radius: var(--card-radius);
    box-shadow: 0 16px 45px rgba(15,23,42,.06);
}
.stat-card { padding: 22px; overflow: hidden; position: relative; }
.stat-card:after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -36px;
    top: -42px;
    border-radius: 50%;
    background: rgba(37,99,235,.08);
}
.stat-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 1.35rem;
}
.panel-card { padding: 22px; }
.table { vertical-align: middle; }
.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 0;
}
.table tbody td { border-color: #f1f5f9; }
.form-control,
.form-select {
    border-radius: 14px;
    border-color: #e2e8f0;
    padding: 11px 13px;
}
.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .25rem rgba(37,99,235,.12);
}
.btn { border-radius: 14px; font-weight: 700; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 10px 20px rgba(37,99,235,.18); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,.28), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(124,58,237,.20), transparent 26%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
    padding: 20px;
}
.login-card {
    width: min(1040px, 100%);
    overflow: hidden;
    border: 0;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(15,23,42,.16);
}
.login-hero {
    color: #fff;
    min-height: 520px;
    padding: 42px;
    background:
        linear-gradient(rgba(15,23,42,.72), rgba(15,23,42,.86)),
        linear-gradient(135deg, #2563eb, #7c3aed);
}
.login-hero .feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    margin: 5px 4px 0 0;
}
.login-form-side { padding: 42px; background: #fff; }
.mobile-sidebar { width: 292px !important; }
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state {
    padding: 42px 12px;
    text-align: center;
    color: #64748b;
}
.empty-state i { font-size: 3rem; color: #cbd5e1; }
@media (max-width: 991.98px) {
    .main-content { margin-left: 0; }
    .topbar { min-height: 72px; }
    .panel-card { padding: 16px; border-radius: 18px; }
    .stat-card { padding: 18px; border-radius: 18px; }
    .login-hero { min-height: auto; padding: 30px; }
    .login-form-side { padding: 30px; }
}
@media (max-width: 575.98px) {
    .topbar .container-fluid { gap: 12px; }
    .topbar h5 { font-size: 1rem; }
    .table-responsive { border-radius: 16px; }
    .login-card { border-radius: 22px; }
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255,255,255,.95);
    padding: 4px;
    box-shadow: 0 12px 35px rgba(37,99,235,.35);
}
.logo-preview-box {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}
.main-logo-preview {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    background: #fff;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(15,23,42,.10);
}
.main-logo-empty {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #fff;
    font-size: 1.8rem;
    box-shadow: 0 12px 30px rgba(15,23,42,.08);
}


/* =========================================================
   FIX UKURAN LOGO UTAMA
   Tujuan: logo upload tidak membesar dan tidak menabrak menu/sidebar.
   Aman untuk logo kotak maupun logo panjang seperti brand internet.
   ========================================================= */
.brand-logo-holder {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}
.brand-logo-img {
    display: block !important;
    object-fit: contain !important;
    object-position: center !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Logo di sidebar desktop dibuat rapi dan tidak menutupi menu */
.sidebar > .brand-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 185px !important;
    padding: 18px 8px 26px !important;
    margin-bottom: 4px !important;
    overflow: hidden !important;
    text-align: center !important;
}
.sidebar > .brand-box .brand-logo-holder {
    width: 100% !important;
    max-width: 220px !important;
    height: 135px !important;
    max-height: 135px !important;
    border-radius: 18px !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 6px !important;
}
.sidebar > .brand-box .brand-logo-img,
.sidebar > .brand-box img {
    width: 100% !important;
    height: 100% !important;
    max-width: 220px !important;
    max-height: 135px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.sidebar > .brand-box .brand-logo-holder + div {
    display: none !important;
}

/* Fallback kalau belum ada logo, ikon bawaan tetap normal */
.sidebar > .brand-box .brand-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
}

/* Logo di sidebar mobile */
.mobile-sidebar .brand-box {
    overflow: hidden !important;
    min-width: 0 !important;
}
.mobile-sidebar .brand-box .brand-logo-holder {
    width: 168px !important;
    max-width: 168px !important;
    height: 58px !important;
    max-height: 58px !important;
    padding: 2px !important;
}
.mobile-sidebar .brand-box .brand-logo-img,
.mobile-sidebar .brand-box img {
    width: 100% !important;
    height: 100% !important;
    max-width: 168px !important;
    max-height: 58px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.mobile-sidebar .brand-box .brand-logo-holder + div {
    display: none !important;
}

/* Logo pada halaman login juga dibatasi agar tidak melebar */
.login-hero .brand-box,
.login-form-side .brand-box {
    overflow: hidden !important;
}
.login-hero .brand-logo-holder,
.login-form-side .brand-logo-holder {
    width: 180px !important;
    max-width: 180px !important;
    height: 78px !important;
    max-height: 78px !important;
    padding: 3px !important;
}
.login-hero .brand-logo-img,
.login-form-side .brand-logo-img,
.login-hero .brand-box img,
.login-form-side .brand-box img {
    width: 100% !important;
    height: 100% !important;
    max-width: 180px !important;
    max-height: 78px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.login-hero .brand-logo-holder + div,
.login-form-side .brand-logo-holder + div {
    display: none !important;
}

@media (max-width: 991.98px) {
    .mobile-sidebar .brand-box .brand-logo-holder {
        width: 155px !important;
        height: 54px !important;
    }
    .mobile-sidebar .brand-box .brand-logo-img,
    .mobile-sidebar .brand-box img {
        max-width: 155px !important;
        max-height: 54px !important;
    }
}
