/* Reset and Base Styles */
:root {
    /* Dark Theme (Default) */
    --bg-1: #0f172a;
    --bg-2: #1a1a2e;
    --accent-1: rgba(255,255,255,0.06);
    --glass-bg: rgba(255,255,255,0.08);
    --glass-border: rgba(255,255,255,0.18);
    --glass-strong: rgba(255,255,255,0.12);
    --primary: #7c5cff;
    --primary-hover: #6b4de0;
    --accent-gradient: linear-gradient(135deg, rgba(124,92,255,0.20) 0%, rgba(0,200,255,0.12) 50%, rgba(124,92,255,0.14) 100%);
    --text-primary: #f8fbff;
    --text-secondary: #e6eef8;
    --text-muted: rgba(230,238,248,0.7);
    --card-bg: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    --card-hover: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    --input-bg: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    --input-border: rgba(255,255,255,0.15);
    --table-header-bg: linear-gradient(180deg, rgba(124,92,255,0.15), rgba(124,92,255,0.08));
    --table-row-hover: linear-gradient(90deg, rgba(124,92,255,0.08), rgba(124,92,255,0.04));
    --table-border: rgba(255,255,255,0.05);
    --shadow-color: rgba(2,6,23,0.4);
    --navbar-bg: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    --footer-bg: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    --btn-secondary-bg: #475569;
    --btn-secondary-hover: #64748b;
    --select-bg: #1a1a2e;
    --body-bg-gradient: radial-gradient(1200px 600px at 10% 10%, rgba(124,92,255,0.14), transparent 10%),
                        radial-gradient(1000px 500px at 90% 90%, rgba(0,200,255,0.08), transparent 10%),
                        var(--bg-1);
}

/* Light Theme - Blue Glassmorphism */
[data-theme="light"] {
    --bg-1: #f7fbff;
    --bg-2: #ffffff;
    --accent-1: rgba(0,0,0,0.03);
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-strong: rgba(255, 255, 255, 0.6);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-gradient: linear-gradient(135deg, rgba(37,99,235,0.10) 0%, rgba(37,99,235,0.05) 100%);
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-hover: rgba(255, 255, 255, 0.6);
    --input-bg: rgba(255, 255, 255, 0.6);
    --input-border: rgba(0, 0, 0, 0.08);
    --table-header-bg: rgba(37, 99, 235, 0.08);
    --table-row-hover: rgba(37, 99, 235, 0.04);
    --table-border: rgba(0, 0, 0, 0.06);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --navbar-bg: rgba(255, 255, 255, 0.45);
    --footer-bg: rgba(255, 255, 255, 0.45);
    --btn-secondary-bg: #2563eb;
    --btn-secondary-hover: #1d4ed8;
    --select-bg: rgba(255, 255, 255, 0.9);
    --blur: 18px;
    --radius: 18px;
    --body-bg-gradient: linear-gradient(135deg, #e8f1ff, #f7fbff);
}

/* Light theme specific overrides */
[data-theme="light"] body {
    color-scheme: light;
}

/* Clean light theme - no sparkle effects for blue glassmorphism */
[data-theme="light"] body::before {
    display: none;
}

/* Glass effect for light theme sections - Blue Glassmorphism */
[data-theme="light"] .stat-card,
[data-theme="light"] .form-container,
[data-theme="light"] .quick-actions,
[data-theme="light"] .recent-section,
[data-theme="light"] .invoice-view,
[data-theme="light"] .empty-state,
[data-theme="light"] .dashboard-toggles,
[data-theme="light"] .customer-details-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: 18px;
}

[data-theme="light"] .stat-card:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Customer details card */
[data-theme="light"] .customer-details-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Project summary card */
[data-theme="light"] .project-summary-card {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
}

[data-theme="light"] .data-table {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    overflow: hidden;
}

