/* ============================================================================
   FrappeFlo Cloud — Premium Design System
   ============================================================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-input: #0d1321;
    --border-primary: #1f2937;
    --border-secondary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-tertiary: #06b6d4;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #eab308;
    --warning-bg: rgba(234, 179, 8, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.08);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);
    --transition: 0.2s ease;
}

/* -- Reset ----------------------------------------------------------------- */

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-tertiary);
}

/* ============================================================================
   LANDING PAGE
   ============================================================================ */

#landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* -- Background effects ---------------------------------------------------- */

.landing-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 25s ease-in-out infinite;
    will-change: transform;
}
.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -15%;
    left: -8%;
}
.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a855f7, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -8s;
}
.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%;
    right: 25%;
    animation-delay: -16s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.03); }
    66% { transform: translate(-15px, 15px) scale(0.97); }
}

/* -- Landing content ------------------------------------------------------- */

.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 680px;
}

.landing-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 3rem;
}

.logo-mark {
    filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.35));
}

.logo-wordmark {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #f9fafb 30%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-title {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: #f9fafb;
    -webkit-text-fill-color: #f9fafb;
}
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* -- Auth buttons ---------------------------------------------------------- */

.auth-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

.auth-secondary {
    display: flex;
    gap: 0.75rem;
}

/* -- Feature cards --------------------------------------------------------- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: left;
}

.feature-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.feature-card:hover {
    border-color: var(--border-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
    color: var(--accent-primary);
}

.feature-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.feature-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
}
.btn:active {
    transform: scale(0.98);
}

.btn-google {
    background: #ffffff;
    color: #1f2937;
    padding: 0.8rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 340px;
}
.btn-google:hover {
    background: #f3f4f6;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-oauth {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
}
.btn-oauth:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 24px var(--accent-glow);
}
.btn-accent:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 36px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}
.btn-gradient:hover {
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-control {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}
.btn-control:hover {
    color: var(--text-primary);
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; font-weight: 600; }
.btn-full { width: 100%; }

.btn-logout {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}
.btn-logout:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* ============================================================================
   TOP NAVIGATION
   ============================================================================ */

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
    border-bottom: 1px solid var(--border-primary);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.logo-mark-sm {
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.25));
}

.nav-wordmark {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f9fafb, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* -- Tab Navigation -------------------------------------------------------- */

.tab-nav {
    display: flex;
    gap: 2px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-primary);
}

.tab-btn {
    padding: 0.4rem 1rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: calc(var(--radius-md) - 2px);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}

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

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.page-narrow { max-width: 560px; }

.page-header {
    margin-bottom: 2rem;
}
.page-header.center { text-align: center; }

.onboard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    margin-bottom: 1rem;
}
.card:hover {
    border-color: var(--border-secondary);
}

.onboard-card {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================================
   STATUS HERO CARD
   ============================================================================ */

.card-status-hero {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(17, 24, 39, 0.8));
    border-color: var(--border-primary);
    padding: 1.75rem;
    margin-bottom: 1rem;
}

.status-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.status-hero-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* -- Status Badge ---------------------------------------------------------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge.running {
    background: var(--success-bg);
    color: var(--success);
}
.status-badge.running::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-badge.stopped {
    background: var(--warning-bg);
    color: var(--warning);
}
.status-badge.stopped::before { background: var(--warning); }

