@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

/* =====================================================================
   RUX API & PORTAL - ULTRA-PROFESSIONAL TECH INDIGO DESIGN SYSTEM
   ===================================================================== */

:root {
    /* Rich Midnight Obsidian Backgrounds */
    --bg: #07090e;
    --bg-elevated: #0b0f19;
    --surface: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #273549;
    --surface-glass: rgba(15, 23, 42, 0.85);

    /* Borders & Accents */
    --border: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.22);
    --border-focus: rgba(99, 102, 241, 0.55);

    /* Text Colors */
    --text: #f8fafc;
    --silver: #cbd5e1;
    --muted: #94a3b8;
    --subtle: #64748b;

    /* Signature Electric Indigo & Cyber Cyan Accent */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-hover: #4338ca;
    --primary-glow: rgba(99, 102, 241, 0.35);

    --accent-cyan: #06b6d4;
    --accent-cyan-light: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.3);

    --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --brand-gradient-hover: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);
    --surface-gradient: linear-gradient(180deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.85) 100%);

    /* Functional Status */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #f43f5e;
    --danger-glow: rgba(244, 63, 94, 0.2);
    --warn: #f59e0b;
    --info: #38bdf8;

    /* Layout & Geometry */
    --max: 1120px;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 90% 50% at 50% -20%, rgba(79, 70, 229, 0.18), transparent 70%),
        radial-gradient(ellipse 70% 40% at 85% 15%, rgba(6, 182, 212, 0.09), transparent 60%),
        radial-gradient(ellipse 60% 40% at 10% 80%, rgba(99, 102, 241, 0.06), transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-cyan-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #fff;
}

/* =====================================================================
   TOPBAR & NAVIGATION
   ===================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.02em;
    color: #ffffff;
    background: var(--brand-gradient);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-text span {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.topnav a {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.topnav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
}

.topnav a.active {
    color: #818cf8;
    background: rgba(79, 70, 229, 0.12);
    border-color: rgba(99, 102, 241, 0.28);
}

.nav-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
    font-weight: 600;
}

.nav-admin:hover {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.nav-admin.active {
    color: #fff !important;
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.nav-crown {
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.user-greeting {
    font-size: 13px;
    color: var(--muted);
    margin-right: 4px;
}

.user-greeting b {
    color: var(--silver);
}

/* =====================================================================
   TYPOGRAPHY & CODE HELPERS
   ===================================================================== */
.mono,
.code-tag,
.code-window,
.code-window code,
.code-window-body {
    font-family: "IBM Plex Mono", Consolas, monospace;
}

.code-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.text-glow {
    background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: text-shine 6s linear infinite;
}

@keyframes text-shine {
    to { background-position: 200% center; }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-right {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float-glow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, -20px) scale(1.08); }
}

@keyframes grid-drift {
    from { background-position: 0 0; }
    to { background-position: 48px 48px; }
}

@keyframes border-shimmer {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.9; }
}

@keyframes scan-line {
    0% { transform: translateY(-100%); opacity: 0; }
    20% { opacity: 0.55; }
    100% { transform: translateY(320%); opacity: 0; }
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

@keyframes line-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes icon-glow {
    0%, 100% { box-shadow: 0 8px 30px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 10px 40px rgba(6, 182, 212, 0.45); }
}

.anim-in {
    opacity: 0;
    animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d, 0ms);
}

