@tailwind base;
@tailwind components;
@tailwind utilities;


/* ========================================
   KEELANCE DESIGN SYSTEM
   Fresh start - Notion-inspired
   ======================================== */

:root {
    /* Dark Theme - Design System */
    --bg-page: #0f0f0f;
    --bg-nav: #191919;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-elevated: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-active: rgba(255, 255, 255, 0.08);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-dropdown: #252525;
    --border-default: rgba(255, 255, 255, 0.04);
    --border-strong: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.03);
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --text-muted: rgba(255, 255, 255, 0.4);
    --text-breadcrumb: #a1a1a1;
    --accent: #37352f;
    --accent-hover: #2f2e2b;
    --danger: #eb5757;
    --success: #10b981;
}

[data-theme='light'] {
    --bg-page: #f5f5f4;
    --bg-nav: #fbfbfa;
    --bg-surface: #fff;
    --bg-elevated: #fff;
    --bg-hover: #fafafa;
    --bg-active: rgba(0, 0, 0, 0.05);
    --bg-card: #fff;
    --bg-dropdown: #fff;
    --border-default: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --border-subtle: rgba(0, 0, 0, 0.03);
    --text-primary: #37352f;
    --text-secondary: rgba(55, 53, 47, 0.6);
    --text-tertiary: rgba(55, 53, 47, 0.45);
    --text-muted: rgba(55, 53, 47, 0.4);
    --text-breadcrumb: rgba(55, 53, 47, 0.5);
    --accent: #37352f;
    --accent-hover: #2f2e2b;
    --danger: #eb5757;
    --success: #10b981;
}

/* Base */
body {
    margin: 0;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell__content {
    flex: 1;
}

body.app-shell > footer {
    margin-top: auto;
}

.hidden {
    display: none;
}

.theme-logo--dark {
    display: inline-block;
}

.theme-logo--light {
    display: none;
}

[data-theme='light'] .theme-logo--dark {
    display: none;
}

[data-theme='light'] .theme-logo--light {
    display: inline-block;
}

.funnel-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.funnel-shell > footer {
    margin-top: auto;
}

.funnel-main {
    flex: 1;
    width: 100%;
    padding: 32px 16px;
}

.funnel-main--center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.funnel-header {
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-page);
}

.funnel-header__inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.funnel-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.funnel-header__logo {
    height: 28px;
    width: auto;
}

.funnel-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.funnel-subtle {
    color: var(--text-secondary);
    font-size: 12px;
}

.funnel-hero {
    max-width: 780px;
    margin: 0 auto 18px;
    text-align: center;
}

.funnel-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.funnel-subtitle {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.site-footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-page);
}

.site-footer__inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.site-footer__logo {
    height: 18px;
    width: auto;
}

.site-footer__copy {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.funnel-card {
    width: 100%;
    max-width: 420px;
}

.page-narrow {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

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

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.auth-card {
    padding: 22px;
}

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

@media (min-width: 900px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-checkbox {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
}

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

.alert {
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.alert--danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-primary);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.segmented {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    padding: 3px;
    gap: 4px;
}

.segmented__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
}

.segmented__item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.segmented__item--active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 900px) {
    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.plan-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.plan-card__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-card__name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-card__desc {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.plan-card__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-card__price-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-card__price-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-card__meta {
    font-size: 12px;
    color: var(--text-muted);
}

.plan-card__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card__feature {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-card__feature::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* Main layout */
.main-container {
    margin-left: 224px;
    min-height: 100vh;
}

@media (max-width: 767px) {
    .main-container {
        margin-left: 0;
    }
}

/* Content container */
.container {
    width: 100%;
    padding: 20px 16px;
}

.dash-container {
    width: 100%;
    padding: 20px 16px;
}

.page-width {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        padding: 24px 32px;
    }

    .dash-container {
        padding: 24px 32px;
    }
}

.dash-section {
    margin-bottom: 20px;
}

.dash-section:last-child {
    margin-bottom: 0;
}

.invoice-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 768px) minmax(280px, 1fr);
    gap: 32px;
    align-items: flex-start;
}

.invoice-settings-layout__main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 768px;
    width: 100%;
}

.invoice-settings-layout__main > *,
.invoice-settings-layout__main section,
.invoice-settings-layout__main .card {
    width: 100%;
}

.invoice-settings-layout__sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 84px;
    align-self: flex-start;
}

@media (max-width: 1199px) {
    .invoice-settings-layout {
        grid-template-columns: minmax(0, 640px) minmax(240px, 1fr);
    }
}

@media (max-width: 1024px) {
    .invoice-settings-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .invoice-settings-layout__sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .invoice-settings-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Page Header */
.page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    background: #0f0f0f;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
    .page-header {
        padding: 0 32px;
    }
}

[data-theme='light'] .page-header {
    background: #fafafa;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: all 0.1s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 0;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-icon--danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.5);
}

[data-theme='light'] .btn-icon--danger {
    border-color: rgba(185, 28, 28, 0.4);
}

.btn-icon--danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: all 0.1s ease;
}

.btn-search:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-emerald {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border-radius: 0.375rem;
    transition: background 0.15s ease;
}

.btn-emerald:hover {
    background: var(--accent-hover);
}

/* Cards */
.card, .dashboard-card, .stat-card {
    padding: 14px 16px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    transition: background 0.1s ease;
}

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

.card-title {
    margin: 4px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.card-subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
}

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

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.client-card {
    padding: 14px 16px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    transition: background 0.1s ease;
}

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

.invoice-preview-card {
    padding: 0;
    overflow: hidden;
}

