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

:root {
    --color-primary: #6d28d9;
    --color-primary-light: #8b5cf6;
    --color-primary-hover: #5b21b6;
    --color-primary-subtle: #ede9fe;
    --color-accent: #06b6d4;
    --color-accent-light: #cffafe;
    --color-warm: #f59e0b;
    --color-warm-light: #fef3c7;
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-text: #1c1917;
    --color-text-muted: #78716c;
    --color-border: #e7e5e4;
    --color-border-focus: #a78bfa;
    --color-danger: #ef4444;
    --color-success: #10b981;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
    --gradient-hero: linear-gradient(135deg, #6d28d9 0%, #4f46e5 40%, #06b6d4 100%);
    --gradient-btn: linear-gradient(135deg, #6d28d9, #4f46e5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background:
        radial-gradient(ellipse at 10% 30%, rgba(109, 40, 217, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, #f5f3ff 0%, #fafaf9 30%, #fdf4ff 70%, #f0fdfa 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* === Navbar === */
.navbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    padding: 0 32px;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo {
    height: 46px;
    width: auto;
    margin: -12px 0 -12px 2px;
}

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

.nav-links > a,
.nav-links > span {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links > a:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

/* Language dropdown */
.lang-dropdown {
    position: relative;
    margin-left: 6px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
}

.lang-toggle:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    border-color: var(--color-primary-light);
}

.lang-toggle svg {
    flex-shrink: 0;
}

.lang-current {
    line-height: 1;
}

.lang-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 200;
    overflow: hidden;
}

.lang-menu.open {
    display: flex;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.1s;
}

.lang-option:hover {
    background: var(--color-primary-subtle);
}

.lang-option.lang-active {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-primary-subtle);
}

.lang-code {
    font-weight: 700;
    font-size: 11px;
    color: var(--color-text-muted);
    min-width: 22px;
}

.nav-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-subtle);
    padding: 5px 12px;
    border-radius: 20px;
    margin-left: 4px;
}

.nav-links > .btn-nav {
    background: var(--gradient-btn);
    color: #fff;
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
}

.nav-links .btn-nav:hover {
    opacity: 0.9;
    background: var(--gradient-btn);
    color: #fff;
    transform: translateY(-1px);
}

/* === Footer === */
.footer {
    margin-top: auto;
    padding: 24px 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* === Hero === */
.hero {
    text-align: center;
    padding: 76px 24px 60px;
    background: var(--gradient-hero);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.2) 0%, transparent 50%);
    pointer-events: none;
}

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

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero h1 {
    font-size: 44px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -0.5px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-sub {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero .btn {
    background: #fff;
    color: var(--color-primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    font-size: 16px;
    padding: 14px 36px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
}

.hero .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    background: #fff;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

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

.hero-stat-value {
    font-size: 24px;
    font-weight: 800;
}

.hero-stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* === Features === */
.features {
    padding: 56px 0 64px;
}

.features-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.features-sub {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 15px;
    margin-bottom: 36px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

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

.feature-card:nth-child(1):hover { box-shadow: 0 8px 30px rgba(109, 40, 217, 0.12); }
.feature-card:nth-child(2):hover { box-shadow: 0 8px 30px rgba(6, 182, 212, 0.12); }
.feature-card:nth-child(3):hover { box-shadow: 0 8px 30px rgba(245, 158, 11, 0.12); }
.feature-card:nth-child(4):hover { box-shadow: 0 8px 30px rgba(16, 185, 129, 0.12); }

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.feature-card:nth-child(1)::before { background: var(--color-primary); }
.feature-card:nth-child(2)::before { background: var(--color-accent); }
.feature-card:nth-child(3)::before { background: var(--color-warm); }
.feature-card:nth-child(4)::before { background: var(--color-success); }

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.feature-card:nth-child(1) .feature-icon { background: var(--color-primary-subtle); }
.feature-card:nth-child(2) .feature-icon { background: var(--color-accent-light); }
.feature-card:nth-child(3) .feature-icon { background: var(--color-warm-light); }
.feature-card:nth-child(4) .feature-icon { background: #d1fae5; }

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.feature-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1.5px solid var(--color-border);
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--color-primary-subtle);
    border-color: var(--color-primary-light);
}

.btn-lg {
    padding: 13px 36px;
    font-size: 16px;
    border-radius: 12px;
}

/* === Invoice Form Page === */
.invoice-form-page {
    padding: 36px 0 64px;
}

.invoice-form-page > h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.invoice-form-page > .form-subtitle {
    color: var(--color-text-muted);
    font-size: 15px;
    margin-bottom: 28px;
}

.form-section {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.form-section:nth-child(1)::before { background: var(--color-primary-light); }
.form-section:nth-child(2)::before { background: var(--color-accent); }
.form-section:nth-child(3)::before { background: var(--color-warm); }
.form-section:nth-child(4)::before { background: var(--color-success); }
.form-section:nth-child(5)::before { background: #a78bfa; }

.form-section h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--color-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h2 .section-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.form-section:nth-child(1) .section-icon { background: var(--color-primary-subtle); }
.form-section:nth-child(2) .section-icon { background: var(--color-accent-light); }
.form-section:nth-child(3) .section-icon { background: var(--color-warm-light); }
.form-section:nth-child(4) .section-icon { background: #d1fae5; }
.form-section:nth-child(5) .section-icon { background: #ede9fe; }

.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 140px;
}

.form-group-wide {
    flex: 1 1 100%;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.08);
    background: var(--color-surface);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a8a29e;
}

.form-group textarea {
    resize: vertical;
}

/* === Line Items Table === */
.line-items-wrapper {
    overflow-x: auto;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.line-items-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 6px;
    border-bottom: 2px solid var(--color-border);
}

.line-items-table tbody td {
    padding: 6px;
    vertical-align: middle;
}

.line-items-table input,
.line-items-table select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    transition: all 0.2s;
}

.line-items-table input:focus,
.line-items-table select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.08);
    background: var(--color-surface);
}

.col-desc { width: 35%; }
.col-qty { width: 12%; }
.col-price { width: 16%; }
.col-tax { width: 14%; }
.col-net { width: 14%; text-align: right; }
.col-actions { width: 40px; }

.item-net {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding-right: 8px !important;
    color: var(--color-text);
    font-size: 14px;
}

.btn-remove-row {
    background: none;
    border: none;
    font-size: 18px;
    color: #d6d3d1;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1;
    transition: all 0.15s;
}

.btn-remove-row:hover {
    color: var(--color-danger);
    background: #fef2f2;
}

/* === Totals === */
.invoice-totals {
    max-width: 340px;
    margin-left: auto;
    padding: 16px 20px;
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-top: 4px;
}

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

.totals-tax .totals-label {
    color: var(--color-text-muted);
    font-size: 13px;
}

.totals-grand {
    border-top: 2px solid var(--color-primary);
    margin-top: 10px;
    padding-top: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
}

.totals-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* === Form Actions === */
.form-actions {
    text-align: center;
    padding: 24px 0;
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--color-danger);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

/* === Success animation for download === */
@keyframes pulse-glow {
    0% { box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25); }
    50% { box-shadow: 0 2px 20px rgba(109, 40, 217, 0.45); }
    100% { box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25); }
}

