:root{
    --dark:#050816;
    --dark2:#070b18;
    --panel:#0d1328;
    --card:#11182f;
    --card2:#151d38;
    --line:rgba(255,255,255,.08);
    --text:#ffffff;
    --muted:#9ca3af;
    --primary:#0059FF;
    --secondary:#b720eb;
    --success:#22c55e;
    --danger:#ef4444;
}

*{box-sizing:border-box}

body{
    margin:0;
    font-family:Inter,Arial,sans-serif;
    background:var(--dark2);
    color:var(--text);
}

a{text-decoration:none;color:inherit}

.login-body{
    min-height:100vh;
    display:grid;
    place-items:center;
    background:
        radial-gradient(circle at top left,rgba(183,32,235,.25),transparent 34%),
        radial-gradient(circle at bottom right,rgba(0,89,255,.25),transparent 34%),
        var(--dark);
}

.login-card{
    width:100%;
    max-width:430px;
    background:rgba(17,24,47,.92);
    border:1px solid var(--line);
    border-radius:28px;
    padding:34px;
    box-shadow:0 30px 90px rgba(0,0,0,.45);
}

.login-brand{
    display:flex;
    gap:16px;
    align-items:center;
    margin-bottom:26px;
}

.brand-icon,.brand-mark{
    width:46px;
    height:46px;
    border-radius:16px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,var(--primary),var(--secondary));
    color:white;
    font-weight:900;
}

.login-brand h1{margin:0;font-size:24px}
.login-brand p{margin:4px 0 0;color:var(--muted)}

label{
    display:block;
    margin:16px 0 8px;
    color:#d1d5db;
    font-size:14px;
}

input,select,textarea{
    width:100%;
    border:1px solid var(--line);
    background:#080d1f;
    color:white;
    border-radius:15px;
    padding:0 14px;
    outline:none;
    height:50px;
}

textarea{
    height:140px;
    padding-top:14px;
    resize:vertical;
}

button,.btn-primary,.btn-secondary,.btn-light,.btn-logout{
    border:0;
    border-radius:15px;
    padding:13px 18px;
    font-weight:800;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

button,.btn-primary{
    background:linear-gradient(135deg,var(--primary),var(--secondary));
    color:white;
}

.btn-secondary{
    background:rgba(255,255,255,.07);
    border:1px solid var(--line);
    color:white;
}

.btn-light,.btn-logout{
    background:white;
    color:#111827;
}

.login-card button{width:100%;margin-top:22px}

.alert-error{
    background:rgba(239,68,68,.12);
    border:1px solid rgba(239,68,68,.35);
    color:#fecaca;
    padding:12px;
    border-radius:14px;
    margin-bottom:18px;
}

.app{display:flex;min-height:100vh}

.sidebar{
    width:286px;
    position:fixed;
    inset:0 auto 0 0;
    padding:24px 18px;
    background:#050816;
    border-right:1px solid var(--line);
    overflow-y:auto;
    z-index:20;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:26px;
    padding:4px 4px 18px;
    border-bottom:1px solid var(--line);
}

.sidebar-brand strong{display:block;font-size:18px}
.sidebar-brand span{color:var(--muted);font-size:13px}

.sidebar-nav{
    display:grid;
    gap:6px;
}

.nav-label{
    margin:18px 12px 6px;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:#6b7280;
    font-weight:900;
}

.sidebar-nav a{
    padding:12px 13px;
    border-radius:14px;
    color:#d1d5db;
    transition:.2s;
}

.sidebar-nav a:hover{
    color:white;
    background:rgba(255,255,255,.08);
    transform:translateX(3px);
}

.main{
    margin-left:286px;
    width:calc(100% - 286px);
    min-height:100vh;
    padding:24px;
    background:
        radial-gradient(circle at top right,rgba(0,89,255,.16),transparent 30%),
        radial-gradient(circle at bottom left,rgba(183,32,235,.12),transparent 28%),
        var(--dark2);
}

.topbar{
    min-height:76px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:22px;
}

.menu-toggle{
    display:none;
    width:44px;
    height:44px;
    padding:0;
}

.topbar-title h2{margin:0;font-size:27px}
.topbar-title p{margin:5px 0 0;color:var(--muted)}

.topbar-actions{
    display:flex;
    align-items:center;
    gap:12px;
}

.topbar-search{
    min-width:270px;
    height:44px;
    padding:0 16px;
    display:flex;
    align-items:center;
    border:1px solid var(--line);
    border-radius:999px;
    background:rgba(255,255,255,.06);
    color:#cbd5e1;
}

.user-pill{
    background:rgba(255,255,255,.07);
    border:1px solid var(--line);
    border-radius:999px;
    padding:11px 15px;
    color:#e5e7eb;
}

.studio-hero{
    display:grid;
    grid-template-columns:1.35fr .8fr;
    gap:22px;
    border:1px solid var(--line);
    border-radius:34px;
    padding:34px;
    background:
        linear-gradient(135deg,rgba(0,89,255,.22),rgba(183,32,235,.16)),
        rgba(17,24,47,.92);
    margin-bottom:22px;
}

.eyebrow{
    color:#93c5fd;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-size:12px;
    font-weight:900;
}

.hero-copy h1{
    margin:12px 0;
    font-size:44px;
    line-height:1.05;
}

.hero-copy p{
    color:#d1d5db;
    font-size:17px;
    max-width:670px;
    margin:0;
}

.hero-buttons{
    display:flex;
    gap:12px;
    margin-top:24px;
    flex-wrap:wrap;
}

.assistant-mini{
    background:rgba(5,8,22,.62);
    border:1px solid var(--line);
    border-radius:26px;
    padding:20px;
}

.assistant-mini-head{
    display:flex;
    justify-content:space-between;
    margin-bottom:16px;
}

.assistant-mini-head span{
    color:#86efac;
    font-size:13px;
}

.assistant-bubble{
    background:rgba(255,255,255,.08);
    border:1px solid var(--line);
    border-radius:20px;
    padding:16px;
    color:#e5e7eb;
    margin-bottom:14px;
}

.assistant-mini-form{
    display:flex;
    gap:10px;
}

.assistant-mini-form input{height:46px}

.quick-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:22px;
}