.invoice-preview-card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
}

.invoice-preview-card__subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.invoice-preview-wrapper {
    padding: 20px;
    background: var(--bg-surface);
    display: flex;
    justify-content: center;
}

[data-theme='light'] .invoice-preview-wrapper {
    background: var(--bg-card);
}

.invoice-preview-paper {
    background: #ffffff;
    color: #111827;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    width: 100%;
    max-width: 920px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.wizard-stepper {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    flex-wrap: wrap;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
}

.wizard-step__circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.15s ease;
}

.wizard-step__circle.is-active {
    background: var(--text-primary);
    color: var(--bg-page);
    border-color: var(--text-primary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

[data-theme='light'] .wizard-step__circle.is-active {
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.wizard-step__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.wizard-step__label.is-active {
    color: var(--text-primary);
}

.wizard-step__description {
    font-size: 11px;
    color: var(--text-muted);
}

.wizard-step__connector {
    flex: 1;
    height: 2px;
    border-radius: 999px;
    background: var(--border-default);
    transition: background 0.15s ease;
}

.wizard-step__connector.is-filled {
    background: var(--text-primary);
}

.success-hero {
    display: flex;
    gap: 16px;
    padding: 20px;
    align-items: center;
}

.success-hero__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.success-hero__icon svg {
    width: 22px;
    height: 22px;
}

.success-hero__inline-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.success-hero__inline-icon svg {
    width: 16px;
    height: 16px;
}

.success-hero__body {
    flex: 1;
}

.success-hero__description {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.success-hero__headline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.success-hero__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--bg-surface);
    margin-bottom: 16px;
}

.success-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.summary-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: background 0.15s ease, border-color 0.15s ease;
}

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

.success-actions .btn-primary,
.success-actions .btn-secondary {
    min-width: 0;
}

.invoice-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.summary-field {
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.next-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.next-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--bg-surface);
}

.next-step__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.next-step__icon svg {
    width: 18px;
    height: 18px;
}

.next-step__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.next-step__description {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

@media (max-width: 640px) {
    .wizard-actions {
        flex-direction: column;
    }

    .success-hero {
        flex-direction: column;
    }

    .success-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .success-actions .btn-primary,
    .success-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .next-step {
        flex-direction: column;
    }
}

/* Client list view (stack) */
.client-list-view .client-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    margin-bottom: 0;
}

.client-list-view .client-card:first-child {
    border-top: 1px solid var(--border-default);
    border-radius: 6px 6px 0 0;
}

.client-list-view .client-card:last-child {
    border-radius: 0 0 6px 6px;
}

.client-list-view .client-card:only-child {
    border-radius: 6px;
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 9999px;
}

/* Form inputs */
.form-input,
.input {
    width: 100%;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    transition: border-color 0.1s ease;
}

.form-input:focus,
.input:focus {
    outline: none;
    border-color: var(--border-strong);
}

[data-theme='light'] .form-input:focus,
[data-theme='light'] .input:focus {
    border-color: rgba(0, 0, 0, 0.25);
}

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon .input {
    padding-left: 28px;
}

.input-with-icon svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Tables */
.table-shell {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.data-table th, .data-table td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
}

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

/* Billing shell */
.billing-shell {
    background: var(--bg-page);
    color: var(--text-primary);
}

/* Workspace cards */
.workspace-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

/* Usage cards */
.usage-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.usage-meter {
    height: 0.25rem;
    background: var(--bg-surface);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.usage-meter__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 9999px;
}

/* Section title */
.section-title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

/* Status banners */
.status-banner {
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-list {
    margin: 0;
    padding-left: 18px;
    color: inherit;
}

.status-list li {
    margin: 2px 0;
}

.template-preview-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-preview-hero__title {
    margin: 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-preview-hero__subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 640px;
}

.template-preview-hero__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.template-preview-hero__stat {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-surface);
}

.template-preview-hero__label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 0;
}

.template-preview-hero__value {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.template-preview-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-preview-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-preview-pane__header h2 {
    margin: 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-preview-pane__header p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    max-width: 640px;
}

.template-preview-pane__hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-preview-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-surface {
    border: 1px solid var(--border-default);
    border-radius: 16px;
    background: var(--bg-elevated);
    padding: 16px;
}

.preview-surface__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.preview-paper {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fdfdfc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 35px rgba(15, 23, 42, 0.18);
}

[data-theme='dark'] .preview-paper {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 35px rgba(0, 0, 0, 0.45);
}

.tinymce-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #0f172a;
    padding: 20px;
}

.tinymce-preview h1 {
    font-size: 1.8em;
    margin: 0.6em 0;
    line-height: 1.2;
}

.tinymce-preview h2 {
    font-size: 1.4em;
    margin: 0.7em 0;
    line-height: 1.3;
}

.tinymce-preview h3 {
    font-size: 1.2em;
    margin: 0.75em 0;
    line-height: 1.3;
}

.tinymce-preview p {
    margin: 0.8em 0;
}

.tinymce-preview a {
    color: var(--accent);
    text-decoration: underline;
}

.tinymce-preview ul,
.tinymce-preview ol {
    padding-left: 1.5em;
    margin: 0.8em 0;
}

.tinymce-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.tinymce-preview th,
.tinymce-preview td {
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 8px;
    font-size: 13px;
}

[data-theme='dark'] .tinymce-preview {
    color: #111827;
}

[data-theme='dark'] .tinymce-preview th,
[data-theme='dark'] .tinymce-preview td {
    border-color: rgba(15, 23, 42, 0.25);
}