.anim-form {
    opacity: 0;
    animation: fade-right 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.anim-field {
    opacity: 0;
    animation: fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(0.35s + var(--d, 0ms));
}

.c-dim { color: #64748b; }
.c-accent { color: #cbd5e1; }
.c-method { color: #38bdf8; font-weight: 600; }
.c-path { color: #a5b4fc; }
.c-key { color: #94a3b8; }
.c-str { color: #34d399; }
.c-num { color: #fbbf24; }

/* =====================================================================
   AUTH LAYOUT (LOGIN & REGISTER)
   ===================================================================== */
.page-auth {
    overflow-x: hidden;
    background-color: #07090e;
}

.page-auth .portal-main { display: none; }

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
}

.auth-showcase {
    position: relative;
    padding: 48px 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border);
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.12), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.08), transparent 45%),
                #07090e;
    overflow: hidden;
}

.auth-showcase-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: float-glow 14s ease-in-out infinite;
}

.glow-1 {
    width: 460px;
    height: 460px;
    top: -120px;
    left: -80px;
    background: rgba(79, 70, 229, 0.22);
    animation-duration: 14s;
}

.glow-2 {
    width: 360px;
    height: 360px;
    bottom: -60px;
    right: -40px;
    background: rgba(6, 182, 212, 0.16);
    animation-duration: 18s;
    animation-delay: -4s;
}

.glow-3 {
    width: 260px;
    height: 260px;
    top: 40%;
    right: 20%;
    background: rgba(139, 92, 246, 0.16);
    animation-duration: 12s;
    animation-delay: -2s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, black 30%, transparent 100%);
    animation: grid-drift 24s linear infinite;
}

.auth-showcase-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
}

.showcase-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
    text-decoration: none;
    color: #fff;
    letter-spacing: -0.02em;
}

.logo-ring {
    position: relative;
    display: grid;
    place-items: center;
}

.logo-ring::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    animation: pulse-ring 3.6s ease-in-out infinite;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.logo-text small {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.brand-icon-lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
    animation: icon-glow 3.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { opacity: 0.4; transform: scale(1); border-color: rgba(99, 102, 241, 0.3); }
    50% { opacity: 1; transform: scale(1.05); border-color: rgba(6, 182, 212, 0.5); }
}

.orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.08);
    pointer-events: none;
}

.orbit-1 {
    width: 520px;
    height: 520px;
    top: -160px;
    left: -180px;
}

.orbit-2 {
    width: 340px;
    height: 340px;
    bottom: -80px;
    right: -40px;
    border-color: rgba(99, 102, 241, 0.12);
}

.stat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.stat-chips span {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(6px);
    font-size: 12px;
    color: var(--silver);
    letter-spacing: 0.01em;
}

.stat-chips b {
    color: var(--accent-cyan-light);
    font-weight: 700;
}

.code-live {
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #34d399;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.showcase-tag {
    margin: 0 0 16px;
    padding: 6px 12px;
    border-radius: 8px;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
    background: rgba(56, 189, 248, 0.08);
}

.auth-showcase h1 {
    margin: 0 0 16px;
    font-family: 'Plus Jakarta Sans', Syne, Inter, sans-serif;
    font-size: clamp(32px, 4.2vw, 46px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.showcase-desc {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 440px;
}

/* =====================================================================
   CODE WINDOW COMPONENT
   ===================================================================== */
.code-window {
    position: relative;
    margin-bottom: 24px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #090d16;
    overflow: hidden;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.code-window:hover {
    transform: translateY(-3px);
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(79, 70, 229, 0.25);
    border-color: rgba(99, 102, 241, 0.35);
}

.code-window-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.06), transparent);
    animation: scan-line 4s ease-in-out infinite;
}

.code-window-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.7);
}

.code-window-bar .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dot-red { background: #f43f5e; box-shadow: 0 0 6px rgba(244, 63, 94, 0.4); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.dot-green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }

.code-window-bar code {
    margin-left: auto;
    font-size: 11px;
    color: #64748b;
}

.code-window-body {
    margin: 0;
    padding: 18px;
    font-size: 12px;
    line-height: 1.75;
    color: #94a3b8;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-line {
    display: block;
    opacity: 0;
    animation: line-in 0.45s ease forwards;
    animation-delay: calc(0.6s + var(--l, 0) * 80ms);
}

.code-cursor {
    color: var(--accent-cyan-light);
    animation: code-blink 1.1s step-end infinite;
}

@keyframes code-blink {
    50% { opacity: 0; }
}

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

.code-meta li,
.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    opacity: 0;
    animation: fade-up 0.5s ease forwards;
    animation-delay: calc(0.7s + var(--l, 0) * 100ms);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease infinite;
}

/* =====================================================================
   AUTH FORM SIDE
   ===================================================================== */
.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background:
        radial-gradient(circle at 80% 20%, rgba(79, 70, 229, 0.08), transparent 45%),
        #07090e;
}