.quick-card,.stat-card,.panel-card{
    background:rgba(17,24,47,.92);
    border:1px solid var(--line);
    border-radius:24px;
}

.quick-card{
    padding:22px;
    transition:.2s;
}

.quick-card:hover{
    transform:translateY(-4px);
    background:rgba(21,29,56,.96);
}

.quick-card span{
    font-size:30px;
    display:block;
    margin-bottom:14px;
}

.quick-card strong{
    display:block;
    font-size:18px;
}

.quick-card p{
    margin:7px 0 0;
    color:var(--muted);
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:22px;
}

.stat-card{padding:22px}
.stat-card span{color:var(--muted)}
.stat-card strong{display:block;font-size:36px;margin-top:10px}

.panel-card{padding:24px}

.section-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:18px;
}

.section-head h3{margin:0;font-size:22px}
.section-head p{margin:5px 0 0;color:var(--muted)}

.activity-list{
    display:grid;
    gap:10px;
}

.activity-item{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    padding:16px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.04);
}

.activity-item strong{display:block}
.activity-item span{display:block;color:var(--muted);margin-top:4px}
.activity-item em{
    font-style:normal;
    color:#93c5fd;
    background:rgba(0,89,255,.15);
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.empty-state{
    color:var(--muted);
    padding:18px;
    border:1px dashed var(--line);
    border-radius:18px;
}

.assistant-layout{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:22px;
}

.chat-panel{
    min-height:calc(100vh - 130px);
    background:rgba(17,24,47,.92);
    border:1px solid var(--line);
    border-radius:28px;
    padding:24px;
    position:relative;
}

.chat-welcome{
    text-align:center;
    max-width:660px;
    margin:40px auto 26px;
}

.chat-welcome span{font-size:48px}
.chat-welcome h1{font-size:38px;margin:14px 0 8px}
.chat-welcome p{color:var(--muted);margin:0}

.message{
    max-width:820px;
    padding:18px;
    border-radius:20px;
    margin:14px auto;
    border:1px solid var(--line);
}

.message strong{
    display:block;
    margin-bottom:8px;
}

.message p{
    margin:0;
    color:#e5e7eb;
    line-height:1.6;
}

.user-message{
    background:rgba(0,89,255,.15);
}

.ai-message{
    background:rgba(255,255,255,.06);
}

.chat-input{
    max-width:880px;
    margin:24px auto 0;
    display:flex;
    gap:12px;
}

.chat-input input{
    height:56px;
    font-size:15px;
}

.assistant-side{
    background:rgba(17,24,47,.92);
    border:1px solid var(--line);
    border-radius:28px;
    padding:22px;
    height:max-content;
}

.assistant-side h3{margin-top:0}

.assistant-side a{
    display:block;
    padding:14px;
    border:1px solid var(--line);
    border-radius:16px;
    margin-bottom:10px;
    color:#e5e7eb;
    background:rgba(255,255,255,.04);
}

.table-wrap{overflow-x:auto}

table{
    width:100%;
    border-collapse:collapse;
}

th,td{
    padding:15px 12px;
    border-bottom:1px solid var(--line);
    text-align:left;
}

th{
    color:#9ca3af;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.badge{
    display:inline-flex;
    padding:7px 10px;
    border-radius:999px;
    background:rgba(0,89,255,.16);
    color:#93c5fd;
    font-size:12px;
    font-weight:800;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:18px;
}

.form-grid .full{grid-column:1/-1}

@media(max-width:1100px){
    .studio-hero,.assistant-layout{
        grid-template-columns:1fr;
    }

    .quick-grid,.stats-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .topbar-search{
        display:none;
    }
}

@media(max-width:780px){
    .sidebar{
        transform:translateX(-100%);
        transition:.25s;
    }

    .sidebar.open{
        transform:translateX(0);
    }

    .main{
        margin-left:0;
        width:100%;
        padding:16px;
    }

    .menu-toggle{
        display:inline-flex;
    }

    .topbar{
        align-items:flex-start;
    }

    .topbar-actions{
        flex-wrap:wrap;
        justify-content:flex-end;
    }

    .hero-copy h1{
        font-size:34px;
    }

    .quick-grid,.stats-grid,.form-grid{
        grid-template-columns:1fr;
    }

    .assistant-mini-form,.chat-input{
        flex-direction:column;
    }
}