.status-badge.error {
    background: var(--error-bg);
    color: var(--error);
}
.status-badge.error::before {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.status-badge.provisioning, .status-badge.starting {
    background: var(--info-bg);
    color: var(--info);
}
.status-badge.provisioning::before, .status-badge.starting::before {
    background: var(--info);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.instance-controls {
    display: flex;
    gap: 0.5rem;
}

/* ============================================================================
   DASHBOARD GRID
   ============================================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* -- Usage Card ------------------------------------------------------------ */

.usage-item {
    margin-bottom: 1.25rem;
}
.usage-item:last-child { margin-bottom: 0; }

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

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

.usage-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.progress-fill-cyan {
    background: linear-gradient(90deg, var(--accent-tertiary), var(--accent-primary));
}

/* -- Quick Info Card ------------------------------------------------------- */

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

.code-badge {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--accent-tertiary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    user-select: all;
    letter-spacing: 0.02em;
}

/* -- Logs ------------------------------------------------------------------ */

.log-viewer {
    background: #060a14;
    color: #86efac;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.75rem;
    line-height: 1.7;
    max-height: 340px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.log-viewer::-webkit-scrollbar { width: 6px; }
.log-viewer::-webkit-scrollbar-track { background: transparent; }
.log-viewer::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

/* ============================================================================
   SETTINGS (Collapsible)
   ============================================================================ */

.card-settings { max-width: 1100px; }

.clickable { cursor: pointer; user-select: none; }
.clickable:hover .chevron { color: var(--text-primary); }

.chevron {
    color: var(--text-muted);
    transition: transform var(--transition), color var(--transition);
}

.collapsible {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    max-height: 800px;
    opacity: 1;
}

.collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

.card-settings .card-header { margin-bottom: 0; }
.card-settings .collapsible:not(.collapsed) { padding-top: 1.5rem; }

/* ============================================================================
   DANGER ZONE
   ============================================================================ */

.card-danger {
    border-color: rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.03);
    margin-top: 2rem;
}

.danger-title { color: var(--error) !important; }

.danger-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-primary);
}
.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-section-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-hover);
    flex-shrink: 0;
}

.form-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 16px rgba(99, 102, 241, 0.08);
}

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

.form-error {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

.link {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(129, 140, 248, 0.3);
}
.link:hover {
    color: var(--accent-tertiary);
    text-decoration-color: var(--accent-tertiary);
}

/* ============================================================================
   ADMIN PANEL
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
}
.stat-card:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-total { background: var(--info-bg); color: var(--info); }
.stat-icon-running { background: var(--success-bg); color: var(--success); }
.stat-icon-error { background: var(--error-bg); color: var(--error); }

.stat-content { min-width: 0; }

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
}

.stat-card-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
}
.stat-card-action .stat-label { text-align: center; }

/* -- Admin Table ----------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
}

.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.5);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr {
    transition: background var(--transition);
}
.admin-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.td-slug code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    background: var(--bg-primary);
    color: var(--accent-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
}

.td-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* -- Admin badges ---------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.badge.running { background: var(--success-bg); color: var(--success); }
.badge.running::before { background: var(--success); animation: pulse-dot 2s ease-in-out infinite; }
.badge.stopped { background: var(--warning-bg); color: var(--warning); }
.badge.stopped::before { background: var(--warning); }
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.error::before { background: var(--error); }
.badge.provisioning, .badge.starting { background: var(--info-bg); color: var(--info); }
.badge.provisioning::before, .badge.starting::before {
    background: var(--info);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.plan-select {
    padding: 0.35rem 0.6rem;
    font-family: inherit;
    font-size: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}
.plan-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* -- Rolling update result ------------------------------------------------- */

.result-list {
    margin: 0.5rem 0 0 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.result-list li { margin-bottom: 0.25rem; }
.result-list li.error { color: var(--error); }

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

#toast-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 3px solid;
}

.toast-success {
    background: rgba(10, 31, 14, 0.95);
    color: var(--success);
    border-left-color: var(--success);
}

.toast-error {
    background: rgba(31, 10, 10, 0.95);
    color: var(--error);
    border-left-color: var(--error);
}

.toast-info {
    background: rgba(10, 15, 31, 0.95);
    color: var(--info);
    border-left-color: var(--info);
}

.toast-exit {
    animation: toast-out 0.25s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.95); }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

@media (max-width: 768px) {
    .landing-title { font-size: 2.25rem; }
    .landing-subtitle { font-size: 1rem; }

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

    .top-nav {
        padding: 0 1rem;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .nav-left { gap: 1rem; flex-wrap: wrap; }
    .nav-wordmark { display: none; }
    .user-email { display: none; }

    .page-container { padding: 1.5rem 1rem 3rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }

    .status-hero-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .td-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-secondary {
        flex-direction: column;
        width: 100%;
        max-width: 340px;
    }
    .btn-oauth {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .instance-controls { flex-direction: column; }
    .instance-controls .btn-control { width: 100%; }
    .landing-title { font-size: 1.85rem; }
}
