:root {
    --app-bg: #f5f7fb;
    --surface: #ffffff;
    --sidebar-bg: #172033;
    --sidebar-link: #cbd5e1;
    --sidebar-link-active: #ffffff;
    --text-main: #111827;
    --text-muted: #64748b;
    --border: #e5e7eb;
    --accent: #2563eb;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--text-main);
    font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: var(--sidebar-bg);
    padding: 24px 18px;
    z-index: 1020;
}

/* Collapsed sidebar (icon-only) */
.sidebar {
    transition: width 220ms ease;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    width: 34px;
    display: inline-block;
    text-align: center;
}

.sidebar .nav-link .nav-text {
    transition: opacity 180ms ease, transform 180ms ease;
}

.sidebar.collapsed {
    width: 72px !important;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar.collapsed .sidebar-brand {
    text-align: center;
}

.sidebar.collapsed .nav-link {
    padding: 10px 6px;
}

.sidebar.collapsed .nav-link .nav-text {
    opacity: 0;
    transform: translateX(-6px);
    width: 0;
    height: 0;
    overflow: hidden;
    display: inline-block;
}

.main-panel {
    transition: margin-left 220ms ease;
}

@media (min-width: 992px) {
    .main-panel {
        margin-left: 260px;
    }
    .sidebar.collapsed ~ .main-panel {
        margin-left: 72px;
    }
}

.sidebar-brand {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 28px;
    padding: 0 12px;
}

.sidebar-nav {
    gap: 6px;
}

.sidebar-nav .nav-link {
    border-radius: 8px;
    color: var(--sidebar-link);
    font-weight: 500;
    padding: 11px 12px;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--sidebar-link-active);
}

.main-panel {
    min-height: 100vh;
}

.app-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.navbar-brand {
    color: var(--text-main);
    font-weight: 700;
    white-space: normal;
}

.content-area {
    padding: 28px 20px;
}

.dashboard-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 22px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.dashboard-header p {
    color: var(--text-muted);
    margin: 6px 0 0;
}

.kpi-card,
.table-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.kpi-card .card-body {
    min-height: 120px;
    padding: 22px;
}

.kpi-label {
    color: var(--text-muted);
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.kpi-value {
    color: var(--text-main);
    display: block;
    font-size: 1.75rem;
    line-height: 1.2;
}

.table-section {
    margin-top: 28px;
}

.section-header {
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.table-card {
    overflow: hidden;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.table td,
.table th {
    padding: 14px 18px;
}

.status-badge {
    background: #e8f0ff;
    color: #1d4ed8;
    font-weight: 600;
}

.offcanvas {
    background: var(--sidebar-bg);
}

.offcanvas-title {
    color: #ffffff;
}

.offcanvas .btn-close {
    filter: invert(1);
}

@media (min-width: 992px) {
    .main-panel {
        margin-left: 260px;
    }

    .app-navbar {
        padding-left: 32px;
        padding-right: 32px;
    }

    .content-area {
        padding: 32px;
    }
}

@media (max-width: 575.98px) {
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .kpi-card .card-body {
        min-height: auto;
    }

    .kpi-value {
        font-size: 1.5rem;
    }
}

/* Login page logo styling */
.brand-panel .login-logo {
    display: block;
    max-width: 180px; /* default maximum width */
    max-height: 100px; /* prevent overly tall logos */
    width: auto;
    height: auto;
    margin-bottom: 18px;
}

@media (max-width: 991.98px) {
    .brand-panel .login-logo {
        max-width: 140px;
        max-height: 64px;
    }
}

@media (max-width: 575.98px) {
    .brand-panel .login-logo {
        max-width: 120px;
        max-height: 56px;
        margin-bottom: 12px;
    }
}