.btn-primary:active {
    transform: scale(0.98);
}

/* === Free badge === */
.free-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #d1fae5;
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Auth Pages === */
.auth-page {
    padding: 48px 0 64px;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
}

.auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.auth-sub {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

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

.auth-form .form-group label .hint {
    font-weight: 400;
    color: #a8a29e;
    text-transform: none;
    letter-spacing: 0;
}

.btn-full {
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.auth-switch a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-card .form-error {
    margin-top: 0;
    margin-bottom: 16px;
}

/* === Dashboard === */
.dashboard-page {
    padding: 36px 0 64px;
}

.dashboard-page > h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.invoice-list-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.invoice-list {
    width: 100%;
    border-collapse: collapse;
}

.invoice-list thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--color-border);
    background: rgba(0,0,0,0.02);
}

.invoice-list tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    vertical-align: middle;
}

.invoice-list tbody tr:last-child td {
    border-bottom: none;
}

.invoice-list tbody tr:hover {
    background: rgba(109, 40, 217, 0.02);
}

.invoice-number {
    font-weight: 600;
    color: var(--color-text);
}

.text-right {
    text-align: right;
}

.amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.row-cancelled {
    opacity: 0.5;
}

/* Status select */
.status-form {
    display: inline;
}

.status-select {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    appearance: auto;
}

.status-draft { background: #f3f4f6; color: #6b7280; }
.status-sent { background: #dbeafe; color: #2563eb; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-overdue { background: #fee2e2; color: #dc2626; }
.status-cancelled { background: #f3f4f6; color: #9ca3af; }

/* Actions */
.actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    background: none;
    border: 1px solid var(--color-border);
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: all 0.15s;
    line-height: 1;
}

.action-btn:hover {
    background: var(--color-primary-subtle);
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.action-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: var(--color-danger);
}

.inline-form {
    display: inline;
}

/* Reminder settings */
.reminder-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminder-row {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.toggle-text {
    font-weight: 500;
    color: var(--color-text);
}

.reminder-days-label {
    font-size: 14px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.reminder-days-input {
    width: 60px;
    padding: 5px 8px;
    font-size: 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
    font-family: inherit;
}

.reminder-days-input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.08);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    font-size: 16px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-state a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* === Logo Upload === */
.logo-upload-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.logo-upload-form .form-group {
    flex: 1;
}

.logo-preview-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-success);
}

/* Logo grid */
.logo-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.logo-preview-card {
    position: relative;
    display: inline-block;
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 24px;
    transition: border-color 0.2s;
}

.logo-preview-card:hover {
    border-color: var(--color-danger);
}

.logo-preview-img {
    display: block;
    max-height: 60px;
    max-width: 200px;
    width: auto;
    height: auto;
}

.logo-remove-form {
    position: absolute;
    top: -10px;
    right: -10px;
    opacity: 0;
    transition: opacity 0.15s;
}

.logo-preview-card:hover .logo-remove-form {
    opacity: 1;
}

.logo-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--color-danger);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.1s;
    padding: 0;
}

