/* Petrol Pump ERP Modern Styling */
:root {
    --sidebar-bg: #111c38;
    --sidebar-hover: #1b2a52;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-blue: #3b82f6;
    --accent-teal: #0d9488;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --topbar-height: 64px;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

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

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.sidebar-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-brand-subtext {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.menu-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.nav-link-custom:hover {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.nav-link-custom.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--sidebar-active) 0%, #3b82f6 100%);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-link-custom i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

/* Sidebar Dropdowns & Submenus */
.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-toggle .submenu-arrow {
    font-size: 0.72rem;
    color: #64748b;
    transition: transform 0.25s ease, color 0.2s ease;
    margin-left: auto;
}

.nav-dropdown-toggle:hover .submenu-arrow {
    color: #cbd5e1;
}

.nav-dropdown-toggle[aria-expanded="true"] .submenu-arrow,
.nav-dropdown-toggle:not(.collapsed) .submenu-arrow {
    transform: rotate(180deg);
    color: #ffffff;
}

.nav-dropdown-toggle.parent-active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-submenu {
    list-style: none;
    padding: 0.25rem 0 0.35rem 0.5rem;
    margin: 0.15rem 0 0.4rem 1.35rem;
    border-left: 2px solid rgba(148, 163, 184, 0.18);
}

.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.48rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.nav-sub-link:hover {
    color: #ffffff;
    background-color: var(--sidebar-hover);
    padding-left: 0.95rem;
}

.nav-sub-link.active {
    color: #60a5fa;
    background-color: rgba(37, 99, 235, 0.15);
    font-weight: 600;
}

.nav-sub-link.active::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #3b82f6;
    border-radius: 2px;
}

.nav-sub-link i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    opacity: 0.85;
}

.nav-sub-link.active i {
    opacity: 1;
    color: #60a5fa;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar */
.app-topbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pump-selector-pill {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    gap: 0.5rem;
}

.pump-selector-pill select {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    cursor: pointer;
}

/* Page Content */
.app-content {
    padding: 1.5rem;
    flex: 1;
}

/* Modern Card Styling */
.card-erp {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-erp:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.card-erp-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-erp-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-erp-body {
    padding: 1.25rem;
}

/* KPI Cards */
.kpi-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.kpi-card-green {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.kpi-card-amber {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.kpi-card-teal {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}
.kpi-card-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}
.kpi-card-rose {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}

.kpi-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.2rem;
    line-height: 1.1;
}

.kpi-subtext {
    font-size: 0.72rem;
    opacity: 0.85;
}

.kpi-icon-watermark {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 3.5rem;
    opacity: 0.15;
    pointer-events: none;
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #334155;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-align: center;
}

.quick-action-btn:hover {
    border-color: #3b82f6;
    color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Tank stock visualization */
.tank-visual-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    background: #ffffff;
}

.tank-progress {
    height: 14px;
    border-radius: 7px;
    background-color: #f1f5f9;
    overflow: hidden;
    margin: 0.75rem 0;
}

/* Table styling */
.table-erp {
    width: 100%;
    margin-bottom: 0;
}

.table-erp th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-erp td {
    padding: 0.85rem 1rem;
    font-size: 0.86rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-erp tr:hover td {
    background-color: #f8fafc;
}

/* Responsive & Mobile Drawer */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Dedicated Print Stylesheet */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }
    .app-sidebar, .app-topbar, .btn, .no-print, .dataTables_filter, .dataTables_paginate, .dataTables_info, .dataTables_length {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .app-content {
        padding: 0 !important;
    }
    .card-erp {
        border: none !important;
        box-shadow: none !important;
    }
    .print-only {
        display: block !important;
    }
}

.print-only {
    display: none;
}

/* Thermal POS Receipt (58mm / 80mm) */
.thermal-receipt {
    width: 280px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.3;
    padding: 10px;
    background: #fff;
    color: #000;
}
.thermal-receipt-80mm {
    width: 380px;
}
.thermal-divider {
    border-top: 1px dashed #000;
    margin: 6px 0;
}
