@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --dark-bg: #090d16;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    font-size: 0.925rem;
    line-height: 1.5;
}

/* ── Brand & Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* ── Sidebar & Navbar Styles (Elevated Card Accordion Theme) ────── */
.sidebar {
    background: #f1f5f9 !important;
    border-right: 1px solid #cbd5e1;
    box-shadow: 2px 0 15px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}

.brand-header {
    padding: 1.15rem 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
}

.brand-pulse-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-search-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 0.825rem;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.nav-search-input:focus {
    background: #ffffff;
    border-color: #6366f1;
    color: #0f172a;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.nav-group-section {
    border-radius: var(--radius-sm);
}

.nav-group-toggle {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: left;
}

.nav-group-toggle:hover {
    background: #ffffff;
    color: #4f46e5;
    border-color: #6366f1;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.nav-group-toggle.active {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.nav-group-toggle.active i,
.nav-group-toggle.active span {
    color: #ffffff !important;
}

.nav-group-items {
    border-left: 2px solid #cbd5e1;
    margin-left: 0.85rem;
    padding-left: 0.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.dashboard-link {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    color: #0f172a !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 0.65rem 0.85rem !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dashboard-link:hover {
    background: #e0e7ff !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}

.nav-link {
    color: #475569 !important;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 3px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: #0f172a !important;
    background: #e2e8f0 !important;
    transform: translateX(3px);
}

.nav-link.active {
    color: #4338ca !important;
    background: #ffffff !important;
    border-left: 3px solid #4f46e5;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.nav-link .bi {
    font-size: 1.05rem;
    margin-right: 0.65rem;
}

/* User Footer inside Sidebar */
.user-profile-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    margin-top: auto;
}

/* ── Dashboard KPI Cards ────────────────────────────────────────── */
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
}

.kpi-icon-box.primary { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.kpi-icon-box.success { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.kpi-icon-box.warning { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.kpi-icon-box.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.kpi-icon-box.info { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }

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

.kpi-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* ── Widget Panel & Toggle Controls ────────────────────────────── */
.widget-toggle-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ── Form Controls & Inputs ─────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

label {
    font-weight: 600;
    font-size: 0.825rem;
    color: #475569;
    margin-bottom: 0.35rem;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    font-weight: 600;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    border: none;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
    font-size: 0.9rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* ── Thermal Printing Styles (80mm) ─────────────────────────────── */
.thermal-print {
    width: 80mm;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.2;
    color: black;
    background: white;
}

.thermal-print .header {
    text-align: center;
    border-bottom: 1px dashed black;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.thermal-print h4 {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

@media print {
    .no-print {
        display: none !important;
    }

    body.printing-thermal {
        width: 80mm;
        margin: 0;
        padding: 0;
    }

    .printing-thermal .thermal-print {
        width: 100%;
        margin: 0;
    }
}
