/* ============================================
   TAILOR CRM - MAIN STYLESHEET
   No build tools needed. Pure CSS with custom properties.
   ============================================ */

/* CSS Custom Properties (Design Tokens) */
:root {
    /* Colors */
    --color-primary: #1a5f3f;
    --color-primary-dark: #124a30;
    --color-primary-light: #2d8a5e;
    --color-secondary: #c4943a;
    --color-secondary-dark: #a0782e;

    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-hover: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-bg: #fee2e2;
    --color-info: #3b82f6;
    --color-info-bg: #dbeafe;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --max-content-width: 1400px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-surface: #1e293b;
        --color-surface-hover: #334155;
        --color-border: #334155;
        --color-border-light: #1e293b;
        --color-text: #f1f5f9;
        --color-text-secondary: #94a3b8;
        --color-text-muted: #64748b;
    }
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   LAYOUT
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-primary);
}

.logo-icon {
    font-size: var(--text-2xl);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.nav-link.active {
    background: var(--color-primary);
    color: white;
}

.nav-icon {
    font-size: var(--text-lg);
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-avatar {
    font-size: var(--text-2xl);
}

.user-name {
    font-weight: 600;
    font-size: var(--text-sm);
}

.logout-link {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--space-xl);
    max-width: calc(var(--max-content-width) + var(--sidebar-width));
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: 90;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ============================================
   QUICK SEARCH
   ============================================ */

.quick-search-bar {
    position: relative;
    margin-bottom: var(--space-xl);
    max-width: 600px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 0 var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.search-wrapper:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.search-icon {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    margin-right: var(--space-sm);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--space-md) 0;
    font-size: var(--text-base);
    color: var(--color-text);
    outline: none;
}

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

.search-clear {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: var(--text-sm);
}

.search-results {
    position: absolute;
    top: calc(100% + var(--space-sm));
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--color-surface-hover);
}

.result-type {
    font-size: var(--text-xs);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-title {
    font-weight: 600;
    color: var(--color-text);
}

.result-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.search-loading, .search-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--color-text-muted);
}