.auth-form-wrap {
    position: relative;
    width: min(100%, 420px);
    padding: 32px 30px 24px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.9) 100%);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.auth-card-glow {
    position: absolute;
    top: -80px;
    right: -40px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25), transparent 65%);
    pointer-events: none;
}

.auth-form-wrap-wide {
    width: min(100%, 460px);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
}

.auth-tab {
    text-align: center;
    padding: 10px 12px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.auth-tab.is-active {
    color: #ffffff;
    background: var(--brand-gradient);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.auth-form-head {
    margin-bottom: 22px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 16px;
}

.auth-mobile-brand .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

.auth-form-head h2 {
    margin: 0 0 6px;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}

.auth-form-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

/* =====================================================================
   FORM FIELDS & FLOATING LABELS
   ===================================================================== */
.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.field {
    position: relative;
    margin-bottom: 14px;
}

.field input,
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input {
    padding: 22px 48px 10px 44px;
    border-radius: 12px;
}

.page-auth .form-row .field input {
    padding-left: 14px;
    padding-right: 14px;
}

.field input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover {
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.85);
}

.field input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.field label {
    position: absolute;
    left: 44px;
    top: 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    pointer-events: none;
    transform-origin: left center;
    transition: transform 0.18s ease, color 0.18s, font-size 0.18s, top 0.18s;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    top: 8px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-cyan-light);
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    display: grid;
    place-items: center;
    pointer-events: none;
    transition: color 0.2s ease;
}

.field input:focus ~ .field-icon,
.field:focus-within .field-icon {
    color: var(--primary-light);
}

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

.form-row .field input { padding-left: 14px; }
.form-row .field label { left: 14px; }

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}

.toggle-pass:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.auth-kbd {
    margin: 14px 0 0;
    text-align: center;
    font-size: 11px;
    color: #64748b;
}

.auth-kbd kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: rgba(30, 41, 59, 0.6);
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 10px;
    color: var(--silver);
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
}

.auth-status strong {
    color: var(--silver);
    font-weight: 600;
}

/* =====================================================================
   BUTTONS SYSTEM
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    width: 100%;
    color: #ffffff;
    background: var(--brand-gradient);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.panel .btn-primary {
    width: auto;
    margin-top: 8px;
}

.btn-ghost {
    color: var(--silver);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    color: #fff;
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(99, 102, 241, 0.35);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-danger {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.28);
}

.btn-danger:hover {
    color: #fff;
    background: rgba(244, 63, 94, 0.24);
    border-color: rgba(244, 63, 94, 0.45);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.25);
}

.btn-glow {
    position: relative;
    overflow: hidden;
    padding: 14px 20px;
    font-size: 14px;
}

.btn-glow::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-glow:hover::after {
    left: 140%;
}

.btn-arrow {
    transition: transform 0.2s;
}

.btn-glow:hover .btn-arrow {
    transform: translateX(4px);
}

.register-perks {
    list-style: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.5);
}

.register-perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--silver);
    padding: 6px 0;
}

.register-perks li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    flex-shrink: 0;
}

.register-perks li + li {
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

/* =====================================================================
   DASHBOARD (CLIENT PANEL)
   ===================================================================== */
.page-dashboard {
    background-color: var(--bg);
    min-height: 100vh;
}

.client-panel {
    max-width: 760px;
    padding-top: 36px;
    padding-bottom: 56px;
}

.client-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.client-head h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

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

.client-stat {
    padding: 20px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-gradient);
    box-shadow:
        0 10px 25px -10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.client-stat span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.client-stat strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #fff;
}

.text-used { color: #fb7185 !important; }
.text-left { color: #34d399 !important; text-shadow: 0 0 14px rgba(52, 211, 153, 0.3); }

.client-usage {
    margin-bottom: 20px;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-gradient);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.client-usage-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--silver);
}

