/* Modern Black & White Theme CSS - Accounting System */
:root {
    --primary: #111111;
    --primary-dark: #000000;
    --primary-light: #ffffff;

    --secondary: #a3a3a3;
    --accent: #d4d4d4;
    --accent-glow: rgba(212, 212, 212, 0.3);

    --background: #f5f5f5;   /* light background */
    --surface: #ffffff;      /* white cards */
    --surface-light: #f3f3f3;
    --surface-dark: #e5e5e5;

    --text: #111111;
    --text-muted: #4b4b4b;
    --text-dim: #777777;

    --border: #d4d4d4;
    --border-light: #e5e5e5;

    --success: #555555;
    --warning: #777777;
    --danger: #999999;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.05);
    --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(--secondary);
}

/* 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.2;
    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-dark), var(--accent));
}

.login-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-light), 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-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: translateX(-2px);
}

.creator-badge{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1;
  border: 1px solid var(--border);
  user-select: none;
}

/* Walat */
.creator-w{
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

/* Barzan */
.creator-b{
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.35);
  color: #16a34a;
}

/* Unknown/others */
.creator-u{
  background: rgba(107, 114, 128, 0.15);
  border-color: rgba(107, 114, 128, 0.35);
  color: #6b7280;
}

.invoice-actions .creator-badge{
  margin-right: 6px;
}
.action-buttons .creator-badge{
  margin-right: 6px;
}


.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), #5b5b5b);
    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(0, 0, 0, 0.6);
}

.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-light), 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;
}

/* Button Styles Matching data.html */
.btn-action {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 100px;
}

.btn-view-client {
    background: linear-gradient(135deg, #f5f5f5, #e5e5e5);
    color: #111111;
    border-color: #e5e5e5;
}

.btn-view-client:hover {
    background: linear-gradient(135deg, #e5e5e5, #d4d4d4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-view-invoice {
    background: linear-gradient(135deg, #f3f3f3, #e0e0e0);
    color: #111111;
    border-color: var(--accent);
}

.btn-view-invoice:hover {
    background: linear-gradient(135deg, #e0e0e0, #cccccc);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-edit-client {
    background: linear-gradient(135deg, #d4d4d4, #a3a3a3);
    color: #111111;
    border-color: #b3b3b3;
}

.btn-edit-client:hover {
    background: linear-gradient(135deg, #b3b3b3, #8a8a8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* For the Open button in employee_clients.html table */
.data-table .btn-action {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    min-width: 70px;
}

/* For buttons in invoice view page */
.info-actions .btn-action {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* For the edit button in invoice items table */
.btn-edit {
    background: linear-gradient(135deg, #d4d4d4, #a3a3a3);
    color: #111111;
    border: 2px solid #b3b3b3;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    min-width: 60px;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #b3b3b3, #8a8a8a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45);
}

.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-dark), 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-light), 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-dark), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.action-card:hover, .report-card:hover {
    border-color: var(--primary-dark);
    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-light);
    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-light), 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-dark), 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-dark);
    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-light), var(--primary-dark));
    color: #111111;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover, .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.btn-ghost {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-light);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #5b5b5b);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.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-light), 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-dark), 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-light);
    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-light);
}

.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-light);
}

.amount-in-words p, .invoice-notes p {
    margin: 0;
    color: var(--text);
}

.amount-in-words strong, .invoice-notes strong {
    color: var(--primary-light);
}