.template-preview-pane__footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.template-preview-pane__id {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.template-preview-pane__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.status-banner.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme='light'] .status-banner.success {
    background: rgba(16, 185, 129, 0.1);
}

.status-banner.error {
    background: rgba(235, 87, 87, 0.15);
    color: var(--danger);
    border: 1px solid rgba(235, 87, 87, 0.2);
}

[data-theme='light'] .status-banner.error {
    background: rgba(235, 87, 87, 0.1);
}

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

@media (min-width: 768px) {
    .client-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Empty state */
.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.empty-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 16px;
}

/* Contract signing experience */
body.public-page {
    background: #f5f5f4;
    color: #1f232b;
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    padding: 32px 16px 48px;
}

[data-theme='dark'] body.public-page {
    background: #f0eee8;
    color: #1f232b;
}

.sign-page {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sign-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.sign-header__logo img {
    height: 32px;
}

.sign-header__meta {
    font-size: 12px;
    color: rgba(31, 35, 43, 0.7);
}

.sign-card {
    --text-primary: #1f232b;
    --text-secondary: rgba(31, 35, 43, 0.72);
    --text-tertiary: rgba(31, 35, 43, 0.5);
    --text-muted: rgba(31, 35, 43, 0.45);
    --border-default: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.05);
    --bg-card: #ffffff;
    --bg-surface: #f8f8f5;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    border: 1px solid rgba(15, 15, 15, 0.08);
    box-shadow: 0 18px 50px rgba(5, 5, 8, 0.12);
}

[data-theme='light'] .sign-card {
    box-shadow: 0 20px 45px rgba(15, 15, 15, 0.08);
}

.sign-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.sign-card__title {
    margin: 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.sign-card__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.sign-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sign-summary {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sign-summary__top span {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
}

.sign-summary__top h2 {
    margin: 6px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.sign-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.sign-summary__cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sign-summary__cell span {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sign-summary__value {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.sign-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

.sign-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sign-section__head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.sign-section__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sign-section__subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

.sign-section__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.signature-pad {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    box-shadow: inset 0 2px 6px rgba(15, 15, 15, 0.08);
    padding: 12px;
}

.signature-pad canvas {
    width: 100%;
    height: 200px;
    display: block;
}

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

.sign-card--success {
    text-align: left;
}

.sign-card__success-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #059669;
}

.sign-card__success-body h1 {
    margin: 0 0 8px;
    font-size: 22px;
    color: var(--text-primary);
}

.sign-card__success-body p {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.sign-footer {
    text-align: center;
    padding-top: 12px;
    font-size: 11px;
    color: rgba(31, 35, 43, 0.5);
}

.sign-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 18px;
}

.sign-details span {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
}

.sign-details p {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

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

@media (max-width: 640px) {
    .sign-card {
        padding: 22px;
    }

    body.public-page {
        padding: 24px 12px 32px;
    }
}

/* View toggle */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 4px;
}

.view-toggle button {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.1s ease;
}

.view-toggle button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.view-toggle button.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

/* Delete modal */
.delete-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

 [data-theme='dark'] .delete-modal-overlay {
     background: rgba(0, 0, 0, 0.72);
 }

[data-theme='light'] .delete-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.delete-modal-content {
    width: 100%;
    max-width: 400px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

[data-theme='light'] .delete-modal-content {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ensure modal is opaque */
.delete-modal-content {
    background: var(--bg-card);
}

[data-theme='dark'] .delete-modal-content {
    background: var(--bg-card);
}

[data-theme='light'] .delete-modal-content {
    background: #fff;
}

.delete-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

[data-theme='dark'] .delete-modal-header {
    background: var(--bg-card);
}

[data-theme='light'] .delete-modal-header {
    background: #fff;
}

.delete-modal-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-theme='dark'] .delete-modal-body {
    background: var(--bg-card);
}

[data-theme='light'] .delete-modal-body {
    background: #fff;
}

.delete-modal-footer {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 639px) {
    .delete-modal-footer {
        flex-direction: column;
    }
}

[data-theme='dark'] .delete-modal-footer {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme='light'] .delete-modal-footer {
    background: #fff;
}

.delete-modal-client-info {
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #d84545;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================== Billing Page Styles ======================================== */
.billing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    width: 100%;
}

.billing-card--full {
    width: 100%;
}

.billing-card, .billing-card--full {
    padding: 16px;
    margin-bottom: 20px;
}

/* ======================================== Proposal Builder (generate.php) ======================================== */
.proposal-wizard .bg-neutral-950,
.proposal-wizard .bg-neutral-900 {
    background-color: var(--bg-surface);
}

.proposal-wizard .border-neutral-800,
.proposal-wizard .border-neutral-900 {
    border-color: var(--border-default);
}

.proposal-wizard .text-neutral-50,
.proposal-wizard .text-neutral-100 {
    color: var(--text-primary);
}

.proposal-wizard .text-neutral-300,
.proposal-wizard .text-neutral-400,
.proposal-wizard .text-neutral-500 {
    color: var(--text-secondary);
}

.proposal-wizard .status-banner.success,
.proposal-wizard .status-banner.error {
    background: var(--bg-card);
    border-color: var(--border-default);
    color: var(--text-primary);
}

/* Map old amber utility classes to design tokens inside proposal builder */
.proposal-wizard .bg-amber-500\/10,
.proposal-wizard .bg-amber-500\/20,
.proposal-wizard .bg-amber-950\/40 {
    background-color: var(--bg-surface);
}

.proposal-wizard .border-amber-500\/30,
.proposal-wizard .border-amber-500\/40,
.proposal-wizard .border-amber-400 {
    border-color: var(--border-default);
}

.proposal-wizard .text-amber-100,
.proposal-wizard .text-amber-200,
.proposal-wizard .text-amber-300,
.proposal-wizard .text-amber-700 {
    color: var(--accent);
}

.proposal-wizard .placeholder-amber-300\/60::placeholder {
    color: var(--text-muted);
}

.proposal-wizard .focus\:ring-amber-400:focus {
    box-shadow: 0 0 0 1px var(--accent);
}

.proposal-wizard .focus\:border-amber-400:focus {
    border-color: var(--accent);
}

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

.template-card__option {
    display: block;
}

.template-card__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-card {
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--bg-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.template-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.template-card__icon svg {
    width: 16px;
    height: 16px;
}

.template-card__check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    position: relative;
    transition: all 0.15s ease;
}

.template-card__check::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 4px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    opacity: 0;
}

.template-card__body h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.template-card__body p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
}

.template-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.template-card__meta .status-chip {
    font-size: 10px;
    white-space: nowrap;
}

.template-card__meta span {
    white-space: nowrap;
}

.template-card__option:hover .template-card {
    border-color: var(--border-strong);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.template-card__radio:checked + .template-card {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.08);
}

.template-card__radio:checked + .template-card .template-card__check {
    background: var(--accent);
    border-color: var(--accent);
}

.template-card__radio:checked + .template-card .template-card__check::after {
    opacity: 1;
}

.module-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.module-choice__card {
    gap: 10px;
}

.module-choice__icon {
    width: 32px;
    height: 32px;
}

.module-choice__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.module-choice__title-row h3 {
    font-size: 13px;
    margin: 0;
    color: var(--text-primary);
}

.module-choice__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

.module-choice__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.module-choice__stats span {
    white-space: nowrap;
}

.module-choice-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.proposal-step-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.proposal-step-card-header svg {
    width: 16px;
    height: 16px;
}

.section-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
}

.step-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.module-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.module-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.module-card__stat {
    font-size: 11px;
    color: var(--text-tertiary);
}

.module-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.module-card__hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

.module-order-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    font-size: 11px;
    color: var(--text-secondary);
}

.module-card {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 14px 16px;
}

.module-card--disabled {
    opacity: 0.6;
}

.module-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.module-card__head-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-card__head h3 {
    font-size: 13px;
    margin: 2px 0 0;
    color: var(--text-primary);
}

.module-card__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.module-card__category {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.module-card__label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 2px 0 0;
}

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.module-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.module-toggle input {
    display: none;
}

.module-toggle__control {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-default);
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid var(--border-default);
}