[data-theme="light"] .data-table thead {
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .form-section {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus,
[data-theme="light"] .form-group textarea:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .filter-indicator {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-left: 4px solid var(--primary) !important;
    border-radius: 12px;
}

[data-theme="light"] .nav-links a {
    color: #64748b;
}

[data-theme="light"] .nav-links a:hover {
    color: #2563eb;
}

/* Light theme nav icons - blue glassmorphism style */
[data-theme="light"] .nav-icon {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #64748b;
}

[data-theme="light"] .nav-icon:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563eb;
}

/* Active page indicator */
[data-theme="light"] .nav-icon.active {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-bottom: 3px solid #2563eb;
    color: #2563eb;
    border-radius: 8px 8px 0 0;
}

[data-theme="light"] .burger-menu span {
    background-color: #64748b;
}

[data-theme="light"] .nav-icon[data-tooltip]::after {
    background-color: #1e293b;
}

[data-theme="light"] .nav-icon[data-tooltip]::before {
    border-bottom-color: #1e293b;
}

[data-theme="light"] .btn-secondary {
    background: #2563eb;
    color: white !important;
    border-color: rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .btn-secondary:hover {
    background: #1d4ed8;
    color: white !important;
}

[data-theme="light"] .btn-secondary:visited,
[data-theme="light"] .btn-secondary:active {
    color: white !important;
}

/* Light mode button improvements */
[data-theme="light"] .btn-info {
    background: #3b82f6;
    color: white !important;
}

[data-theme="light"] .btn-info:hover {
    background: #2563eb;
    color: white !important;
}

[data-theme="light"] .btn-warning {
    background: #f59e0b;
    color: white !important;
}

[data-theme="light"] .btn-warning:hover {
    background: #d97706;
    color: white !important;
}

[data-theme="light"] .btn-danger {
    background: #ef4444;
}

[data-theme="light"] .btn-danger:hover {
    background: #dc2626;
}

[data-theme="light"] .btn-success {
    background: #10b981;
}

[data-theme="light"] .btn-success:hover {
    background: #059669;
}

[data-theme="light"] select,
[data-theme="light"] .form-group select {
    color-scheme: light;
    background-color: var(--select-bg);
}

[data-theme="light"] select option {
    background-color: var(--select-bg);
    color: var(--text-primary);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background-color: var(--select-bg);
    border-color: var(--input-border);
}

[data-theme="light"] .item-row input,
[data-theme="light"] .item-row textarea {
    background-color: var(--select-bg);
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.04);
}

/* Light theme placeholder styles - darker color for visibility */
[data-theme="light"] .form-group input::placeholder,
[data-theme="light"] .form-group textarea::placeholder,
[data-theme="light"] .item-row input::placeholder,
[data-theme="light"] .item-row textarea::placeholder,
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: rgba(45, 55, 72, 0.5);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: var(--table-row-hover);
}

[data-theme="light"] .data-table tbody tr {
    border-bottom: 1px solid var(--table-border);
}

[data-theme="light"] .nav-divider {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .status-draft {
    background: linear-gradient(135deg, rgba(100,116,139,0.2), rgba(100,116,139,0.1));
    color: #475569;
    border-color: rgba(100,116,139,0.3);
}

[data-theme="light"] .status-sent {
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.1));
    color: #2563eb;
    border-color: rgba(59,130,246,0.3);
}

[data-theme="light"] .status-accepted,
[data-theme="light"] .status-paid,
[data-theme="light"] .status-received {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
    color: #16a34a;
    border-color: rgba(34,197,94,0.3);
}

[data-theme="light"] .status-rejected,
[data-theme="light"] .status-cancelled {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.1));
    color: #dc2626;
    border-color: rgba(239,68,68,0.3);
}

[data-theme="light"] .status-unpaid {
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.1));
    color: #d97706;
    border-color: rgba(245,158,11,0.3);
}

[data-theme="light"] .status-overdue {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.1));
    color: #dc2626;
    border-color: rgba(239,68,68,0.3);
}

[data-theme="light"] .alert-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.08));
    color: #059669;
}

[data-theme="light"] .alert-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.08));
    color: #dc2626;
}

[data-theme="light"] .toggle-slider {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
}

[data-theme="light"] .toggle-slider:before {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
}

[data-theme="light"] .toggle-item {
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #2563eb;
}