/* 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: #111;
    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: #111;
}

.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 #111;
}

.print-amount-words p, .print-notes p {
    margin: 0;
    color: #333;
}

.print-amount-words strong, .print-notes strong {
    color: #111;
}

.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, #4b4b4b, #2b2b2b);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid #2b2b2b;
    font-weight: 500;
}

.success-message {
    background: linear-gradient(135deg, #e5e5e5, #b3b3b3);
    color: #111111;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid #d4d4d4;
    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;
}


/* Left side of navbar: Back + Home */
.nav-left{
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Home button (matches Back button style) */
.home-button{
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.home-button:hover{
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
}





/* 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-light);
}

.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-light);
    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-light), 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-light);
    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-light);
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.schedule-card.scheduled {
    border-left-color: var(--primary-light);
}

.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(250, 250, 250, 0.12);
    color: var(--primary-light);
}

.schedule-status.in_progress {
    background: rgba(179, 179, 179, 0.2);
    color: var(--warning);
}

.schedule-status.completed {
    background: rgba(229, 229, 229, 0.2);
    color: var(--success);
}

.schedule-status.cancelled {
    background: rgba(138, 138, 138, 0.25);
    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), #b3b3b3);
    color: #111111;
    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, #b3b3b3, #8a8a8a);
    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-dark);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-light);
    color: #111111;
    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);
    color: var(--text);
}

.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-light);
}

.client-info-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-light);
    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(138, 138, 138, 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-light);
    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-light), 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-light);
    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-light);
}

.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-light), 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: #a3a3a3;
    font-weight: 700;
}

.amt-green {
    color: #f5f5f5;
    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: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 2px);
    box-shadow: var(--shadow-lg);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text);
}

.suggestion-item:hover {
    background: var(--surface-light);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item strong {
    color: var(--primary-light);
}

.suggestion-item small {
    color: var(--text-muted);
}

.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-light);
}

/* Nice inline buttons for table actions (View / Print / View Expenses) */
.data-table .action-buttons .btn-small {
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #d4d4d4;
    background: #f3f4f6;
    color: #111111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: var(--transition);
}
/* Different accent per action (still grayscale but slightly different) */
.data-table .action-buttons .btn-small:nth-child(1) {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

/* Print */
.data-table .action-buttons .btn-small:nth-child(2) {
    background: #6b7280;
    border-color: #4b5563;
    color: #ffffff;
}

/* View Expenses */
.data-table .action-buttons .btn-small:nth-child(3) {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}

/* Hover states */
.data-table .action-buttons .btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

/* 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-light);
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background: var(--secondary);
    color: white;
}

::-moz-selection {
    background: var(--secondary);
    color: white;
}

/* ===== Readability tweaks for light black & white theme ===== */

/* Main section titles */
.dashboard-header h2,
.form-container h2,
.form-header h2,
.invoice-header h2,
.report-header h2,
.products-header h2,
.schedule-header h2 {
    background: none;
    -webkit-text-fill-color: initial;
    color: #111111;
}

/* Card titles (Debt Report, Monthly Report, etc.) */
.action-card h3,
.report-card h3,
.client-info-card h3,
.current-totals h3,
.current-items h3,
.item-form h3,
.schedule-section h3,
.schedule-card h4,
.recent-invoices h3,
.stat-card h3 {
    background: none;
    -webkit-text-fill-color: initial;
    color: #222222;
    font-weight: 700;
}

/* Descriptions / paragraph text in cards and info blocks */
.action-card p,
.report-card p,
.schedule-details p,
.no-data p,
.invoice-meta p,
.detail-column p {
    color: #444444;
}

/* Table headers + cells (client names, totals, etc.) */
.data-table th {
    color: #333333;
    font-weight: 700;
}

.data-table td {
    color: #222222;
}

/* Muted text should still be readable on light background */
.text-muted {
    color: #555555 !important;
}

/* ===== Colored button overrides ===== */

/* Primary actions – New Invoice, main submit, view/search buttons */
.btn-primary,
.search-btn,
.btn-view-client,
.btn-view-invoice {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover,
.search-btn:hover,
.btn-view-client:hover,
.btn-view-invoice:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Edit buttons (warning / edit color) */
.btn-edit,
.btn-edit-client {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-color: #d97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-edit:hover,
.btn-edit-client:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Success buttons (complete / save / done) */
.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

/* Danger / delete + Logout */
.btn-danger,
.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(248, 113, 113, 0.3);
}

.btn-danger:hover,
.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.4);
}

/* Ghost / secondary buttons */
.btn-ghost {
    background: #ffffff;
    border: 2px solid #d4d4d4;
    color: #111111;
}

.btn-ghost:hover {
    background: #f3f3f3;
    border-color: #9ca3af;
    transform: translateY(-2px);
}
/* ===== Yearly report summary cards – make text visible ===== */
.yearly-report-summary,
.yearly-report-summary .summary-card {
    background: #020617;          /* very dark navy */
    color: #ffffff;               /* white text */
}

.yearly-report-summary .summary-card h2,
.yearly-report-summary .summary-card h3,
.yearly-report-summary .summary-card p,
.yearly-report-summary .summary-card span,
.yearly-report-summary .summary-card small,
.yearly-report-summary .summary-card strong {
    color: #ffffff;
}

.yearly-report-summary .summary-card .summary-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

.yearly-report-summary .summary-card .summary-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.yearly-report-summary .summary-card .summary-sub {
    font-size: 0.85rem;
    opacity: 0.7;
}
