/* Custom variables and theme colors */
:root {
    /* Google Font Link: Inter & Outfit */
    --font-primary: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Common animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    
    /* Status Colors */
    --color-consulting: #d97706;      /* Amber 600 */
    --bg-consulting-light: #fef3c7;   /* Amber 100 */
    --bg-consulting-dark: rgba(217, 119, 6, 0.15);
    
    --color-won: #059669;             /* Emerald 600 */
    --bg-won-light: #d1fae5;          /* Emerald 100 */
    --bg-won-dark: rgba(5, 150, 105, 0.15);
    
    --color-lost: #dc2626;            /* Red 600 */
    --bg-lost-light: #fee2e2;         /* Red 100 */
    --bg-lost-dark: rgba(220, 38, 38, 0.15);

    /* Category Colors */
    --color-tour: #3b82f6;            /* Blue 500 */
    --color-rent: #8b5cf6;            /* Violet 500 */
    --color-rescue: #f97316;          /* Orange 500 */
    --color-garage: #10b981;          /* Emerald 500 */
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-color: #f58b1f;           /* VITRACO Orange */
    --accent-hover: #d97706;           /* Amber 600 */
    --accent-rgb: 245, 139, 31;
    --shadow-glow: rgba(245, 139, 31, 0.12);
    --table-header-bg: #f8fafc;
    --table-hover-bg: #f8fafc;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-track: #f1f5f9;
    
    --status-consulting-bg: var(--bg-consulting-light);
    --status-won-bg: var(--bg-won-light);
    --status-lost-bg: var(--bg-lost-light);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --bg-tertiary: #1e293b;
    --border-color: #243049;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-color: #f58b1f;           /* VITRACO Orange */
    --accent-hover: #fa9d3b;           /* Light orange */
    --accent-rgb: 245, 139, 31;
    --shadow-glow: rgba(245, 139, 31, 0.25);
    --table-header-bg: #162238;
    --table-hover-bg: #17243c;
    --input-bg: #172237;
    --input-border: #2d3d5a;
    --scrollbar-thumb: #2d3d5a;
    --scrollbar-track: #0b0f19;
    
    --status-consulting-bg: var(--bg-consulting-dark);
    --status-won-bg: var(--bg-won-dark);
    --status-lost-bg: var(--bg-lost-dark);
}

/* Base Reset & Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

button, input, select, textarea {
    font-family: var(--font-primary);
    outline: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

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

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.sidebar-logo i {
    font-size: 28px;
    color: var(--accent-color);
    filter: drop-shadow(0 0 8px var(--shadow-glow));
}

.sidebar-logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent-color), #ff7a00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 24px;
    padding-left: 8px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
}

.menu-item a i {
    font-size: 20px;
    transition: var(--transition-fast);
}

.menu-item a:hover {
    color: var(--accent-color);
    background-color: var(--bg-tertiary);
}

.menu-item.active a {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    box-shadow: 0 4px 14px var(--shadow-glow);
}

.menu-item.active a i {
    color: #ffffff;
}

/* Sidebar Footer / Brand info */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.sidebar-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-footer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

/* Header Component */
.main-header {
    height: 72px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: var(--transition-normal);
}

.header-title-area h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-title-area p {
    font-size: 13px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Role Selector Tool */
.role-badge-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.role-badge-selector span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.role-select {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding-right: 4px;
}

.role-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.role-icon.admin { background-color: var(--color-won); }
.role-icon.editor { background-color: var(--color-consulting); }
.role-icon.viewer { background-color: var(--text-muted); }

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px var(--shadow-glow);
}

/* User Info Info */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #ff7a00);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main App Body Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Dynamic view sections */
.view-section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view-section.active-view {
    display: block;
}

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

/* Page Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.section-actions {
    display: flex;
    gap: 12px;
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 14px var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--color-lost);
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background-color: var(--color-lost);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--border-radius-sm);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Dashboard Summary Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--card-accent, var(--accent-color));
}

.metric-card.m-won { --card-accent: var(--color-won); }
.metric-card.m-consulting { --card-accent: var(--color-consulting); }
.metric-card.m-lost { --card-accent: var(--color-lost); }

.metric-content h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px;
    line-height: 1;
}

.metric-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-subtext span.trend-up {
    color: var(--color-won);
    font-weight: 600;
}

.metric-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-accent, var(--accent-color));
    transition: var(--transition-fast);
}

.metric-card:hover .metric-icon-wrap {
    background-color: var(--card-accent, var(--accent-color));
    color: #ffffff;
}

/* Sheets/Tabs Layout */
.sheets-tabs-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.sheets-tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 0 16px;
    overflow-x: auto;
}

.sheet-tabs-list {
    display: flex;
    list-style: none;
}

