/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
:root {
    --bg-body: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --gold: #d4af37;
    --danger: #ef4444;
    --success: #10b981;
    --primary: #3b82f6;
    --warning: #f59e0b;
}

/* Dark theme variables */
.dark-theme {
    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   2. UTILITIES
   ========================================= */
.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

.mt-1 {
    margin-top: 5px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mb-2 {
    margin-bottom: 10px;
}

.flex {
    display: flex;
    gap: 10px;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.text-green {
    color: var(--success);
    font-weight: bold;
}

.text-red {
    color: var(--danger);
    font-weight: bold;
}

.text-warning {
    color: var(--warning);
}

.cursor-pointer {
    cursor: pointer;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 12px;
}

.font-bold {
    font-weight: bold;
}

.rounded {
    border-radius: 4px;
}

.rounded-lg {
    border-radius: 8px;
}

/* =========================================
   3. UI COMPONENTS (Loader, Toast)
   ========================================= */
#loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 11000;
    display: flex;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

#custom-toast.show {
    opacity: 1;
    visibility: visible;
    top: 40px;
}

.toast-icon {
    width: 30px;
    height: 30px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon.error {
    background: var(--danger);
}

/* =========================================
   4. LOGIN MODAL ENHANCED
   ========================================= */
#loginModal {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-content {
    background: white;
    width: 90%;
    max-width: 420px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-logo {
    font-size: 32px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8fafc;
}

.login-input:focus {
    border-color: var(--gold);
    background: white;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    outline: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin: 15px 0 25px;
    font-size: 14px;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--gold);
    cursor: pointer;
}

.login-btn {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #b8941f, #9c7e1a);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.login-footer {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

/* =========================================
   5. SIDEBAR NAVIGATION
   ========================================= */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.brand {
    padding: 25px 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-panel {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.user-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-val {
    color: white;
    font-weight: bold;
    margin-top: 5px;
    font-size: 15px;
}

.nav-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    padding: 14px 20px;
    text-align: left;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding-left: 25px;
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--gold);
    font-weight: bold;
    border-right: 4px solid var(--gold);
}

.nav-btn i {
    width: 20px;
    text-align: center;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 20px;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* =========================================
   6. MAIN CONTENT AREA & SECTIONS
   ========================================= */
.main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: block;
    position: relative;
}

.section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.rate-card {
    background: white;
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dark-theme .rate-card {
    background: var(--bg-card);
    border-color: var(--gold);
}

.rate-card input {
    border: none;
    width: 100px;
    font-weight: bold;
    font-size: 16px;
    outline: none;
    text-align: right;
    background: transparent;
}

.rate-label {
    font-size: 14px;
    color: var(--text-main);
}

.rate-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    min-width: 80px;
    text-align: right;
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

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

.row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.col {
    flex: 1;
    min-width: 200px;
}

/* =========================================
   7. INPUTS & BUTTONS
   ========================================= */
label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    transition: border 0.3s;
    background: var(--bg-card);
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

input:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.dark-theme input:disabled {
    background-color: #334155;
    color: #64748b;
}

button {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 600;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: black;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    width: 100%;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #b8941f, #9c7e1a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.btn-blue {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
}

.btn-blue:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-red {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
}

.btn-red:hover {
    background: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-green {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
}

.btn-green:hover {
    background: #0da271;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
}

.btn-edit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-bday {
    background: #FF6B6B;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}

.btn-anni {
    background: #4ECDC4;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}

.btn-wa {
    background: #25D366;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Refresh Button */
.btn-refresh {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* =========================================
   8. TOGGLE SWITCH
   ========================================= */
.toggle-switch {
    display: flex;
    background: #e2e8f0;
    border-radius: 50px;
    padding: 4px;
    width: fit-content;
}

.dark-theme .toggle-switch {
    background: #334155;
}

.toggle-option {
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    background: transparent;
    color: #64748b;
}

.toggle-option.active {
    background: rgb(38, 178, 127);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: white;
}

/* =========================================
   9. DATA TABLES
   ========================================= */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
    font-size: 13px;
}

th {
    background: #1e293b;
    color: white;
    padding: 14px 12px;
    text-align: center;
    position: sticky;
    top: 0;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.dark-theme th {
    background: #334155;
}

th:hover {
    background: #334155;
}

.dark-theme th:hover {
    background: #475569;
}

th.sorted-asc::after {
    content: ' ↑';
    font-size: 10px;
    opacity: 0.8;
}

th.sorted-desc::after {
    content: ' ↓';
    font-size: 10px;
    opacity: 0.8;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
    background: var(--bg-card);
}

tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-theme tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.gold-row {
    border-left: 4px solid var(--gold);
}

.silver-row {
    border-left: 4px solid #94a3b8;
}

.diamond-row {
    border-left: 4px solid #3b82f6;
}

.melted-row {
    background-color: rgba(209, 213, 219, 0.3) !important;
    color: #6b7280 !important;
}

.melted-row td {
    opacity: 0.7;
}

.dark-theme .melted-row {
    background-color: rgba(75, 85, 99, 0.3) !important;
    color: #9ca3af !important;
}

.non-melted-row {
    background-color: var(--bg-card);
}

/* =========================================
   10. DAY BOOK GRID
   ========================================= */
.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.db-card {
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.db-card:hover {
    transform: translateY(-5px);
}

.db-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-val {
    font-size: 26px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =========================================
   11. CART ITEMS
   ========================================= */
.cart-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.dark-theme .cart-item {
    background: #334155;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
}

.cart-item-title {
    font-weight: bold;
    color: var(--text-main);
}

.cart-total {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid var(--border);
}

.dark-theme .cart-total {
    background: #334155;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.dark-theme .total-row {
    border-bottom: 1px solid #475569;
}

.total-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 16px;
    color: var(--text-main);
}

/* =========================================
   12. MODALS
   ========================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f1f5f9;
    color: var(--danger);
}

.dark-theme .close-btn:hover {
    background: #334155;
}

/* =========================================
13. INVOICE STYLES - UPDATED FOR SAMPLE FORMAT
========================================= */
#invoiceContent {
    width: 190mm !important; /* Fixed width */
    min-height: 277mm !important; /* Fixed height */
    background: white !important;
    color: black !important;
    font-family: 'Arial', sans-serif !important;
    padding: 10mm 15mm !important;
    box-sizing: border-box !important;
    position: relative !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.1) !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
}

/* Force all invoice content to stay within bounds */
.invoice-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Make tables fit perfectly */
.invoice-container table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

/* Ensure table cells don't overflow */
.invoice-container th,
.invoice-container td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
}

/* Even more compact column widths */
.invoice-container table th:nth-child(1), 
.invoice-container table td:nth-child(1) {
    width: 4% !important; /* S/No */
    min-width: 20px;
}

.invoice-container table th:nth-child(2), 
.invoice-container table td:nth-child(2) {
    width: 35% !important; /* Description */
    text-align: left;
    padding-left: 4px !important;
}

.invoice-container table th:nth-child(3), 
.invoice-container table td:nth-child(3) {
    width: 8% !important; /* HSN */
    min-width: 40px;
}

.invoice-container table th:nth-child(4), 
.invoice-container table td:nth-child(4) {
    width: 8% !important; /* Qty */
    min-width: 40px;
}

.invoice-container table th:nth-child(5), 
.invoice-container table td:nth-child(5) {
    width: 10% !important; /* Rate */
    min-width: 50px;
}

.invoice-container table th:nth-child(6), 
.invoice-container table td:nth-child(6) {
    width: 15% !important; /* Amount */
    min-width: 60px;
}

/* Compact headers and text */
.invoice-header {
    text-align: center;
    margin-bottom: 8px !important;
}

.gstin-header {
    font-size: 11px !important;
    font-weight: bold;
    margin-bottom: 3px !important;
}

.shop-name {
    font-size: 14px !important;
    font-weight: bold;
    text-decoration: underline;
    margin: 8px 0 4px 0 !important;
}

.shop-address {
    font-size: 10px !important;
    margin-bottom: 3px !important;
    line-height: 1.1 !important;
}

/* Compact contact row */
.contact-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px !important;
    font-size: 9px !important;
}

/* Compact customer details */
.customer-details {
    margin: 8px 0 !important;
    font-size: 9px !important;
}

.customer-details div {
    margin-bottom: 1px !important;
}

/* Compact totals */
.invoice-totals {
    width: 100%;
    margin: 8px 0 !important;
    font-size: 9px !important;
}

.invoice-totals tr td {
    border: none;
    padding: 2px 0 !important;
}

/* Compact payment section */
.payment-signature {
    display: flex;
    width: 100%;
    margin: 10px 0 !important;
    font-size: 9px !important;
}

/* Compact bank details */
.bank-details {
    margin: 8px 0 !important;
    font-size: 9px !important;
}

/* Compact terms */
.terms-conditions {
    font-size: 8px !important;
    margin: 8px 0 !important;
}

/* Amount in words compact */
.amount-words {
    font-size: 9px !important;
    padding: 4px !important;
    margin: 8px 0 !important;
}

@media print {
    body {
        display: none;
    }
}


/* =========================================
   14. SCRAP SUMMARY CARDS
   ========================================= */
.scrap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.scrap-card {
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.scrap-card:hover {
    transform: translateY(-5px);
}

.scrap-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scrap-val {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.scrap-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

/* =========================================
   15. STOCK SUMMARY CARDS
   ========================================= */
.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stock-summary-card {
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stock-summary-card:hover {
    transform: translateY(-5px);
}

.stock-summary-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-summary-val {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.stock-summary-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

/* =========================================
   16. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }

    .main {
        padding: 15px;
    }
}

@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }

    .brand {
        width: 100%;
        padding: 15px;
    }

    .nav-btn {
        padding: 10px 15px;
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .main {
        padding: 10px;
    }

    .top-bar {
        flex-direction: column;
        gap: 15px;
    }

    .rate-card {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .col {
        width: 100%;
    }

    .db-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .login-content {
        padding: 30px 20px;
    }
}

@media print {

    .no-print,
    .sidebar,
    .top-bar,
    button,
    #loader,
    #custom-toast,
    .modal-header,
    .close-btn,
    .btn-refresh {
        display: none !important;
    }

    body {
        background: white !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main {
        padding: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        display: block !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .invoice-a4 {
        border: none !important;
        margin: 0 !important;
        width: 210mm !important;
        padding: 0 !important;
        min-height: 297mm !important;
        box-shadow: none !important;
    }

    .modal {
        position: static !important;
        background: white !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        background: white !important;
    }

    #invoiceModal {
        display: flex !important;
    }

    #invoiceContent {
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* =========================================
   17. CUSTOM SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dark-theme ::-webkit-scrollbar-track {
    background: #334155;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: #64748b;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.text-muted {
    color: #64748b;
    font-size: 11px;
}