.module-toggle__control::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transform: translateY(-50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.module-toggle input:checked + .module-toggle__control {
    background: var(--success);
    border-color: transparent;
}

.module-toggle input:checked + .module-toggle__control::after {
    transform: translate(18px, -50%);
}

.module-toggle__label {
    font-weight: 500;
    color: var(--text-secondary);
}

.module-card--disabled .module-toggle__label,
.module-toggle__label.is-disabled {
    color: var(--text-tertiary);
}

.module-card--disabled .module-toggle__control {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-default);
}

[data-theme='light'] .module-card--disabled .module-toggle__control {
    background: rgba(0, 0, 0, 0.05);
}

.module-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module-card__body.is-disabled {
    display: none;
}

.module-card--disabled .module-card__body {
    display: none;
}

.module-card__inserts p {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.variable-chip,
.label-chip {
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.variable-chip:hover,
.label-chip:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.editor-area {
    width: 100%;
    min-height: 240px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
}

[data-theme='dark'] .proposal-wizard .editor-area {
    background: #1E1E1E;
}

.editor-area:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

[data-theme='dark'] .proposal-wizard .tox .tox-toolbar-overlord,
[data-theme='dark'] .proposal-wizard .tox .tox-toolbar__primary,
[data-theme='dark'] .proposal-wizard .tox .tox-menubar {
    background: #1B1B1B !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

[data-theme='dark'] .proposal-wizard .tox:not(.tox-tinymce-inline) .tox-editor-header {
    background: #1B1B1B !important;
    border-bottom: none !important;
}

[data-theme='dark'] .proposal-wizard .tox:not(.tox-tinymce-inline) {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.info-panel,
.label-panel {
    margin-top: 20px;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 18px;
    background: var(--bg-card);
}

.info-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.info-panel__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.info-panel__subtitle {
font-size: 11px;
color: var(--text-tertiary);
margin: 2px 0 0;
}

.info-panel__hint {
font-size: 11px;
color: var(--text-tertiary);
margin-top: 8px;
}

.info-panel .form-grid,
.label-panel .form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 12px;
}

.form-field span {
display: block;
font-size: 11px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 4px;
}

.checkbox-field {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.checkbox-field input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.checkbox-field span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.field-input,
.label-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus,
.label-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.label-panel__composer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.label-panel__quick {
    margin-top: 16px;
}

.label-panel__quick p {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.labels-selected {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    padding: 10px;
    border: 1px dashed var(--border-default);
    border-radius: 10px;
    background: var(--bg-surface);
}

.label-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.4);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.label-pill button {
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    color: inherit;
    cursor: pointer;
}

.label-pill svg {
    width: 10px;
    height: 10px;
    color: inherit;
}

.module-pick-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.module-pick {
    display: block;
    cursor: pointer;
}

.module-pick__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.module-pick__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.module-pick:hover .module-pick__card {
    background: var(--bg-hover);
}

.module-pick__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.module-pick__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-pick__meta {
    font-size: 11px;
    color: var(--text-tertiary);
}

.module-pick__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.module-pick__input:checked + .module-pick__card {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

[data-theme='light'] .module-pick__input:checked + .module-pick__card {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.module-pick__check {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

[data-theme='light'] .module-pick__check {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.04);
}

.module-pick__check svg {
    stroke: currentColor;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.module-pick__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.module-pick__input:checked + .module-pick__card .module-pick__check {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(16, 185, 129, 0.12);
}

[data-theme='dark'] .module-pick__input:checked + .module-pick__card .module-pick__check {
    background: rgba(16, 185, 129, 0.18);
}

[data-theme='light'] .module-pick__input:checked + .module-pick__card .module-pick__check {
    background: rgba(37, 99, 235, 0.1);
}

.module-pick__input:checked + .module-pick__card .module-pick__check svg {
    opacity: 1;
}

.module-pick-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.module-drag-handle {
    cursor: move;
}

.module-placeholder {
    border: 2px dashed rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    height: 72px;
    border-radius: 12px;
}

[data-theme='light'] .module-placeholder {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
}

.wizard-complete-card {
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wizard-complete-card__header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wizard-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
}

.wizard-complete-card__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.wizard-complete-card__subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.proposal-id-chip {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px dashed var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.proposal-id-chip svg {
    width: 16px;
    height: 16px;
}

.wizard-complete-card__actions {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.wizard-complete-card__downloads {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proposal-download-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
}

.proposal-download-card__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.proposal-download-card__content svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}

.proposal-download-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.proposal-download-card__subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.proposal-download-card__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.proposal-download-card__action svg {
    width: 16px;
    height: 16px;
}

.proposal-download-card__action.is-primary {
    background: var(--success);
    border-color: var(--success);
    color: #041b12;
}

.proposal-download-card__action:hover {
    border-color: var(--border-strong);
}

.proposal-download-card__action.is-primary:hover {
    background: #34d399;
    border-color: #34d399;
}

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

@media (min-width: 768px) {
    .party-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
}

.party-info-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proposal-download-card--pending {
    align-items: center;
}

.proposal-download-card--pending svg {
    color: var(--text-secondary);
}

.proposal-details-card {
    border-radius: 12px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    padding: 20px;
}

.proposal-details-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.proposal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.proposal-details-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.proposal-details-value {
    font-size: 13px;
    color: var(--text-primary);
    margin: 0;
}
.billing-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.billing-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.billing-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
    text-decoration: none;
}

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

.billing-btn-primary:hover {
    background: var(--accent-hover);
}

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

.billing-btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

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

.billing-btn-danger:hover {
    background: #d84545;
}

.billing-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 9999px;
}

.billing-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

[data-theme='light'] .billing-status-active {
    background: rgba(16, 185, 129, 0.1);
}

.billing-status-inactive {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.billing-plan-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.billing-plan-card {
    padding: 12px;
    border-radius: 6px;
    border: 2px solid var(--border-default);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.billing-plan-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

input[type="radio"]:checked ~ .billing-plan-card {
    border-color: #37352f;
    background: #37352f;
}

input[type="radio"]:checked ~ .billing-plan-card .billing-plan-name,
input[type="radio"]:checked ~ .billing-plan-card .billing-plan-price,
input[type="radio"]:checked ~ .billing-plan-card span {
    color: #fff;
}

.billing-toggle-group {
    display: flex;
    padding: 2px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
}

.billing-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.billing-toggle-btn:hover {
    background: var(--bg-hover);
}

input[type="radio"]:checked + .billing-toggle-btn {
    background: #37352f;
    color: #fff !important;
    font-weight: 600;
}

.billing-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .billing-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.billing-stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 14px 16px;
}

/* Settings page */
.settings-page .settings-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-page .settings-hero {
    padding: 20px;
}

.settings-page .settings-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.settings-page .settings-hero__title {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-page .settings-hero__subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 520px;
    line-height: 1.5;
}

.settings-page .settings-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-page .settings-section-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.settings-page .settings-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.settings-page .settings-metric {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 14px 16px;
}

.settings-page .settings-metric__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-page .settings-metric__label {
    margin: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.settings-page .settings-metric__icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.settings-page .settings-metric__icon svg {
    width: 14px;
    height: 14px;
}

.settings-page .settings-metric__value {
    margin: 10px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-page .settings-metric__hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.settings-page .dash-section {
    margin-bottom: 2px;
}

.settings-page .dash-section:last-child {
    margin-bottom: 0;
}

.settings-page .members-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-page .members-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.settings-page .members-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.settings-page .members-tab.is-active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-primary);
    font-weight: 600;
}

.settings-page .settings-suggestion {
    margin-top: 8px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
}

.settings-page .settings-suggestion code {
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-primary);
}

.settings-page .settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-page .settings-form-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.settings-page .settings-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.settings-page .settings-meta span {
    color: var(--text-primary);
    font-weight: 600;
}

.settings-page .settings-danger-card {
    border: 1px solid rgba(235, 87, 87, 0.22);
    background: rgba(235, 87, 87, 0.06);
}

.settings-page .settings-danger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.settings-page .input-danger {
    border-color: rgba(235, 87, 87, 0.55);
    background: rgba(235, 87, 87, 0.08);
}

.settings-page .input-danger:focus {
    border-color: rgba(235, 87, 87, 0.85);
}

/* Members page */
.members-page .members-hero {
    padding: 20px;
}

.members-page .members-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.members-page .members-hero__title {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-page .members-hero__subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 560px;
    line-height: 1.5;
}

.members-page .members-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.members-page .members-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.members-page .members-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.members-page .members-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.members-page .members-tab.is-active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-primary);
    font-weight: 600;
}

.members-page .members-limit {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.members-page .members-limit__desc {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.members-page .members-limit__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.members-page .members-progress-track {
    width: 180px;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-hover);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.members-page .members-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.members-page .members-upgrade-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.members-page .members-upgrade-link:hover {
    color: var(--accent-hover);
}

.members-page .members-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.members-page .members-card-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.members-page .members-empty {
    padding: 18px;
    border-radius: 6px;
    border: 1px dashed var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.members-page .members-list {
    display: flex;
    flex-direction: column;
}

.members-page .members-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.members-page .members-row:last-child {
    border-bottom: none;
}

.members-page .members-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.members-page .members-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.members-page .members-user__meta {
    min-width: 0;
}

.members-page .members-user__name {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-page .members-user__email {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

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

.members-page .members-owner-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 193, 7, 0.35);
    background: rgba(255, 193, 7, 0.12);
    color: rgba(255, 193, 7, 0.9);
    font-size: 11px;
    font-weight: 600;
}

.members-page .members-role-form {
    margin: 0;
}

.members-page .members-role-select {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 11px;
}

.members-page .members-role-select:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.members-page .members-remove-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(235, 87, 87, 0.35);
    background: rgba(235, 87, 87, 0.12);
    color: rgba(235, 87, 87, 0.95);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.members-page .members-remove-btn:hover {
    border-color: rgba(235, 87, 87, 0.55);
    background: rgba(235, 87, 87, 0.18);
}

.members-page .members-roles {
    display: flex;
    flex-direction: column;
}

.members-page .members-role-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.members-page .members-role-row:last-child {
    border-bottom: none;
}

.members-page .members-role-name {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-page .members-role-desc {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.members-page .members-role-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.members-page .members-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--text-muted);
    opacity: 0.5;
}

.members-page .members-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.members-page .members-modal-overlay.is-hidden {
    display: none;
}

.members-page .members-modal {
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: 0 16px 55px rgba(0, 0, 0, 0.45);
}

.members-page .members-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.members-page .members-modal-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-page .members-modal-subtitle {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.members-page .members-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.members-page .members-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}

/* Roles page */
.roles-page .roles-hero {
    padding: 20px;
}

.roles-page .roles-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.roles-page .roles-hero__title {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.roles-page .roles-hero__subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 560px;
    line-height: 1.5;
}

.roles-page .roles-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.roles-page .members-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.roles-page .members-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.roles-page .members-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.roles-page .members-tab.is-active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-primary);
    font-weight: 600;
}

.roles-page .roles-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.roles-page .roles-card-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.roles-page .roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.roles-page .roles-role-card {
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: 10px;
    overflow: hidden;
}

.roles-page .roles-role-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.roles-page .roles-role-card__name {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.roles-page .roles-role-card__desc {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.roles-page .roles-role-card__body {
    padding: 12px 14px;
}

.roles-page .roles-role-card__label {
    margin: 0 0 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.roles-page .roles-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.roles-page .roles-perm-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
}

.roles-page .roles-perm-chip.muted {
    color: var(--text-tertiary);
}

.roles-page .roles-perm-empty {
    font-size: 11px;
    color: var(--text-tertiary);
}

.roles-page .roles-role-card__footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.roles-page .roles-note {
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.roles-page .roles-note p {
    margin: 0;
    font-size: 12px;
    color: var(--text-primary);
}

.roles-page .roles-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.roles-page .roles-modal-overlay.is-hidden {
    display: none;
}

.roles-page .roles-modal {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: 0 16px 55px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.roles-page .roles-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.roles-page .roles-modal-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.roles-page .roles-modal-subtitle {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.roles-page .roles-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(90vh - 120px);
    overflow: auto;
}

.roles-page .roles-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}

.roles-page .roles-permission-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.roles-page .roles-permission-group {
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 12px;
}

.roles-page .roles-permission-group__title {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.roles-page .roles-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 768px) {
    .roles-page .roles-permission-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.roles-page .roles-permission-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.roles-page .roles-permission-item input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent);
}

.roles-page .roles-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.roles-page .roles-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.roles-page .roles-drawer__panel {
    position: relative;
    width: min(520px, 92vw);
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
}

.roles-page .roles-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.roles-page .roles-drawer__title {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.roles-page .roles-drawer__body {
    padding: 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roles-page .roles-drawer__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.roles-page .roles-drawer__section-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.roles-page .roles-drawer__section-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.roles-page .roles-drawer__footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.activity-page .activity-hero {
    padding: 20px;
}

.activity-page .activity-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.activity-page .activity-hero__title {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-page .activity-hero__subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 560px;
    line-height: 1.5;
}

.activity-page .activity-hero__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-page .members-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-page .members-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.activity-page .members-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.activity-page .members-tab.is-active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-primary);
    font-weight: 600;
}

.activity-page .activity-switcher {
    position: relative;
}

.activity-page .activity-switcher-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: var(--bg-card);
    background-color: var(--bg-card);
    opacity: 1;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    z-index: 50;
}

.activity-page .activity-switcher-menu.is-hidden {
    display: none;
}

.activity-page .activity-switcher-menu__title {
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.activity-page .activity-switcher-menu__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.activity-page .activity-switcher-menu__item:last-child {
    border-bottom: 0;
}

.activity-page .activity-switcher-menu__item:hover {
    background: var(--bg-hover);
}

.activity-page .activity-switcher-menu__label {
    font-size: 12px;
    font-weight: 600;
}

.activity-page .activity-switcher-menu__hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

.activity-page .activity-locked__title {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-page .activity-locked__subtitle {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.6;
}

.activity-page .activity-locked__hint {
    margin: 12px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.activity-page .activity-filters-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.activity-page .activity-filters-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

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

@media (min-width: 1100px) {
    .activity-page .activity-filters-grid {
        grid-template-columns: repeat(5, minmax(180px, 1fr)) auto;
    }
}

.activity-page .activity-filters-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.activity-page .activity-filters-actions .btn-primary,
.activity-page .activity-filters-actions .btn-secondary {
    min-height: 32px;
    padding: 6px 14px;
}

.activity-page .activity-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.activity-page .activity-list-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.activity-page .activity-list-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-page .activity-perpage {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.activity-page .activity-perpage .form-label {
    margin: 0;
    padding-bottom: 2px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.activity-page .activity-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-page .activity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px;
    border-top: 1px solid var(--border-subtle);
}

.activity-page .activity-row:first-child {
    border-top: 0;
}

.activity-page .activity-row:hover {
    background: var(--bg-hover);
}

.activity-page .activity-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.activity-page .activity-main {
    flex: 1;
    min-width: 0;
}

.activity-page .activity-line {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.activity-page .activity-line strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-page .activity-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.activity-page .activity-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.activity-page .activity-time {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex: 0 0 auto;
}

.activity-page .activity-empty {
    padding: 30px 14px;
    text-align: center;
}

.activity-page .activity-empty__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-page .activity-empty__subtitle {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.activity-page .activity-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.checkout-page .funnel-shell {
    min-height: 100vh;
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.checkout-page .funnel-shell > main {
    flex: 1;
}

.checkout-page .funnel-shell footer {
    margin-top: auto;
}

.checkout-shell {
    min-height: 100vh;
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.checkout-shell__main {
    flex: 1;
}

.checkout-shell footer {
    margin-top: auto;
}

.checkout-page .funnel-shell__header {
    padding: 18px 16px 0;
}

.checkout-page .funnel-shell__header-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
}

.checkout-page .funnel-shell__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.checkout-page .funnel-shell__logo {
    height: 28px;
    width: auto;
}

.checkout-page .funnel-shell__header-text {
    flex: 0 1 auto;
    min-width: 0;
    text-align: center;
}

.checkout-page .funnel-shell__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkout-page .funnel-shell__subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.checkout-page .funnel-shell__main {
    flex: 1;
    padding: 16px;
}

.checkout-page .checkout-grid {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.checkout-page .checkout-container {
    background: transparent;
    color: var(--text-primary);
    max-width: 980px;
    margin: 0 auto;
}

.checkout-page .checkout-header {
    text-align: center;
    margin-bottom: 24px;
}

.checkout-page .checkout-header__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 12px;
}

.checkout-page .checkout-header__logo {
    height: 32px;
    width: auto;
}

.checkout-page .checkout-header__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.checkout-page .checkout-header__subtitle {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

@media (min-width: 900px) {
    .checkout-page .checkout-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.checkout-page .checkout-card {
    padding: 16px;
}

.checkout-page .checkout-card__header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.checkout-page .checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkout-page .checkout-summary__line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.checkout-page .checkout-summary__name {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkout-page .checkout-summary__hint {
    margin: 3px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.checkout-page .checkout-summary__amount {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.checkout-page .checkout-summary__discount {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 11px;
}

.checkout-page .checkout-summary__total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 2px;
}

.checkout-page .checkout-summary__total-label {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.checkout-page .checkout-summary__total-hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.checkout-page .checkout-summary__total-amount {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.checkout-page .checkout-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.checkout-page .checkout-discount__row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.checkout-page .checkout-discount__row .btn-secondary {
    flex: 0 0 auto;
    white-space: nowrap;
}

.checkout-page .checkout-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.checkout-page .checkout-error {
    margin: 8px 0 0;
    font-size: 11px;
    color: rgba(235, 87, 87, 1);
}

.checkout-page .checkout-payment {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-page .checkout-free {
    padding: 2px 0;
}

.checkout-page .checkout-free__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkout-page .checkout-free__subtitle {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.checkout-page .checkout-stripe-element {
    padding: 12px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: 8px;
}

.checkout-page code.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-secondary);
}

.checkout-page .checkout-back {
    max-width: 980px;
    margin: 12px auto 0;
    display: flex;
    justify-content: center;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.template-section-subtitle {
    margin: 4px 0 12px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.template-hero__title {
    margin: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-hero__subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 520px;
    line-height: 1.5;
}

.template-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.template-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.template-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 14px 16px;
}

.template-stat__label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.template-stat__value {
    margin: 6px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-stat__hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.template-library__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.template-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.template-library-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-library-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.template-library-card__title {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.template-library-card__meta {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-library-card__details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-library-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.template-library-card__actions-left {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.template-builder-card {
    padding: 0;
}

.template-builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
    gap: 16px;
}

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

.template-builder-form {
    padding: 24px;
    border-right: 1px solid var(--border-subtle);
}

.template-builder-form form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1024px) {
    .template-builder-form {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

.template-builder-aside {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-editor-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-editor-block__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-editor-block__title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-editor-block__subtitle {
    margin: 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-editor-block__variables {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.editor-shell {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 8px;
    background: var(--bg-surface);
}

.editor-shell textarea {
    width: 100%;
    min-height: 220px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
}

.editor-shell textarea:focus {
    outline: none;
}

.editor-hint {
    margin: 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.template-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.template-builder-actions {
    margin-top: 4px;
}

.btn-tertiary {
    border: 1px dashed var(--border-default);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
}

.btn-tertiary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.upload-panel {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 18px;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-panel__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-panel__subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.upload-panel__hint {
    margin: 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input {
    border: 1px dashed var(--border-default);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-card);
    font-size: 12px;
    color: var(--text-secondary);
}

.file-input input {
    width: 100%;
    background: transparent;
    border: none;
    color: inherit;
}

.file-input input:focus {
    outline: none;
}

.template-info-panel {
    padding: 18px;
}

.template-info-panel__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-info-list {
    margin: 0;
    padding-left: 16px;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}


/* ======================================== Profile Page Styles ======================================== */
.profile-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
}

.profile-hero__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.3;
}

.profile-hero__subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.profile-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.profile-hero__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.profile-hero__value {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-card--span2 {
    grid-column: span 2;
}

@media (max-width: 767px) {
    .profile-card--span2 {
        grid-column: span 1;
    }
}

.profile-card--meta {
    grid-column: span 1;
}

.profile-card__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.profile-card__icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.profile-card__icon svg {
    width: 18px;
    height: 18px;
}

.profile-card__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.profile-card__subtitle {
    margin: 3px 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 0.8125rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.form-hint__icon {
    width: 12px;
    height: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.profile-meta-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-meta-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.profile-meta-list li:last-child {
    border-bottom: none;
}

.profile-meta-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ======================================== Billing Page Styles ======================================== */
.billing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
}

.billing-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.billing-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.billing-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
    text-decoration: none;
}

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

.billing-btn-primary:hover {
    background: var(--accent-hover);
}

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

.billing-btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

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

.billing-btn-danger:hover {
    background: #d84545;
}

.billing-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 9999px;
}

.billing-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

[data-theme='light'] .billing-status-active {
    background: rgba(16, 185, 129, 0.1);
}

.billing-status-inactive {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.billing-plan-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.billing-plan-card {
    padding: 12px;
    border-radius: 6px;
    border: 2px solid var(--border-default);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.billing-plan-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

input[type="radio"]:checked ~ .billing-plan-card {
    border-color: #37352f;
    background: #37352f;
}

input[type="radio"]:checked ~ .billing-plan-card .billing-plan-name,
input[type="radio"]:checked ~ .billing-plan-card .billing-plan-price,
input[type="radio"]:checked ~ .billing-plan-card span {
    color: #fff;
}

.billing-toggle-group {
    display: flex;
    padding: 2px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
}

.billing-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.billing-toggle-btn:hover {
    background: var(--bg-hover);
}

input[type="radio"]:checked + .billing-toggle-btn {
    background: #37352f;
    color: #fff !important;
    font-weight: 600;
}

.billing-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .billing-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.billing-stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 14px 16px;
}

.projects-page .projects-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .projects-page .projects-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.projects-page .projects-status-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.projects-calendar-page .bg-white {
    background: var(--bg-card) !important;
}

.projects-calendar-page .bg-slate-50,
.projects-calendar-page .bg-slate-100,
.projects-calendar-page .bg-blue-50 {
    background: var(--bg-surface) !important;
}

.projects-calendar-page .border-slate-200,
.projects-calendar-page .border-slate-300 {
    border-color: var(--border-default) !important;
}

.projects-calendar-page .text-slate-900 {
    color: var(--text-primary) !important;
}

.projects-calendar-page .text-slate-600,
.projects-calendar-page .text-slate-500,
.projects-calendar-page .text-slate-700 {
    color: var(--text-muted) !important;
}

.projects-calendar-page .bg-slate-200 {
    background: rgba(148, 163, 184, 0.15) !important;
}

.is-hidden {
    display: none !important;
}

.form-select,
.form-textarea {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.task-page .task-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1024px) {
    .task-page .task-detail-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
    }
}

.task-page .task-detail-main,
.task-page .task-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-page .task-detail-fields {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.task-page .task-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.task-page .task-detail-comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.task-page .task-detail-comment {
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: 6px;
    padding: 12px 14px;
}

.task-page .task-detail-comment__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.task-page .task-detail-comment__author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-page .task-detail-comment__time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.task-page .task-detail-comment__body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.task-page .task-detail-assignees,
.task-page .task-detail-attachments {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.task-page .task-detail-assignee,
.task-page .task-detail-attachment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: var(--bg-surface);
}

.task-page .task-detail-assignee__name,
.task-page .task-detail-attachment__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-page .task-detail-attachment__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.task-page .task-detail-attachment__sub {
    font-size: 11px;
    color: var(--text-tertiary);
}

.projects-page .quick-add-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.55);
    padding: 20px;
    overflow-y: auto;
}

[data-theme='light'] .projects-page .quick-add-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.projects-page .quick-add-modal-align {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-page .quick-add-modal-card {
    width: 100%;
    max-width: 720px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

.projects-page .quick-add-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 12px;
}

.projects-page .quick-add-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projects-page .quick-add-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.projects-page .quick-add-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 720px) {
    .projects-page .quick-add-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .projects-page .quick-add-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.projects-page .quick-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
    margin-top: 4px;
}

.projects-page .edit-project-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.55);
    padding: 20px;
    overflow-y: auto;
}

[data-theme='light'] .projects-page .edit-project-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.projects-page .edit-project-modal-align {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-page .edit-project-modal-card {
    width: 100%;
    max-width: 720px;
}

.projects-page .edit-project-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 12px;
}

.projects-page .edit-project-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projects-page .edit-project-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 720px) {
    .projects-page .edit-project-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.projects-page .edit-project-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
    margin-top: 4px;
}








