:root {
    --color-primary: #172033;
    --color-primary-light: #222f4b;
    --color-gold: #C8A951;
    --color-gold-hover: #b3933c;
    --color-gold-light: #fbf7ee;
    --color-bg: #F7F7F5;
    --color-white: #FFFFFF;
    --color-text: #202020;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-success: #198754;
    --color-danger: #DC3545;
    --color-warning: #ffc107;
    --sidebar-width: 260px;
    --header-height: 65px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-primary);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(200, 169, 81, 0.2);
}

.sidebar .brand {
    padding: 20px 18px;
    background: linear-gradient(180deg, #111827 0%, #172033 100%);
    border-bottom: 2px solid var(--color-gold);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #d4af37 0%, #aa7c11 100%);
    color: #172033;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(200, 169, 81, 0.4);
}

.brand-text h5 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
}

.brand-text span {
    color: var(--color-gold);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.sidebar-nav {
    padding: 15px 0;
    list-style: none;
    margin: 0;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #8a96aa;
    padding: 12px 24px 6px;
    font-weight: 700;
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    color: #d1d5db;
    padding: 10px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    font-size: 16px;
    color: #9ca3af;
    width: 20px;
    text-align: center;
    transition: color 0.2s;
}

.sidebar-nav .nav-link:hover {
    color: #ffffff;
    background-color: rgba(200, 169, 81, 0.12);
}

.sidebar-nav .nav-link:hover i {
    color: var(--color-gold);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(200, 169, 81, 0.22) 0%, rgba(200, 169, 81, 0.08) 100%);
    color: #ffffff;
    border-left: 3px solid var(--color-gold);
}

.sidebar-nav .nav-link.active i {
    color: var(--color-gold);
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header / Topbar */
.top-header {
    height: var(--header-height);
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 990;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    gap: 10px;
}

.rate-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    padding: 4px 10px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 45vw;
    scrollbar-width: thin;
}

.rate-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.rate-label {
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
}

.rate-val {
    font-weight: 800;
    color: #854d0e;
    background: #fef08a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Content Container */
.content-body {
    padding: 18px 20px;
    flex: 1;
    min-width: 0;
}

}

/* Custom Cards */
.card-erp {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(23, 32, 51, 0.04);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-erp .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-erp .card-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Gold Theme Buttons */
.btn-gold {
    background: linear-gradient(135deg, #c8a951 0%, #b3933c 100%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 6px rgba(200, 169, 81, 0.35);
    transition: all 0.2s ease;
}

.btn-gold:hover, .btn-gold:focus {
    background: linear-gradient(135deg, #b3933c 0%, #9e7f29 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(200, 169, 81, 0.5);
    transform: translateY(-1px);
}

.btn-navy {
    background-color: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    border: none;
}

.btn-navy:hover {
    background-color: var(--color-primary-light);
    color: #ffffff;
}

/* KPI Metric Cards */
.metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.metric-card .metric-info h6 {
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-card .metric-info h3 {
    color: var(--color-primary);
    font-size: 24px;
    font-weight: 800;
    margin: 0;
}

.metric-card .metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.icon-gold {
    background-color: #fef9c3;
    color: #a16207;
}

.icon-navy {
    background-color: #e0e7ff;
    color: #3730a3;
}

.icon-green {
    background-color: #dcfce7;
    color: #15803d;
}

.icon-purple {
    background-color: #f3e8ff;
    color: #7e22ce;
}

/* Custom Table Styling */
.table-erp {
    margin-bottom: 0;
}

.table-erp thead th {
    background-color: #172033;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border: none;
}

.table-erp tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f5f9;
}

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

/* POS Screen Styles */
.pos-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
    width: 100%;
}

.pos-container > div:first-child {
    min-width: 0;
}

.pos-container > div:last-child {
    min-width: 320px;
}

.pos-summary-box {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    position: sticky;
    top: 75px;
    box-sizing: border-box;
    width: 100%;
}


.pos-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.pos-grand-total {
    background: #172033;
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--color-gold);
}

.pos-grand-total h4 {
    margin: 0;
    font-size: 16px;
    color: var(--color-gold);
}

.pos-grand-total h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
}

/* Keyboard Shortcut Badge */
.kbd-badge {
    background-color: #e5e7eb;
    color: #374151;
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ==========================================================================
   RESPONSIVE LAYOUT & MOBILE BREAKPOINTS
   ========================================================================== */

/* Overlay backdrop for mobile sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 995;
    transition: opacity 0.3s ease;
}

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

/* Large Screens / Tablets (< 1200px) */
@media (max-width: 1200px) {
    .pos-container {
        grid-template-columns: minmax(0, 1fr) 320px !important;
        gap: 14px;
    }
}

/* Medium Tablets & Mobile (< 992px) */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar.show {
        transform: translateX(0) !important;
    }

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

    .top-header {
        padding: 0 15px;
    }

    .rate-ticker {
        max-width: 50vw;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .content-body {
        padding: 15px;
    }

    .pos-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .pos-summary-box {
        position: static !important;
        width: 100% !important;
    }
}


/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
    .top-header {
        height: auto;
        min-height: var(--header-height);
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .rate-ticker {
        max-width: 100%;
        width: 100%;
        order: 3;
        margin-top: 4px;
        font-size: 11px;
    }

    .content-body {
        padding: 10px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-card .metric-info h3 {
        font-size: 20px;
    }

    .card-erp .card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-erp th, .table-erp td {
        padding: 8px 10px;
        font-size: 12.5px;
    }
}

/* High DPI / Touch Screen optimizations */
@media (pointer: coarse) {
    .btn, .form-control, .form-select {
        min-height: 38px;
    }
}

