/* ============================================================================
   SISTEM INFORMASI KAS MULTI CABANG — STYLESHEET UTAMA
   ============================================================================ */

:root {
    --brand-navy: #0f294a;
    --brand-navy-dark: #091a30;
    --brand-accent: #2563eb;
    --brand-accent-hover: #1d4ed8;
    --surface-bg: #f4f6f9;
    --surface-card: #ffffff;
    --border-soft: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --topbar-height: 68px;
    --radius-card: 14px;
    --radius-control: 10px;
    --shadow-card: 0 2px 12px rgba(15, 41, 74, 0.05);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    font-size: 0.9375rem;
    line-height: 1.5;
    overflow-x: clip;
}

.text-navy {
    color: var(--brand-navy) !important;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.78) !important;
}

.text-success-soft {
    color: #34d399 !important;
}

.text-danger-soft {
    color: #f87171 !important;
}

.py-2-5 {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
}

.shadow-xs {
    box-shadow: 0 1px 4px rgba(15, 41, 74, 0.04) !important;
}

/* ----------------------------------------------------------------------------
   BUTTONS & FORM CONTROLS
   ---------------------------------------------------------------------------- */
.btn-navy {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #ffffff;
    border-radius: var(--radius-control);
    transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.btn-navy:hover,
.btn-navy:focus {
    background-color: var(--brand-navy-dark);
    border-color: var(--brand-navy-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 41, 74, 0.2);
}

.btn-navy:active {
    transform: scale(0.99);
}

.btn-primary {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    border-radius: var(--radius-control);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-accent-hover);
    border-color: var(--brand-accent-hover);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: var(--radius-control);
    border-color: #cbd5e1;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ----------------------------------------------------------------------------
   CARDS & TABLES
   ---------------------------------------------------------------------------- */
.card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 41, 74, 0.08);
}

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

.table thead th {
    background-color: #f8fafc;
    color: var(--brand-navy);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.875rem;
    border-color: #f1f5f9;
}

/* ----------------------------------------------------------------------------
   LOGIN PAGE
   ---------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #091a30 0%, #0f294a 52%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-wrapper {
    width: 100%;
    max-width: 940px;
}

.login-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 10, 24, 0.35);
}

.login-brand-panel {
    background: linear-gradient(160deg, var(--brand-navy-dark) 0%, var(--brand-navy) 60%, var(--brand-accent) 160%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-logo-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.login-logo-img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 4px;
}

.login-form-panel {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ----------------------------------------------------------------------------
   APP SHELL: SIDEBAR, TOPBAR & MAIN CONTENT
   ---------------------------------------------------------------------------- */
.app-body {
    min-height: 100vh;
    background-color: var(--surface-bg);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-navy-dark) 0%, var(--brand-navy) 100%);
    color: #ffffff;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(9, 26, 48, 0.12);
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffffff;
    min-width: 0;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.sidebar-menu-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.75rem 0.65rem 0.35rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 10px;
    padding: 0.62rem 0.8rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.92rem;
    opacity: 0.88;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--brand-accent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-footer {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    z-index: 1040;
    display: none;
}

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

.app-main-wrapper {
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left 0.25s ease;
}

.app-topbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-navy);
    line-height: 1.2;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.topbar-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ----------------------------------------------------------------------------
   RESPONSIVE MOBILE
   ---------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-brand-panel,
    .login-form-panel {
        padding: 1.75rem;
    }
}

/* ----------------------------------------------------------------------------
   PRINT FRIENDLY
   ---------------------------------------------------------------------------- */
@media print {
    .app-sidebar,
    .app-topbar,
    .sidebar-backdrop,
    .no-print,
    .btn,
    .alert .btn-close {
        display: none !important;
    }

    .app-main-wrapper {
        margin-left: 0 !important;
    }

    body,
    .app-body,
    .app-content {
        background: #ffffff !important;
    }

    .card,
    .stat-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
    }
}