:root {
    /* Brand Colors */
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-secondary: #ec4899;

    /* === DEFAULT: Dark Theme === */
    --bg-base: #141414;
    --bg-card: #1c1c1e;
    --bg-input: #27272a;
    --bg-nav-active: rgba(255, 255, 255, 0.06);

    --text-primary: #fcfcfc;
    --text-secondary: #a1a1aa;
    --text-muted: #737373;
    --text-inverse: #09090b;

    --border-color: #27272a;
    --border-color-focus: #6366f1;

    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: cubic-bezier(0.4, 0, 0.2, 1) 300ms;
}

/* Light Theme Override — applied only when user selects light mode */
.light-theme {
    --bg-base: #fafafa;
    --bg-card: #ffffff;
    --bg-input: #f4f4f5;
    --bg-nav-active: rgba(0, 0, 0, 0.04);

    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-inverse: #ffffff;

    --border-color: #e4e4e7;
    --border-color-focus: #818cf8;

    --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);
}

/* .dark-theme is kept as a no-op for any legacy references — dark is the :root default */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition), color var(--transition);
}

.font-mono {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: -0.2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--brand-primary-hover);
}

/* Typography Utilities */
.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--status-success);
}

.text-danger {
    color: var(--status-danger);
}

.text-gradient {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-sm {
    font-size: 0.8125rem;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Display Utilities */
.hidden {
    display: none !important;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.pt-2 {
    padding-top: 0.5rem;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--brand-primary);
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {

background-color: var(--bg-input);
    color: var(--text-primary);
}

.btn-link {
    background-color: transparent;
    color: var(--brand-primary);
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

.btn-lg {
    padding: 0.65rem 1.25rem;
    font-size: 0.925rem;
}

.btn-block {
    width: 100%;
}

.btn-icon,
.btn-close {
    padding: 0.5rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-icon:hover,
.btn-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.4s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Login View */
.login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 50%),
        radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.1), transparent 50%);
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.login-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-login {
    display: grid;
    grid-template-columns: 1fr; /* Single column — Google only */
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon-small {
    width: 32px;
    height: 32px;

background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    letter-spacing: -0.025em;
}

.nav-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: calc(100% - 1rem);
    margin: 0.25rem 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.nav-item:hover {
    color: var(--brand-primary);
    background: var(--bg-nav-active);
}

.nav-item.active {
    color: var(--brand-primary);
    background: var(--bg-nav-active);
}

.nav-item svg {
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    width: fit-content;
}

.badge-free {
    background: var(--bg-nav-active);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-pro-tier {
    background: #10b981;
    color: #fff;
}

.logout-link {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    scroll-behavior: smooth;
    position: relative;
}

.app-view {
    max-width: 1200px;
    margin: 0 auto;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Cards & Grid */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

/* Analytics & Charts */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    padding: 1.5rem;
}

.chart-container-simple {
    height: 250px;
    display: flex;
    align-items: flex-end;
    padding: 1rem 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    width: 100%;
    height: 100%;
    gap: 8px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 8px;
}

.chart-bar {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(to top, var(--brand-primary), var(--brand-secondary));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}

.bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem;
    background: var(--bg-nav-active);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.metric-item span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.metric-item strong {
    font-size: 1rem;
    color: var(--text-primary);
}


/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 2px 4px; /* Super Dense Baseline - Overridden by Desktop Media Query */
    text-align: left;
    border-bottom: none;
    font-size: 0.8125rem;
}

/* --- DESKTOP TABLE HEIGHT (Exclusive) --- */
@media (min-width: 769px) {
    .data-table th,
    .data-table td {
        padding: 0.85rem 1rem !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

}

.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    background-color: var(--bg-base) !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--bg-nav-active);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success {
    background: #10b981 !important;
    color: white !important;
}

.badge-warning {
    background: #f59e0b !important;
    color: white !important;
}

.badge-danger {
    background: #ef4444 !important;
    color: white !important;
}

/* Force status badge colors on <select> elements (browsers override background by default) */
select.badge-success,
select.badge-warning,
select.badge-danger {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-align-last: center !important;
    border: none !important;
    cursor: pointer !important;
}

/* Invoice / Quotes statuses */
select.badge-success { background: #10b981 !important; color: white !important; } /* paid, approved */
select.badge-warning { background: #f59e0b !important; color: white !important; } /* pending, draft, sent */
select.badge-danger  { background: #ef4444 !important; color: white !important; } /* overdue, declined, rejected */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 2rem;
    align-items: start;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Line Items Editor */
.items-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.items-header,
.item-row {
    display: grid;
    grid-template-columns: 2fr 80px 100px 120px 40px;
    gap: 0.5rem;
    padding: 0.75rem;
    align-items: center;
}

.items-header {
    background-color: var(--bg-base);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.item-row {
    border-bottom: 1px solid var(--border-color);
}

.item-row:last-child {
    border-bottom: none;
}

.item-row input {
    padding: 0.5rem;
}

/* Totals Summary */
.totals-summary {
    background: var(--bg-base);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.summary-row.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Preview Sticky Wrapper */
.preview-wrapper {
    position: sticky;
    top: 0;
}

.preview-sticky {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-base);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.invoice-preview-container {
    padding: 1rem;
    background: #e2e8f0;

overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px);
    /* A 'virtual viewport' for the scaled invoice */
    display: flex;
    justify-content: center;
}

/* Scaler wrapper collapses layout to match the visual size after scale() */
.invoice-scaler {
    width: 397px; /* 210mm * 0.5 = ~397px visual width */
    min-height: 420.5px; /* 297mm * 0.5 = ~420.5px visual height */
    flex-shrink: 0;
}

/* The actual invoice preview page inside */
.invoice-page {
    background: white;
    width: 794px; /* 210mm at 96dpi */
    min-height: 1123px; /* 297mm at 96dpi */
    padding: 76px; /* 20mm at 96dpi */
    box-sizing: border-box;
    box-shadow: var(--shadow-md);
    color: #1a1a1a;
    transform-origin: top left;
    transform: scale(0.5);
    /* Scale down to visual (397px x 561px) - layout taken by parent .invoice-scaler */
}

/* At larger screens, we might change scale, handled via JS if needed */

/* Settings Area */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
}

.settings-card {
    padding: 2rem;
}

.logo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-base);
}

.logo-upload-area:hover {
    border-color: var(--brand-primary);
    background: var(--bg-nav-active);
}

.upload-placeholder {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-preview-img {
    max-height: 100px;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

/* Customization Panel */
.customization-panel {
    background: var(--bg-nav-active);
    border-bottom: 2px solid var(--brand-primary);
    padding: 1.25rem;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

.panel-controls {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr;
    gap: 1.25rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.control-group input[type="color"]:hover {
    transform: scale(1.05);
}

.badge-pro {
    font-size: 0.7em !important;
    background: linear-gradient(135deg, #6366f1, #a855f7) !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: none !important;
    margin-left: 8px !important;
    font-weight: 700;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 90vh; /* Keep within viewport */
    overflow-y: auto; /* Enable scroll if content is long */
    margin: auto; /* Auto margin ensures flex centers it vertically */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}


/* Toast System */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.toast {
    min-width: 250px;
    background: var(--bg-card);
    border-left: 4px solid var(--brand-primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideUp 0.3s ease-out forwards;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 80px;
    }

    .sidebar-brand h1,
    .nav-item span,
    .user-name,
    .logout-link,
    #theme-toggle span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 0.75rem;
    }

    .nav-item svg {
        margin: 0;
    }

    .user-profile {
        justify-content: center;
    }

    #theme-toggle {
        justify-content: center;
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-4,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        overflow-y: visible;
        overflow-x: auto;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .view-header button, .view-header .header-actions {
        width: 100%;
        justify-content: center;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .items-editor {
        overflow-x: auto;
    }

    .items-header,
    .item-row {
        min-width: 500px;
    }

    .editor-controls {
        gap: 1rem;
    }

    .card {
        overflow-y: visible;
        overflow-x: auto;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

.view-header button, .view-header .header-actions {
    width: 100%;
    justify-content: center;
}

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .items-editor {
        overflow-x: auto;
    }

    .items-header,
    .item-row {
        min-width: 500px;
    }

    .editor-controls {
        gap: 1rem;
    }
}
/* Offline Indicator & Enhancements */
.offline-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 8px 16px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--status-warning);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.toast-warning {
    border-left-color: var(--status-warning);
}

/* Signature Features */
.signature-section label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signature-preview-box {
    position: relative;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

#signature-img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(1) contrast(1.5);
}

.dark-theme #signature-img {
    filter: grayscale(1) contrast(1.5) invert(1);
}

.btn-remove-signature {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 16px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger);
}

.signature-canvas-container {
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: crosshair;
    touch-action: none;
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

#signature-canvas {
    max-width: 100%;
    height: auto;
}

/* Phase 2: Client Details & Analytics */
.header-with-back {
    display: flex;
    align-items: center;
}

.mr-2 { margin-right: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

.chart-container-simple {
    padding: 20px 10px;
    height: 250px;
    display: flex;
    align-items: flex-end;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    width: 100%;
    height: 100%;
    gap: 10px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 10px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, var(--brand-primary), var(--brand-secondary));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.chart-bar:hover {
    filter: brightness(1.2);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}

.bar-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.metric-item span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.metric-item strong {
    font-size: 1.1rem;
    color: var(--text-heading);
}

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   PHASE 3: ADVANCED FINANCIAL TOOLS
   ========================================================== */

/* Enhanced Analytics & Stats */
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#analytics-stats-grid .stat-title {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Expenses Table */
.btn-edit-expense {
    margin-right: 0.5rem;
}

/* Header Theme Toggle */
.theme-toggle-header {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
}
.theme-toggle-header:hover {
    background: var(--bg-hover, rgba(0,0,0,0.05));
    color: var(--brand-color, #6366f1) !important;
}
.dark-theme .theme-toggle-header:hover {
    background: var(--bg-hover, rgba(255,255,255,0.1));
}


/* Modal Header & Close UI */
.modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--text-primary);
}

.btn-close {
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    color: var(--text-muted) !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-primary) !important;
    transform: scale(1.1);
}

/* Signature Modal Enhancements */
.signature-preview-container {
    background-color: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.signature-preview-container:focus-within {
    border-color: var(--brand-primary);
    background-color: var(--bg-card);
}

#signature-input {
    width: 100%;
    background: transparent;
    border: none;
    text-align: center;
    color: var(--text-primary);
    outline: none;
    padding: 20px;
    font-size: 45px; /* Midpoint of 30-60px range */
    height: 120px; /* Specific height to prevent clipping */
    line-height: normal;
    transition: font-size 0.05s linear, font-family 0.3s ease;
    box-sizing: border-box !important;
}

.signature-placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    opacity: 0.5;
}

.font-selector {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
    margin-bottom: 24px;
}

.font-option {
    padding: 12px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    transition: var(--transition);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.font-option:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.font-option.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

.font-option span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.size-control {
    margin-bottom: 24px;
}

.size-control label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transition: var(--transition);
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.3);
}

/* Custom fonts for preview items */
.font-sacramento { font-family: 'Sacramento', cursive; }
.font-satisfy { font-family: 'Satisfy', cursive; }
.font-alex { font-family: 'Alex Brush', cursive; }
.font-momo { font-family: 'Momo Signature', cursive; }
.font-handlee { font-family: 'Handlee', cursive; }

/* --- Pro Upgrade Flow --- */
.pro-view {
    display: block;
    transition: all 0.3s ease;
}

.pro-view.hidden {
    display: none;
}

.premium-pricing {
    padding: 2.5rem 2rem;
    background: var(--bg-nav-active);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.premium-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.premium-price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.bank-details-card {
    transition: transform 0.2s;
}

.bank-row {
    position: relative;
}

.btn-success {
    background-color: #25d366;
    color: white;
    border: none;
    transition: all 0.2s;
}

.btn-success:hover {
    background-color: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-copy {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.btn-copy:hover {
    opacity: 1;
    text-decoration: underline;
}

.icon-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--brand-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.icon-copy:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

.icon-copy svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Payment Method Cards */
button.payment-method-card {
    width: 100%;
    display: block;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

button.payment-method-card:hover {
    border-color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.06);
}

button.payment-method-card.active {
    border-color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-info strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.payment-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.payment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-nav-active);
    border-radius: 10px;
    color: var(--brand-primary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.payment-method-card.active .payment-icon {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.payment-info strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.payment-info span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Modal Header Fix for Pro Flow */
#pro-modal .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#pro-modal .modal-header h3 {
    margin: 0;
    flex: 1;
}

#pro-modal .btn-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    z-index: 10;
}

#pro-modal .btn-close:hover {
    color: var(--text-primary);
}

/* --- Document Creator Layout --- */
.creator-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    height: calc(100vh - 160px);
    overflow: hidden;
}

.creator-scroll-area {
    overflow-y: auto;
    padding-right: 1rem;
}

.creator-preview-area {
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow-y: auto;
}

.preview-sticky {
    position: sticky;
    top: 0;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Document Sections List --- */
.doc-sections-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-sec-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
}

.doc-sec-item:hover {
    border-color: var(--border-color-focus);
}

.doc-sec-head {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.doc-sec-title-inp {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    outline: none;
}

.doc-sec-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-sec-arrow {
    transition: transform 0.3s;
    font-size: 0.8rem;
    opacity: 0.5;
}

.doc-sec-item.collapsed .doc-sec-arrow {
    transform: rotate(-90deg);
}

.doc-sec-body {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.doc-sec-item.collapsed .doc-sec-body {
    display: none;
}

/* Quill Editor Dark Theme Fixes */
.doc-quill-editor {
    height: 300px;
    background: white;
    color: #111;
    border-radius: 4px;
}

.ql-toolbar.ql-snow {
    background: #f3f4f6;
    border-color: #ddd !important;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.ql-container.ql-snow {
    border-color: #ddd !important;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.ql-editor { font-family: 'Inter', sans-serif; font-size: 14px; }

/* --- Cover Page Preview (Scaled) --- */
.doc-preview-container {
    width: 100%;
    aspect-ratio: 1 / 1.414; /* A4 Ratio */
    background: white;

box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* --- Actual Document Cover Page (A4 Size for Rendering) --- */
.doc-cover-page {
    width: 794px;
    height: 1123px;
    position: relative;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #1a1a1a;
    box-sizing: border-box;
    overflow: hidden;
}

.doc-preview-container .doc-cover-page {
    transform: scale(0.44); /* Scaled down for 400px width container approximately */
    transform-origin: top left;
    position: absolute;
    top: 0;
    left: 0;
}

/* Geometric Shapes */
.doc-geo-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.doc-geo {
    position: absolute;
    background: var(--shape-color, #5b21b6);
}

.doc-geo-tl { width: 300px; height: 300px; top: -150px; left: -150px; transform: rotate(45deg); opacity: 0.1; }
.doc-geo-tr1 { width: 400px; height: 100px; top: 50px; right: -150px; transform: rotate(-30deg); }
.doc-geo-tr2 { width: 200px; height: 200px; top: -100px; right: -50px; transform: rotate(15deg); opacity: 0.6; }
.doc-geo-br { width: 400px; height: 400px; bottom: -200px; right: -200px; transform: rotate(45deg); }
.doc-geo-bc { width: 150px; height: 150px; bottom: 50px; right: 150px; transform: rotate(20deg); opacity: 0.3; }
.doc-geo-bl { width: 250px; height: 50px; bottom: 100px; left: -100px; transform: rotate(-45deg); opacity: 0.8; }

.doc-cover-company {
    position: relative;
    z-index: 1;
}

.doc-cover-cname { font-weight: 700; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 1px; }

.doc-cover-main {
    position: relative;
    z-index: 1;
    margin-bottom: 100px;
}

.doc-cover-t1 { font-size: 5rem; font-weight: 800; line-height: 1; margin-bottom: 0.5rem; letter-spacing: -2px; }
.doc-cover-t2 { font-size: 5rem; font-weight: 800; line-height: 1; margin-bottom: 2rem; letter-spacing: -2px; }
.doc-cover-rule { width: 80px; height: 8px; margin-bottom: 2rem; border-radius: 4px; }
.doc-cover-sub { font-size: 1.5rem; font-weight: 500; margin-bottom: 4rem; max-width: 80%; line-height: 1.4; color: #4b5563; }

.doc-cover-parties { display: flex; gap: 4rem; }
.doc-party-lbl { display: block; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; margin-bottom: 0.5rem; opacity: 0.8; }
.doc-party-name { font-size: 1.25rem; font-weight: 700; color: #111827; }

.doc-cover-contact {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    display: flex;
    gap: 2rem;
}

/* --- Section Page Styling (for PDF rendering) --- */
.doc-section-page {
    width: 794px;
    height: 1123px;
    background: white;
    padding: 100px 60px 80px;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}

.doc-sp-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 60px;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.doc-sp-num { font-size: 1.5rem; margin-right: 1.5rem; opacity: 0.7; font-weight: 800; }
.doc-sp-title { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; flex: 1; }
.doc-sp-company { font-size: 0.9rem; opacity: 0.9; }

.doc-sp-body {
    flex: 1;
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}

.doc-sp-body p { margin-bottom: 1.25rem; }
.doc-sp-body h1, .doc-sp-body h2, .doc-sp-body h3 { border-bottom: 1px solid #eee; padding-bottom: 0.5rem; margin: 1.5rem 0 1rem; color: #111; }
.doc-sp-body ul, .doc-sp-body ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.doc-sp-body li { margin-bottom: 0.5rem; }
.doc-sp-body blockquote { border-left: 4px solid var(--theme-color); padding-left: 1rem; font-style: italic; color: #4b5563; margin: 1.5rem 0; }

.doc-sp-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
.doc-sp-body th { background: #f9fafb; font-weight: 700; text-align: left; color: #111; padding: 0.75rem; border: 1px solid #e5e7eb; }
.doc-sp-body td { border: 1px solid #e5e7eb; padding: 0.75rem; color: #374151; }

.doc-sp-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;

text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    padding: 2px 8px;
    background: var(--brand-primary);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.drag-over {
    border-color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.1);
}

.preview-hint {
    background: rgba(0,0,0,0.03);
    padding: 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ==========================================================
   MOBILE DATA TABLE TO CARD TRANSFORMATION (ROBUST)
   ========================================================== */
@media (max-width: 768px) {
    /* Ensure the body and specific containers don't allow overflow */
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Hide Mobile Navigation Scrollbar */
    .nav-menu {
        overflow-x: auto !important;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important;  /* IE and Edge */
    }
    .nav-menu::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Opera */
    }

    .recent-invoices-card .card {
        padding: 0.65rem !important;
    }

    .data-table {
        display: block !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
    }

    .data-table thead {
        display: none !important;
    }

    .data-table tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Transform TR into a Card container with Flex Wrap */
    .data-table tr.data-row {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        box-shadow: var(--shadow-sm) !important;
        position: relative !important;
        gap: 0 !important;
        justify-content: space-between !important;
    }

    .data-table tr.data-row td {
        padding: 0 !important;
        border: none !important;
    }

    /* --- TOP ROW: Number & Amount --- */
    .col-number, .col-amount {
        flex: 1 1 48% !important;
        width: 48% !important;
        display: flex !important;
        margin-bottom: 0.1rem !important;
        box-sizing: border-box !important;
    }

    .col-number {
        font-weight: 700 !important;
        color: var(--text-primary) !important;
        font-family: var(--font-mono) !important;
        align-items: center !important;
    }

    .number-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .col-amount {
        text-align: right !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        font-weight: 700 !important;
        font-family: var(--font-mono) !important;
        color: var(--brand-primary) !important;
        font-size: 1.1rem !important;
    }

    .col-amount::before {
        content: attr(data-label) !important;
        display: block !important;
        font-size: 0.6rem !important;
        text-transform: uppercase !important;
        color: var(--text-muted) !important;
        font-weight: 700 !important;
        margin-bottom: 2px !important;
    }

    /* --- MIDDLE ROW: Client Name --- */
    .col-client {
        flex: 0 0 100% !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: #00bcd4 !important; /* BRAND CYAN */
        margin: 0.2rem 0 !important;
        width: 100% !important;
        display: block !important;
    }

    .dark-theme .col-client { color: #00bcd4 !important; }

    .client-email {
        display: block !important;
        font-size: 0.8rem !important;

color: var(--text-muted) !important;
        font-weight: 400 !important;
        margin-top: 2px !important;
    }

    /* divider */
    .col-client::after {
        content: "" !important;
        display: block !important;
        height: 1px !important;
        background: var(--border-color) !important;
        margin: 0.75rem 0 0.75rem 0 !important;
        opacity: 0.4 !important;
    }

    /* --- BOTTOM ROW: Issued, Due, Status --- */
    .col-date, .col-due {
        display: flex !important;
        flex-direction: column !important;
        margin-bottom: 0.5rem !important;
        width: auto !important;
        min-width: 80px !important;
    }

    .col-date {
        flex: 0 0 auto !important;
        margin-right: 0.5rem !important;
    }

    .col-due {
        flex: 0 0 auto !important;
        border-left: 1px solid var(--border-color) !important;
        padding-left: 1rem !important;
    }

    .col-date::before, .col-due::before {
        content: attr(data-label) !important;
        display: block !important;
        font-size: 0.55rem !important;
        color: var(--text-muted) !important;
        text-transform: uppercase !important;
        font-weight: 700 !important;
        margin-bottom: 2px !important;
    }

    .col-date, .col-due {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
    }

    /* Status Label & Badge Alignment */
    .col-status {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin: 1rem 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        order: 5 !important;
    }

    .col-status::before {
        content: "STATUS" !important;
        display: block !important;
        font-size: 0.6rem !important;
        font-weight: 700 !important;
        color: #818cf8 !important;
        margin-bottom: 6px !important;
        text-align: center !important;
    }

    .col-status select,
    .col-status .status-select {
        width: 100% !important;
        max-width: none !important;
        height: 38px !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* ACTIONS ROW: Centered Icons */
    .col-actions {
        flex: 0 0 100% !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 1rem !important;
        margin-top: 0.5rem !important;
        order: 6 !important;
    }

    .actions-wrapper {
        display: flex !important;
        gap: 1.5rem !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* ==========================================================
       MOBILE DOCUMENT CREATOR & INVOICE EDITOR OVERHAUL
       ========================================================== */

    /* Force column stacking on both Invoice Editor and Proposal Creator */
    .creator-layout,
    .editor-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow-y: visible !important;
        width: 100% !important;
        gap: 2rem !important;
        padding-bottom: 80px !important; /* Space for sticky buttons */
    }

    /* Sidebar/Editor Scroll Area */
    .creator-scroll-area,
    .editor-controls {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Preview Area Scaling & Width */
    .creator-preview-area,
    .preview-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        flex: none !important;
        overflow: visible !important;
    }

    .preview-sticky {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
    }

    /* Scale document preview (A4) to fit standard mobile width */
    .invoice-preview-container,
    .doc-preview-container {
        width: 100% !important;
        height: auto !important;
        min-height: 400px !important;
        display: block !important;
        position: relative !important;

background: transparent !important;
        box-shadow: none !important;
        overflow: hidden !important; 
    }

    /* Target the A4 content specifically */
    #invoice-preview .invoice-box, 
    .doc-preview-container .doc-cover-page,
    .doc-preview-container .doc-section-page {
        transform: scale(0.42) !important;
        transform-origin: top left !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        box-shadow: var(--shadow-lg) !important;
        border: 1px solid var(--border-color) !important;
        display: block !important;
    }

    /* Container for the scaled element to prevent huge white space */
    .invoice-preview-container {
        height: 480px !important;
    }
    .doc-preview-container {
        height: 520px !important;
    }

    /* Stacking Buttons & Form Controls */
    .header-actions,
    .editor-controls button,
    .creator-layout button {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .form-group input, 
    .form-group select, 
    .form-group textarea {
        font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
    }

    .table-responsive {
        overflow-x: auto !important;
    }

    /* --- PREMIUM MOBILE CLIENT CARD --- */
    #clients-table, #clients-body {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    #clients-table thead {
        display: none !important;
    }

    tr.client-row {
        display: block !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        margin-bottom: 0.65rem !important;
        padding: 0.65rem 0.75rem !important;
        box-shadow: var(--shadow-sm) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    tr.client-row td {
        padding: 0 !important;
        border: none !important;
    }

    .col-client-name {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 0.5rem !important;
    }

    .client-card-top {
        display: flex !important;
        align-items: center !important;
        gap: 0.65rem !important;
        width: 100% !important;
    }

    .client-avatar {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 0 !important;
        background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }

    .client-meta {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
    }

    .client-full-name {
        display: block !important;
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: var(--text-primary) !important;
    }

    .client-email-mobile {
        display: block !important;
        font-size: 0.85rem !important;
        color: var(--text-muted) !important;
    }

    .col-client-email.desktop-only {
        display: none !important;
    }

    .col-client-phone, .col-client-address {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 0.75rem !important;
        width: 100% !important;
        font-size: 0.95rem !important;
        color: var(--text-primary) !important;
    }

    .col-client-email::before, .col-client-phone::before, .col-client-address::before {
        content: attr(data-label) !important;
        display: block !important;
        font-size: 0.65rem !important;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        margin-bottom: 4px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
    }

    .col-client-actions {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        margin-top: 1.5rem !important;
        padding-top: 1.25rem !important;

border-top: 1px solid var(--border-color) !important;
        width: 100% !important;
    }

    .client-actions-wrapper {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
}

/* Action Buttons Base Styles (Desktop & Mobile) */
.btn-history {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
}

.action-buttons-group {
    display: inline-flex !important;
    gap: 0.4rem !important;
}

.btn-edit, .btn-delete {
    background: #27272a !important;
    border: 1px solid #3f3f46 !important;
    border-radius: 6px !important;
    padding: 0.3rem 0.75rem !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.btn-edit {
    color: #e4e4e7 !important;
}

.btn-delete {
    color: #ef4444 !important;
}

.btn-edit:hover, .btn-delete:hover {
    background: #3f3f46 !important;
}

/* Desktop Fix for initials column */
@media (min-width: 769px) {
    .client-full-name, .client-email-mobile {
        display: none !important;
    }
    .col-client-name .client-avatar {
        margin-bottom: 0 !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem !important;
    }
}


/* Custom Desktop Table Head Height */
@media (min-width: 769px) {
    .data-table th { padding: 1.5rem 1rem !important; }
}

/* AI Assistant Panel */
.ai-assistant-panel { background: var(--bg-nav-active); border: 1px solid #6366f1; border-radius: var(--radius-md); margin-bottom: 1rem; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2); overflow: hidden; animation: slideDown 0.3s ease-out; }
.ai-panel-header { background: #4f46e5; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.ai-title { color: white; font-weight: 600; font-size: 0.875rem; letter-spacing: 0.5px; }
.ai-panel-body { padding: 1rem; }
.ai-content-box { margin-top: 0.5rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); max-height: 250px; overflow-y: auto; font-size: 0.875rem; color: var(--text-primary); }
.ai-content-box p { margin-bottom: 0.5rem; }
.ai-content-box h1,.ai-content-box h2,.ai-content-box h3 { margin: 1rem 0 0.5rem; }
.btn-ask-ai { display: inline-flex; align-items: center; justify-content: center; background: #4f46e5; color: white; border: none; border-radius: 4px; padding: 4px 8px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3); }
.btn-ask-ai:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4); opacity: 0.9; }

/* =========================================================
   Task Manager Styles 
   ========================================================= */

.tm-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-bottom: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .tm-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .tm-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .tm-dashboard-grid .tm-form-row {
        grid-template-columns: 1fr !important;
    }

    .tm-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.pagination-controls .btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pagination-controls span {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =========================================================
   PRO Tier UI Styles 
   ========================================================= */

.badge-pro {

background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 6px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    vertical-align: middle;
}

.pro-locked {
    position: relative !important;
    filter: grayscale(0.8) opacity(0.5) !important;
    cursor: not-allowed !important;
}

.upgrade-banner {
    background: linear-gradient(90deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.upgrade-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.upgrade-banner-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.upgrade-banner-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.upgrade-banner-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.premium-modal-header {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.premium-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.premium-modal-header p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.premium-features-list {
    padding: 2rem;
}

.premium-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.premium-feature-check {
    color: #10b981;
    font-size: 1.1rem;
    margin-top: 2px;
}

.premium-feature-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.premium-feature-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.premium-pricing {
    background: var(--bg-nav-active);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.premium-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.premium-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Admin Styles */
.badge-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-status.available {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-status.used {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.admin-license-table-wrapper tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-license-table-wrapper td {
    border-bottom: 1px solid var(--border-color);
}

/* Utils */
.hidden { display: none !important; visibility: hidden !important; height: 0 !important; width: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; }

/* Sidebar Section Title */
.nav-section-title {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Help & Product Guide */
.help-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.help-section {
    margin-bottom: 4rem;
}

.section-title-flex {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.badge-pro {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    border-radius: 12px;
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;

overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-info h4 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feature-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Accordion FAQ */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.accordion-item.active {
    border-color: var(--brand-primary);
}

.accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.accordion-header svg {
    color: var(--text-muted);
}

.accordion-item.active .accordion-header svg {
    transform: rotate(180deg);
    color: var(--brand-primary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-inner {
    padding: 0 1.5rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.accordion-inner a {
    color: var(--brand-primary);
    font-weight: 500;
}

/* Privacy Layout Overhaul */

.privacy-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3rem;
    position: relative;
    align-items: flex-start;
}

.privacy-sidebar {
    position: sticky;
    top: 2rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.privacy-toc-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-primary);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.privacy-toc {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.privacy-nav-item {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.privacy-nav-item:hover {
    background: var(--bg-nav-active);
    color: var(--text-primary);
}

.privacy-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.privacy-main {
    max-width: 800px;
}

.privacy-main section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.privacy-main h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.privacy-main p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.privacy-list {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
}

.privacy-list li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.privacy-contact-card {
    background: var(--bg-nav-active);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.8;
}

@media (max-width: 1024px) {
    .privacy-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .privacy-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.5rem;
        padding-right: 0;
    }

    .privacy-toc {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