[data-theme="light"] .toggle-switch input:checked + .toggle-slider:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Light theme stat card colors */
[data-theme="light"] .stat-card.pending .stat-number {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .stat-card.po-amount .stat-number {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light theme anchor link hover */
[data-theme="light"] a:hover {
    color: #2563eb;
}

/* Light theme document title gradient */
[data-theme="light"] .doc-type {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Theme Toggle Button Styles */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    z-index: 1000;
    transition: all 0.3s ease;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124,92,255,0.4);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(124,92,255,0.5);
}

/* Dark mode: show moon icon (to switch to light) */
.theme-toggle .fa-moon {
    display: block;
}

.theme-toggle .fa-sun {
    display: none;
}

/* Light mode: show sun icon (to switch to dark) */
[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: block;
}

/* Logo switching for themes */
.logo-light {
    display: none;
}

.logo-dark {
    display: block;
}

[data-theme="light"] .logo-light {
    display: block;
}

[data-theme="light"] .logo-dark {
    display: none;
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Poppins', 'Manrope', 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--body-bg-gradient);
    background-attachment: fixed;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* Global select styling for dark theme (Windows compatibility) */
select {
    background-color: #1a1a2e;
    color: var(--text-primary);
    color-scheme: dark;
}

select option {
    background-color: #1a1a2e;
    color: var(--text-primary);
}

/* Anchor Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
}

a:visited {
    color: var(--primary);
}

a:hover {
    color: #00c8ff;
    text-decoration: none;
}

a:active {
    color: var(--primary-hover);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glass Effect Utility */
.glass {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .glass {
        background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    }
}

/* Navigation */
.navbar {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    position: relative;
    z-index: 1100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-logo {
    max-height: 50px;
    height: auto;
    max-width: 180px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

.nav-icon:hover {
    background: rgba(124,92,255,0.15);
    border-color: rgba(124,92,255,0.4);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-icon i {
    transition: transform 0.3s ease;
}

.nav-icon:hover i {
    transform: scale(1.1);
}

/* Active nav icon indicator (dark theme) */
.nav-icon.active {
    background: rgba(124,92,255,0.15);
    border: 1px solid rgba(124,92,255,0.4);
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
    border-radius: 8px 8px 0 0;
}

/* Custom Tooltip */
.nav-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-icon[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 5px solid transparent;
    border-bottom-color: #2c3e50;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-icon[data-tooltip]:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.nav-icon[data-tooltip]:hover::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.nav-divider {
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu span {
    color: #ecf0f1;
    font-weight: 600;
}

/* Hide text labels on desktop, show only icons */
.nav-text {
    display: none;
}

/* Burger Menu Button */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
    position: relative;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
}

.page-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(124,92,255,0.15);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-block;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    color: white;
}

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

.btn-primary {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(124,92,255,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(124,92,255,0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-primary:visited {
    color: white !important;
}

.btn-primary:active {
    color: white !important;
}

.btn-secondary {
    background: #475569;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 4px 12px rgba(2,6,23,0.3);
}

.btn-secondary:hover {
    background: #64748b;
    box-shadow: 0 6px 16px rgba(2,6,23,0.4);
    color: var(--text-primary) !important;
    transform: translateY(-1px);
}

.btn-secondary:visited,
.btn-secondary:active {
    color: var(--text-secondary) !important;
}

.btn-danger {
    background: #ef4444;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239,68,68,0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-danger:visited,
.btn-danger:active {
    color: white !important;
}

.btn-success {
    background: #10b981;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 16px rgba(16,185,129,0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-success:visited,
.btn-success:active {
    color: white !important;
}

.btn-info {
    background: #06b6d4;
    color: white !important;
    box-shadow: 0 4px 12px rgba(6,182,212,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-info:hover {
    background: #0891b2;
    box-shadow: 0 6px 16px rgba(6,182,212,0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-info:visited,
.btn-info:active {
    color: white !important;
}

.btn-warning {
    background: #f59e0b;
    color: white !important;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-warning:hover {
    background: #d97706;
    box-shadow: 0 6px 16px rgba(245,158,11,0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-warning:visited,
.btn-warning:active {
    color: white !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

/* Icon Buttons - consistent style like nav icons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    transform: translateY(-2px);
}

/* Icon button color variants */
.btn-icon.btn-icon-view {
    color: #60a5fa;
    border-color: rgba(96,165,250,0.3);
}
.btn-icon.btn-icon-view:hover {
    background: rgba(96,165,250,0.15);
    border-color: rgba(96,165,250,0.5);
    color: #93c5fd;
    box-shadow: 0 4px 12px rgba(96,165,250,0.3);
}

.btn-icon.btn-icon-edit {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.3);
}
.btn-icon.btn-icon-edit:hover {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.5);
    color: #fcd34d;
    box-shadow: 0 4px 12px rgba(251,191,36,0.3);
}

.btn-icon.btn-icon-delete {
    color: #f87171;
    border-color: rgba(248,113,113,0.3);
}
.btn-icon.btn-icon-delete:hover {
    background: rgba(248,113,113,0.15);
    border-color: rgba(248,113,113,0.5);
    color: #fca5a5;
    box-shadow: 0 4px 12px rgba(248,113,113,0.3);
}

.btn-icon.btn-icon-pdf {
    color: #a78bfa;
    border-color: rgba(167,139,250,0.3);
}
.btn-icon.btn-icon-pdf:hover {
    background: rgba(167,139,250,0.15);
    border-color: rgba(167,139,250,0.5);
    color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(167,139,250,0.3);
}

.btn-icon.btn-icon-clone {
    color: #2dd4bf;
    border-color: rgba(45,212,191,0.3);
}
.btn-icon.btn-icon-clone:hover {
    background: rgba(45,212,191,0.15);
    border-color: rgba(45,212,191,0.5);
    color: #5eead4;
    box-shadow: 0 4px 12px rgba(45,212,191,0.3);
}

.btn-icon.btn-icon-invoice {
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
}
.btn-icon.btn-icon-invoice:hover {
    background: rgba(74,222,128,0.15);
    border-color: rgba(74,222,128,0.5);
    color: #86efac;
    box-shadow: 0 4px 12px rgba(74,222,128,0.3);
}

.btn-icon.btn-icon-check {
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
}
.btn-icon.btn-icon-check:hover {
    background: rgba(74,222,128,0.15);
    border-color: rgba(74,222,128,0.5);
    color: #86efac;
    box-shadow: 0 4px 12px rgba(74,222,128,0.3);
}

.btn-icon.btn-icon-unlink {
    color: #94a3b8;
    border-color: rgba(148,163,184,0.3);
}
.btn-icon.btn-icon-unlink:hover {
    background: rgba(148,163,184,0.15);
    border-color: rgba(148,163,184,0.5);
    color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(148,163,184,0.3);
}

.btn-icon.btn-icon-download {
    color: #38bdf8;
    border-color: rgba(56,189,248,0.3);
}
.btn-icon.btn-icon-download:hover {
    background: rgba(56,189,248,0.15);
    border-color: rgba(56,189,248,0.5);
    color: #7dd3fc;
    box-shadow: 0 4px 12px rgba(56,189,248,0.3);
}

/* Large icon buttons for dashboard */
.btn-icon-lg {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

/* Action buttons - larger buttons with icon and text */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-action i {
    font-size: 0.95rem;
}

/* Action button variants */
.btn-action.btn-action-primary {
    color: #a78bfa;
    border-color: rgba(167,139,250,0.3);
}
.btn-action.btn-action-primary:hover {
    background: rgba(167,139,250,0.15);
    border-color: rgba(167,139,250,0.5);
    color: #c4b5fd;
    box-shadow: 0 4px 16px rgba(167,139,250,0.3);
}

.btn-action.btn-action-success {
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
}
.btn-action.btn-action-success:hover {
    background: rgba(74,222,128,0.15);
    border-color: rgba(74,222,128,0.5);
    color: #86efac;
    box-shadow: 0 4px 16px rgba(74,222,128,0.3);
}

.btn-action.btn-action-secondary {
    color: #94a3b8;
    border-color: rgba(148,163,184,0.3);
}
.btn-action.btn-action-secondary:hover {
    background: rgba(148,163,184,0.15);
    border-color: rgba(148,163,184,0.5);
    color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(148,163,184,0.3);
}

.btn-action.btn-action-info {
    color: #60a5fa;
    border-color: rgba(96,165,250,0.3);
}
.btn-action.btn-action-info:hover {
    background: rgba(96,165,250,0.15);
    border-color: rgba(96,165,250,0.5);
    color: #93c5fd;
    box-shadow: 0 4px 16px rgba(96,165,250,0.3);
}

.btn-action.btn-action-warning {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.3);
}
.btn-action.btn-action-warning:hover {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.5);
    color: #fcd34d;
    box-shadow: 0 4px 16px rgba(251,191,36,0.3);
}

.btn-action.btn-action-danger {
    color: #f87171;
    border-color: rgba(248,113,113,0.3);
}
.btn-action.btn-action-danger:hover {
    background: rgba(248,113,113,0.15);
    border-color: rgba(248,113,113,0.5);
    color: #fca5a5;
    box-shadow: 0 4px 16px rgba(248,113,113,0.3);
}

/* Light theme action buttons */
[data-theme="light"] .btn-action {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.15);
    color: #4b5563;
}

[data-theme="light"] .btn-action.btn-action-primary {
    color: #7c3aed;
    border-color: rgba(124,58,237,0.25);
}
[data-theme="light"] .btn-action.btn-action-primary:hover {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.4);
    color: #6d28d9;
}

[data-theme="light"] .btn-action.btn-action-success {
    color: #16a34a;
    border-color: rgba(22,163,74,0.25);
}
[data-theme="light"] .btn-action.btn-action-success:hover {
    background: rgba(22,163,74,0.1);
    border-color: rgba(22,163,74,0.4);
    color: #15803d;
}

[data-theme="light"] .btn-action.btn-action-secondary {
    color: #64748b;
    border-color: rgba(100,116,139,0.25);
}
[data-theme="light"] .btn-action.btn-action-secondary:hover {
    background: rgba(100,116,139,0.1);
    border-color: rgba(100,116,139,0.4);
    color: #475569;
}

[data-theme="light"] .btn-action.btn-action-info {
    color: #2563eb;
    border-color: rgba(37,99,235,0.25);
}
[data-theme="light"] .btn-action.btn-action-info:hover {
    background: rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.4);
    color: #1d4ed8;
}

[data-theme="light"] .btn-action.btn-action-warning {
    color: #d97706;
    border-color: rgba(217,119,6,0.25);
}
[data-theme="light"] .btn-action.btn-action-warning:hover {
    background: rgba(217,119,6,0.1);
    border-color: rgba(217,119,6,0.4);
    color: #b45309;
}

[data-theme="light"] .btn-action.btn-action-danger {
    color: #dc2626;
    border-color: rgba(220,38,38,0.25);
}
[data-theme="light"] .btn-action.btn-action-danger:hover {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.4);
    color: #b91c1c;
}

/* Icon button tooltip */
.btn-icon[data-tooltip] {
    position: relative;
}

.btn-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn-icon[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 5px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
}

.btn-icon[data-tooltip]:hover::after,
.btn-icon[data-tooltip]:hover::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Light theme icon buttons */
[data-theme="light"] .btn-icon {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.15);
}

[data-theme="light"] .btn-icon.btn-icon-view {
    color: #2563eb;
    border-color: rgba(37,99,235,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-view:hover {
    background: rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.4);
    color: #1d4ed8;
}

[data-theme="light"] .btn-icon.btn-icon-edit {
    color: #d97706;
    border-color: rgba(217,119,6,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-edit:hover {
    background: rgba(217,119,6,0.1);
    border-color: rgba(217,119,6,0.4);
    color: #b45309;
}

[data-theme="light"] .btn-icon.btn-icon-delete {
    color: #dc2626;
    border-color: rgba(220,38,38,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-delete:hover {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.4);
    color: #b91c1c;
}

[data-theme="light"] .btn-icon.btn-icon-pdf {
    color: #7c3aed;
    border-color: rgba(124,58,237,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-pdf:hover {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.4);
    color: #6d28d9;
}

[data-theme="light"] .btn-icon.btn-icon-clone {
    color: #0d9488;
    border-color: rgba(13,148,136,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-clone:hover {
    background: rgba(13,148,136,0.1);
    border-color: rgba(13,148,136,0.4);
    color: #0f766e;
}

[data-theme="light"] .btn-icon.btn-icon-invoice {
    color: #16a34a;
    border-color: rgba(22,163,74,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-invoice:hover {
    background: rgba(22,163,74,0.1);
    border-color: rgba(22,163,74,0.4);
    color: #15803d;
}

[data-theme="light"] .btn-icon.btn-icon-check {
    color: #16a34a;
    border-color: rgba(22,163,74,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-check:hover {
    background: rgba(22,163,74,0.1);
    border-color: rgba(22,163,74,0.4);
    color: #15803d;
}

[data-theme="light"] .btn-icon.btn-icon-unlink {
    color: #64748b;
    border-color: rgba(100,116,139,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-unlink:hover {
    background: rgba(100,116,139,0.1);
    border-color: rgba(100,116,139,0.4);
    color: #475569;
}

[data-theme="light"] .btn-icon.btn-icon-download {
    color: #0284c7;
    border-color: rgba(2,132,199,0.25);
}
[data-theme="light"] .btn-icon.btn-icon-download:hover {
    background: rgba(2,132,199,0.1);
    border-color: rgba(2,132,199,0.4);
    color: #0369a1;
}

[data-theme="light"] .btn-icon[data-tooltip]::after {
    background: rgba(30, 41, 59, 0.95);
}

[data-theme="light"] .btn-icon[data-tooltip]::before {
    border-top-color: rgba(30, 41, 59, 0.95);
}

/* Flash Messages */
.flash-messages {
    margin: 1rem 0;
}

.alert {
    padding: 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.08));
    color: #6ee7b7;
    border-color: rgba(16,185,129,0.3);
    box-shadow: 0 4px 12px rgba(16,185,129,0.15);
}

.alert-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.08));
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
    box-shadow: 0 4px 12px rgba(239,68,68,0.15);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stats-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stats-grid-compact .stat-card {
    padding: 1rem;
}

.stats-grid-compact .stat-card h3 {
    font-size: 0.85rem;
}

.stats-grid-compact .stat-number {
    font-size: 1.5rem;
    margin: 0.75rem 0;
}

.stats-grid-compact .btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* Dashboard Section Toggles */
.dashboard-toggles {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    margin: 2rem 0;
}

.dashboard-toggles h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.toggles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}

.toggle-item label {
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    border-color: var(--primary);
}

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

.toggle-slider:hover {
    background: rgba(255,255,255,0.15);
}

.toggle-switch input:checked + .toggle-slider:hover {
    background: linear-gradient(135deg, #9333ea, var(--primary));
}

.dashboard-section {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.dashboard-section.hidden {
    display: none;
}

.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(2,6,23,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.stat-card.spacer {
    background: transparent;
    box-shadow: none;
    border: none;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 1rem 0;
    text-shadow: 0 2px 8px rgba(124,92,255,0.2);
}

.stat-card.revenue .stat-number {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.pending .stat-number {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.po-amount .stat-number {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-actions {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    margin: 2rem 0;
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
}

.action-buttons .btn {
    flex: 1;
    min-width: fit-content;
    white-space: nowrap;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.recent-activity {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.recent-section {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    width: 100%;
}

.recent-section .data-table {
    width: 100%;
}

.recent-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.recent-section .data-table th {
    font-size: 0.8rem;
}

.recent-section .data-table td {
    font-size: 0.8rem;
}

/* Customer Details Card */
.customer-details-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.data-table {
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 6px 20px rgba(2,6,23,0.3);
    overflow: hidden;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(180deg, rgba(124,92,255,0.15), rgba(124,92,255,0.08));
    color: var(--text-primary);
    border-bottom: 1px solid rgba(124,92,255,0.3);
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(124,92,255,0.08), rgba(124,92,255,0.04));
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table tfoot {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    font-weight: bold;
    border-top: 1px solid var(--glass-border);
}

.data-table tfoot td {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
}

.data-table tfoot .total-row td {
    font-size: 0.95rem;
    padding: 0.75rem;
}

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

.total-row {
    font-size: 1.1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: linear-gradient(135deg, rgba(148,163,184,0.25), rgba(148,163,184,0.15));
    color: #cbd5e1;
    border: 1px solid rgba(148,163,184,0.3);
}

.status-sent {
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(59,130,246,0.15));
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.3);
}

.status-accepted,
.status-paid,
.status-received {
    background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(34,197,94,0.15));
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.3);
}

.status-rejected,
.status-cancelled {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(239,68,68,0.15));
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}

.status-unpaid {
    background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(251,191,36,0.15));
    color: #fde047;
    border: 1px solid rgba(251,191,36,0.3);
}

.status-overdue {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(239,68,68,0.15));
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}

/* Forms */
.form-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    max-width: 1200px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    background-color: #1a1a2e;
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Force dark styling for select dropdowns on Windows */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23e6eef8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select option {
    background-color: #1a1a2e;
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Style for select on Windows/Chrome */
select,
.form-group select {
    color-scheme: dark;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(230,238,248,0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,92,255,0.25), 0 4px 12px rgba(124,92,255,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}

.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.item-row {
    display: grid;
    grid-template-columns: 35px 0.6fr 1.5fr 0.7fr 0.5fr 0.6fr 0.8fr 80px;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: start;
    max-width: 100%;
}

.item-row input {
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    min-width: 0;
    width: 100%;
    font-size: 0.9rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.item-row input::placeholder {
    color: rgba(230,238,248,0.4);
}

.item-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124,92,255,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}

.item-row textarea.item-description {
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    min-width: 0;
    width: 100%;
    font-size: 0.9rem;
    font-family: 'Poppins', 'Manrope', 'Inter', Arial, sans-serif;
    resize: vertical;
    min-height: 48px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.item-row textarea.item-description::placeholder {
    color: rgba(230,238,248,0.4);
}

.item-row textarea.item-description:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124,92,255,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}

.item-row .item-number {
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    min-width: 30px;
}

.item-row .btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.item-row .item-subtotal {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    font-weight: 600;
}

.items-header {
    display: grid;
    grid-template-columns: 35px 0.6fr 1.5fr 0.7fr 0.5fr 0.6fr 0.8fr 80px;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    max-width: 100%;
}

.items-header div {
    padding: 0 0.25rem;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Invoice/Quote View */
.invoice-view {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

.document-header-with-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-left {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.company-logo {
    max-width: 220px;
    max-height: 90px;
    height: auto;
}

.logo-divider-web {
    width: 2px;
    height: 70px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
}

.company-info-web {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.company-info-web div {
    margin: 2px 0;
}

.document-title-right {
    text-align: right;
    flex: 0 0 auto;
}

.doc-type {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), #00c8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
}

.contract-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0.3rem 0;
    font-weight: 600;
}

.doc-number {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
    font-weight: 600;
}

.invoice-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.invoice-header h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.invoice-header p {
    margin-bottom: 0.5rem;
}

.invoice-items {
    margin: 2rem 0;
}

.invoice-items h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-name-section {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-name-section h3 {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 100px;
}

.project-name-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.invoice-notes {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}

.invoice-notes h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.invoice-notes p {
    font-size: 0.85rem;
    margin: 0;
}

.terms-section {
    margin-top: 3rem;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    border-top: 2px solid var(--primary);
    clear: both;
}

.terms-section h3 {
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: bold;
}

.terms-section ol {
    margin: 0 0 1rem 1.2rem;
    padding: 0;
}

.terms-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    font-size: 0.8rem;
}

.terms-section .proprietary-notice {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Empty State */
.empty-state {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(2,6,23,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
    text-align: center;
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 780px) {
    /* Base container adjustments */
    .container {
        padding: 0 10px;
        max-width: 100%;
        width: 100%;
    }

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    * {
        max-width: 100%;
    }

    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 10px;
    }

    .navbar-logo {
        max-height: 40px;
        max-width: 150px;
    }

    /* Show burger menu button on mobile */
    .burger-menu {
        display: flex;
    }

    /* Hide nav links by default on mobile */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background-color: #2c3e50;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        padding: 80px 20px 20px;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease-in-out;
        z-index: 2000;
        overflow-y: auto;
    }

    /* Show nav links when active */
    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
    }

    /* Hide tooltips on mobile */
    .nav-icon[data-tooltip]::after,
    .nav-icon[data-tooltip]::before {
        display: none !important;
    }

    /* Change nav icon styles for mobile - show text, adjust layout */
    .nav-icon {
        font-size: 1.2rem;
        width: 100%;
        height: auto;
        padding: 15px 20px;
        border-radius: 0;
        justify-content: flex-start;
        gap: 15px;
        text-align: left;
    }

    .nav-icon:hover {
        background-color: rgba(52, 152, 219, 0.3);
        transform: none;
    }

    /* Show text labels on mobile */
    .nav-text {
        display: inline-block;
        font-size: 1rem;
        font-weight: 500;
    }

    /* Hide icons on mobile, show only text */
    .nav-icon i {
        display: none;
    }

    /* Adjust divider for mobile */
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 10px 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin: 1rem 0;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .page-header .btn {
        width: auto;
        font-size: 0.75rem;
        padding: 0.45rem 0.6rem;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .page-header > div {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        width: 100%;
    }

    .page-header > div .btn {
        width: 100%;
        text-align: center;
    }

    /* Dashboard and Stats */
    .dashboard {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 1rem 0;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card.spacer {
        display: none;
    }

    .stat-card h3 {
        font-size: 0.85rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-card .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        text-align: center;
    }

    .recent-activity {
        gap: 0.75rem;
        margin: 1rem 0;
    }

    /* Tables - Make scrollable on mobile */
    .data-table {
        width: 100%;
        display: table;
        table-layout: auto;
        border-collapse: collapse;
    }

    .data-table thead {
        display: table-header-group;
    }

    .data-table tbody {
        display: table-row-group;
    }

    .data-table tr {
        display: table-row;
        width: 100%;
    }

    .data-table th,
    .data-table td {
        display: table-cell;
        padding: 0.6rem 0.5rem;
        font-size: 0.75rem;
        vertical-align: middle;
        text-align: center;
        word-wrap: break-word;
    }

    .data-table th {
        font-size: 0.7rem;
        padding: 0.7rem 0.5rem;
        vertical-align: middle;
        text-align: center;
        font-weight: 600;
    }

    /* Table actions on mobile */
    .data-table .actions {
        display: flex;
        flex-direction: row;
        gap: 0.3rem;
        white-space: nowrap;
        justify-content: center;
        align-items: center;
    }

    .data-table .actions .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
        white-space: nowrap;
        text-align: center;
    }

    .data-table .actions form {
        display: inline-block;
        margin: 0;
    }

    .data-table .actions form button {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
        text-align: center;
    }

    /* Form Container */
    .form-container {
        padding: 0.75rem;
        margin: 0.5rem 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Form Section */
    .form-section {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
        box-sizing: border-box;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    input, select, textarea, button {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Items Grid - Stack on mobile */
    .items-header {
        display: none; /* Hide header on mobile, items will be cards */
    }

    .item-row {
        display: block;
        background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .item-row .item-number {
        display: block;
        text-align: left;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .item-row input,
    .item-row textarea {
        width: 100% !important;
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }

    .item-row input::before,
    .item-row textarea::before {
        content: attr(placeholder) ": ";
        font-weight: 600;
    }

    .item-row .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Invoice/Quote View Container */
    .invoice-view {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Invoice/Quote Header */
    .invoice-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .invoice-header h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .invoice-header p {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    /* Document Header with Logo */
    .document-header-with-logo {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    .logo-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .logo-divider-web {
        display: none;
    }

    .company-logo {
        max-width: 150px;
        max-height: 60px;
    }

    .company-info-web {
        font-size: 0.7rem;
    }

    .document-title-right {
        text-align: left;
        margin-top: 0.75rem;
    }

    .doc-type {
        font-size: 1.5rem;
    }

    .doc-number {
        font-size: 0.9rem;
    }

    .contract-info {
        font-size: 0.75rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.6rem;
        text-align: center;
        display: inline-block;
    }

    .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
        text-align: center;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.4rem;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .form-actions {
        flex-direction: row;
        gap: 0.4rem;
    }

    .form-actions .btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.5rem;
        text-align: center;
    }

    /* Quick Actions */
    .quick-actions {
        padding: 1rem;
        margin: 1rem 0;
    }

    .quick-actions h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .action-buttons .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        text-align: center;
        width: 100%;
    }

    /* Recent Sections */
    .recent-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .recent-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

    /* Special handling for recent section tables */
    .recent-section .data-table {
        font-size: 0.75rem;
        width: 100%;
        table-layout: auto;
    }

    .recent-section .data-table th {
        font-size: 0.7rem;
        padding: 0.6rem 0.4rem;
        vertical-align: middle;
        text-align: center;
    }

    .recent-section .data-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
        vertical-align: middle;
        text-align: center;
    }

    /* Status badge adjustments for mobile */
    .recent-section .status-badge {
        display: inline-block;
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        white-space: nowrap;
    }

    .recent-section .data-table a {
        color: var(--primary);
        text-decoration: none;
    }

    /* Empty State */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state p {
        font-size: 1rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    footer p {
        font-size: 0.85rem;
    }

    /* Status Badges */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* Project Name Section */
    .project-name-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .project-name-section h3 {
        font-size: 0.8rem;
        min-width: auto;
    }

    .project-name-text {
        font-size: 0.9rem;
    }

    /* Invoice Items Section */
    .invoice-items {
        margin: 1rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .invoice-items h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    /* Remove fixed widths from table columns on mobile */
    .invoice-items table th[style],
    .invoice-items table td[style] {
        width: auto !important;
    }

    .invoice-items .data-table {
        font-size: 0.7rem;
    }

    .invoice-items .data-table th {
        font-size: 0.65rem;
        padding: 0.5rem 0.3rem;
    }

    .invoice-items .data-table td {
        font-size: 0.7rem;
        padding: 0.5rem 0.3rem;
    }

    .invoice-items .data-table tfoot td {
        font-size: 0.75rem;
        padding: 0.5rem 0.3rem;
    }

    .invoice-items .data-table .total-row td {
        font-size: 0.8rem;
        font-weight: bold;
    }

    /* Invoice Notes */
    .invoice-notes {
        padding: 0.75rem;
        margin: 1rem 0;
    }

    .invoice-notes h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .invoice-notes p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* Terms Section */
    .terms-section {
        margin-top: 1.5rem;
        padding: 0.75rem;
    }

    .terms-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .terms-section ol {
        margin-left: 1rem;
    }

    .terms-section li {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .terms-section .proprietary-notice {
        font-size: 0.7rem;
        margin-top: 0.75rem;
        line-height: 1.3;
    }

    /* Overlay for mobile menu */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Drag and Drop Sortable Rows */
.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr.dragging {
    opacity: 0.5;
    background: linear-gradient(180deg, rgba(124,92,255,0.2), rgba(124,92,255,0.1));
}

.data-table tbody tr.drag-over {
    border-top: 3px solid var(--primary);
    background: linear-gradient(180deg, rgba(124,92,255,0.08), rgba(124,92,255,0.04));
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.drag-handle:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.row-placeholder {
    pointer-events: none;
}

/* Mobile: Hide drag handles on small screens */
@media (max-width: 780px) {
    .drag-handle {
        display: none;
    }
}

/* Mileage Expense Sections */
#mileage-section {
    background: linear-gradient(180deg, rgba(124,92,255,0.08), rgba(124,92,255,0.04));
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid rgba(124,92,255,0.2);
}

.mileage-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mileage-details small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

#calculate-distance-btn {
    width: 100%;
}

/* Trial Banner */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(124,92,255,0.2), rgba(59,130,246,0.15));
    border: 1px solid rgba(124,92,255,0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.trial-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.trial-banner-content i {
    color: var(--primary);
    font-size: 1.1rem;
}

.trial-banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(167,139,250,0.4);
    color: #a78bfa;
    cursor: pointer;
}

.trial-banner-btn:hover {
    background: rgba(167,139,250,0.15);
    border-color: rgba(167,139,250,0.6);
    color: #c4b5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167,139,250,0.2);
}

[data-theme="light"] .trial-banner-btn {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.3);
    color: #2563eb;
}

[data-theme="light"] .trial-banner-btn:hover {
    background: rgba(37,99,235,0.15);
    border-color: rgba(37,99,235,0.5);
    color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

[data-theme="light"] .trial-banner {
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

@media (max-width: 600px) {
    .trial-banner {
        flex-direction: column;
        text-align: center;
    }

    .trial-banner-btn {
        width: 100%;
        text-align: center;
    }
}

/* Hero Buttons - Premium styled buttons from landing page */
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
}

.hero-btn-primary {
    background: linear-gradient(135deg, rgba(124,92,255,0.3), rgba(167,139,250,0.15));
    border: 1px solid rgba(167,139,250,0.5);
    color: #c4b5fd;
    animation: heroBtnPulse 3s ease-in-out infinite;
}

@keyframes heroBtnPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(124,92,255,0.25);
    }
    50% {
        box-shadow: 0 4px 35px rgba(124,92,255,0.5), 0 0 20px rgba(167,139,250,0.3);
    }
}

.hero-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

.hero-btn-primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, #7c5cff, #a78bfa, #c4b5fd, #a78bfa, #7c5cff);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    animation: borderGlowHero 3s ease infinite;
}

@keyframes borderGlowHero {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-btn-primary:hover {
    background: linear-gradient(135deg, rgba(124,92,255,0.4), rgba(167,139,250,0.25));
    border-color: transparent;
    color: #fff;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 40px rgba(124,92,255,0.5),
        0 0 30px rgba(167,139,250,0.4),
        inset 0 0 20px rgba(255,255,255,0.1);
    animation: none;
}

.hero-btn-primary:hover::before {
    left: 100%;
}

.hero-btn-primary:hover::after {
    opacity: 1;
}

.hero-btn-primary:hover i {
    animation: iconWave 0.6s ease;
}

@keyframes iconWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.hero-btn-primary:active {
    transform: translateY(-1px) scale(1);
}

.hero-btn-secondary {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
}

.hero-btn-secondary:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
    border-color: rgba(167,139,250,0.4);
    color: #c4b5fd;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124,92,255,0.2);
}

/* Light theme hero buttons */
[data-theme="light"] .hero-btn-primary {
    background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(59,130,246,0.1));
    border-color: rgba(37,99,235,0.4);
    color: #2563eb;
    animation: heroBtnPulseLightStyle 3s ease-in-out infinite;
}

@keyframes heroBtnPulseLightStyle {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37,99,235,0.2);
    }
    50% {
        box-shadow: 0 4px 35px rgba(37,99,235,0.4), 0 0 20px rgba(59,130,246,0.2);
    }
}

[data-theme="light"] .hero-btn-primary::after {
    background: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa, #3b82f6, #2563eb);
}

[data-theme="light"] .hero-btn-primary:hover {
    background: linear-gradient(135deg, rgba(37,99,235,0.3), rgba(59,130,246,0.2));
    color: #1d4ed8;
    box-shadow:
        0 15px 40px rgba(37,99,235,0.35),
        0 0 30px rgba(59,130,246,0.25);
}

[data-theme="light"] .hero-btn-secondary {
    background: rgba(255,255,255,0.6);
    border-color: rgba(0,0,0,0.08);
    color: var(--text-secondary);
}

[data-theme="light"] .hero-btn-secondary:hover {
    background: rgba(255,255,255,0.8);
    border-color: rgba(37,99,235,0.3);
    color: #2563eb;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