.sheet-tab {
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sheet-tab i {
    font-size: 16px;
}

.sheet-tab:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.sheet-tab.active-tab {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.sheet-tab-pill {
    font-size: 11px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sheet-tab.active-tab .sheet-tab-pill {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--accent-color);
}

/* Sheets Toolbar (Search & Filter) */
.sheets-toolbar {
    padding: 16px 24px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.search-input-wrap {
    position: relative;
    min-width: 240px;
    max-width: 320px;
    width: 100%;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.search-input-wrap input {
    width: 100%;
    height: 40px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    padding: 0 16px 0 40px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-input-wrap input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

.filter-select-wrap {
    position: relative;
    min-width: 180px;
}

.filter-select {
    width: 100%;
    height: 40px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    padding: 0 36px 0 14px;
    color: var(--text-primary);
    font-size: 14px;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

.filter-select-wrap::after {
    content: '\ebad'; /* Boxicons down arrow */
    font-family: 'boxicons';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 16px;
}

/* Premium Customer Table styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    background-color: var(--bg-secondary);
}

.customer-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 900px;
}

.customer-table th {
    background-color: var(--table-header-bg);
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.customer-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    vertical-align: middle;
}

.customer-table tbody tr {
    transition: var(--transition-fast);
}

.customer-table tbody tr:hover {
    background-color: var(--table-hover-bg);
}

.customer-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Column Specifics */
.td-name {
    font-weight: 600;
    color: var(--text-primary);
}

.td-phone {
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.td-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.td-sale-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.td-sale-badge i {
    font-size: 14px;
    color: var(--accent-color);
}

/* Status badging */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.consulting {
    color: var(--color-consulting);
    background-color: var(--status-consulting-bg);
}
.status-badge.won {
    color: var(--color-won);
    background-color: var(--status-won-bg);
}
.status-badge.lost {
    color: var(--color-lost);
    background-color: var(--status-lost-bg);
}

.status-badge i {
    font-size: 8px;
}

/* Inline Form Elements for Editor mode */
.table-inline-input {
    width: 100%;
    padding: 6px 10px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-fast);
}

.table-inline-input:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-secondary);
}

.table-inline-select {
    padding: 6px 10px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.table-inline-select.consulting {
    color: var(--color-consulting);
}
.table-inline-select.won {
    color: var(--color-won);
}
.table-inline-select.lost {
    color: var(--color-lost);
}

/* Empty State Styling */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
    max-width: 320px;
    margin-bottom: 20px;
}

/* Actions Column styling */
.td-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: var(--bg-tertiary);
}

.action-btn.delete:hover {
    color: var(--color-lost);
    border-color: var(--color-lost);
    background-color: rgba(220, 38, 38, 0.05);
}

.action-btn.save:hover {
    color: var(--color-won);
    border-color: var(--color-won);
    background-color: rgba(5, 150, 105, 0.05);
}

/* Cards & Layout for Category Section */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.category-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

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

.category-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.category-card.cat-tour .category-icon { background-color: rgba(59, 130, 246, 0.1); color: var(--color-tour); }
.category-card.cat-rent .category-icon { background-color: rgba(139, 92, 246, 0.1); color: var(--color-rent); }
.category-card.cat-rescue .category-icon { background-color: rgba(249, 115, 22, 0.1); color: var(--color-rescue); }
.category-card.cat-garage .category-icon { background-color: rgba(16, 185, 129, 0.1); color: var(--color-garage); }

.category-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-stats-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background-color: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--border-radius-md);
    text-align: center;
}

.category-stat-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dynamic Add Category Section */
.card-form {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.form-group-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group.margin-zero {
    margin-bottom: 0;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    height: 44px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

textarea.form-control {
    height: 100px;
    padding: 12px 14px;
    resize: none;
}

/* Reports/Charts Grid */
.reports-toolbar {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.report-date-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-date-filter input {
    height: 40px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    padding: 0 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.chart-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.chart-card-header {
    margin-bottom: 24px;
}

.chart-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-card-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-container {
    position: relative;
    flex: 1;
    width: 100%;
}

/* Modal Popup Window */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-backdrop.modal-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-backdrop.modal-open .modal-box {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
}

.modal-close-btn:hover {
    color: var(--color-lost);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--table-header-bg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform var(--transition-normal);
    min-width: 280px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success { border-left-color: var(--color-won); }
.toast-error { border-left-color: var(--color-lost); }
.toast-info { border-left-color: var(--accent-color); }

.toast i {
    font-size: 20px;
}
.toast-success i { color: var(--color-won); }
.toast-error i { color: var(--color-lost); }
.toast-info i { color: var(--accent-color); }

.toast-content {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Responsive breakdowns */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-logo {
        margin-bottom: 16px;
    }
    
    .menu-section-label {
        margin-top: 12px;
        margin-bottom: 6px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .menu-item a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .main-header {
        padding: 0 16px;
        flex-direction: column;
        height: auto;
        gap: 12px;
        padding: 16px;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: space-between;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .sheets-toolbar {
        padding: 12px;
    }
    
    .toolbar-filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .search-input-wrap, .filter-select-wrap {
        max-width: none;
        min-width: 0;
        width: 100%;
    }
}

/* Custom source-pill elements for report summary checkbox tags */
.source-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-pill {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.source-pill i {
    font-size: 14px;
    transition: var(--transition-fast);
}

.source-pill.active {
    background-color: rgba(245, 139, 31, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 600;
}

.source-pill:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.source-pill.active:hover {
    background-color: rgba(245, 139, 31, 0.15);
    color: var(--accent-color);
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    flex-wrap: wrap;
    gap: 12px;
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.pagination-btn i {
    font-size: 18px;
}

.pagination-btn:hover {
    color: #ffffff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.pagination-btn.active {
    color: #ffffff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Login Gate Style */
.login-gate-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    z-index: 9999;
}

.login-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg), 0 0 40px var(--shadow-glow);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition-normal);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.login-logo img {
    max-height: 48px;
    filter: drop-shadow(0 0 8px rgba(245, 139, 31, 0.25));
}

.login-card h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.toggle-password-icon {
    transition: var(--transition-fast);
}

.toggle-password-icon:hover {
    color: var(--accent-color) !important;
}


