/* Opus customer dashboard. Dark theme, indigo accent #7a6ff0. No build step. */

:root {
    --bg: #0d0f1a;
    --bg-elev: #151827;
    --bg-card: #1a1e30;
    --border: #2a2f45;
    --text: #e8eaf2;
    --text-dim: #9aa0b8;
    --accent: #7a6ff0;
    --accent-dim: #5a52c8;
    --free: #3ecf8e;
    --premium: #f5b942;
    --danger: #e5484d;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #4a3fb5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 14px;
}

main { max-width: 1200px; margin: 0 auto; padding: 24px; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

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

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.primary:hover { background: var(--accent-dim); }

.btn.small { padding: 6px 12px; font-size: 12px; }

.btn:disabled { opacity: 0.5; cursor: default; }

.hero {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 24px;
}

.hero h1 { margin: 0 0 10px; font-size: 28px; }
.hero p { color: var(--text-dim); margin: 0 0 20px; }

.notice {
    background: #2a2113;
    border: 1px solid #6b5518;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.notice code {
    background: #00000055;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.notice ul { margin: 8px 0 0; padding-left: 20px; }

.controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

select#server-picker {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 280px;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.free { background: #14362a; color: var(--free); border: 1px solid #1f5c40; }
.badge.premium { background: #3a2c10; color: var(--premium); border: 1px solid #6b5518; }
.badge.warn { background: #3a1a1a; color: var(--danger); border: 1px solid #6b2828; }

.billing-bar {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
}

.billing-bar .stat strong { display: block; font-size: 20px; }
.billing-bar .stat span { color: var(--text-dim); font-size: 12px; }
.billing-bar .hint { color: var(--text-dim); font-size: 12px; flex-basis: 100%; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-head h3 { margin: 0; font-size: 16px; }

.card .category {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.card .desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0; }

.nuggets {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    min-height: 62px;
}

.nuggets .row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.nuggets .row .k { color: var(--text-dim); }
.nuggets .row .v { font-weight: 600; text-align: right; }
.nuggets .empty { color: var(--text-dim); font-style: italic; }

.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #3a3f55; border-radius: 999px; transition: 0.2s;
}
.slider:before {
    position: absolute; content: "";
    height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.45; cursor: default; }

.card .msg { font-size: 12px; color: var(--premium); min-height: 16px; }
.card .msg.err { color: var(--danger); }

footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    padding: 24px;
}

.hidden { display: none !important; }
