:root {
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
    --app-sidebar-width: 240px;
    --app-sidebar-bg: #0e3324;
    --app-sidebar-bg-end: #0a2318;
    --app-sidebar-fg: #bfe3cf;
    --app-sidebar-fg-active: #ffffff;
}

body {
    background-color: #f4f6f8;
}

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #0d9488 100%);
}

.login-wrap {
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 0.75rem;
}

.login-brand-icon {
    font-size: 2.5rem;
    color: var(--bs-primary);
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--app-sidebar-width);
    background: linear-gradient(180deg, var(--app-sidebar-bg) 0%, var(--app-sidebar-bg-end) 100%);
    color: var(--app-sidebar-fg);
    border: none;
}

.app-sidebar .offcanvas-header {
    color: #fff;
}

.app-sidebar-brand {
    align-items: center;
    padding: 1.1rem 1.25rem;
    font-weight: 600;
    color: #fff;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.6rem;
    gap: 0.15rem;
    overflow-y: auto;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--app-sidebar-fg);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

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

.app-nav-link.active {
    background-color: var(--bs-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-hamburger {
    font-size: 1.3rem;
    padding: 0.2rem 0.5rem;
    color: #334155;
}

.app-topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #0f172a;
    flex: 1;
}

.app-user-menu .btn {
    color: #334155;
    border: none;
    background: none;
}

.app-content {
    flex: 1;
    padding: 0;
}

.app-content-loading {
    display: flex;
    align-items: center;
}

/* ---------- Module stub / empty states ---------- */
.module-stub {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.module-stub i {
    font-size: 2.75rem;
    color: var(--bs-primary);
    opacity: 0.6;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.empty-state i {
    font-size: 2.5rem;
    color: #94a3b8;
}

/* ---------- Select2 (lookup dropdown pattern) ---------- */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    padding-left: 0.25rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal;
    padding-left: 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--bs-primary);
}

/* ---------- Dashboard KPI cards ---------- */
.kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    height: 100%;
    padding: 1.1rem 1.25rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kpi-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
}

.kpi-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.kpi-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.kpi-indigo::before { background: #6366f1; }
.kpi-indigo .kpi-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); }

.kpi-emerald::before { background: #10b981; }
.kpi-emerald .kpi-icon { background: linear-gradient(135deg, #34d399, #059669); }

.kpi-rose::before { background: #f43f5e; }
.kpi-rose .kpi-icon { background: linear-gradient(135deg, #fb7185, #e11d48); }

.kpi-teal::before { background: #0d9488; }
.kpi-teal .kpi-icon { background: linear-gradient(135deg, #2dd4bf, #0f766e); }

.kpi-amber::before { background: #f59e0b; }
.kpi-amber .kpi-icon { background: linear-gradient(135deg, #fbbf24, #d97706); }

.dashboard-panel .card-header {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.06), rgba(99, 102, 241, 0.04));
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-weight: 600;
    color: #0f172a;
}

.currency-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        --bs-offcanvas-width: 260px;
    }
}
