/* ======================================================================
   Zenonext UGC Studio — Digital Creator Ready SaaS Dashboard
   Font: Inter Tight exclusively
   ====================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-sidebar: #ffffff;
    
    --border-hairline: rgba(226, 232, 240, 0.8);
    --border-subtle: #e2e8f0;
    --border-focus: #4f46e5;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --brand-indigo: #4f46e5;
    --brand-indigo-light: #eef2ff;
    --brand-purple: #7c3aed;
    --brand-green: #10b981;
    --brand-green-light: #ecfdf5;
    --brand-amber: #f59e0b;
    --brand-rose: #f43f5e;

    --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.03), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --sidebar-width: 260px;
    --header-height: 64px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans) !important;
}

/* Allow code blocks and monospace elements to use JetBrains Mono */
code, pre, .font-mono, input.font-mono {
    font-family: var(--font-mono) !important;
}

html, body {
    height: 100%;
    font-family: var(--font-sans) !important;
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
}

[x-cloak] { display: none !important; }

/* Background Canvas & Grid Overlay */
.bg-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-size: 32px 32px;
    background-image: 
        radial-gradient(circle, rgba(148, 163, 184, 0.15) 1px, transparent 1px);
    opacity: 0.7;
}

#antigravityCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ======================================================================
   DASHBOARD LAYOUT (SIDEBAR + TOPBAR + MAIN CONTENT)
   ====================================================================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* LEFT SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 20px 14px;
    transition: all 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 20px;
    border-bottom: 1px solid var(--border-hairline);
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-indigo), var(--brand-purple));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar-brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.sidebar-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--brand-indigo);
    background: var(--brand-indigo-light);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 20px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0 10px 6px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--brand-indigo-light);
    color: var(--brand-indigo);
    font-weight: 700;
}

.sidebar-link i {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.sidebar-link.active i {
    opacity: 1;
    color: var(--brand-indigo);
}

/* Sidebar User Footer */
.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--border-hairline);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-indigo);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-email {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MAIN CONTENT WRAPPER */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* TOPBAR */
.topbar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.page-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

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

/* CONTENT CONTAINER */
.content-container {
    padding: 32px;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* ======================================================================
   HOW IT WORKS ONBOARDING BANNER
   ====================================================================== */

.how-it-works-banner {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}

.workflow-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.workflow-step-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.workflow-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--brand-indigo);
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.workflow-step-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.workflow-step-desc {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

/* ======================================================================
   CLEAN UI CARDS & METRICS
   ====================================================================== */

.clean-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.clean-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-hairline);
}

.clean-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.clean-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* KPI METRIC CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--brand-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ACTION BUTTONS */
.btn-primary {
    background: var(--brand-indigo);
    color: #ffffff;
    border: 1px solid transparent;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-danger-subtle {
    background: transparent;
    color: var(--brand-rose);
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-danger-subtle:hover {
    background: #ffe4e6;
    border-color: #fecdd3;
}

/* BADGES & PILLS */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-rose { background: #ffe4e6; color: #be123c; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-slate { background: #f1f5f9; color: #475569; }

/* DATA TABLES */
.clean-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.clean-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}

.clean-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.clean-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    vertical-align: middle;
}

.clean-table tr:hover td {
    background: #fafafa;
}

/* MODALS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    width: 100%;
    max-width: 540px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
}

/* FORM ELEMENTS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    font-size: 0.86rem;
    color: var(--text-primary);
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-wrapper {
        margin-left: 0;
    }
}
