:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ecf4ff;
  background: #070c15;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: #101827;
  --line: #263247;
  --muted: #91a0b7;
  --cyan: #69dcff;
  --green: #77e2ad;
  --red: #ff7a82;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 78% 0%, rgba(21, 99, 129, .2), transparent 42%),
    radial-gradient(ellipse at 12% 35%, rgba(49, 76, 141, .13), transparent 40%),
    #070c15;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 28px 48px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(163, 188, 222, .13); }
.brand { font-weight: 850; letter-spacing: .1em; font-size: 14px; }
.brand span { margin-left: 10px; color: var(--cyan); font-size: 10px; letter-spacing: .16em; }
.back-link, .muted { color: var(--muted); }
.back-link { font-size: 13px; }
.login-view { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 28px 0; }
.login-card, .panel, .metric-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17, 27, 43, .97), rgba(11, 18, 30, .97)); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.login-card { width: min(430px, 100%); padding: 36px; border-radius: 18px; }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
.login-card > .muted { margin: 12px 0 26px; line-height: 1.6; font-size: 14px; }
label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #34455f; border-radius: 9px; color: #fff; background: #080e19; outline: none; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(105, 220, 255, .12); }
button { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 750; transition: filter .15s ease, transform .15s ease; }
button:hover:not(:disabled) { filter: brightness(1.13); transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: wait; }
.primary { width: 100%; margin-top: 14px; color: #041016; background: var(--cyan); }
.secondary { border-color: #34445b; color: #d6e4f7; background: #172236; }
.danger { color: #fff1f1; background: #a53645; border-color: #db5966; }
.status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.status.error { color: #ff9ca1; }
.status.success { color: var(--green); }
.dashboard { padding-top: 34px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.dashboard-heading h1 { margin-bottom: 5px; }
.dashboard-heading .muted { margin: 0; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; }
.metric-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.metric-card { min-height: 118px; padding: 17px; border-radius: 13px; }
.metric-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.metric-card strong { display: block; margin: 12px 0 5px; font-size: clamp(21px, 3vw, 30px); letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 11px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { min-width: 0; padding: 18px; border-radius: 13px; }
.panel h2 { margin: 0 0 15px; font-size: 14px; }
.chart-panel canvas { display: block; width: 100%; height: 170px; }
.details-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 14px; margin-top: 14px; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.access-note { margin: -5px 0 10px; font-size: 11px; line-height: 1.5; }
.access-grid table, .blocked-panel table { font-size: 10px; }
.access-grid td, .blocked-panel td { padding: 9px 7px; }
.ip-address { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ip-select { min-height: 24px; padding: 0; border: 0; color: var(--cyan); background: transparent; font: inherit; text-align: left; }
.ip-select:hover:not(:disabled) { text-decoration: underline; transform: none; }
.ip-location { display: block; max-width: 190px; margin-top: 3px; color: var(--muted); font-size: 9px; white-space: normal; }
.ip-activity { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(145, 160, 183, .18); }
.ip-activity h3 { margin: 0; font-size: 12px; }
.small-danger, .small-secondary { min-height: 30px; padding: 0 9px; font-size: 10px; }
.small-danger { color: #fff1f1; background: #8c303d; border-color: #ba4b59; }
.small-secondary { border-color: #34445b; color: #d6e4f7; background: #172236; }
.blocked-panel { margin-top: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; }
.live-pill { padding: 5px 8px; border: 1px solid rgba(119, 226, 173, .27); border-radius: 99px; color: var(--green); background: rgba(119, 226, 173, .08); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
th { padding: 9px 10px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
td { padding: 12px 10px; border-top: 1px solid rgba(145, 160, 183, .13); white-space: nowrap; }
.activity-list { display: grid; gap: 8px; }
.activity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid rgba(145, 160, 183, .13); border-radius: 9px; background: rgba(5, 10, 18, .28); }
.activity-name { font-size: 12px; font-weight: 750; }
.activity-detail { color: var(--muted); font-size: 11px; text-align: right; }
.password-settings { margin-top: 14px; }
.password-settings summary { cursor: pointer; font-size: 14px; font-weight: 750; }
.password-settings > .muted { margin: 12px 0 18px; font-size: 12px; line-height: 1.5; }
.password-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.password-submit { width: auto; margin-top: 16px; color: #041016; background: var(--cyan); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .metric-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .details-grid { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { padding: 0 14px 32px; }
  .topbar { min-height: 64px; }
  .brand { font-size: 12px; }
  .brand span { margin-left: 5px; font-size: 8px; }
  .back-link { font-size: 11px; }
  .login-card { padding: 25px 21px; }
  .chart-grid { grid-template-columns: 1fr; }
  .password-fields { grid-template-columns: 1fr; gap: 12px; }
  .chart-panel canvas { height: 145px; }
  .toolbar { width: 100%; }
  .toolbar button { flex: 1 1 auto; }
  .metric-card { min-height: 105px; padding: 13px; }
}

@media (max-width: 380px) {
  .shell { padding-right: 10px; padding-left: 10px; }
  .brand { letter-spacing: .06em; }
  .brand span { margin-left: 3px; letter-spacing: .1em; }
  .login-card { padding: 22px 17px; }
  .panel { padding: 14px; }
  .toolbar button { flex-basis: 100%; }
}
