/* ================================================
   FlowDesk — Design System V2
   Premium dark theme with glassmorphism
   ================================================ */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.18);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b4;
    --text-muted: #606078;

    --accent-primary: #7c3aed;
    --accent-primary-hover: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 240px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

input,
select,
textarea,
button {
    font-family: inherit;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

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

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

/* ---- Form Controls ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group {
    margin-bottom: 16px;
}

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

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

.filter-select {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 140px;
}

/* ---- Cards ---- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--glass-border-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ---- Utility ---- */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.8rem;
}

.text-link {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.text-link:hover {
    text-decoration: underline;
}

.empty-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 20px 0;
    text-align: center;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-lg);
}

.empty-state h3 {
    margin: 12px 0 4px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ================================================
   LANDING PAGE
   ================================================ */
#landing-page {
    max-width: 100%;
    overflow-x: hidden;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 18, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.hero {
    text-align: center;
    padding: 140px 20px 80px;
    background: radial-gradient(ellipse at top, rgba(124, 58, 237, 0.15) 0%, transparent 60%);
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-size: 0.8rem;
    color: #a78bfa;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-stat {
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.hero-stat span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-mockup {
    max-width: 480px;
    margin: 0 auto;
    perspective: 1000px;
}

.mockup-window {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transform: rotateX(5deg) rotateY(-3deg);
    transition: transform 0.5s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mockup-window:hover {
    transform: rotateX(0) rotateY(0);
}

.mockup-dots {
    padding: 10px 14px;
    display: flex;
    gap: 6px;
}

.mockup-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.mockup-dots span:nth-child(1) {
    background: #ef4444;
}

.mockup-dots span:nth-child(2) {
    background: #f59e0b;
}

.mockup-dots span:nth-child(3) {
    background: #10b981;
}

.mockup-content {
    padding: 16px;
}

.mockup-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.mock-label {
    color: var(--text-muted);
}

.mock-value {
    color: var(--text-primary);
    font-weight: 500;
}

.mock-green {
    color: var(--accent-green);
}

.mock-badge {
    padding: 2px 10px;
    background: var(--accent-green);
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mockup-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 80px;
    padding: 16px 0 8px;
}

.mock-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-primary), transparent);
    border-radius: 4px 4px 0 0;
    min-height: 10px;
    animation: growBar 1.5s ease-out;
}

@keyframes growBar {
    from {
        height: 0;
    }
}

