/* R-40: BD-control-panel design language, tokens read from Ron's screenshots of brightdata.com/cp
   (2026-08-21): near-black icon rail with stacked icon+label items, white content, slate titles
   (#303B45), brand blue #3d7ffc, hairline borders (#d2dce4), blue-underline tabs, a floating
   account card top-right. Font is the CP's neutral sans (Inter-like system stack), NOT Gibson. */
:root {
    --brand: #3d7ffc;
    --titles: #303b45;
    --text: #526373;
    --border: #d2dce4;
    --bg: #ffffff;
    --rail: #111315;
    --rail-ink: #b9c2cc;
    --green: #0be597;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 14.5px; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------------------ left rail */
.shell { display: flex; min-height: 100vh; }
.rail {
    width: 88px; flex: 0 0 88px; background: var(--rail); display: flex; flex-direction: column;
    align-items: stretch; padding: 10px 8px; gap: 4px; min-height: 100vh;
}
.rail-item {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    color: var(--rail-ink); text-decoration: none; font-size: 11px;
    padding: 11px 4px; border-radius: 9px; cursor: pointer;
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item.active { background: #24262b; color: #fff; }
.rail-item.active svg { color: var(--brand); }
.rail-item.disabled { opacity: 0.38; cursor: default; }
.rail-item.info { padding: 6px 4px 14px; }
.rail-logo {
    width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.rail-spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------------------------- content */
.content { flex: 1 1 auto; min-width: 0; padding: 22px 34px 48px; position: relative; }
.page-head { display: flex; align-items: center; justify-content: space-between; }
.page-head h1 { color: var(--titles); font-size: 22px; font-weight: 600; }
.head-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
    border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 34px;
    height: 34px; cursor: pointer; color: var(--text); font-size: 15px;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; font-weight: 600; text-transform: uppercase;
}

/* Floating account/root card, top-right — mirrors the CP's hovering panel. */
.acct-card {
    position: absolute; top: 64px; right: 34px; z-index: 30; width: 300px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(48, 59, 69, 0.14); padding: 12px 14px;
}
.acct-top { display: flex; align-items: center; justify-content: space-between; }
.acct-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text); }
.root-flag { display: inline-flex; align-items: center; gap: 7px; font-weight: 600;
    color: var(--titles); font-size: 13.5px; }
.toggle {
    width: 34px; height: 18px; border-radius: 999px; background: #c8d4e2; position: relative;
    display: inline-block;
}
.toggle.on { background: var(--brand); }
.toggle::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
    border-radius: 50%; background: #fff; transition: left 0.15s ease;
}
.toggle.on::after { left: 18px; }
.acct-select {
    width: 100%; margin-top: 9px; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 8px; font: inherit; color: var(--titles); background: #fff;
}
.acct-name { margin-top: 9px; font-weight: 600; color: var(--titles); }
.acct-access { margin-top: 7px; font-size: 12.5px; }
.acct-access b.full { color: var(--green); }
.acct-access b.ro { color: var(--brand); }

/* ---------------------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 26px; margin: 26px 0 0; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 2px 12px; color: var(--text); text-decoration: none; cursor: pointer;
    border-bottom: 3px solid transparent; font-weight: 500;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab.disabled { opacity: 0.4; cursor: default; }
.tabpane { padding-top: 24px; }

/* --------------------------------------------------------------------------- dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px;
    margin-bottom: 22px; max-width: 900px; }
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.tile b { display: block; font-size: 24px; color: var(--titles); font-weight: 600; }
.tile span { font-size: 12.5px; }

.tablewrap { border: 1px solid var(--border); border-radius: 10px; overflow-x: auto;
    max-width: 1100px; }
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th {
    text-align: left; font-weight: 600; color: var(--text); font-size: 12.5px;
    padding: 11px 14px; border-bottom: 1px solid var(--border); background: #f7f9fc;
}
.grid td { padding: 11px 14px; border-bottom: 1px solid #e8eef5; color: var(--titles); }
.grid tr:last-child td { border-bottom: 0; }
.status-pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
    background: #eef3fb; color: var(--text); text-transform: capitalize;
}
.status-pill.active, .status-pill.running { background: #e7f8f1; color: #0a9f6d; }
.status-pill.failed { background: #fdecef; color: #d64560; }
.empty { text-align: center; padding: 56px 20px; }
.empty h3 { color: var(--titles); font-weight: 600; margin-bottom: 8px; }

/* --------------------------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; background: #f5f8ff; }
.login-card {
    width: 400px; max-width: 92vw; background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 30px 28px; box-shadow: 0 12px 32px rgba(48, 59, 69, 0.1);
}
.login-brand { font-size: 19px; color: var(--titles); margin-bottom: 18px; }
.login-brand b { font-weight: 700; }
.login-brand span { color: var(--brand); font-weight: 600; }
.login-card h2 { color: var(--titles); font-size: 20px; margin-bottom: 6px; }
.login-sub { font-size: 13.5px; margin-bottom: 18px; }
.login-row { display: flex; gap: 10px; margin-bottom: 12px; }
.login-row input {
    flex: 1 1 auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font: inherit;
}
.btn {
    border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; font: inherit;
    font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #2f6ef0; }
.login-note { min-height: 18px; font-size: 13px; color: var(--text); }
.login-note.err { color: #d64560; }
