/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-xl);
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.company-name {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    margin-bottom: 24px;
}

.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Navigation */
.navbar {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.nav-brand h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.nav-subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

body:not(.login-page) {
    background: var(--bg-light);
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-card);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

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

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.profile-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.profile-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
}

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

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stat-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-stat-item .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.chart-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

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

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Filter Section */
.filter-section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* Transaction Summary */
.transaction-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.summary-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.summary-item .label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-item .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Table */
.table-container {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.transactions-table thead {
    background: var(--bg-light);
}

.transactions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-table td {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.transactions-table tbody tr {
    transition: background 0.2s;
}

.transactions-table tbody tr:hover {
    background: var(--bg-light);
}

.amount-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.person-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.person-jatin {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.person-sachin {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-light);
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-light);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon.edit {
    color: var(--info-color);
}

.btn-icon.delete {
    color: var(--danger-color);
}

/* Form Container */
.form-container {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}

.transaction-form {
    max-width: 100%;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Messages */
.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    margin-top: 24px;
    padding: 16px 20px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.success-message a {
    color: #047857;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px !important;
}

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-message svg {
    color: var(--gray-light);
    width: 48px;
    height: 48px;
}

.empty-message p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    margin: auto;
}

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

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.modal-content form {
    padding: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

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

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

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

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

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

    .table-container {
        overflow-x: auto;
    }

    .transactions-table {
        min-width: 800px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .form-container {
        padding: 24px 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .company-name {
        font-size: 24px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .stat-value {
        font-size: 22px;
    }
}

/* Invoice & Quotation Styles */
.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.document-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.document-badge.invoice {
    background-color: #dbeafe;
    color: #1e40af;
}

.document-badge.quotation {
    background-color: #fef3c7;
    color: #92400e;
}

.payment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.payment-badge.paid {
    background-color: #d1fae5;
    color: #065f46;
}

.payment-badge.unpaid {
    background-color: #fee2e2;
    color: #991b1b;
}

.payment-badge.partial {
    background-color: #fed7aa;
    color: #92400e;
}

.payment-badge.pending {
    background-color: #e5e7eb;
    color: #4b5563;
}

/* ===== Clients CRM Styles ===== */
.clients-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.clients-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.clients-filters select,
.clients-filters input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.clients-filters input {
    flex: 1;
    min-width: 200px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.client-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.client-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.client-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.client-info {
    flex: 1;
}

.client-info h3 {
    margin: 0 0 0.25rem 0;
    color: #1a202c;
    font-size: 1.1rem;
}

.client-gstin {
    margin: 0;
    color: #718096;
    font-size: 0.85rem;
}

.client-badges {
    margin-top: 0.5rem;
}

.client-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.client-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.client-badge.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.client-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.client-stat {
    text-align: center;
    overflow: hidden;
}

.client-stat .label {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.client-stat .value {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

/* Responsive: Stack stats on smaller cards */
@media (max-width: 480px) {
    .client-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.client-card-contact {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.client-card-contact span {
    font-size: 0.85rem;
    color: #4b5563;
}

/* Client Detail Modal */
#clientModal .modal-content {
    max-width: 900px;
}

.client-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.client-detail-info h2 {
    margin: 0 0 0.5rem 0;
    color: #1a202c;
}

.client-detail-gstin {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
}

.client-detail-actions {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

/* Client Sections */
.client-section {
    margin-bottom: 2rem;
}

.section-title {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Contact Info Grid */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    color: #1a202c;
    margin: 0;
    word-wrap: break-word;
}

/* Stats Row */
.client-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.client-stat-box {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.client-stat-box h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-large {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    word-break: break-word;
}

.stat-pending {
    color: #dc2626 !important;
}

/* Invoice History */
.client-invoices-section {
    margin-top: 2rem;
}

.client-invoices-section h3 {
    margin: 0 0 1rem 0;
    color: #1a202c;
}

.client-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.client-detail-stat {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.client-detail-stat .label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.client-detail-stat .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.client-invoices-section h3 {
    margin: 0 0 1rem 0;
    color: #1a202c;
}

.client-invoices-list {
    max-height: 400px;
    overflow-y: auto;
}

.client-invoice-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.client-invoice-item:hover {
    background: #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.invoice-action-hint {
    margin-top: 0.5rem;
    text-align: right;
}

.invoice-item-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.invoice-number {
    font-weight: 600;
    color: #1a202c;
    margin-left: auto;
}

.invoice-item-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.document-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.document-badge.invoice {
    background-color: #dbeafe;
    color: #1e40af;
}

.document-badge.quotation {
    background-color: #fef3c7;
    color: #92400e;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-size: 1.1rem;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
    background: #f3f4f6;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f9fafb;
}

.dashboard-content {
    display: none;
}

.dashboard-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.section-heading {
    margin: 0 0 1.5rem 0;
    color: #1a202c;
    font-size: 1.5rem;
}

.stat-success {
    color: #059669 !important;
}

.stat-danger {
    color: #dc2626 !important;
}

.document-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.document-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.document-body {
    margin-bottom: 15px;
}

.document-info div {
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.document-footer {
    display: flex;
    gap: 10px;
}

.filters-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    font-size: 14px;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.filter-group input[type="text"] {
    min-width: 250px;
}

.modal-large {
    max-width: 1000px;
    width: 95%;
}

.modal-large .modal-body {
    padding: 30px;
}

.modal-body {
    padding: 20px 32px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.line-item {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
}

.line-item .form-row {
    align-items: center;
}

.btn-icon-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.totals-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    max-width: 400px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.total-final {
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 12px;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}