/* Features */
.features-section {
    padding: 80px 40px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: var(--transition);
    cursor: default;
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* How Section */
.how-section {
    padding: 80px 40px;
    background: var(--bg-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.step-card h3 {
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Pricing */
.pricing-section {
    padding: 80px 40px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    position: relative;
}

.pricing-pro {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px var(--accent-glow);
}

.pro-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pricing-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    margin-bottom: 24px;
}

.pricing-features li {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pricing-features li strong {
    color: var(--text-primary);
}

/* Final CTA */
.final-cta-section {
    text-align: center;
    padding: 100px 20px;
    background: radial-gradient(ellipse at bottom, rgba(124, 58, 237, 0.1) 0%, transparent 60%);
}

.final-cta-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.final-cta-section p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.landing-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================================
   APP LAYOUT
   ================================================ */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
}

.premium-badge {
    background: var(--accent-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary);
    color: #fff;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-upgrade {
    margin: 0 12px 8px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    text-align: center;
}

.sidebar-upgrade p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.top-bar h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.top-bar-actions {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
}

.search-input {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 220px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    width: 300px;
    transition: width 0.3s;
}

.content-area {
    padding: 24px;
    flex: 1;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.view-header-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dashboard */
.dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.qa-btn span {
    font-size: 1.4rem;
}

.qa-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ---- Invoices ---- */
.invoice-card {
    cursor: pointer;
    margin-bottom: 8px;
    padding: 16px 20px;
}

.invoice-card:hover {
    background: var(--bg-card-hover);
}

.invoice-card-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invoice-card-info {
    flex: 1;
}

.invoice-card-info strong {
    font-size: 0.9rem;
    display: block;
}

.invoice-card-info .text-muted {
    font-size: 0.8rem;
}

.invoice-card-amount {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 100px;
    text-align: right;
}

.invoice-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

/* Editor */
.editor-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.editor-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.items-table th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 4px;
    border-bottom: 1px solid var(--glass-border);
}

.items-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--glass-border);
}

.items-table input {
    width: 100%;
}

.items-table td:nth-child(2) input,
.items-table td:nth-child(3) input {
    width: 80px;
}

.item-amount {
    font-weight: 600;
    min-width: 90px;
}

.totals-card {
    max-width: 400px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.total-row input {
    width: auto;
    padding: 4px 8px;
    font-size: 0.85rem;
    text-align: center;
}

.total-final {
    border-top: 2px solid var(--accent-primary);
    padding-top: 12px;
    margin-top: 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Clients ---- */
.client-card {
    cursor: pointer;
    margin-bottom: 12px;
}

.client-card:hover {
    background: var(--bg-card-hover);
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.client-info {
    flex: 1;
}

.client-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.client-company {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.client-score {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.score-great {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.score-good {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.score-fair {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.score-poor {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.score-new {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.client-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.client-stat {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.client-stat .stat-val {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.client-stat .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- Expenses ---- */
.expense-day {
    margin-bottom: 20px;
}

.expense-day-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 6px;
}

.expense-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.expense-entry:hover {
    background: var(--bg-card-hover);
}

.expense-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
}

.expense-details {
    flex: 1;
}

.expense-desc {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.expense-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.expense-amount {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ---- Proposals ---- */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.template-card {
    padding: 24px 20px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.template-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.template-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.template-card h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.template-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.proposal-card {
    cursor: pointer;
    margin-bottom: 10px;
}

.proposal-card:hover {
    background: var(--bg-card-hover);
}

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.proposal-header h3 {
    font-size: 0.95rem;
}

.proposal-amount {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 8px;
}

.proposal-section {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ---- Reports ---- */
.report-header {
    margin-bottom: 20px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    min-height: 160px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.bar-label {
    font-size: 0.8rem;
    width: 120px;
    flex-shrink: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 18px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 9px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.6s ease;
}

.bar-green {
    background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.bar-red {
    background: linear-gradient(90deg, var(--accent-red), #f87171);
}

.bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    width: 80px;
    text-align: right;
}

.monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    padding: 10px 0;
}

.month-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.month-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    flex: 1;
    width: 100%;
}

.month-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.6s ease;
}

.month-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* Tax */
.tax-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.tax-card {
    text-align: center;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}

.tax-rate {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tax-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.tax-quarterly {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* P&L Table */
.pnl-table {
    width: 100%;
    border-collapse: collapse;
}

.pnl-table td {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--glass-border);
}

.pnl-amount {
    text-align: right;
    font-family: monospace;
}

.pnl-header td {
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 2px solid var(--glass-border);
}

.pnl-section td {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-top: 16px;
}

.pnl-total-row td {
    border-top: 1px solid var(--glass-border);
    font-weight: 600;
}

.pnl-profit-row td {
    border-top: 2px solid var(--accent-primary);
    font-size: 1.05rem;
}

/* ---- AI Writer ---- */
.ai-writer-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.ai-input-card textarea {
    font-size: 1rem;
    min-height: 120px;
}

.ai-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-example {
    text-align: left;
    font-size: 0.8rem;
}

.ai-confidence {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.confidence-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}

.confidence-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.ai-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0;
}

.ai-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.ai-items-table th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 6px 4px;
    border-bottom: 1px solid var(--glass-border);
}

.ai-items-table td {
    padding: 6px 4px;
}

.ai-items-table input {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-primary);
}

/* ---- Calculator ---- */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.calc-results {
    display: flex;
    flex-direction: column;
}

.rate-main {
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rate-main.suggested {
    border: 1px solid var(--accent-primary);
    background: rgba(124, 58, 237, 0.1);
}

.rate-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rate-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.rate-card {
    text-align: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}

.rate-card-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.rate-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.breakdown {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ---- Timer ---- */
.timer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.timer-card {
    text-align: center;
}

.timer-mode-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.timer-mode-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.timer-mode-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.timer-display {
    font-size: 4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.timer-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.timer-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 1s linear;
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.timer-sessions {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.log-project {
    font-weight: 500;
    flex: 1;
}

.log-time {
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- Settings ---- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.data-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.modal h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    min-width: 260px;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast-info {
    border-left: 3px solid var(--accent-blue);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .ai-writer-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tax-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar-close {
        display: block;
    }

    .mobile-sidebar-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

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

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

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

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

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

    .timer-layout {
        grid-template-columns: 1fr;
    }

    .editor-parties {
        grid-template-columns: 1fr;
    }

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

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

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .client-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .content-area {
        padding: 16px;
    }

    .landing-nav {
        padding: 12px 16px;
    }

    .landing-nav .nav-links a {
        display: none;
    }

    .features-section,
    .how-section,
    .pricing-section {
        padding: 60px 16px;
    }

    .search-input {
        display: none;
    }

    .monthly-chart {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   NEW V2 POLISH STYLES
   ================================================ */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* --- Selection Color --- */
::selection {
    background: rgba(124, 58, 237, 0.35);
    color: #fff;
}

/* --- Dashboard Greeting --- */
.dash-greeting {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    opacity: 0.9;
}

/* --- Stat Card Color Coding --- */
.stat-card {
    transition: transform 0.18s, box-shadow 0.18s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.22);
}

.stat-card.stat-revenue .stat-value {
    color: var(--accent-green);
}

.stat-card.stat-expenses .stat-value {
    color: var(--accent-red);
}

.stat-card.stat-pending .stat-value {
    color: var(--accent-yellow);
}

.stat-card.stat-profit .stat-value {
    color: var(--accent-green);
}

/* Trend badge */
.stat-trend {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 4px;
}

.stat-trend.trend-up {
    color: var(--accent-green);
}

.stat-trend.trend-down {
    color: var(--accent-red);
}

.stat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* Sparkline */
.sparkline {
    vertical-align: middle;
    opacity: 0.85;
}

/* --- Stat Meta (sparkline row) --- */
.stat-meta .sparkline {
    margin-bottom: -3px;
}

/* --- Overdue Banner --- */
.overdue-banner {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    animation: pulse-banner 2s ease-in-out infinite;
}

@keyframes pulse-banner {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

/* --- Onboarding Checklist Card --- */
.onboarding-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.onboarding-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-step {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.onboarding-step:hover {
    background: rgba(124, 58, 237, 0.15);
}

.onboarding-step.done {
    opacity: 0.5;
    cursor: default;
    text-decoration: line-through;
}

/* --- Search Dropdown --- */
.search-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    min-width: 320px;
    backdrop-filter: blur(20px);
}

.search-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 14px 4px;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.88rem;
}

.search-result:hover,
.search-result.sr-active {
    background: rgba(124, 58, 237, 0.12);
}

.sr-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sr-main {
    flex: 1;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.search-no-results {
    padding: 16px 14px;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

/* --- Invoice List Cards: Action Buttons --- */
.invoice-card-row {
    flex-wrap: wrap;
    gap: 8px;
}

.inv-card-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.btn-mark-paid {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-mark-paid:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: scale(1.05);
}

.btn-dup {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-dup:hover {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-primary);
}

/* --- Auto-save indicator --- */
.autosave-indicator {
    font-size: 0.78rem;
    color: var(--accent-green);
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.3s;
    align-self: center;
}

/* --- Timer Ring --- */
.timer-ring-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    margin: 20px auto;
}

.timer-ring {
    position: absolute;
    width: 180px;
    height: 180px;
}

.timer-ring circle {
    transition: stroke-dashoffset 1s linear;
}

.timer-display {
    position: relative;
    z-index: 2;
    font-size: 2.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.timer-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 4px 0 12px;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.78rem;
    font-family: var(--font-mono, monospace);
}

/* --- Mobile Bottom Nav --- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 200;
    display: none;
    grid-template-columns: repeat(5, 1fr);
}

.bottom-nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.15s;
}

.bottom-nav-btn span {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.bottom-nav-btn.active,
.bottom-nav-btn:hover {
    color: var(--accent-primary);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: grid;
    }

    /* Push main content up from bottom nav */
    .content-area {
        padding-bottom: 80px;
    }
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

/* --- Card hover glow --- */
.card:hover {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.18), var(--shadow-card);
    border-color: rgba(124, 58, 237, 0.2);
    transition: box-shadow 0.2s, border-color 0.2s;
}

/* --- Client Card Actions --- */
.client-card {
    cursor: pointer;
}

.client-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
}

.client-card:hover .client-card-actions {
    opacity: 1;
    transform: none;
}

/* --- Hero Glow Orb --- */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, rgba(139, 92, 246, 0.08) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1.15);
    }
}

.hero>* {
    position: relative;
    z-index: 1;
}

/* --- Feature Card Sub-features --- */
.feature-sub {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    opacity: 0;
}

.feature-card:hover .feature-sub {
    max-height: 200px;
    opacity: 1;
}

.feature-sub li {
    font-size: 0.8rem;
    color: var(--accent-green);
    padding: 3px 0;
}

/* --- Pricing Toggle --- */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.15s;
}

.toggle-label.active {
    color: var(--text-primary);
}

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

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
}

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

.save-badge {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 4px;
}

/* --- Focus Ring (Keyboard Accessibility) --- */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* --- Input Placeholder --- */
input::placeholder,
textarea::placeholder {
    color: rgba(200, 190, 230, 0.4);
}

/* --- PDF Button Loading --- */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* --- Touch Targets (Mobile) --- */
@media (max-width: 768px) {

    .btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
        /* prevents zoom on iOS */
    }

    .nav-item {
        min-height: 44px;
        padding: 10px 14px;
    }
}