/**
 * AraInvoice - Main Styles
 * Complete application styling
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CSS VARIABLES - THEME SYSTEM
   ============================================ */

:root {
    /* Light Theme (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #3b82f6;

    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);

    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus-border: #3b82f6;
    --input-focus-ring: rgba(59, 130, 246, 0.1);

    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(102, 126, 234, 0.3);

    --topbar-bg: #ffffff;
    --topbar-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);

    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #065f46;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;

    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #1e40af;

    --table-header-bg: #f8fafc;
    --table-row-hover: #f8fafc;
    --table-border: #e2e8f0;

    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-bg: #ffffff;

    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Dark Theme */
[data-theme="dark"],
.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #1e293b;

    --border-color: #334155;
    --border-light: #1e293b;
    --border-focus: #3b82f6;

    --card-bg: #1e293b;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);

    --input-bg: #1e293b;
    --input-border: #475569;
    --input-focus-border: #3b82f6;
    --input-focus-ring: rgba(59, 130, 246, 0.2);

    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --sidebar-text: #f1f5f9;
    --sidebar-text-muted: rgba(241, 245, 249, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.05);
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(102, 126, 234, 0.4);

    --topbar-bg: #1e293b;
    --topbar-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: rgba(59, 130, 246, 0.2);

    --success: #34d399;
    --success-light: rgba(16, 185, 129, 0.2);
    --success-dark: #10b981;

    --warning: #fbbf24;
    --warning-light: rgba(245, 158, 11, 0.2);
    --warning-dark: #f59e0b;

    --danger: #f87171;
    --danger-light: rgba(239, 68, 68, 0.2);
    --danger-dark: #ef4444;

    --info: #60a5fa;
    --info-light: rgba(59, 130, 246, 0.2);
    --info-dark: #3b82f6;

    --table-header-bg: #334155;
    --table-row-hover: #334155;
    --table-border: #475569;

    --modal-overlay: rgba(0, 0, 0, 0.7);
    --modal-bg: #1e293b;

    --scrollbar-track: #1e293b;
    --scrollbar-thumb: #475569;
    --scrollbar-thumb-hover: #64748b;
}

/* Apply theme variables to body */
body.light-theme {
    background: var(--bg-primary);
}

body.dark-theme {
    background: var(--bg-primary);
}

/* Dark theme specific overrides for app container */
.dark-theme .app-container {
    background: var(--bg-primary);
}

.dark-theme .main-content {
    background: var(--bg-primary);
}

.dark-theme .sidebar {
    background: var(--sidebar-bg);
}

/* Dark theme form inputs */
.dark-theme input,
.dark-theme textarea,
.dark-theme select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

.dark-theme input:focus,
.dark-theme textarea:focus,
.dark-theme select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: var(--text-tertiary);
}

/* Dark theme tables */
.dark-theme table {
    border-color: var(--table-border);
}

.dark-theme th {
    background-color: var(--table-header-bg);
    color: var(--text-secondary);
    border-color: var(--table-border);
}

.dark-theme td {
    border-color: var(--table-border);
    color: var(--text-primary);
}

.dark-theme tr:hover {
    background-color: var(--table-row-hover);
}

