:root {
    color-scheme: dark;
    --ink: #06111d;
    --line: rgba(153, 205, 224, 0.17);
    --muted: rgba(225, 242, 249, 0.66);
    --cyan: #36c7dc;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f4fbfe; background: var(--ink); }
a { color: #65d9ed; text-decoration: none; }
.account-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr); }
.brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(34px, 6vw, 78px); overflow: hidden; background: radial-gradient(circle at 10% 10%, rgba(0, 188, 212, 0.24), transparent 32%), linear-gradient(145deg, #071827, #0b3141); }
.brand-panel::after { position: absolute; right: -18%; bottom: -24%; width: 560px; height: 560px; border: 1px solid rgba(89, 214, 237, 0.16); border-radius: 50%; box-shadow: 0 0 0 68px rgba(89, 214, 237, 0.035), 0 0 0 136px rgba(89, 214, 237, 0.025); content: ''; }
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: #fff; font-size: 1.04rem; font-weight: 700; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(108, 224, 244, 0.5); border-radius: 12px; color: #9aecf8; background: rgba(10, 46, 61, 0.7); font-size: 0.72rem; letter-spacing: 0.08em; }
.brand-copy { position: relative; z-index: 1; max-width: 600px; margin: auto 0; }
.eyebrow { color: #62d8eb; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.17em; }
.brand-copy h1 { max-width: 590px; margin: 18px 0; font-size: clamp(2.5rem, 5vw, 5.2rem); line-height: 1.02; letter-spacing: -0.045em; }
.brand-copy p { max-width: 540px; color: var(--muted); font-size: 1.03rem; line-height: 1.85; }
.trust-list { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 36px 0 0; padding: 0; color: rgba(224, 244, 250, 0.66); list-style: none; font-size: 0.84rem; }
.trust-list li::before { margin-right: 8px; color: #51d0e3; content: '•'; }
.auth-panel { display: grid; min-height: 100vh; padding: 38px; place-items: center; background: #06111d; }
.auth-card { width: min(100%, 460px); }
.status-pill { display: inline-flex; padding: 7px 11px; border: 1px solid rgba(246, 190, 79, 0.3); border-radius: 999px; color: #f4c975; background: rgba(246, 190, 79, 0.07); font-size: 0.74rem; font-weight: 700; }
.status-pill.ready { color: #6be6c1; border-color: rgba(107, 230, 193, 0.3); background: rgba(107, 230, 193, 0.07); }
.auth-card h2 { margin: 26px 0 8px; font-size: 2rem; }
.subtitle { margin: 0 0 30px; color: var(--muted); line-height: 1.7; }
form { display: flex; flex-direction: column; }
label { margin: 17px 0 8px; color: rgba(238, 249, 252, 0.82); font-size: 0.86rem; font-weight: 600; }
input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: #fff; background: rgba(14, 38, 54, 0.8); font: inherit; transition: 0.2s ease; }
input:focus { border-color: rgba(61, 201, 223, 0.7); box-shadow: 0 0 0 4px rgba(54, 199, 220, 0.09); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 15px 0 22px; font-size: 0.84rem; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--cyan); }
.consent { margin: 18px 0 22px; line-height: 1.5; }
button { height: 52px; border: 0; border-radius: 11px; color: #03141b; background: linear-gradient(135deg, #69e0ef, #20aec5); font: inherit; font-weight: 800; cursor: pointer; }
.button-link { display: grid; min-height: 48px; margin-bottom: 12px; padding: 0 18px; place-items: center; border-radius: 11px; color: #03141b; background: linear-gradient(135deg, #69e0ef, #20aec5); font-weight: 800; }
button:disabled { cursor: wait; opacity: 0.65; }
.form-message { min-height: 24px; margin: 12px 0 0; color: #f2c87a; font-size: 0.84rem; line-height: 1.5; }
.auth-footer { display: flex; justify-content: center; gap: 8px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.legal { margin-top: 22px; color: rgba(225, 242, 249, 0.45); font-size: 0.75rem; line-height: 1.6; text-align: center; }
.account-details { display: grid; gap: 12px; margin: 24px 0; }
.account-details div { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.secondary-button { color: #f4fbfe; border: 1px solid var(--line); background: transparent; }
.device-code { margin: 24px 0; padding: 18px; border-radius: 14px; background: rgba(14, 38, 54, 0.8); text-align: center; font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: 0.12em; }
.desktop-auth-flow .status-pill { color: #6be6c1; border-color: rgba(107, 230, 193, 0.3); background: rgba(107, 230, 193, 0.07); }
.desktop-return-note { margin-top: 18px; color: var(--muted); font-size: 0.84rem; line-height: 1.65; }

.admin-page { min-width: 320px; background: #06111d; }
.admin-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(6, 17, 29, 0.94); backdrop-filter: blur(18px); }
.admin-header nav { display: flex; align-items: center; gap: 16px; }
.admin-main { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; }
.admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.admin-hero h1 { margin: 10px 0; font-size: clamp(2rem, 5vw, 4.4rem); letter-spacing: -0.04em; }
.admin-hero p, .section-heading p { color: var(--muted); }
.admin-search { width: min(360px, 100%); margin: 0; }
.admin-search span { display: block; margin-bottom: 8px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.summary-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(14, 38, 54, 0.58); }
.summary-grid span { display: block; color: var(--muted); font-size: 0.82rem; }
.summary-grid strong { display: block; margin-top: 8px; font-size: 2rem; }
.admin-section { margin-top: 22px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: rgba(9, 29, 43, 0.72); }
.section-heading h2 { margin: 0 0 6px; }
.section-heading p { margin: 0 0 22px; line-height: 1.6; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.05em; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { max-width: 290px; margin-top: 5px; color: var(--muted); font-size: 0.74rem; overflow-wrap: anywhere; }
.admin-select { min-width: 118px; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: #f4fbfe; background: #0d2939; }
.role-options { min-width: 118px; }
.role-options .checkbox { display: flex; margin-bottom: 8px; }
.state-badge { display: inline-flex; margin: 0 6px 7px 0; padding: 5px 8px; border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, 0.06); font-size: 0.72rem; }
.state-badge.online { color: #6be6c1; background: rgba(107, 230, 193, 0.09); }
.compact-button { width: auto; height: 38px; padding: 0 14px; border-radius: 8px; }
.device-cell { max-width: 360px; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.events-table { min-width: 880px; }

@media (max-width: 860px) {
    .account-shell { grid-template-columns: 1fr; }
    .brand-panel { min-height: auto; padding: 32px 24px 48px; }
    .brand-copy { margin: 76px 0 28px; }
    .brand-copy h1 { font-size: clamp(2.4rem, 12vw, 4.2rem); }
    .auth-panel { min-height: auto; padding: 58px 24px 80px; }
    .admin-header { align-items: flex-start; }
    .admin-header nav { align-items: flex-end; flex-direction: column; }
    .admin-hero { align-items: stretch; flex-direction: column; }
    .summary-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .admin-main { width: min(100% - 24px, 1480px); padding-top: 34px; }
    .admin-section { padding: 18px 14px; }
}