/* ============================================
   CARDS & COMPONENTS
   ============================================ */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-surface-hover);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-icon {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

.stat-card.primary { border-top: 3px solid var(--color-primary); }
.stat-card.success { border-top: 3px solid var(--color-success); }
.stat-card.warning { border-top: 3px solid var(--color-warning); }
.stat-card.danger { border-top: 3px solid var(--color-danger); }

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th {
    background: var(--color-surface-hover);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-pending { background: var(--color-warning-bg); color: #92400e; }
.badge-in_progress { background: var(--color-info-bg); color: #1e40af; }
.badge-ready { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: var(--color-success-bg); color: #065f46; }
.badge-cancelled { background: var(--color-danger-bg); color: #991b1b; }
.badge-paid { background: var(--color-success-bg); color: #065f46; }
.badge-partial { background: var(--color-warning-bg); color: #92400e; }
.badge-unpaid { background: var(--color-danger-bg); color: #991b1b; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

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

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

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

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    cursor: pointer;
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--color-border);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
}

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

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   MEASUREMENT GRID
   ============================================ */

.measurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
}

.measurement-item {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.measurement-name {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.measurement-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-primary);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-text);
}

.page-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ============================================
   FILTERS & TABS
   ============================================ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-pill {
    padding: var(--space-xs) var(--space-md);
    border-radius: 9999px;
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--color-surface-hover);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.messages {
    margin-bottom: var(--space-lg);
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.alert-success { background: var(--color-success-bg); color: #065f46; }
.alert-error { background: var(--color-danger-bg); color: #991b1b; }
.alert-warning { background: var(--color-warning-bg); color: #92400e; }
.alert-info { background: var(--color-info-bg); color: #1e40af; }

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-lg);
    opacity: 0.6;
}

.alert-close:hover { opacity: 1; }

/* ============================================
   TOASTS
   ============================================ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }
.toast.info { border-left-color: var(--color-info); }

.toast button {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
}

.toast button:hover { opacity: 1; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   OFFLINE BANNER
   ============================================ */

.offline-banner {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--color-warning);
    color: #78350f;
    padding: var(--space-sm) var(--space-lg);
    text-align: center;
    font-weight: 600;
    font-size: var(--text-sm);
    z-index: 1000;
}

/* ============================================
   GALLERY
   ============================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.gallery-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast);
}

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

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.gallery-info {
    padding: var(--space-md);
}

.gallery-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.gallery-category {
    font-size: var(--text-xs);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-lg);
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-xl);
    cursor: pointer;
    color: var(--color-text-muted);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--color-surface-hover);
}

.page-link.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.empty-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: calc(var(--header-height) + var(--space-lg));
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .mobile-header {
        display: flex;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

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

    .offline-banner {
        left: 0;
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        min-width: auto;
    }
}

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

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

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

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .sidebar, .mobile-header, .quick-search-bar, .page-actions, .btn {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* HTMX transitions */
.htmx-added {
    animation: slideUp 0.3s ease;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.subscription-banner {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.subscription-banner.free-plan {
    border: 2px solid var(--color-primary);
}

.plan-badge {
    background: var(--color-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 600;
}

.upgrade-nudge {
    margin-left: 1rem;
    font-size: var(--text-sm);
}

.upgrade-nudge a {
    color: var(--color-primary);
    text-decoration: underline;
}

.limit-warning {
    color: #e74c3c;
    font-size: var(--text-xs);
    font-weight: 600;
}

.progress-fill.warning {
    background: #f39c12;
}

.risk-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.risk-blocked { background: #dc3545; color: white; }
.risk-throttled { background: #ffc107; color: #212529; }
.risk-warning { background: #fd7e14; color: white; }

@media (max-width: 768px) {
    .dashboard-section > div {
        grid-template-columns: 1fr !important;
    }
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.auth-card h2 {
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #4338ca;
}

.switch-auth {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.switch-auth a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
/* ============================================
   COMING SOON MODAL
   ============================================ */

body.modal-open {
    overflow: hidden;
}

.coming-soon-modal-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.coming-soon-modal-wrapper > * {
    pointer-events: auto;
}

.cs-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1;
}

.cs-modal {
    position: relative;
    z-index: 2;
    background: #1e293b;
    border-radius: 20px;
    width: 92%;
    max-width: 440px;
    padding: 36px 28px 24px;
    text-align: center;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 1px solid #334155;
}

.cs-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
}

.cs-demand-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #fde68a;
    z-index: 3;
}

.cs-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 3;
}

.cs-close:hover {
    background: #475569;
    color: #e2e8f0;
}

.cs-icon-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 8px auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(26, 95, 63, 0.15);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.cs-pulse {
    position: absolute;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #34d399;
    opacity: 0.12;
    z-index: 1;
    animation: cs-pulse 2.5s ease-out infinite;
}

@keyframes cs-pulse {
    0% { transform: scale(1); opacity: 0.12; }
    100% { transform: scale(1.7); opacity: 0; }
}

.cs-title {
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 10px;
    line-height: 1.3;
}

.cs-desc,
.cs-desc-default {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 24px;
    line-height: 1.6;
}

.cs-teaser-list {
    list-style: none;
    margin: 0 0 28px;
    text-align: left;
    background: #0f172a;
    border-radius: 12px;
    padding: 18px 22px;
    border: 1px solid #1e293b;
}

.cs-teaser-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #cbd5e1;
    padding: 7px 0;
}

.cs-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(26, 95, 63, 0.25);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.cs-notify-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.cs-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #475569;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #0f172a;
    color: #f1f5f9;
}

.cs-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.25);
}

.cs-input::placeholder {
    color: #64748b;
}

.cs-btn-primary {
    padding: 12px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
}

.cs-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.cs-btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.cs-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cs-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cs-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

.cs-thanks {
    background: rgba(26, 95, 63, 0.15);
    color: #34d399;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.cs-btn-text {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
}

.cs-btn-text:hover {
    color: #94a3b8;
}

.cs-brand-strip {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Pro Card - Coming Soon variant on upgrade page */
.card-coming-soon {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px dashed #475569;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-coming-soon:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.cs-ribbon {
    position: absolute;
    top: 14px;
    right: -32px;
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 36px;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.cs-coming-icon {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-coming-pulse {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.15;
    animation: cs-pulse-ring 2s ease-out infinite;
}

@keyframes cs-pulse-ring {
    0% { transform: scale(1); opacity: 0.15; }
    100% { transform: scale(1.8); opacity: 0; }
}

.btn-coming-soon {
    background: #334155;
    color: #94a3b8;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .cs-modal {
        padding: 28px 20px 20px;
        border-radius: 16px;
        width: 95%;
    }
    .cs-notify-form {
        flex-direction: column;
    }
    .cs-btn-primary {
        width: 100%;
    }
    .cs-demand-badge {
        position: static;
        display: inline-block;
        margin-bottom: 14px;
    }
    .cs-title {
        font-size: 18px;
    }
}

