:root {
    --admin-navy: #091e3a;
    --admin-blue: #1768b2;
    --admin-blue-dark: #10528f;
    --admin-gold: #e9a83a;
    --admin-bg: #f3f6fa;
    --admin-card: #ffffff;
    --admin-line: #dfe6ef;
    --admin-muted: #6a788b;
    --admin-green: #16884a;
    --admin-red: #b42318;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--admin-bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--admin-navy);
    background: var(--admin-bg);
    font-family: "DM Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body *:not(input):not(textarea):not([contenteditable="true"]) {
    caret-color: transparent;
    user-select: none;
}
input, textarea, [contenteditable="true"] { caret-color: auto; user-select: text; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.admin-login-page {
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background:
        radial-gradient(circle at 18% 14%, rgba(23,104,178,.13), transparent 32rem),
        radial-gradient(circle at 82% 86%, rgba(233,168,58,.14), transparent 28rem),
        #eef3f8;
}

.auth-box { width: min(450px, 100%); }
.admin-login-card {
    position: relative;
    overflow: hidden;
    padding: 38px;
    border: 1px solid rgba(13, 46, 82, .08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(9, 30, 58, .12);
}

.auth-decoration { position: absolute; top: -58px; right: -50px; width: 190px; height: 190px; opacity: .16; pointer-events: none; }
.auth-decoration i { position: absolute; display: block; border-radius: 22px; transform: rotate(45deg); }
.auth-decoration i:nth-child(1) { inset: 24px; border: 2px solid var(--admin-blue); }
.auth-decoration i:nth-child(2) { width: 58px; height: 58px; right: 38px; bottom: 12px; background: var(--admin-blue); }
.auth-decoration i:nth-child(3) { width: 32px; height: 32px; left: 18px; bottom: 42px; background: var(--admin-gold); }
.auth-decoration i:nth-child(4) { width: 18px; height: 18px; left: 54px; top: 28px; background: #f36a78; }

.admin-language { display: flex; align-items: center; gap: 4px; }
.admin-login-card > .admin-language { position: absolute; z-index: 2; top: 18px; right: 18px; }
.admin-language a {
    display: grid;
    width: 31px;
    height: 28px;
    place-items: center;
    border-radius: 7px;
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.admin-language a:hover, .admin-language a.is-active { color: #fff; background: var(--admin-blue); }

.admin-auth-brand { position: relative; display: flex; align-items: center; gap: 12px; width: max-content; color: var(--admin-navy); text-decoration: none; }
.admin-auth-brand img { border-radius: 12px; box-shadow: 0 7px 16px rgba(23,104,178,.16); }
.admin-auth-brand span { display: grid; gap: 2px; }
.admin-auth-brand strong { font: 700 18px/1.1 Inter, sans-serif; }
.admin-auth-brand small { max-width: 240px; overflow: hidden; color: var(--admin-blue); font-size: 12px; text-overflow: ellipsis; }
.admin-auth-copy { position: relative; margin: 32px 0 26px; }
.admin-auth-copy h1 { margin: 0 0 10px; font: 700 clamp(25px, 6vw, 32px)/1.15 Inter, sans-serif; overflow-wrap: anywhere; }
.admin-auth-copy p { margin: 0; color: var(--admin-muted); font-size: 15px; line-height: 1.6; }

.admin-login-form { display: grid; gap: 9px; }
.admin-login-form label { margin-top: 7px; color: #35465a; font-size: 13px; font-weight: 700; }
.admin-login-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #ced8e5;
    border-radius: 9px;
    outline: none;
    color: var(--admin-navy);
    background: #fff;
}
.admin-login-form input:focus { border-color: var(--admin-blue); box-shadow: 0 0 0 4px rgba(23,104,178,.12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 50px; }
.password-toggle { position: absolute; top: 6px; right: 6px; display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: #718095; background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--admin-blue); background: #edf4fb; }
.password-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.admin-primary, .admin-secondary, .admin-logout {
    min-height: 43px;
    border: 0;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
}
.admin-primary { margin-top: 17px; color: #fff; background: var(--admin-blue); box-shadow: 0 8px 18px rgba(23,104,178,.2); }
.admin-primary:hover { background: var(--admin-blue-dark); }
.admin-primary:disabled { cursor: not-allowed; opacity: .55; }
.admin-back-link { display: block; margin-top: 26px; color: var(--admin-muted); font-size: 13px; font-weight: 600; text-align: center; text-decoration: none; }
.admin-back-link:hover { color: var(--admin-blue); }

.admin-alert { margin: 0 0 20px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 14px; line-height: 1.45; }
.admin-alert.is-error { border-color: #f3c7c3; color: #8f1e15; background: #fff2f1; }
.admin-alert.is-success { border-color: #b9e2c9; color: #126c3b; background: #eefbf3; }

.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 258px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 18px; color: #dbe8f6; background: linear-gradient(180deg, #0a2443, #071a32); }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 7px; color: #fff; text-decoration: none; }
.admin-brand img { border-radius: 10px; }
.admin-brand span { display: grid; gap: 2px; }
.admin-brand strong { font: 700 16px/1.1 Inter, sans-serif; }
.admin-brand small { color: #8fa8c2; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.admin-domain-pill { display: flex; min-width: 0; align-items: center; gap: 8px; margin: 26px 6px 18px; padding: 10px 11px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: #fff; background: rgba(255,255,255,.055); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.admin-domain-pill span { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4cd080; box-shadow: 0 0 0 4px rgba(76,208,128,.12); }
.admin-menu { display: grid; gap: 6px; }
.admin-menu > a, .admin-menu > span { display: grid; min-height: 45px; align-items: center; grid-template-columns: 28px minmax(0,1fr) auto; padding: 0 10px; border-radius: 9px; color: #b9c9db; font-size: 13px; font-weight: 600; text-decoration: none; }
.admin-menu > a > span, .admin-menu > span > span { display: grid; width: 22px; height: 22px; place-items: center; font-size: 15px; }
.admin-menu > a.is-active { color: #fff; background: rgba(67,145,219,.22); }
.admin-menu > span.is-disabled { opacity: .58; }
.admin-menu small { padding: 3px 5px; border-radius: 5px; color: #9fb1c5; background: rgba(255,255,255,.06); font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
.admin-sidebar-home { margin: auto 7px 0; color: #8fa8c2; font-size: 12px; font-weight: 600; text-decoration: none; }
.admin-sidebar-home:hover { color: #fff; }

.admin-workspace { min-width: 0; }
.admin-topbar { display: flex; min-height: 74px; align-items: center; justify-content: flex-end; gap: 22px; padding: 12px clamp(20px,4vw,48px); border-bottom: 1px solid var(--admin-line); background: rgba(255,255,255,.9); }
.admin-topbar > div:first-child { display: grid; gap: 1px; text-align: right; }
.admin-topbar small { color: var(--admin-muted); font-size: 10px; text-transform: uppercase; }
.admin-topbar strong { font-size: 13px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-topbar form { margin: 0; }
.admin-logout { min-height: 35px; padding: 0 13px; border: 1px solid #cad5e1; color: #3e4c5e; background: #fff; font-size: 12px; }
.admin-logout:hover { border-color: var(--admin-blue); color: var(--admin-blue); }

.admin-content { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 43px 0 70px; }
.admin-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.admin-eyebrow { display: block; margin-bottom: 8px; color: var(--admin-blue); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.admin-page-heading h1 { margin: 0 0 9px; font: 700 clamp(27px,4vw,38px)/1.15 Inter, sans-serif; }
.admin-page-heading p { max-width: 700px; margin: 0; color: var(--admin-muted); line-height: 1.55; }

.setup-progress { display: grid; grid-template-columns: repeat(4,1fr); margin: 0 0 24px; padding: 20px 18px; border: 1px solid var(--admin-line); border-radius: 13px; background: #fff; list-style: none; box-shadow: 0 2px 9px rgba(9,30,58,.035); }
.setup-progress li { position: relative; display: grid; justify-items: center; gap: 7px; color: #8997a9; text-align: center; }
.setup-progress li:not(:first-child)::before { position: absolute; z-index: 0; top: 14px; right: 50%; width: 100%; height: 2px; background: #dce4ed; content: ""; }
.setup-progress li.is-done:not(:first-child)::before { background: #48b879; }
.setup-progress li > span { position: relative; z-index: 1; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #65758a; background: #dce4ed; font-size: 12px; font-weight: 700; }
.setup-progress li.is-done > span { color: #fff; background: var(--admin-green); }
.setup-progress small { font-size: 11px; font-weight: 700; }
.setup-progress li.is-done small { color: var(--admin-green); }

.setup-complete { display: flex; align-items: center; gap: 15px; margin: 0 0 22px; padding: 18px 20px; border: 1px solid #b6dfc5; border-radius: 12px; color: #12683a; background: linear-gradient(135deg,#ecfbf2,#f7fffa); }
.setup-complete > span { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 50%; color: #fff; background: var(--admin-green); font-weight: 700; }
.setup-complete h2 { margin: 0 0 3px; font: 700 17px/1.2 Inter,sans-serif; }
.setup-complete p { margin: 0; font-size: 13px; }

.setup-list { display: grid; gap: 16px; }
.setup-card { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 14px; padding: 21px; border: 1px solid var(--admin-line); border-radius: 13px; background: var(--admin-card); box-shadow: 0 2px 9px rgba(9,30,58,.035); }
.setup-card.is-current { border-color: rgba(23,104,178,.4); box-shadow: 0 7px 24px rgba(23,104,178,.08); }
.setup-card.is-locked { background: #f7f9fb; opacity: .76; }
.setup-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--admin-navy); font-size: 13px; font-weight: 700; }
.setup-card.is-done .setup-number { background: var(--admin-green); }
.setup-card-body { min-width: 0; }
.setup-card-body > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.setup-card h2 { margin: 1px 0 7px; font: 700 17px/1.3 Inter,sans-serif; }
.setup-card h3 { margin: 0 0 12px; font: 700 14px/1.3 Inter,sans-serif; }
.setup-card header p { max-width: 760px; margin: 0 0 15px; color: var(--admin-muted); font-size: 14px; line-height: 1.5; }
.status-badge { flex: none; padding: 6px 9px; border-radius: 999px; color: #805b00; background: #fff2cc; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge.is-done { color: #12683a; background: #e2f7ea; }
.domain-name-large { display: block; margin-top: 4px; color: var(--admin-blue); font-size: 20px; overflow-wrap: anywhere; }

.dns-values { display: grid; gap: 8px; margin: 4px 0 17px; }
.dns-values > div { display: grid; align-items: center; grid-template-columns: minmax(135px,.25fr) minmax(0,1fr); gap: 12px; padding: 10px 12px; border-radius: 8px; background: #f4f7fb; }
.dns-values dt { color: var(--admin-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.dns-values dd { display: flex; min-width: 0; align-items: center; gap: 8px; margin: 0; }
code { min-width: 0; overflow-wrap: anywhere; color: #123b68; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; user-select: text!important; }
.copy-button { display: grid; width: 31px; height: 31px; flex: none; padding: 0; place-items: center; border: 1px solid #ced8e5; border-radius: 7px; color: var(--admin-blue); background: #fff; cursor: pointer; }
.copy-button:hover, .copy-button.is-copied { border-color: var(--admin-green); color: var(--admin-green); background: #eefbf3; }
.admin-secondary { min-height: 39px; padding: 0 15px; border: 1px solid #aac3dc; color: var(--admin-blue); background: #f7fbff; font-size: 12px; }
.admin-secondary:hover { border-color: var(--admin-blue); color: #fff; background: var(--admin-blue); }

.dns-table-wrap { max-width: 100%; overflow-x: auto; margin: 2px 0 13px; }
.dns-table { width: 100%; min-width: 590px; border-collapse: collapse; }
.dns-table th { padding: 8px 10px; border-bottom: 1px solid var(--admin-line); color: var(--admin-muted); font-size: 10px; text-align: left; text-transform: uppercase; }
.dns-table td { padding: 11px 10px; border-bottom: 1px solid #edf1f5; font-size: 13px; }
.setup-warning { max-width: 800px; margin: 12px 0; padding: 10px 12px; border: 1px solid #e8c365; border-radius: 8px; color: #735000; background: #fff8df; font-size: 12px; line-height: 1.45; }
.dns-note { margin: 11px 0 0; color: var(--admin-muted); font-size: 11px; line-height: 1.45; }

.hostname-form { display: grid; gap: 7px; max-width: 820px; margin-top: 3px; }
.hostname-form > label { color: #405168; font-size: 12px; font-weight: 700; }
.hostname-form > div { display: flex; min-width: 0; align-items: center; gap: 0; }
.hostname-form > div > span { display: flex; height: 42px; align-items: center; padding: 0 10px; border: 1px solid #ced8e5; color: var(--admin-muted); background: #f5f7fa; font-size: 13px; white-space: nowrap; }
.hostname-form > div > span:first-child { border-right: 0; border-radius: 8px 0 0 8px; }
.hostname-form > div > span:nth-child(3) { min-width: 0; overflow: hidden; border-right: 0; border-left: 0; text-overflow: ellipsis; }
.hostname-form input { width: 92px; height: 42px; padding: 0 9px; border: 1px solid #ced8e5; outline: 0; color: var(--admin-navy); background: #fff; font-weight: 700; }
.hostname-form input:focus { border-color: var(--admin-blue); box-shadow: inset 0 0 0 1px var(--admin-blue); }
.hostname-form .admin-secondary { height: 42px; border-radius: 0 8px 8px 0; }
.hostname-form small { color: var(--admin-muted); font-size: 11px; }
.cname-block { margin-top: 21px; padding-top: 19px; border-top: 1px solid var(--admin-line); }

.admin-tools { margin-top: 22px; padding: 19px 21px; border: 1px dashed #b9c8d8; border-radius: 13px; color: #4e6075; background: rgba(255,255,255,.58); }
.admin-tools > div { display: flex; align-items: center; gap: 14px; }
.admin-tools > div > span { display: grid; width: 39px; height: 39px; flex: none; place-items: center; border-radius: 10px; color: var(--admin-blue); background: #e6f0fa; font-weight: 700; }
.admin-tools h2 { margin: 0 0 4px; font: 700 15px/1.2 Inter,sans-serif; }
.admin-tools p { margin: 0; color: var(--admin-muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 860px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; padding: 14px 18px; }
    .admin-brand { padding: 0; }
    .admin-domain-pill { position: absolute; left: -9999px; }
    .admin-menu { grid-template-columns: 1fr; margin-top: 13px; }
    .admin-menu > span.is-disabled { display: none; }
    .admin-sidebar-home { display: none; }
    .admin-topbar { min-height: 66px; justify-content: space-between; padding: 10px 18px; }
    .admin-topbar > div:first-child { text-align: left; }
    .admin-content { width: min(100% - 28px, 720px); padding-top: 30px; }
}

@media (max-width: 600px) {
    .admin-login-card { padding: 32px 24px; }
    .admin-auth-brand span { max-width: 210px; }
    .admin-topbar strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-topbar .admin-language { display: none; }
    .setup-progress { padding: 15px 8px; }
    .setup-progress small { font-size: 9px; }
    .setup-card { grid-template-columns: 1fr; padding: 17px; }
    .setup-number { display: none; }
    .setup-card-body > header { align-items: flex-start; flex-direction: column; gap: 2px; }
    .dns-values > div { grid-template-columns: 1fr; gap: 5px; }
    .hostname-form > div { flex-wrap: wrap; }
    .hostname-form > div > span:nth-child(3) { flex: 1; border-right: 1px solid #ced8e5; border-radius: 0 8px 8px 0; }
    .hostname-form .admin-secondary { width: 100%; margin-top: 8px; border-radius: 8px; }
}
