﻿:root {
    /* Modern Deep Dark Theme */
    --bg-base: #0b1121;
    --bg: radial-gradient(circle at top right, #1e293b, #0b1121);
    --card: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --primary-hover: #60a5fa;
    --border: rgba(255, 255, 255, 0.1);
    --zebra: rgba(255, 255, 255, 0.02);
    --zebra-hover: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(15, 23, 42, 0.5);
    --glass-blur: blur(16px);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] {
    /* Defined Light Theme */
    --bg-base: #e2e8f0;
    --bg: radial-gradient(circle at top right, #f8fafc, #e2e8f0);
    --card: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.08);
    --text: #0f172a;
    --text-muted: #475569;
    --primary: #1d4ed8;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    --primary-hover: #1e40af;
    --border: rgba(0, 0, 0, 0.1);
    --zebra: rgba(0, 0, 0, 0.03);
    --zebra-hover: rgba(0, 0, 0, 0.06);
    --input-bg: rgba(255, 255, 255, 0.8);
    --glass-blur: blur(16px);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    background: var(--bg);
    background-color: var(--bg-base);
    background-attachment: fixed;
    color: var(--text);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
.title {
    letter-spacing: -0.02em;
    font-weight: 800;
}

/* Sidebar & Navigation */
.sidebar {
    width: 180px;
    margin: 20px 0 20px 20px;
    border-radius: 20px;
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: 18px;
    margin-bottom: 35px;
    color: var(--primary);
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-item:hover {
    background: var(--zebra-hover);
    color: var(--text);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
    font-weight: 700;
}

.nav-item.active i {
    color: white;
}

.nav-item i {
    opacity: 0.8;
    transition: color 0.2s;
}

.submenu {
    padding-left: 35px;
    display: none;
    margin-bottom: 12px;
}

.submenu.open {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-item {
    padding: 10px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.sub-item:hover {
    color: var(--text);
    transform: translateX(4px);
}

.sub-item i {
    width: 14px;
    opacity: 0.7;
}

.theme-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: auto;
    cursor: pointer;
    border-radius: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-blur);
}

.theme-switch:hover {
    background: var(--zebra-hover);
    border-color: var(--card-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

#theme-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--bg-base);
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#theme-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    opacity: 0.9;
}

/* Main Views */
.main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.main::-webkit-scrollbar {
    width: 8px;
}

.main::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}

.view-section {
    display: none;
    padding-bottom: 150px;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    background: var(--text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

[data-theme="dark"] .title {
    background: linear-gradient(to right, #ffffff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    overflow: visible;
    margin-bottom: 50px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 10;
}

.data-table th {
    text-align: left;
    padding: 18px 20px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.data-table td {
    padding: 18px 20px;
    font-size: 14.5px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--zebra-hover);
}

.data-table th:first-child {
    border-top-left-radius: 20px;
}

.data-table th:last-child {
    border-top-right-radius: 20px;
}

.data-table tr:last-child td:first-child {
    border-bottom-left-radius: 20px;
}

.data-table tr:last-child td:last-child {
    border-bottom-right-radius: 20px;
}

/* Inputs and Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.search-container input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1.5px solid rgba(148, 163, 184, 0.4);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.form-group input:focus,
.form-group select:focus,
.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: var(--bg-base);
}

.item-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    box-sizing: border-box;
}

.item-input::placeholder {
    color: #94a3b8;
    font-weight: normal;
}

/* Search Container inside manage view */
.search-container {
    display: flex;
    align-items: center;
    background: var(--card);
    padding: 5px 15px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    color: var(--text);
    border: 1px solid var(--card-border);
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
    background: var(--zebra-hover);
    transform: translateY(-2px);
    border-color: var(--border);
}

/* Modals & Login Box */
.login-box {
    background: var(--card);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 50px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--card-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
    animation: slowPulse 10s ease-in-out infinite alternate;
}

@keyframes slowPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

#login-screen {
    min-height: 100vh;
    overflow-y: auto;
    padding: 40px 20px !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: modalFade 0.3s ease forwards;
}

@keyframes modalFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    padding: 40px;
    border-radius: 24px;
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
    to {
        transform: translateY(0) scale(1);
    }
}

/* Action Menu */
.action-cell {
    position: relative;
    overflow: visible !important;
}

.action-menu {
    position: absolute;
    right: 0;
    top: 35px;
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    width: 180px;
    z-index: 9999 !important;
    display: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    transform-origin: top right;
    animation: dropDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#pagination-controls-dash,
#pagination-controls-list {
    position: relative;
    z-index: 1;
    /* Drop behind the action menu */
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.action-item {
    padding: 12px 20px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: var(--text);
}

.action-item:hover {
    background: var(--zebra-hover);
    color: var(--primary-hover);
}

/* Badges */
.status-select {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    border: none;
    outline: none;
    cursor: pointer;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background: var(--input-bg);
    color: var(--text) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

option {
    background: var(--card);
    /* Ensure drop-down options are readable */
    color: var(--text);
}

.status-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.status-REQUESTED {
    background: linear-gradient(135deg, #64748b, #475569);
}

.status-IN_TRANSIT {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.status-ARRIVED {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-CLEARED {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.status-DELIVERED {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.status-BILLED {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.status-CLOSED {
    background: linear-gradient(135deg, #475569, #334155);
    color: #ffffff !important;
}

.status-REQUESTED,
.status-IN_TRANSIT,
.status-ARRIVED,
.status-CLEARED,
.status-DELIVERED,
.status-BILLED,
.status-CLOSED {
    color: #ffffff !important;
}

.doc-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.doc-badge-zero {
    background: #64748b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    opacity: 0.8;
}

/* Invoices & Printing */
.invoice-wrapper {
    background: #ffffff;
    color: #0f172a;
    padding: 60px;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.inv-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 40px;
}

.inv-items-table th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    border: 1px solid #e2e8f0;
    text-transform: uppercase;
}

.inv-items-table td {
    padding: 15px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}

.inv-totals-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
}

.inv-totals td {
    padding: 10px 20px;
    text-align: right;
    font-size: 15px;
}

.inv-totals tr td:first-child {
    font-weight: 800;
    color: #475569;
}

.inv-footer {
    margin-top: 60px;
    font-size: 13px;
    color: #64748b;
    border-top: 2px solid #e2e8f0;
    padding-top: 30px;
    line-height: 1.8;
}

@media print {
    .print-hide {
        display: none !important;
    }

    body,
    .main,
    #app-container {
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
        display: block !important;
    }

    .invoice-wrapper {
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
    }
}

/* RTL Support */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .sidebar {
    margin: 20px 20px 20px 0;
}

html[dir="rtl"] .main {
    text-align: right;
}

html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td {
    text-align: right;
}

html[dir="rtl"] .header {
    flex-direction: row;
}

html[dir="rtl"] .action-menu {
    right: auto;
    left: 0;
    transform-origin: top left;
}

html[dir="rtl"] .submenu {
    padding-left: 0;
    padding-right: 35px;
}

html[dir="rtl"] .stat-card {
    text-align: right;
}

html[dir="rtl"] .btn-primary i,
html[dir="rtl"] .btn-secondary i {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] .nav-item i {
    margin-right: 0;
    margin-left: 12px;
}

html[dir="rtl"] .search-container i {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .form-group {
    text-align: right;
}

/* Watermark Styles */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

#quote-gen,
#invoice-gen {
    position: relative;
    z-index: 1;
}

/* AI Widget */
#hana-ai-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    pointer-events: none;
}

#ai-chat-panel {
    width: 380px;
    height: 550px;
    background-color: var(--card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

#ai-chat-panel:not(.ai-panel-hidden) {
    pointer-events: auto;
}

.ai-panel-hidden {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    pointer-events: none;
}

.ai-panel-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.ai-chat-history {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-chat-history::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-history::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
}

.message {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.system-message {
    background-color: var(--card);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.user-message {
    background: var(--primary-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.ai-input-area {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

#ai-chat-input {
    flex-grow: 1;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    color: var(--text);
    border-radius: 12px;
    outline: none;
    transition: 0.3s;
}

#ai-chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#ai-chat-send {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

#ai-chat-send:hover {
    transform: scale(1.05);
}

#ai-toggle-btn {
    pointer-events: auto;
    background: var(--primary-gradient) !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5) !important;
}

/* Mobile Responsiveness */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--card);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: auto;
    }

    .main {
        padding: 15px;
        width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-left {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 220px;
        margin: 0;
        border-radius: 0 20px 20px 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100vh;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
    }

    .overlay.active {
        display: block;
    }
}