/* Modern Dark Theme CSS - Accounting System */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.3);
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-dark: #0f1424;
    --text: #f8fafc;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;
    --border: #475569;
    --border-light: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface-dark) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Login Page */
.login-body {
    background: linear-gradient(135deg, var(--background) 0%, var(--surface-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

.login-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.login-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* App Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.top-bar {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-dark) 100%);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.back-button {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateX(-2px);
}

.app-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logout-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Common Components */
.dashboard {
    width: 100%;
}

.dashboard-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.dashboard-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.action-card, .report-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.action-card::before, .report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.action-card:hover, .report-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.action-card:hover::before, .report-card:hover::before {
    transform: scaleX(1);
}

.action-card h3, .report-card h3 {
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.action-card p, .report-card p {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Forms */
.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.form-container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.form-panel {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-dim);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger, .btn-small, .login-btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary, .login-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover, .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

.btn-ghost {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: linear-gradient(135deg, var(--surface-light), var(--surface));
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--surface-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Invoice Styles */
.invoice-container, .invoice-view-container, .report-container {
    width: 100%;
}

.invoice-header, .report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.invoice-header h2, .report-header h2 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.8rem;
}

.invoice-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.invoice-preview {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.invoice-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.invoice-header-preview {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.invoice-header-preview h2 {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
}

.invoice-meta p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.invoice-meta strong {
    color: var(--text);
}

.invoice-summary, .report-totals {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.summary-row, .total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.summary-row:last-child, .total-row:last-child {
    border-bottom: none;
}

.summary-row.total, .total-row.final {
    font-weight: 800;
    font-size: 1.2rem;
    border-top: 2px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 1rem;
    color: var(--primary);
}

.amount-in-words, .invoice-notes {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface-dark);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.amount-in-words p, .invoice-notes p {
    margin: 0;
    color: var(--text);
}

.amount-in-words strong, .invoice-notes strong {
    color: var(--primary);
}

/* Print Styles */
@media print {
    .top-bar, .back-button, .invoice-actions, .report-header button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .printable-invoice {
        background: white !important;
        color: black !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .data-table {
        border: 1px solid #ddd !important;
    }
    
    .data-table th {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    .invoice-preview {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Printable Invoice */
.printable-invoice {
    background: white;
    color: black;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.invoice-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    border-bottom: 3px solid #333;
    padding-bottom: 1.5rem;
}

.invoice-print-header h1 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 300;
}

.company-info h2 {
    font-size: 1.5rem;
    color: #2563eb;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.company-info p {
    color: #666;
    font-size: 0.9rem;
}

.invoice-print-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.detail-column p {
    margin-bottom: 0.5rem;
    color: #333;
}

.detail-column strong {
    color: #2563eb;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.print-table th,
.print-table td {
    padding: 1rem;
    border: 1px solid #ddd;
    text-align: left;
}

.print-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}

.print-totals {
    margin-top: 2rem;
    text-align: right;
    font-size: 1rem;
}

.print-amount-words, .print-notes {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #2563eb;
}

.print-amount-words p, .print-notes p {
    margin: 0;
    color: #333;
}

.print-amount-words strong, .print-notes strong {
    color: #2563eb;
}

.print-footer {
    margin-top: 3rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 2px solid #ddd;
    color: #666;
    font-style: italic;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.date-report .form-input {
    margin-bottom: 0.75rem;
    background: var(--surface-dark);
}

.date-report form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-table {
    font-size: 0.85rem;
}

.report-table th,
.report-table td {
    padding: 1rem 0.75rem;
}

/* Error and Messages */
.error-message {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid #dc2626;
    font-weight: 500;
}

.success-message {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid #059669;
    font-weight: 500;
}

.no-data {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.no-data p {
    font-size: 1.1rem;
    margin: 0;
}

/* Demo Accounts */
.demo-accounts {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.demo-accounts h3 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-list {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: grid;
    gap: 0.5rem;
}

.account-list div {
    padding: 0.5rem;
    background: var(--surface-dark);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.account-list strong {
    color: var(--text-muted);
}

/* Item Forms */
.item-form {
    background: var(--surface-dark);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.item-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.invoice-totals {
    background: var(--surface-dark);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Schedule Styles */
.schedule-container {
    width: 100%;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.schedule-header h2 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.8rem;
}

.schedule-section {
    margin-bottom: 3rem;
}

.schedule-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 600;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.schedule-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.schedule-card.scheduled {
    border-left-color: var(--primary);
}

.schedule-card.in_progress {
    border-left-color: var(--warning);
}

.schedule-card.completed {
    border-left-color: var(--success);
}

.schedule-card.cancelled {
    border-left-color: var(--danger);
}

.schedule-card .schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.schedule-card h4 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.schedule-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-status.scheduled {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
}

.schedule-status.in_progress {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.schedule-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.schedule-status.cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.schedule-details p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.schedule-details strong {
    color: var(--text);
}

.schedule-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.schedule-table {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.duration {
    color: var(--accent);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.form-help {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Enhanced Search and Auto-complete Styles */
.search-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.search-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.75rem 1rem;
    background: var(--surface-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    min-width: 300px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Auto-complete Results */
.search-results {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: var(--shadow-lg);
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--surface-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Client Info Card */
.client-info-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
}

.client-info-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
    border-bottom: none;
}

/* Status Badges */
.status-cancelled {
    color: var(--danger);
    font-weight: 600;
}

.status-active {
    color: var(--success);
    font-weight: 600;
}

.cancelled {
    opacity: 0.6;
    background: rgba(239, 68, 68, 0.1);
}

/* Reports Header */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.client-actions {
    display: flex;
    gap: 1rem;
}

/* Recent Invoices */
.recent-invoices {
    margin-top: 3rem;
}

.recent-invoices h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 1.3rem;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

/* Disabled Button */
.btn-danger.disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger.disabled:hover {
    transform: none;
    background: var(--secondary);
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Enhanced Form Styles */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Text Muted */
.text-muted {
    color: var(--text-muted) !important;
}

/* Invoice Adjustments Styles */
.current-totals {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.current-totals h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.total-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--surface-dark);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.total-item.final {
    background: var(--surface-light);
    font-weight: 700;
    border-left-color: var(--accent);
}

/* Product Management Styles */
.products-container {
    width: 100%;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.products-header h2 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.8rem;
}

.products-table {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Currency Formatting */
.currency-usd {
    color: var(--success);
    font-weight: 600;
}

.currency-iqd {
    color: var(--accent);
    font-weight: 600;
}

/* Enhanced Form Help */
.form-help {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Price Input Styles */
.price-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* Shared amount styling (Original → Net) for reports and client pages */
.text-right {
    text-align: right;
}

.amount-pair {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.amt-red {
    color: #ef4444;           /* same red as report */
    font-weight: 700;
}

.amt-green {
    color: #10b981;           /* same green as report */
    font-weight: 800;
}

.arrow {
    color: var(--text-dim);
}

.money {
    font-weight: 600;
}





.price-symbol {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 30px;
}

/* Product Search Autocomplete */
.suggestions-box {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item strong {
    color: var(--primary);
}

.suggestion-item small {
    color: #666;
}

.form-group {
    position: relative;
}

/* Current Items Section */
.current-items {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.current-items h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Nice inline buttons for table actions (View / Print / View Expenses) */
.data-table .action-buttons .btn-small {
    color: var(--primary-light);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    background: transparent;
    border: 1px solid transparent;
    transition: var(--transition);
}

/* Different accent per action (View / Print / View Expenses) */
.data-table .action-buttons .btn-small:nth-child(1) {  /* View */
    color: var(--primary-light);
}
.data-table .action-buttons .btn-small:nth-child(2) {  /* Print */
    color: var(--accent);
}
.data-table .action-buttons .btn-small:nth-child(3) {  /* View Expenses */
    color: var(--success);
}

/* Hover states */
.data-table .action-buttons .btn-small:hover {
    background: var(--surface-light);
    border-color: var(--border-light);
    transform: translateY(-1px);
}




/* Responsive Product Table */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .totals-grid {
        grid-template-columns: 1fr;
    }
    
    .products-table {
        font-size: 0.8rem;
    }
    
    .products-table th,
    .products-table td {
        padding: 0.5rem;
    }
}

/* Print Styles for Adjustments */
@media print {
    .invoice-actions {
        display: none !important;
    }
    
    .current-totals {
        background: white;
        border: 1px solid #ddd;
    }
}

/* Responsive Search */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .reports-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .client-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Print schedule */
@media print {
    .schedule-actions, .action-buttons {
        display: none !important;
    }
    
    .schedule-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .invoice-header-preview {
        flex-direction: column;
        gap: 1rem;
    }
    
    .invoice-print-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions, .invoice-actions {
        flex-direction: column;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .form-panel {
        padding: 2rem 1.5rem;
    }
    
    .invoice-preview {
        padding: 2rem 1.5rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .form-panel {
        padding: 1.5rem 1rem;
    }
    
    .invoice-preview {
        padding: 1.5rem 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .action-card, .report-card {
        padding: 1.5rem;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}