.usage-bar-lg {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.usage-bar-lg span {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.client-usage-foot {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.client-usage-foot strong {
    color: var(--silver);
    font-weight: 600;
}

.client-box {
    padding: 26px 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface-gradient);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.client-box h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.client-field {
    margin-bottom: 20px;
}

.client-field:last-of-type {
    margin-bottom: 24px;
}

.client-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--silver);
}

.client-value-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.client-value-row code {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(7, 9, 14, 0.7);
    font-family: 'IBM Plex Mono', Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #a5b4fc;
    word-break: break-all;
}

.client-value-row .btn {
    flex-shrink: 0;
    align-self: center;
}

.client-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.client-actions .btn-primary {
    width: auto;
}

/* =====================================================================
   PORTAL MAIN, PANELS & DOCS
   ===================================================================== */
.portal-main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-cyan-light);
}

.page-head h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.lead {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 580px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-gradient);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.code-sample {
    margin: 0;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: #090d16;
    overflow-x: auto;
}

.code-sample code {
    font-family: 'IBM Plex Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #38bdf8;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.doc-card {
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.5);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.doc-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.doc-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-cyan-light);
}

.doc-card p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}

.note {
    margin: 14px 0 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* =====================================================================
   PLAYGROUND (LIVE TESTER)
   ===================================================================== */
.playground-box {
    margin-top: 24px;
    border-color: rgba(99, 102, 241, 0.25);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.playground-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.field-compact {
    flex: 1;
    margin-bottom: 0 !important;
}

.playground-input-row .btn-primary {
    width: auto;
    white-space: nowrap;
    padding: 14px 24px;
}

.playground-result {
    margin-top: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: #090d16;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border);
}

.result-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.status-pill-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill-error {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.latency-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.cache-pill {
    font-size: 11px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.code-sample-result {
    margin: 0;
    padding: 16px;
    max-height: 280px;
    overflow-y: auto;
    font-family: 'IBM Plex Mono', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #34d399;
    background: #090d16;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

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

/* =====================================================================
   ADMIN DASHBOARD & ADVANCED COMPONENTS
   ===================================================================== */
.admin-panel {
    max-width: 1540px;
    width: 96%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 28px;
    padding-bottom: 60px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.admin-head h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.admin-head-actions {
    display: flex;
    gap: 10px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-sub {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.text-primary {
    color: #e2e8f0;
}

/* Toolbar & Filters */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-filter-tabs {
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.admin-filter-tabs a {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.admin-filter-tabs a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.admin-filter-tabs a.active {
    color: #ffffff;
    background: var(--brand-gradient);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.search-input-wrap {
    position: relative;
    width: 290px;
}

.search-input-wrap input {
    width: 100%;
    padding: 9px 32px 9px 14px;
    font-size: 13px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}

/* Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px 14px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    background: rgba(15, 23, 42, 0.65);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) rgba(15, 23, 42, 0.4);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.data-table th {
    padding: 10px 12px;
    background: rgba(22, 30, 49, 0.85);
    border-bottom: 1px solid var(--border);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.lead-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lead-email {
    font-size: 12px;
    color: var(--muted);
}

.badge-sub {
    display: inline-block;
    width: fit-content;
    margin-top: 3px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(79, 70, 229, 0.12);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.token-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-cell code {
    font-family: 'IBM Plex Mono', Consolas, monospace;
    font-size: 11px;
    color: #a5b4fc;
    background: rgba(7, 9, 14, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-copy-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: transform 0.15s;
}

.btn-copy-icon:hover {
    transform: scale(1.18);
}

.date-tag {
    font-size: 12px;
    color: var(--silver);
}

.date-expired {
    color: #fb7185;
    font-weight: 600;
}

.progress-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-bar {
    width: 54px;
    height: 4px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    overflow: hidden;
}

.mini-bar span {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 999px;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 11.5px;
    border-radius: 7px;
    height: 30px;
    line-height: 1;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}
.badge-active::before { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }

.badge-paused, .badge-expired, .badge-empty {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.25);
}
.badge-paused::before, .badge-expired::before, .badge-empty::before {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(244, 63, 94, 0.6);
}

/* Modals */
.portal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 9, 14, 0.8);
    backdrop-filter: blur(10px);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: #0f172a;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(99, 102, 241, 0.15);
    padding: 26px;
    animation: modal-fade-in 0.22s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}

.modal-header h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
}

.modal-header p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.btn-close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

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

.modal-footer .btn-primary { width: auto; }

/* ========================================================= */
/* MODAL FORM & INPUT FIELDS FIX                             */
/* ========================================================= */
.modal-form .field {
    position: relative;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.modal-form .field label {
    position: static !important;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: auto;
    transform: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    line-height: 1.4;
}

.modal-form .field-tip {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
}

.modal-form .field input,
.modal-form .field select {
    width: 100%;
    height: 44px;
    padding: 10px 14px !important;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.modal-form .field input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
}

.modal-form .field input:hover,
.modal-form .field select:hover {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.95);
}

.modal-form .field input:focus,
.modal-form .field select:focus {
    outline: none;
    border-color: #6366f1;
    background: #0b1120;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.modal-form .field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px !important;
}

.modal-form .field select option {
    background: #0f172a;
    color: #f8fafc;
    padding: 8px;
}

.quick-helpers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.usage-calculator-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px dashed rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.calc-text .text-used {
    color: #f43f5e;
    font-weight: 700;
    font-size: 14px;
}

.quick-add-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.label-add {
    font-size: 12px;
    color: #64748b;
    margin-right: 4px;
}

.btn-add-req {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-add-req:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
    color: #ffffff;
}

.form-card-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.form-card-section h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--silver);
}

.btn-helper {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border);
    color: var(--silver);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-helper:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Alerts & Toast */
.alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: opacity 0.3s;
}

.alert-success {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-error {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--brand-gradient);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(79, 70, 229, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
}

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

/* =====================================================================
   INTERACTIVE SPOTLIGHT & MICRO-ANIMATIONS
   ===================================================================== */
.client-stat,
.client-box,
.doc-card,
.panel,
.auth-form-wrap,
.usage-stat {
    position: relative;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.28s ease,
                box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-stat::before,
.client-box::before,
.doc-card::before,
.panel::before,
.auth-form-wrap::before,
.usage-stat::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        480px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
        rgba(99, 102, 241, 0.16),
        transparent 65%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.client-stat:hover::before,
.client-box:hover::before,
.doc-card:hover::before,
.panel:hover::before,
.auth-form-wrap:hover::before,
.usage-stat:hover::before {
    opacity: 1;
}

.client-stat:hover,
.panel:hover,
.doc-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.55), 0 0 16px rgba(79, 70, 229, 0.15);
}

/* Staggered Entrance Animations */
.client-head {
    animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.client-stats .client-stat:nth-child(1) {
    animation: fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.client-stats .client-stat:nth-child(2) {
    animation: fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}
.client-stats .client-stat:nth-child(3) {
    animation: fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.19s both;
}

.client-usage {
    animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.client-box:first-of-type {
    animation: fade-up 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.32s both;
}

.playground-box {
    animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both;
}

.admin-stats-grid .usage-stat:nth-child(1) { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both; }
.admin-stats-grid .usage-stat:nth-child(2) { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both; }
.admin-stats-grid .usage-stat:nth-child(3) { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both; }
.admin-stats-grid .usage-stat:nth-child(4) { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both; }

/* Radar pulse no badge ativo */
@keyframes radar-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-active::before {
    animation: radar-pulse 2s infinite ease-in-out !important;
}

/* Playground Border Beam */
.playground-box::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.8), rgba(99, 102, 241, 0.9), transparent);
    animation: border-beam 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes border-beam {
    0%, 100% { opacity: 0.3; transform: translateX(-40%); }
    50% { opacity: 1; transform: translateX(40%); }
}

/* Botão de cópia animado */
.btn-copied {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.brand-icon {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.brand:hover .brand-icon {
    transform: rotate(6deg) scale(1.08);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.55);
}

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

@media (max-width: 768px) {
    .client-stats { grid-template-columns: 1fr; }
    .client-value-row { flex-direction: column; }
    .client-value-row .btn { width: 100%; }
    .client-actions .btn, .client-actions form { width: 100%; }

    .auth-layout {
        grid-template-columns: 1fr;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-showcase { display: none; }

    .auth-form-side {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
        background: #07090e;
    }

    .auth-form-wrap {
        width: 100%;
        max-width: 420px;
        padding: 24px 20px 20px;
    }

    .auth-mobile-brand { display: flex; }
    .grid-2, .docs-grid, .form-row { grid-template-columns: 1fr; }
    .topnav { display: none; }
    .topbar-inner { padding: 14px 16px; }
    .portal-main { padding: 20px 16px 40px; }
}

@media (max-width: 600px) {
    .admin-stats-grid { grid-template-columns: 1fr; }
    .admin-toolbar { flex-direction: column; align-items: stretch; }
    .search-input-wrap { width: 100%; }
    .playground-input-row { flex-direction: column; align-items: stretch; }
    .playground-input-row .btn-primary { width: 100%; }
}

/* ==========================================
   CPFs AUDIT SECTION STYLES
   ========================================== */
.btn-copy-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 4px;
    opacity: 0.65;
    transition: opacity 0.18s, transform 0.18s;
}

.btn-copy-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

.stat-mini-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-mini-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.btn-view-cpf {
    white-space: nowrap;
    padding: 6px 12px;
}

/* =====================================================================
   ADMIN MASTER PANEL REDESIGN (MODERNO, ORGANIZADO & PREMIUM)
   ===================================================================== */
.admin-badge-crown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}
.admin-badge-crown .crown-icon { font-size: 14px; }
.admin-badge-crown .crown-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fbbf24;
    text-transform: uppercase;
}

/* Switcher Principal Segmentado */
.admin-main-switcher {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    margin: 24px 0 26px;
    position: relative;
    max-width: 680px;
}

.admin-switch-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.admin-switch-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

.admin-switch-btn.is-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(129, 140, 248, 0.25));
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.admin-switch-btn .switch-count {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    transition: all 0.2s;
}

.admin-switch-btn.is-active .switch-count {
    background: #6366f1;
    border-color: #818cf8;
    color: #ffffff;
}

.switch-dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: radar-pulse 1.8s infinite;
}

/* Avatar de Leads com Iniciais */
.lead-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: normal;
    max-width: 250px;
}

.lead-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
    flex-shrink: 0;
}

.lead-avatar.avatar-vip {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.lead-avatar.avatar-green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.lead-cell strong {
    font-size: 12.5px;
    color: #f8fafc;
    line-height: 1.2;
}

.lead-email {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
    display: inline-block;
}

/* Transição de Painéis */
.admin-pane {
    animation: fade-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.admin-pane[hidden] {
    display: none !important;
}

/* ========================================================= */
/* PAGINAÇÃO MODERNA & ELEGANTE                              */
/* ========================================================= */
.table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border);
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0 0 14px 14px;
    flex-wrap: wrap;
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.pagination-info {
    font-size: 12px;
    color: var(--muted);
}

.pagination-info strong {
    color: #f1f5f9;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.18s ease;
}

.page-btn:hover:not(.is-disabled) {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.45);
}

.page-btn.is-active {
    color: #ffffff;
    background: var(--brand-gradient);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.page-btn.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.page-arrow {
    padding: 0 12px;
}

.page-ellipsis {
    color: #64748b;
    padding: 0 4px;
    font-size: 12px;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
}

.per-page-pills {
    display: flex;
    gap: 3px;
    background: rgba(11, 15, 25, 0.7);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.pill-btn {
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.pill-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.pill-btn.active {
    color: #fff;
    background: #4f46e5;
    box-shadow: 0 1px 6px rgba(79, 70, 229, 0.4);
}

/* ========================================================= */
/* MODAL FIX ABSOLUTO: NENHUM LABEL FLUTUANDO OU SOBREPONDO  */
/* ========================================================= */
.portal-modal .field,
.modal-dialog .field,
.modal-form .field {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-bottom: 14px !important;
}

.portal-modal .field label,
.modal-dialog .field label,
.modal-form .field label {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 0 6px 0 !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    pointer-events: auto !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    line-height: 1.4 !important;
}

.portal-modal .field input,
.portal-modal .field select,
.modal-dialog .field input,
.modal-dialog .field select,
.modal-form .field input,
.modal-form .field select {
    position: static !important;
    width: 100% !important;
    height: 42px !important;
    padding: 9px 12px !important;
    border-radius: 9px !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    background: rgba(15, 23, 42, 0.85) !important;
    color: #f8fafc !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
}