.logo-remove-btn:hover {
    transform: scale(1.15);
}

.logo-selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-subtle);
}

.logo-active-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo-select-form {
    display: contents;
}

.logo-select-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: block;
}

.logo-select-btn:hover {
    opacity: 0.8;
}

/* Top row split: Invoice Details (2/3) + Logo/Style (1/3) */
.top-row-split {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.top-row-split .top-row-main {
    flex: 2;
    min-width: 0;
    margin-bottom: 0;
}

.top-row-side {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.side-card:first-child {
    z-index: 10;
}

.side-card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Logo picker box */
.logo-picker-box {
    flex: 1;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s;
    min-height: 60px;
}

.logo-picker-box:hover {
    border-color: var(--color-primary-light);
    border-style: solid;
}

.logo-picker-img {
    max-height: 50px;
    max-width: 140px;
    width: auto;
    height: auto;
}

.logo-picker-none {
    font-size: 12px;
    color: #c4c0ba;
    font-weight: 500;
}

.logo-picker-chevron {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    color: #c4c0ba;
    transition: color 0.15s;
}

.logo-picker-box:hover .logo-picker-chevron {
    color: var(--color-primary);
}

.logo-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow: hidden;
}

.logo-picker-dropdown.open {
    display: block;
}

.logo-picker-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    transition: background 0.1s;
    min-height: 44px;
    border-bottom: 1px solid var(--color-border);
}

.logo-picker-option:last-child {
    border-bottom: none;
}

.logo-picker-option:hover {
    background: var(--color-primary-subtle);
}

.logo-picker-option img {
    max-height: 30px;
    max-width: 120px;
    width: auto;
    height: auto;
}

.logo-picker-option-none {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Style picker box */
.style-picker-box {
    flex: 1;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s;
    min-height: 60px;
}

.style-picker-box:hover {
    border-color: var(--color-primary-light);
    border-style: solid;
}

.style-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.style-picker-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow: visible;
    flex-direction: row;
}

.style-picker-panel.open {
    display: flex;
}

.style-picker-list {
    width: 140px;
    flex-shrink: 0;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--color-border);
}

.style-option:last-child {
    border-bottom: none;
}

.style-option:hover {
    background: var(--color-primary-subtle);
}

.style-option-active {
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-primary-subtle);
}

.style-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Style preview - actual rendered thumbnail */
.style-preview {
    width: 220px;
    padding: 8px;
    border-left: 1px solid var(--color-border);
    background: #f8f8f8;
    border-radius: 0 0 var(--radius) 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.style-preview-img {
    width: 200px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: opacity 0.15s;
}

@media (max-width: 640px) {
    .top-row-split {
        flex-direction: column;
    }
    .top-row-side {
        flex: none;
        flex-direction: row;
    }
    .side-card {
        flex: 1;
    }
}

/* === Upgrade Banner === */
.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--color-primary-subtle), #cffafe);
    border: 1px solid rgba(109, 40, 217, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 20px;
}

.upgrade-text {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.5;
}

.upgrade-text strong {
    color: var(--color-primary);
}

.upgrade-banner .btn {
    flex-shrink: 0;
}

.logo-hint {
    font-size: 14px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 12px 16px;
    background: var(--color-primary-subtle);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.logo-hint a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.logo-hint a:hover {
    text-decoration: underline;
}

/* === Pricing === */
.pricing-page {
    padding: 48px 0 64px;
}

.pricing-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.pricing-sub {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 16px;
    margin-bottom: 32px;
}

.lifetime-banner {
    text-align: center;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    font-size: 14px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: start;
}

.price-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.price-card-featured {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
}

.price-card-lifetime {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb, rgba(255,255,255,0.9));
}

.price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.price-badge-save {
    background: var(--color-success);
}

.price-badge-fire {
    background: #f59e0b;
    color: #78350f;
}

.price-tier {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
    text-align: center;
}

.price-amount {
    text-align: center;
    margin-bottom: 2px;
}

.price-currency {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-muted);
    vertical-align: top;
    line-height: 1.3;
}

.price-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -1px;
}

.price-period {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.price-effective {
    color: var(--color-success);
    font-weight: 600;
}

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

.price-features li {
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-features li::before {
    content: "\2713";
    color: var(--color-success);
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.price-features li.feature-no::before {
    content: "\2717";
    color: #ccc;
}

.price-features li.feature-no {
    color: var(--color-text-muted);
}

.price-features li:last-child {
    border-bottom: none;
}

/* === Responsive === */
@media (max-width: 640px) {
    .hero h1 { font-size: 30px; }
    .hero { padding: 48px 16px 40px; }
    .hero-stats { gap: 24px; }
    .hero-stat-value { font-size: 20px; }
    .form-row { flex-direction: column; gap: 8px; }
    .form-group { min-width: 100%; }
    .col-desc { width: 30%; }
    .container { padding: 0 16px; }
    .feature-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-section { padding: 20px 16px; }
}

@media (max-width: 420px) {
    .feature-grid { grid-template-columns: 1fr; }
}