/* Dark theme cards */
.dark-theme .card,
.dark-theme [class*="card"] {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Dark theme modals */
.dark-theme .modal-content,
.dark-theme [class*="modal"] > div {
    background-color: var(--modal-bg);
}

/* Dark theme scrollbars */
.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark-theme ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============================================
   DARK THEME - DASHBOARD & SCREEN OVERRIDES
   ============================================ */

/* Dashboard stat cards */
.dark-theme .stat-card,
.dark-theme .section-stat-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .stat-card:hover {
    border-color: var(--primary);
}

.dark-theme .stat-value {
    color: var(--text-primary);
}

.dark-theme .stat-label {
    color: var(--text-secondary);
}

/* Chart cards */
.dark-theme .chart-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Invoice status section */
.dark-theme .invoice-status-section {
    background: var(--bg-tertiary);
}

.dark-theme .invoice-status-title {
    color: var(--text-secondary);
}

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

.dark-theme .status-label {
    color: var(--text-secondary);
}

.dark-theme .status-value {
    color: var(--text-primary);
}

/* Dashboard sections */
.dark-theme .dashboard-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .dashboard-section-title {
    color: var(--text-primary);
}

/* Form inputs and selects */
.dark-theme .form-input,
.dark-theme .form-select,
.dark-theme input[type="text"],
.dark-theme input[type="email"],
.dark-theme input[type="password"],
.dark-theme input[type="number"],
.dark-theme input[type="date"],
.dark-theme textarea,
.dark-theme select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

.dark-theme .form-input:focus,
.dark-theme .form-select:focus,
.dark-theme input:focus,
.dark-theme textarea:focus,
.dark-theme select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

/* Labels */
.dark-theme label {
    color: var(--text-primary);
}

/* MyCompany screen */
.dark-theme .mycompany-container {
    background: var(--bg-primary);
}

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

.dark-theme .mycompany-section h2,
.dark-theme .mycompany-section h3 {
    color: var(--text-primary);
}

.dark-theme .mycompany-input {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

.dark-theme .mycompany-input:focus {
    border-color: var(--input-focus-border);
}

.dark-theme .mycompany-logo-preview {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Generate screen / Business Partners */
.dark-theme .generate-container,
.dark-theme .partners-container,
.dark-theme .items-container {
    background: var(--bg-primary);
}

.dark-theme .generate-section,
.dark-theme .partners-section,
.dark-theme .items-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Tables */
.dark-theme table {
    background: var(--card-bg);
}

.dark-theme thead tr {
    background: var(--table-header-bg);
}

.dark-theme th {
    color: var(--text-secondary);
    border-color: var(--table-border);
}

.dark-theme td {
    color: var(--text-primary);
    border-color: var(--table-border);
}

.dark-theme tbody tr:hover {
    background: var(--table-row-hover);
}

/* Modals */
.dark-theme .modal-overlay {
    background: var(--modal-overlay);
}

.dark-theme .modal-content,
.dark-theme .modal-container,
.dark-theme [class*="modal"] > div:not(.modal-overlay) {
    background: var(--modal-bg);
    border-color: var(--border-color);
}

.dark-theme .modal-header {
    border-color: var(--border-color);
}

.dark-theme .modal-header h2,
.dark-theme .modal-header h3 {
    color: var(--text-primary);
}

.dark-theme .modal-body {
    color: var(--text-primary);
}

.dark-theme .modal-footer {
    border-color: var(--border-color);
}

/* Buttons - secondary/outline */
.dark-theme .btn-secondary,
.dark-theme .btn-outline,
.dark-theme button[class*="secondary"],
.dark-theme button[class*="outline"] {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .btn-secondary:hover,
.dark-theme .btn-outline:hover {
    background: var(--bg-hover);
}

/* Tabs */
.dark-theme .tab,
.dark-theme .tab-item,
.dark-theme [class*="tab"]:not(.table) {
    color: var(--text-secondary);
}

.dark-theme .tab.active,
.dark-theme .tab-item.active,
.dark-theme [class*="tab"].active:not(.table) {
    color: var(--primary);
    border-color: var(--primary);
}

/* Review screen */
.dark-theme .review-container {
    background: var(--bg-primary);
}

.dark-theme .review-panel,
.dark-theme .review-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Approval screen */
.dark-theme .approval-container {
    background: var(--bg-primary);
}

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

/* History screen */
.dark-theme .history-container {
    background: var(--bg-primary);
}

.dark-theme .history-card,
.dark-theme .history-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Payments screen */
.dark-theme .payments-container {
    background: var(--bg-primary);
}

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

/* Credit notes screen */
.dark-theme .credit-notes-container {
    background: var(--bg-primary);
}

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

/* Tickets screen */
.dark-theme .tickets-container {
    background: var(--bg-primary);
}

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

/* Settings/User management */
.dark-theme .settings-container {
    background: var(--bg-primary);
}

.dark-theme .settings-section,
.dark-theme .user-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Dropdown menus */
.dark-theme .dropdown-menu,
.dark-theme [class*="dropdown-menu"] {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-theme .dropdown-item,
.dark-theme [class*="dropdown-item"] {
    color: var(--text-primary);
}

.dark-theme .dropdown-item:hover,
.dark-theme [class*="dropdown-item"]:hover {
    background: var(--bg-hover);
}

/* Tooltips */
.dark-theme .tooltip {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Empty states */
.dark-theme .empty-state {
    color: var(--text-secondary);
}

/* Badges */
.dark-theme .badge {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Alerts */
.dark-theme .alert {
    border-color: var(--border-color);
}

/* Pagination */
.dark-theme .pagination button {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .pagination button:hover {
    background: var(--bg-hover);
}

.dark-theme .pagination button.active {
    background: var(--primary);
    color: white;
}

/* GenerateScreen / PDF Form specific */
.dark-theme .generate-form,
.dark-theme .pdf-form,
.dark-theme .invoice-form {
    background: var(--card-bg);
}

.dark-theme .form-section,
.dark-theme .form-group,
.dark-theme .input-group {
    background: transparent;
}

.dark-theme .form-header,
.dark-theme .section-header {
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Item rows in invoice */
.dark-theme .item-row,
.dark-theme .item-row-header {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.dark-theme .item-row input,
.dark-theme .item-row select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}

/* Customer/Partner forms */
.dark-theme .customer-form,
.dark-theme .partner-form,
.dark-theme .message-form {
    background: var(--card-bg);
}

/* Radio buttons and checkboxes containers */
.dark-theme .radio-group,
.dark-theme .checkbox-group {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Help text and descriptions */
.dark-theme .help-text,
.dark-theme .description,
.dark-theme .hint {
    color: var(--text-secondary);
}

/* Preview sections */
.dark-theme .preview-section,
.dark-theme .preview-container {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Override common inline styles with !important for dark mode */
.dark-theme [style*="background: #f8fafc"],
.dark-theme [style*="background:#f8fafc"],
.dark-theme [style*="backgroundColor: '#f8fafc'"] {
    background: var(--bg-tertiary) !important;
}

.dark-theme [style*="background: #fff"],
.dark-theme [style*="background:#fff"],
.dark-theme [style*="background: white"],
.dark-theme [style*="backgroundColor: '#fff'"],
.dark-theme [style*="backgroundColor: 'white'"] {
    background: var(--card-bg) !important;
}

.dark-theme [style*="color: #1e293b"],
.dark-theme [style*="color:#1e293b"] {
    color: var(--text-primary) !important;
}

.dark-theme [style*="color: #64748b"],
.dark-theme [style*="color:#64748b"] {
    color: var(--text-secondary) !important;
}

/* ============================================
   DARK THEME - COMPREHENSIVE OVERRIDES
   These use !important to override inline styles
   ============================================ */

/* Global white background override */
.dark-theme .main-content > div,
.dark-theme .main-content > div > div {
    background-color: var(--bg-primary);
}

/* All card-like containers */
.dark-theme [class*="card"],
.dark-theme [class*="Card"],
.dark-theme [class*="section"],
.dark-theme [class*="Section"],
.dark-theme [class*="container"],
.dark-theme [class*="Container"],
.dark-theme [class*="panel"],
.dark-theme [class*="Panel"],
.dark-theme [class*="box"],
.dark-theme [class*="Box"] {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

/* Dashboard specific */
.dark-theme .stat-card,
.dark-theme .chart-card,
.dark-theme .section-stat-card,
.dark-theme .dashboard-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .invoice-status-section {
    background: var(--bg-tertiary) !important;
}

.dark-theme .status-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Items Library cards */
.dark-theme .item-card,
.dark-theme .library-item,
.dark-theme [class*="item-card"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .item-card h3,
.dark-theme .item-card h4,
.dark-theme .item-card p,
.dark-theme .item-card span {
    color: var(--text-primary) !important;
}

.dark-theme .item-card .price,
.dark-theme .item-card [class*="price"] {
    color: var(--text-primary) !important;
}

/* Business Partners / Customers form */
.dark-theme .partner-form,
.dark-theme .customer-form,
.dark-theme [class*="partner"],
.dark-theme [class*="customer"] {
    background: var(--card-bg) !important;
}

.dark-theme .partner-card,
.dark-theme .customer-card,
.dark-theme .partner-item,
.dark-theme .customer-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Import Review screen */
.dark-theme .review-queue,
.dark-theme .upload-zone,
.dark-theme .drop-zone,
.dark-theme [class*="upload"],
.dark-theme [class*="drop"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .queue-item,
.dark-theme .review-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .preview-pane,
.dark-theme .pdf-preview,
.dark-theme .ocr-preview {
    background: var(--bg-tertiary) !important;
}

/* Invoice Generator form */
.dark-theme .invoice-form,
.dark-theme .generate-form,
.dark-theme [class*="invoice-form"],
.dark-theme [class*="generator"] {
    background: var(--card-bg) !important;
}

.dark-theme .form-tabs,
.dark-theme .tab-content {
    background: var(--card-bg) !important;
}

/* Payments screen */
.dark-theme .payment-summary,
.dark-theme .payment-stats,
.dark-theme [class*="payment"] {
    background: var(--card-bg) !important;
}

/* Trial Balance */
.dark-theme .balance-card,
.dark-theme .filter-bar,
.dark-theme [class*="filter"] select,
.dark-theme [class*="filter"] input {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* Credit Notes / History table rows */
.dark-theme .table-row,
.dark-theme tr,
.dark-theme tbody tr {
    background: var(--card-bg) !important;
}

.dark-theme tbody tr:nth-child(even) {
    background: var(--bg-tertiary) !important;
}

.dark-theme tbody tr:hover {
    background: var(--bg-hover) !important;
}

/* Tickets screen */
.dark-theme .ticket-stats,
.dark-theme .ticket-card,
.dark-theme .ticket-item,
.dark-theme [class*="ticket"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .ticket-filters button,
.dark-theme .filter-button {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark-theme .ticket-filters button.active,
.dark-theme .filter-button.active {
    background: var(--primary) !important;
    color: white !important;
}

/* User Management */
.dark-theme .plan-card,
.dark-theme .user-table,
.dark-theme [class*="plan"],
.dark-theme [class*="user-list"] {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* All inputs, selects, textareas */
.dark-theme input:not([type="checkbox"]):not([type="radio"]),
.dark-theme select,
.dark-theme textarea {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: var(--text-tertiary) !important;
}

/* All text colors */
.dark-theme h1, .dark-theme h2, .dark-theme h3,
.dark-theme h4, .dark-theme h5, .dark-theme h6 {
    color: var(--text-primary) !important;
}

.dark-theme p, .dark-theme span, .dark-theme div {
    color: inherit;
}

.dark-theme label {
    color: var(--text-primary) !important;
}

/* Links in dark mode */
.dark-theme a:not(.btn):not([class*="button"]) {
    color: var(--primary);
}

/* Table headers */
.dark-theme th,
.dark-theme thead tr {
    background: var(--table-header-bg) !important;
    color: var(--text-secondary) !important;
}

.dark-theme td {
    color: var(--text-primary) !important;
    border-color: var(--table-border) !important;
}

/* Badges and pills */
.dark-theme .badge,
.dark-theme .pill,
.dark-theme [class*="badge"],
.dark-theme [class*="pill"],
.dark-theme [class*="tag"] {
    border-color: var(--border-color);
}

/* Search inputs */
.dark-theme input[type="search"],
.dark-theme [class*="search"] input {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* Date pickers */
.dark-theme input[type="date"],
.dark-theme input[type="datetime-local"] {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
    color-scheme: dark;
}

/* Empty states and placeholders */
.dark-theme .empty-state,
.dark-theme .no-data,
.dark-theme [class*="empty"],
.dark-theme [class*="placeholder"] {
    color: var(--text-secondary) !important;
}

/* Dividers and separators */
.dark-theme hr,
.dark-theme [class*="divider"],
.dark-theme [class*="separator"] {
    border-color: var(--border-color) !important;
}

/* ============================================
   DARK THEME - SPECIFIC SCREEN FIXES
   ============================================ */

/* My Company - Notice box */
.dark-theme .mycompany-notice {
    background: var(--warning-light) !important;
    color: var(--warning-dark) !important;
}

.dark-theme .mycompany-notice-icon {
    color: var(--warning-dark) !important;
}

/* Business Partners - Partner cards */
.dark-theme .partner-list-item,
.dark-theme .partner-card,
.dark-theme .customer-list-item,
.dark-theme .business-partner-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .partner-list-item *,
.dark-theme .partner-card *,
.dark-theme .customer-list-item * {
    color: var(--text-primary);
}

/* Items Library - Item cards */
.dark-theme .item-card,
.dark-theme .library-card,
.dark-theme .product-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .item-card *,
.dark-theme .library-card *,
.dark-theme .product-card * {
    color: var(--text-primary);
}

.dark-theme .item-card .item-description,
.dark-theme .item-card p,
.dark-theme .library-card p {
    color: var(--text-secondary) !important;
}

/* Import Review - Tabs */
.dark-theme .review-tabs,
.dark-theme .ocr-tabs,
.dark-theme .data-tabs {
    background: var(--bg-tertiary) !important;
}

.dark-theme .review-tab,
.dark-theme .ocr-tab,
.dark-theme .data-tab {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: transparent !important;
}

.dark-theme .review-tab.active,
.dark-theme .ocr-tab.active,
.dark-theme .data-tab.active {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .review-tab:hover,
.dark-theme .ocr-tab:hover,
.dark-theme .data-tab:hover {
    background: var(--bg-hover) !important;
}

/* Payments - Summary cards */
.dark-theme .payment-summary-card,
.dark-theme .summary-card,
.dark-theme .stat-box {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .payment-summary-card h3,
.dark-theme .payment-summary-card .amount,
.dark-theme .summary-card .value {
    color: var(--text-primary) !important;
}

.dark-theme .payment-summary-card .label,
.dark-theme .payment-summary-card .subtitle,
.dark-theme .summary-card .label {
    color: var(--text-secondary) !important;
}

/* Trial Balance - Container and filters */
.dark-theme .trial-balance-container,
.dark-theme .balance-container {
    background: var(--bg-primary) !important;
}

.dark-theme .filter-row,
.dark-theme .filters-container {
    background: var(--card-bg) !important;
}

.dark-theme .trial-balance-table,
.dark-theme .balance-table {
    background: var(--card-bg) !important;
}

/* Credit Notes - Filter bar with inline styles fix */
.dark-theme .filter-bar,
.dark-theme .filters,
.dark-theme [class*="filter"] {
    background: var(--bg-tertiary) !important;
}

/* Override inline rgb(248, 250, 252) background */
.dark-theme div[style*="background: rgb(248, 250, 252)"],
.dark-theme div[style*="background:rgb(248, 250, 252)"],
.dark-theme div[style*="background: rgb(248,250,252)"] {
    background: var(--bg-tertiary) !important;
}

.dark-theme select[style*="border: 1px solid rgb(226, 232, 240)"],
.dark-theme input[style*="border: 1px solid rgb(226, 232, 240)"] {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* Generate Invoice - Form sections */
.dark-theme .invoice-form-section,
.dark-theme .form-panel,
.dark-theme .invoice-panel {
    background: var(--card-bg) !important;
}

.dark-theme .preview-panel,
.dark-theme .pdf-preview-panel {
    background: var(--bg-tertiary) !important;
}

/* Trial Balance specific rows - override inline colors */
.dark-theme tr[style*="background: rgb(239, 246, 255)"],
.dark-theme tr[style*="background: rgb(219, 234, 254)"],
.dark-theme tr[style*="background: rgb(254, 242, 242)"],
.dark-theme tr[style*="background: rgb(254, 226, 226)"],
.dark-theme tr[style*="#eff6ff"],
.dark-theme tr[style*="#dbeafe"],
.dark-theme tr[style*="#fef2f2"],
.dark-theme tr[style*="#fee2e2"] {
    background: var(--card-bg) !important;
}

.dark-theme tr[style*="background"]:hover {
    background: var(--bg-hover) !important;
}

/* My Company - Buttons */
.dark-theme .mycompany-btn-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .mycompany-btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover) !important;
}

/* My Company - Provider buttons (Gmail, Outlook, etc) */
.dark-theme .mycompany-provider-btn {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark-theme .mycompany-provider-btn:hover {
    background: var(--bg-hover) !important;
}

.dark-theme .mycompany-provider-btn.active {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* My Company - Provider help box */
.dark-theme .mycompany-provider-help {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .mycompany-provider-help-content {
    color: var(--text-primary) !important;
}

.dark-theme .mycompany-provider-help-content strong {
    color: var(--text-primary) !important;
}

.dark-theme .mycompany-provider-help-content p {
    color: var(--text-secondary) !important;
}

.dark-theme .mycompany-provider-help-link {
    color: var(--primary) !important;
}

/* Import Review - Select All checkbox area */
.dark-theme div[style*="background-color: rgb(248, 250, 252)"],
.dark-theme div[style*="background: rgb(248, 250, 252)"] {
    background-color: var(--bg-tertiary) !important;
    background: var(--bg-tertiary) !important;
}

.dark-theme label[style*="color: rgb(55, 65, 81)"] {
    color: var(--text-primary) !important;
}

/* Import Review - Field groups and edit fields */
.dark-theme .field-group {
    background: var(--card-bg) !important;
}

.dark-theme .field-label {
    color: var(--text-primary) !important;
}

.dark-theme .edit-field,
.dark-theme select.edit-field,
.dark-theme input.edit-field {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* OCR content - Edit mode background */
.dark-theme .ocr-content .tab-content > div[style*="rgb(255, 247, 237)"],
.dark-theme .ocr-content .tab-content > div[style*="#fff7ed"] {
    background: rgba(245, 158, 11, 0.15) !important;
}

/* Assign Approvers box */
.dark-theme div[style*="background: rgb(240, 249, 255)"],
.dark-theme div[style*="background: #f0f9ff"] {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Approver labels */
.dark-theme label[style*="background: white"] {
    background: var(--card-bg) !important;
}

/* Payments / Trial Balance - Type toggle buttons (Receivable/Payable) */
.dark-theme button[style*="background-color: white"],
.dark-theme button[style*="background: white"] {
    background-color: var(--card-bg) !important;
    background: var(--card-bg) !important;
    color: var(--primary) !important;
}

/* Trial Balance - Container background */
.dark-theme div[style*="background: rgb(241, 245, 249)"],
.dark-theme div[style*="background-color: rgb(241, 245, 249)"] {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
}

/* Trial Balance - Filter area */
.dark-theme div[style*="background: var(--bg-tertiary)"] select,
.dark-theme div[style*="background: rgb(241, 245, 249)"] select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
}

/* Trial Balance - Receivables rows (blue backgrounds) */
.dark-theme tr[style*="rgb(239, 246, 255)"],
.dark-theme tr[style*="rgb(219, 234, 254)"] {
    background: rgba(59, 130, 246, 0.1) !important;
}

.dark-theme tr[style*="rgb(239, 246, 255)"]:hover,
.dark-theme tr[style*="rgb(219, 234, 254)"]:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}

/* Trial Balance - Payables rows (red backgrounds) */
.dark-theme tr[style*="rgb(254, 226, 226)"],
.dark-theme tr[style*="rgb(254, 242, 242)"] {
    background: rgba(239, 68, 68, 0.1) !important;
}

.dark-theme tr[style*="rgb(254, 226, 226)"]:hover,
.dark-theme tr[style*="rgb(254, 242, 242)"]:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* Trial Balance - Table cell text */
.dark-theme tr[style*="background"] td {
    color: var(--text-primary) !important;
}

.dark-theme tr[style*="background"] td[style*="font-family: monospace"] {
    color: var(--text-primary) !important;
}

/* ============================================
   TOP NAVIGATION BAR (for menuPosition: 'top')
   ============================================ */

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--topbar-bg);
    box-shadow: var(--topbar-shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.top-navbar-logo {
    height: 40px;
    margin-right: 32px;
}

.top-navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.top-navbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.top-navbar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.top-navbar-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.top-navbar-item .material-icons {
    font-size: 20px;
}

.top-navbar-dropdown {
    position: relative;
}

.top-navbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow-hover);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

.top-navbar-dropdown:hover .top-navbar-dropdown-menu,
.top-navbar-dropdown.open .top-navbar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--text-primary);
    font-size: 14px;
}

.top-navbar-dropdown-item:hover {
    background: var(--bg-hover);
}

.top-navbar-dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.top-navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.top-navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Main content adjustment for top navbar */
.main-content.with-top-navbar {
    margin-left: 0;
    margin-top: 64px;
}

/* ============================================
   END THEME SYSTEM
   ============================================ */

/* Hide browser's native password reveal icon (Edge/Chrome) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
}

/* For Edge Chromium */
input::-ms-reveal {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* LOGIN STYLES */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* Language Selector Styles */
.language-selector-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.language-selector-btn:hover {
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.language-flag {
    font-size: 24px;
    line-height: 1;
}

.language-flag-img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.language-arrow {
    font-size: 20px !important;
    color: #64748b;
    transition: transform 0.2s ease;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 70px;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.15s ease;
}

.language-option:hover {
    background: #f3f4f6;
}

.language-option.active {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

/* Responsive language selector */
@media (max-width: 480px) {
    .language-selector-container {
        top: 15px;
        right: 15px;
    }

    .language-selector-btn {
        padding: 8px 10px;
    }

    .language-flag {
        font-size: 20px;
    }

    .language-flag-img {
        width: 24px;
        height: 17px;
    }

    .language-arrow {
        font-size: 18px !important;
    }

    .language-option {
        padding: 10px 14px;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px 48px 48px 48px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.logo-large {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    height: 150px;
    width: 100%;
    overflow: hidden;
}

.logo-large img {
    transition: transform 0.3s ease;
    width: 350px;
    height: auto;
    object-fit: contain;
    object-position: center;
    clip-path: inset(15px 40px 30px 40px);
    transform: scale(1.1);
}

.logo-large img:hover {
    transform: scale(1.15);
    filter: brightness(0) saturate(100%) invert(50%) sepia(90%) saturate(2500%) hue-rotate(210deg) brightness(102%) contrast(95%) drop-shadow(0 12px 40px rgba(103, 126, 234, 0.4));
}

.subtitle {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 32px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* APP STYLES */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.sidebar {
    width: 300px;
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
}

.sidebar-scrollable::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Sidebar collapse toggle button */
.sidebar-collapse-btn {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 2px solid #1e293b;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-collapse-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-50%) scale(1.1);
}

.sidebar-collapse-btn .material-icons {
    font-size: 16px;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header {
    padding: 16px 8px;
}

.sidebar.collapsed .sidebar-logo-full {
    height: 40px !important;
    margin: 0 !important;
}

.sidebar.collapsed .sidebar-collapse-btn {
    right: -12px;
}

.sidebar.collapsed .user-info {
    padding: 12px 8px;
    flex-direction: column;
    gap: 4px;
}

.sidebar.collapsed .user-info > div:last-child {
    display: none;
}

.sidebar.collapsed .user-avatar {
    width: 36px;
    height: 36px;
}

.sidebar.collapsed .menu {
    padding: 10px 0;
}

.sidebar.collapsed .menu-item {
    padding: 14px 0;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .menu-item span:not(.material-icons):not(.menu-badge) {
    display: none;
}

.sidebar.collapsed .menu-item .menu-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    padding: 1px 5px;
    font-size: 10px;
    min-width: 16px;
}

.sidebar.collapsed .menu-item .material-icons:last-child {
    display: none; /* Hide expand arrows */
}

.sidebar.collapsed .menu-children {
    display: none;
}

.sidebar.collapsed .menu-parent.expanded .menu-children {
    display: none;
}

/* Tooltip on hover for collapsed sidebar */
.sidebar.collapsed .menu-item {
    position: relative;
}

.sidebar.collapsed .menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-left: 8px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .menu-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 8px;
}

.sidebar.collapsed .sidebar-footer > div:first-child {
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.sidebar.collapsed .sidebar-footer > div:first-child > div:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-footer button {
    padding: 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer button span:not(.material-icons) {
    display: none;
}

/* Main content adjustment when sidebar is collapsed */
.main-content.sidebar-collapsed {
    margin-left: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.user-info {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu {
    padding: 20px 0;
}

.menu-item {
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.2);
    border-right: 3px solid #667eea;
}

.menu-badge {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

/* Hierarchical Menu Styles */
.menu-group {
    margin-bottom: 4px;
}

.menu-parent {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Parent expanded state - shows selector */
.menu-parent.expanded {
    background: rgba(102, 126, 234, 0.2);
    border-right: 3px solid #667eea;
    color: white;
}

/* Parent with active child but NOT expanded - subtle indicator only */
.menu-parent.has-active-child:not(.expanded) {
    background: rgba(102, 126, 234, 0.08);
    color: white;
    /* No border-right selector - only the expanded parent gets it */
}

.menu-children {
    background: rgba(0, 0, 0, 0.12);
    margin-left: 0;
    padding-left: 20px;
    border-left: 3px solid rgba(102, 126, 234, 0.3);
    margin-left: 12px;
}

.menu-child {
    padding: 12px 16px 12px 12px !important;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px 0 0 6px;
    margin: 2px 0;
}

.menu-child:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.menu-child.active {
    background: rgba(102, 126, 234, 0.3);
    border-right: 3px solid #667eea;
    color: white;
    font-weight: 500;
}

.menu-child .material-icons {
    opacity: 0.8;
}

.menu-child.active .material-icons {
    opacity: 1;
}

/* Sub-menu (nested) styles */
.menu-subgroup {
    margin: 2px 0;
}

.menu-subparent {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.menu-subparent.has-active-child {
    color: rgba(255, 255, 255, 0.95);
}

.menu-subchildren {
    background: rgba(0, 0, 0, 0.15);
    margin-left: 12px;
    padding-left: 16px;
    border-left: 2px solid rgba(102, 126, 234, 0.25);
}

.menu-subchild {
    padding: 10px 12px !important;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px 0 0 4px;
    margin: 2px 0;
}

.menu-subchild:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.menu-subchild.active {
    background: rgba(102, 126, 234, 0.25);
    border-right: 2px solid #667eea;
    color: white;
    font-weight: 500;
}

.main-content {
    flex: 1;
    margin-left: 300px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease, background 0.3s ease;
}

/* IMPRESSUM FOOTER - Compact Version */
.impressum-footer {
    background: #1e293b;
    color: #64748b;
    padding: 12px 24px;
    margin-top: auto;
    border-top: 1px solid #334155;
}

.impressum-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 20px;
}

.impressum-title {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.impressum-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    font-size: 10px;
    line-height: 1.4;
}

.impressum-section {
    display: flex;
    align-items: center;
    gap: 4px;
}

.impressum-section strong {
    color: #94a3b8;
    font-weight: 600;
}

.impressum-section span {
    color: #64748b;
}

.impressum-divider {
    display: none;
}

.impressum-copyright {
    font-size: 10px;
    color: #475569;
}

.impressum-separator {
    color: #475569;
    font-size: 10px;
}

/* Login Impressum Footer - Compact */
.login-impressum-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-impressum-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.login-impressum-title {
    display: none;
}

.login-impressum-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    font-size: 9px;
    line-height: 1.3;
}

.login-impressum-item {
    color: rgba(255, 255, 255, 0.5);
}

.login-impressum-item strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.login-impressum-separator {
    color: rgba(255, 255, 255, 0.2);
}

.top-bar {
    background: var(--card-bg);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.content-area {
    padding: 32px;
}

/* ADVANCED DASHBOARD STYLES */
.dashboard-container {
    padding: 24px;
    background: #f8fafc;
    min-height: calc(100vh - 120px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.dashboard-subtitle {
    color: #64748b;
    margin-top: 4px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

/* Botões de ação do Dashboard - Padronizados */
.export-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
    height: 80px;
    flex-shrink: 0;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.export-btn:active {
    transform: translateY(0);
}

/* Todos os botões mantêm a mesma cor e tamanho */
.excel-btn,
.pdf-btn,
.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
    height: 80px;
}

.excel-btn:hover,
.pdf-btn:hover,
.refresh-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
}

.btn-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.btn-text {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
}

.btn-subtitle {
    font-size: 10px;
    opacity: 0.9;
    font-weight: 400;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.dashboard-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.filter-select, .filter-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: all 0.2s ease;
    min-width: 120px;
    height: 32px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.apply-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    margin-top: 20px;
    min-width: 140px;
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.apply-filters-btn:active {
    transform: translateY(0);
}

.apply-filters-btn .material-icons {
    font-size: 18px;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.revenue { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.invoices { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.pending { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.clients { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #059669;
    background: #d1fae5;
}

.stat-change.negative {
    color: #dc2626;
    background: #fee2e2;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.pdf-chart-card {
    grid-column: span 1;
}

.pdf-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pdf-total-badge .material-icons {
    font-size: 16px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-title-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.toggle-switch-container {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn .material-icons {
    font-size: 16px;
}

.toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: #475569;
}

.chart-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chart-type-selector {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.chart-type-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-type-btn.active {
    background: #667eea;
    color: white;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container.pie {
    height: 350px;
}

.data-table {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* Botão de exportação para tabelas (diferente dos botões do dashboard) */
.table-export-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-export-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.data-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: #4b5563;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f8fafc;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pdf-chart-card {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
    }

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

    .pdf-chart-card {
        grid-column: span 1;
    }

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

    .toggle-switch-container {
        flex-wrap: wrap;
    }
}

/* ============================================
   DASHBOARD REDESIGN - Split Sections
   ============================================ */

/* Simple Header */
.dashboard-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: white;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

/* Export Dropdown */
.export-dropdown-container {
    position: relative;
}

.export-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.export-dropdown-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.export-dropdown-btn .material-icons {
    font-size: 20px;
}

.export-dropdown-btn .dropdown-arrow {
    font-size: 18px;
    margin-left: 2px;
}

.export-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    min-width: 160px;
    z-index: 100;
    animation: dropdownFadeIn 0.2s ease;
}

.export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s ease;
    text-align: left;
}

.export-dropdown-item:hover {
    background: #f3f4f6;
}

.export-dropdown-item .material-icons {
    font-size: 20px;
    color: #667eea;
}

/* Dashboard Refresh Button */
.dashboard-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-refresh-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.dashboard-refresh-btn .material-icons {
    font-size: 20px;
}

/* Compact Dashboard Header */
.dashboard-header-compact {
    margin-bottom: 12px;
}

.dashboard-title-compact {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Compact Filters */
.dashboard-filters-compact {
    background: white;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 14px;
}

.filter-row-compact {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group-compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-group-compact .filter-input,
.filter-group-compact .filter-select {
    min-width: 100px;
    height: 30px;
    font-size: 12px;
    padding: 4px 8px;
}

.filter-actions-compact {
    display: flex;
    gap: 6px;
    margin-left: auto;
    align-items: center;
}

.export-dropdown-compact {
    position: relative;
}

.export-dropdown-menu-compact {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 100;
    overflow: hidden;
}

.export-dropdown-menu-compact .export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    transition: background 0.15s;
}

.export-dropdown-menu-compact .export-dropdown-item:hover {
    background: #f3f4f6;
}

.export-dropdown-menu-compact .export-dropdown-item .material-icons {
    font-size: 16px;
    color: #6b7280;
}

/* Enhanced Filters (legacy support) */
.dashboard-filters-enhanced {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    align-items: center;
}

/* Compact filter button style */
.filter-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
}

.filter-action-btn .material-icons {
    font-size: 16px;
}

.filter-action-btn.primary {
    background: #667eea;
    color: white;
}

.filter-action-btn.primary:hover {
    background: #5a67d8;
}

.filter-action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.filter-action-btn.secondary:hover {
    background: #e2e8f0;
}

/* Legacy support */
.apply-filters-btn,
.reset-filters-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apply-filters-btn {
    background: #667eea;
    color: white;
    border: none;
}

.apply-filters-btn:hover {
    background: #5a67d8;
}

.reset-filters-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.reset-filters-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Dashboard Sections Container - Side by Side */
.dashboard-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    min-width: 0;
}

/* Dashboard Sections */
.dashboard-section {
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: white;
    border: 1px solid #e5e7eb;
    min-width: 0;
    overflow: hidden;
}

/* Incoming Invoices Section (neutral with subtle accent) */
.dashboard-section-incoming {
    background: white;
    border-top: 3px solid #ef4444;
}

.dashboard-section-incoming .section-header {
    background: #f9fafb;
    margin: -12px -12px 12px -12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-section-incoming .section-icon {
    color: #ef4444;
    background: transparent;
    font-size: 20px !important;
}

.dashboard-section-incoming .section-title {
    color: #1f2937;
    font-size: 14px;
}

.dashboard-section-incoming .section-subtitle {
    color: #6b7280;
    font-weight: 500;
    font-size: 11px;
}

/* Outgoing Invoices Section (neutral with subtle accent) */
.dashboard-section-outgoing {
    background: white;
    border-top: 3px solid #22c55e;
}

.dashboard-section-outgoing .section-header {
    background: #f9fafb;
    margin: -12px -12px 12px -12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-section-outgoing .section-icon {
    color: #22c55e;
    background: transparent;
    font-size: 20px !important;
}

.dashboard-section-outgoing .section-title {
    color: #1f2937;
    font-size: 14px;
}

.dashboard-section-outgoing .section-subtitle {
    color: #6b7280;
    font-weight: 500;
    font-size: 11px;
}

@media (max-width: 1400px) {
    .dashboard-sections-row {
        grid-template-columns: 1fr;
    }
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-filter {
    display: flex;
    align-items: center;
}

.section-filter-select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    cursor: pointer;
    min-width: 120px;
}

.section-filter-select:focus {
    outline: none;
    border-color: #94a3b8;
}

.dashboard-section-incoming .section-filter-select {
    border-color: #fecaca;
}

.dashboard-section-incoming .section-filter-select:focus {
    border-color: #ef4444;
}

.dashboard-section-outgoing .section-filter-select {
    border-color: #bbf7d0;
}

.dashboard-section-outgoing .section-filter-select:focus {
    border-color: #22c55e;
}

.section-icon {
    font-size: 22px !important;
    padding: 6px;
    border-radius: 8px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.section-subtitle {
    font-size: 12px;
    margin-left: 4px;
}

/* Section Stats Grid (responsive - compact) */
.section-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.section-stats-grid.main-stats {
    grid-template-columns: repeat(3, 1fr);
}

/* Invoice Status Section */
.invoice-status-section {
    margin-top: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.invoice-status-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.status-item {
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    border-radius: 6px;
    background: white;
    border-left: 3px solid #e2e8f0;
}

.status-item.paid {
    border-left-color: #22c55e;
}

.status-item.unpaid {
    border-left-color: #f59e0b;
}

.status-item.overdue {
    border-left-color: #ef4444;
}

.status-item.due-soon {
    border-left-color: #3b82f6;
}

.status-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
}

.status-value {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.due-in-days-selector-mini {
    padding: 1px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 10px;
    background: white;
    cursor: pointer;
}

/* Section Over Time Chart */
.section-overtime-chart {
    margin-top: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.overtime-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container-small {
    height: 150px;
}

.chart-container-small canvas {
    max-height: 150px;
}

@media (max-width: 1400px) {
    .section-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .section-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section-stat-card {
    background: #f9fafb;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    min-width: 0;
}

.section-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-stat-card .stat-value {
    font-size: 16px;
    font-weight: 700;
}

.section-stat-card .stat-label {
    font-size: 10px;
}

/* Simple stat card without icons */
.section-stat-card.simple {
    text-align: center;
    padding: 8px 6px;
}

.section-stat-card.simple .stat-value {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    word-break: break-word;
}

.section-stat-card.simple .stat-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
}

/* Stat card value colors - neutral dark */
.dashboard-section .section-stat-card .stat-value {
    color: #1f2937;
}

/* Due in days selector */
.due-in-days-selector {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: white;
    color: #475569;
    cursor: pointer;
}

.due-in-days-selector:focus {
    outline: none;
    border-color: #667eea;
}

.due-in-card .stat-header {
    flex-wrap: wrap;
    gap: 8px;
}

/* Section chart card */
.section-chart-card {
    background: #f9fafb;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
}

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

.section-chart-card .chart-title {
    font-size: 13px;
}

.section-chart-card .chart-container.pie {
    max-height: 200px;
}

/* Full-width chart card */
.chart-card-full {
    grid-column: 1 / -1;
}

/* Status badges for table */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-paid {
    background: #d1fae5;
    color: #059669;
}

.status-badge.status-pending,
.status-badge.status-unpaid {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.status-overdue {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.status-partial {
    background: #dbeafe;
    color: #2563eb;
}

/* Responsive adjustments for section stats */
@media (max-width: 1200px) {
    .section-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header-simple {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .dashboard-header-actions {
        justify-content: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: stretch;
    }

    .filter-actions button {
        flex: 1;
    }

    .section-header {
        flex-wrap: wrap;
    }

    .section-subtitle {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
}

/* PDF GENERATION STYLES */
.pdf-generator-container {
    padding: 14px;
    background: #f8fafc;
    min-height: calc(100vh - 120px);
}

.pdf-generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: calc(100vh - 160px);
}

.pdf-form-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-preview-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.action-btn {
    padding: 4px 8px;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #d1d5db;
}

.form-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.form-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 3px;
    margin-bottom: 12px;
}

.form-tab {
    flex: 1;
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-tab.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #64748b;
    font-size: 12px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s ease;
    background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.items-section {
    margin-top: 12px;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.items-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.add-item-btn {
    padding: 5px 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-item-btn:hover {
    background: #2563eb;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 60px 90px 90px 70px 90px 40px;
    gap: 6px;
    align-items: end;
    margin-bottom: 6px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.item-row input {
    padding: 5px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 11px;
}

.remove-item-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
}

.remove-item-btn:hover {
    background: #dc2626;
}

.totals-section {
    margin-top: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.totals-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px solid #d1d5db;
    font-weight: 600;
    font-size: 13px;
}

.totals-label {
    color: #4b5563;
    font-weight: 500;
}

.totals-value {
    color: #1e293b;
    font-weight: 600;
}

.pdf-preview-container {
    flex: 1;
    background: #e5e7eb;
    position: relative;
    overflow: hidden;
}

.pdf-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #64748b;
}

.preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #9ca3af;
}

.generate-actions {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.generate-btn {
    padding: 8px 16px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.generate-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.generate-btn:disabled {
    background: var(--text-tertiary);
    color: var(--bg-secondary);
    cursor: not-allowed;
    transform: none;
}

.preview-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-btn:hover {
    background: #2563eb;
}

@media (max-width: 1024px) {
    .pdf-generator-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pdf-preview-section {
        height: 400px;
    }

    .item-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

.api-status {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.api-status.connecting {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.api-status.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-modern {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.card-content {
    padding: 16px 20px;
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.upload-icon {
    font-size: 36px;
    color: #3b82f6;
    margin-bottom: 12px;
}

.progress-modern {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 100%;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.review-layout {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 24px;
    min-height: 600px;
}

.pdf-panel, .data-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.pdf-panel {
    position: relative;
}

.edit-field {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.edit-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-field:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.field-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.field-group {
    margin-bottom: 16px;
}

.edit-mode .data-panel {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1);
}

.save-cancel-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-save {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.tabs-container {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
}

.tabs {
    display: flex;
    gap: 0;
}

.tab {
    padding: 12px 16px;
    background: #f8fafc;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:first-child {
    border-top-left-radius: 8px;
}

.tab:last-child {
    border-top-right-radius: 8px;
}

.tab.active {
    background: white;
    color: #1e293b;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab:hover:not(.active) {
    background: #f1f5f9;
    color: #475569;
}

.tab-content {
    min-height: 400px;
}

/* ============================================
   LEGAL FOOTER & MODALS STYLES
   ============================================ */

/* Login Legal Footer */
.login-legal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-legal-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-legal-company {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.login-legal-company a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.login-legal-company a:hover {
    color: rgba(255, 255, 255, 0.95);
}

.login-legal-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

.login-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.login-legal-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
    font-family: inherit;
}

.login-legal-link:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* Legal Modal Overlay */
.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

/* Legal Modal Container */
.legal-modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: legalModalIn 0.25s ease-out;
}

@keyframes legalModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.legal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.legal-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.legal-modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Legal Section Styles */
.legal-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.legal-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin: 16px 0 8px 0;
}

.legal-section p {
    font-size: 13px;
    line-height: 1.7;
    color: #64748b;
    margin: 0 0 10px 0;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.legal-section li {
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 6px;
}

.legal-section a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-section a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.legal-section strong {
    color: #374151;
    font-weight: 600;
}

.legal-update-date {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 20px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.legal-contact {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: none !important;
}

/* Cookie Preferences Styles */
.cookie-preference-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.cookie-pref-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cookie-pref-info {
    flex: 1;
}

.cookie-pref-info strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.cookie-pref-info p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.cookie-toggle.disabled input {
    accent-color: #10b981;
}

/* Cookie Toggle Switch */
.cookie-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cookie-toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Cookie Preferences Actions */
.cookie-pref-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.cookie-pref-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cookie-pref-btn.secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.cookie-pref-btn.secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cookie-pref-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.cookie-pref-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .main-content {
        margin-left: 0;
    }

    .review-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Legal Footer Responsive */
    .login-legal-footer {
        padding: 10px 12px;
    }

    .login-legal-company {
        font-size: 9px;
        gap: 4px;
    }

    .login-legal-links {
        gap: 4px;
    }

    .login-legal-link {
        font-size: 9px;
        padding: 2px;
    }

    .login-legal-separator {
        font-size: 8px;
    }

    /* Legal Modal Responsive */
    .legal-modal-overlay {
        padding: 10px;
    }

    .legal-modal-container {
        max-height: 90vh;
        border-radius: 12px;
    }

    .legal-modal-header {
        padding: 16px;
    }

    .legal-modal-header h2 {
        font-size: 18px;
    }

    .legal-modal-content {
        padding: 16px;
    }

    .cookie-pref-header {
        flex-direction: column;
        gap: 12px;
    }

    .cookie-pref-actions {
        flex-direction: column;
    }

    .cookie-pref-btn {
        width: 100%;
        text-align: center;
    }
}

/* =============================================
   IMPORT / REVIEW INVOICE SCREEN STYLES
   Three-column layout with full functionality
   ============================================= */

.import-review-screen {
    padding: 12px 16px;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Compact Header */
.screen-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.screen-header-compact .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Collapse Button */
.collapse-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.collapse-btn:hover {
    background: #e5e7eb;
}

.collapse-btn .material-icons {
    font-size: 18px !important;
    color: #6b7280;
}

.screen-header-compact .screen-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.screen-header-compact .status-indicator {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.screen-header-compact .queue-badge {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Three Column Layout */
.import-review-layout {
    display: grid;
    grid-template-columns: 280px 1fr 420px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

/* Collapsed state - minimal left panel */
.import-review-layout.collapsed {
    grid-template-columns: 60px 1fr 420px;
}

.import-review-layout.collapsed .drop-zone-compact .drop-area {
    justify-content: center;
    padding: 12px 8px;
}

.import-review-layout.collapsed .queue-list .queue-item {
    justify-content: center;
    padding: 8px 4px;
}

/* Left Panel - Import & Queue */
.import-queue-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Compact Drop Zone */
.drop-zone-compact {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.drop-zone-compact .drop-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border: 2px dashed transparent;
    border-radius: 6px;
    margin: 4px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.drop-zone-compact .drop-area:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.drop-zone-compact .drop-icon {
    font-size: 24px !important;
    color: #6b7280;
}

.drop-zone-compact .drop-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.drop-zone-compact .drop-title {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.drop-zone-compact .drop-subtitle {
    font-size: 10px;
    color: #9ca3af;
}

/* Processing Queue */
.processing-queue {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 8px;
    flex-shrink: 0;
}

.processing-queue .queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 6px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
}

.processing-queue .queue-header .spin {
    font-size: 14px !important;
    animation: spin 1s linear infinite;
}

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

.processing-queue .queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.processing-queue .queue-item .material-icons {
    font-size: 16px !important;
    color: #9ca3af;
}

.processing-queue .queue-item.completed .material-icons { color: #22c55e; }
.processing-queue .queue-item.processing .material-icons { color: #3b82f6; }
.processing-queue .queue-item.error .material-icons { color: #ef4444; }

.processing-queue .file-info {
    flex: 1;
    min-width: 0;
}

.processing-queue .file-name {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.processing-queue .file-status {
    display: block;
    font-size: 9px;
    color: #9ca3af;
}

.processing-queue .progress-bar {
    height: 2px;
    background: #e5e7eb;
    border-radius: 1px;
    margin-top: 3px;
    overflow: hidden;
}

.processing-queue .progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 1px;
    transition: width 0.3s ease;
}

/* Email Import Section */
.email-import-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.section-header-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    cursor: pointer;
    background: #f9fafb;
    transition: background 0.2s ease;
}

.section-header-toggle:hover { background: #f3f4f6; }

.section-header-toggle .material-icons {
    font-size: 16px !important;
    color: #6b7280;
}

.section-header-toggle span:nth-child(2) {
    flex: 1;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
}

.section-header-toggle .enabled-badge {
    font-size: 9px;
    font-weight: 500;
    color: #22c55e;
    background: #dcfce7;
    padding: 2px 5px;
    border-radius: 3px;
}

.email-config {
    padding: 10px;
    border-top: 1px solid #e5e7eb;
}

.email-config .toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    margin-bottom: 10px;
}

.email-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-fields .field-row {
    display: flex;
    gap: 6px;
}

.email-fields .field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.email-fields .field.small { max-width: 70px; }

.email-fields .field label {
    font-size: 10px;
    font-weight: 500;
    color: #6b7280;
}

.email-fields .field input {
    padding: 5px 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #374151;
}

.email-fields .password-field {
    display: flex;
    position: relative;
}

.email-fields .password-field input {
    flex: 1;
    padding-right: 28px;
}

.email-fields .toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
}

.email-fields .toggle-password .material-icons {
    font-size: 14px !important;
    color: #9ca3af;
}

.email-fields .checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
    padding-top: 16px;
}

.email-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.email-actions .btn-sm {
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.email-actions .btn-secondary {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.email-actions .btn-primary {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: white;
}

/* Review Queue Section */
.review-queue-section {
    flex: 1;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    overflow: hidden;
}

.review-queue-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.review-queue-section .section-header span:first-child {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

.review-queue-section .section-header .count {
    font-size: 10px;
    font-weight: 500;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 8px;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.queue-list .empty-queue {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    color: #9ca3af;
    gap: 6px;
}

.queue-list .empty-queue .material-icons {
    font-size: 32px !important;
    opacity: 0.4;
}

.queue-list .empty-queue span:nth-child(2) {
    font-size: 11px;
}

.queue-list .empty-queue .empty-hint {
    font-size: 10px;
    color: #c0c5cc;
}

.queue-list .queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.queue-list .queue-item:hover { background: #f9fafb; }
.queue-list .queue-item.selected {
    background: #eff6ff;
    border-color: #3b82f6;
}

.queue-list .queue-item .confidence-icon {
    font-size: 18px !important;
}

.queue-list .queue-item .invoice-info {
    flex: 1;
    min-width: 0;
}

.queue-list .queue-item .invoice-name {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-list .queue-item .invoice-details {
    display: block;
    font-size: 10px;
    color: #6b7280;
}

.queue-list .queue-item .invoice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.queue-list .queue-item .confidence-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.queue-list .queue-item .btn-delete-sm {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: #9ca3af;
}

.queue-list .queue-item .btn-delete-sm:hover {
    background: #fee2e2;
    color: #ef4444;
}

.queue-list .queue-item .btn-delete-sm .material-icons {
    font-size: 14px !important;
}

/* Middle Panel - PDF Preview */
.pdf-preview-panel {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-preview-panel .no-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: 10px;
}

.pdf-preview-panel .no-selection .material-icons {
    font-size: 48px !important;
    opacity: 0.3;
}

.pdf-preview-panel .no-selection span:last-child {
    font-size: 12px;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.pdf-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.pdf-title .material-icons {
    font-size: 18px !important;
    color: #6b7280;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #e5e7eb;
    padding: 3px;
    border-radius: 6px;
}

.zoom-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.zoom-btn.disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

.zoom-level {
    min-width: 40px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

.zoom-reset-btn {
    padding: 4px 8px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
}

.pdf-content {
    flex: 1;
    background: #525252;
    overflow: auto;
    position: relative;
}

/* Direct iframe in pdf-content - no container needed */
.pdf-content > iframe {
    display: block;
}

.pdf-not-available {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    gap: 8px;
}

.pdf-not-available .material-icons {
    font-size: 48px !important;
    opacity: 0.5;
}

/* Right Panel - OCR Data */
.ocr-data-panel {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ocr-data-panel .no-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: 10px;
}

.ocr-data-panel .no-selection .material-icons {
    font-size: 48px !important;
    opacity: 0.3;
}

.ocr-data-panel .no-selection span:last-child {
    font-size: 12px;
}

.ocr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ocr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.learning-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 4px;
}

.learning-badge .material-icons {
    font-size: 12px !important;
}

.confidence-indicator {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

/* OCR Tabs */
.ocr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ocr-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

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

.ocr-tab.active {
    background: var(--primary);
    color: white;
}

.ocr-tab .material-icons {
    font-size: 14px !important;
}

.ocr-tab .tab-label {
    display: none;
}

@media (min-width: 1400px) {
    .ocr-tab .tab-label {
        display: inline;
    }
}

/* OCR Content */
.ocr-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* OCR Actions */
.ocr-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ocr-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ocr-actions button .material-icons {
    font-size: 16px !important;
}

.ocr-actions .btn-edit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.ocr-actions .btn-edit:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.ocr-actions .btn-approve {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ocr-actions .btn-approve:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.ocr-actions .btn-cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.ocr-actions .btn-cancel:hover {
    background: #e5e7eb;
}

.ocr-actions .btn-save {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.ocr-actions .btn-save:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Responsive Layout */
@media (max-width: 1400px) {
    .import-review-layout {
        grid-template-columns: 260px 1fr 340px;
    }
}

@media (max-width: 1200px) {
    .import-review-layout {
        grid-template-columns: 240px 1fr 300px;
    }
}

@media (max-width: 1024px) {
    .import-review-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
    }

    .import-queue-panel {
        grid-column: 1 / -1;
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
    }

    .drop-zone-compact,
    .email-import-section {
        min-width: 200px;
    }

    .review-queue-section {
        min-width: 280px;
        min-height: auto;
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .import-review-screen {
        padding: 8px;
        height: auto;
    }

    .import-review-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .import-queue-panel {
        flex-direction: column;
    }

    .pdf-preview-panel,
    .ocr-data-panel {
        min-height: 400px;
    }
}

/* Modal styles moved to modals.css for better organization */

/* ============================================
   MY COMPANY SCREEN STYLES
   Professional design matching Dashboard
   ============================================ */

.mycompany-container {
    padding: 20px 24px;
    background: #f8fafc;
    min-height: calc(100vh - 120px);
}

.mycompany-header {
    margin-bottom: 20px;
}

.mycompany-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.mycompany-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Tabs */
.mycompany-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.mycompany-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.mycompany-tab:hover {
    color: #4f46e5;
}

.mycompany-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

/* Content */
.mycompany-content {
    background: transparent;
}

/* Layout */
.mycompany-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

.mycompany-form-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mycompany-logo-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sections */
.mycompany-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 16px 20px;
}

.mycompany-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Grid */
.mycompany-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
}

/* Fields */
.mycompany-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mycompany-field-wide {
    grid-column: span 2;
}

.mycompany-field-full {
    grid-column: 1 / -1;
}

.mycompany-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.mycompany-input {
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.mycompany-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.mycompany-input::placeholder {
    color: #9ca3af;
}

.mycompany-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* Input Group */
.mycompany-input-group {
    display: flex;
    gap: 0;
}

.mycompany-input-group .mycompany-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.mycompany-input-addon {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #4f46e5;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.mycompany-input-addon:hover {
    background: #e5e7eb;
}

.mycompany-input-addon:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* Checkboxes */
.mycompany-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.mycompany-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.mycompany-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

/* Logo Section */
.mycompany-logo-section {
    text-align: center;
}

.mycompany-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.mycompany-logo-preview {
    width: 100%;
    height: 140px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    margin-bottom: 12px;
    overflow: hidden;
}

.mycompany-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mycompany-logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
}

.mycompany-logo-placeholder .material-icons {
    font-size: 32px;
}

.mycompany-logo-placeholder span:last-child {
    font-size: 12px;
}

.mycompany-logo-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Notice */
.mycompany-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

.mycompany-notice-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Status Section */
.mycompany-status-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.mycompany-status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.mycompany-last-check {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.mycompany-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mycompany-status-badge.idle {
    background: #f1f5f9;
    color: #475569;
}

.mycompany-status-badge.running {
    background: #dcfce7;
    color: #166534;
}

.mycompany-status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.mycompany-status-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.mycompany-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mycompany-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mycompany-btn-primary {
    background: #4f46e5;
    color: white;
}

.mycompany-btn-primary:hover:not(:disabled) {
    background: #4338ca;
}

.mycompany-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.mycompany-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.mycompany-btn-success {
    background: #059669;
    color: white;
}

.mycompany-btn-success:hover:not(:disabled) {
    background: #047857;
}

.mycompany-btn-danger {
    background: #dc2626;
    color: white;
}

.mycompany-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.mycompany-btn-danger-text {
    background: transparent;
    color: #dc2626;
    padding: 8px 12px;
}

.mycompany-btn-danger-text:hover:not(:disabled) {
    background: #fee2e2;
}

/* Actions */
.mycompany-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Email Provider Selector */
.mycompany-provider-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mycompany-provider-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mycompany-provider-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.mycompany-provider-btn.active {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #4f46e5;
}

/* Provider Help Box */
.mycompany-provider-help {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}

.mycompany-provider-help-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.mycompany-provider-help-content .material-icons {
    color: #0284c7;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.mycompany-provider-help-content strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 2px;
}

.mycompany-provider-help-content p {
    font-size: 12px;
    color: #0c4a6e;
    margin: 0;
    line-height: 1.4;
}

.mycompany-provider-help-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #0284c7;
    background: white;
    border: 1px solid #7dd3fc;
    border-radius: 5px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.mycompany-provider-help-link:hover {
    background: #e0f2fe;
}

.mycompany-provider-help-link .material-icons {
    font-size: 14px;
}

/* Label hint (small text after label) */
.mycompany-label-hint {
    font-weight: 400;
    font-size: 11px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 900px) {
    .mycompany-layout {
        grid-template-columns: 1fr;
    }

    .mycompany-logo-column {
        order: -1;
    }

    .mycompany-logo-section {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .mycompany-container {
        padding: 16px;
    }

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

    .mycompany-field-wide {
        grid-column: span 1;
    }

    .mycompany-checkbox-group {
        flex-direction: column;
        gap: 12px;
    }

    .mycompany-status-header {
        flex-direction: column;
        gap: 8px;
    }

    .mycompany-status-actions {
        flex-wrap: wrap;
    }
}
