@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #fafaff;
    --text: #25263a;
    --muted: #9293a2;
    --border: #ececf2;
    --accent: #7256df;
    --accent-soft: #f0edff;
    --green: #1b9b70;
    --green-soft: #e9f8f1;
    --red: #d95367;
    --red-soft: #fff0f1;
    --blue: #4f83d9;
    --orange: #dc9650;
    --chart-grid: #ececf2;
    --shadow: 0 8px 28px rgba(35, 31, 75, .045);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #14151d;
    --surface: #1d1f2b;
    --surface-soft: #232535;
    --text: #f0eff8;
    --muted: #a2a2b4;
    --border: #303244;
    --accent: #9a83ff;
    --accent-soft: #30294b;
    --green: #57c99a;
    --green-soft: #203b34;
    --red: #ff8290;
    --red-soft: #432a32;
    --blue: #82aaff;
    --orange: #efb477;
    --chart-grid: #343648;
    --shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, Arial, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { width: 252px; position: fixed; inset: 0 auto 0 0; z-index: 10; background: var(--surface); border-right: 1px solid var(--border); padding: 27px 18px 18px; display: flex; flex-direction: column; transition: width .2s ease; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; margin-bottom: 48px; font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.brand-name span { color: var(--accent); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 24px; margin: 0 auto 18px; }
.brand-mark.small { width: 35px; height: 35px; border-radius: 11px; margin: 0; font-size: 19px; }
.nav-caption { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; padding: 0 13px; margin-bottom: 12px; }
.nav-menu { display: grid; gap: 6px; }
.nav-menu a, .nav-collapse { display: flex; align-items: center; gap: 13px; padding: 12px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.nav-menu a:hover, .nav-collapse:hover { background: var(--surface-soft); color: var(--text); }
.nav-menu a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; flex: 0 0 20px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-version { color: var(--muted); font-size: 10px; letter-spacing: .8px; padding: 20px 13px 4px; }
.main-content { margin-left: 252px; padding: 32px 38px 48px; max-width: 1800px; transition: margin .2s ease; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.eyebrow { font-size: 10px; letter-spacing: 1.3px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.8px; }
h2 { font-size: 15px; margin: 0; letter-spacing: -.2px; }
p { margin: 6px 0 0; }
.muted, .panel-heading p, .stat-foot { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 18px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.avatar { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 20px; }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.stat-card { position: relative; padding: 20px; min-height: 137px; overflow: hidden; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 29px; font-weight: 700; letter-spacing: -1px; margin: 13px 0 5px; }
.stat-foot { font-size: 11px; }
.stat-icon { position: absolute; right: 18px; top: 18px; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; font-size: 17px; }
.stat-icon.purple { color: var(--accent); background: var(--accent-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.stat-icon.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; margin-bottom: 20px; }
.panel { padding: 22px; margin-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-heading p { font-size: 11px; }
.panel-badge, .endpoint-tag { background: var(--surface-soft); border: 1px solid var(--border); color: var(--muted); border-radius: 7px; padding: 6px 9px; font-size: 10px; }
.chart-wrap { height: 250px; position: relative; }
.country-list { display: grid; gap: 17px; }
.country-row { display: flex; align-items: center; gap: 11px; }
.country-pin { width: 31px; height: 31px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 9px; }
.country-name { flex: 1; font-weight: 600; font-size: 12px; }
.country-name small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; }
.country-row strong { font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { color: var(--muted); text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .3px; padding: 0 13px 13px; }
td { border-top: 1px solid var(--border); padding: 13px; font-size: 11px; }
tbody tr:hover { background: var(--surface-soft); }
code { color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 4px 6px; font-size: 10px; }
.geo-cell { color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty-table, .empty-state { text-align: center; color: var(--muted); padding: 28px; line-height: 1.8; }
.empty-state small { font-size: 11px; }
.settings-panel { max-width: 900px; }
.setting-row { display: flex; align-items: center; gap: 22px; padding: 17px 0; border-top: 1px solid var(--border); }
.setting-copy { flex: 1; }
.setting-copy p { color: var(--muted); font-size: 12px; }
.small-note { font-size: 11px; margin-top: 18px; }
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #c9c9d2; border-radius: 30px; cursor: pointer; transition: .2s; }
.slider:before { content: ""; position: absolute; width: 19px; height: 19px; left: 4px; top: 4px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(21px); }
.btn { border: 0; border-radius: 9px; padding: 10px 15px; cursor: pointer; font-weight: 600; font-size: 11px; }
.btn-primary { background: var(--accent); color: white; }
.btn-light { background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 7px 9px; font-size: 10px; }
.btn-block { width: 100%; padding: 13px; margin-top: 8px; }
.add-user-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 22px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
input:not([type=checkbox]):not([type=hidden]) { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; background: var(--surface-soft); color: var(--text); outline: none; }
input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.status-pill { display: inline-block; border-radius: 20px; padding: 5px 9px; font-size: 10px; font-weight: 600; }
.status-ok { color: var(--green); background: var(--green-soft); }
.status-off, .status-fail { color: var(--red); background: var(--red-soft); }
.actions-cell { display: flex; gap: 9px; align-items: center; }
.inline-form { display: inline; }
.password-details { position: relative; }
.password-details summary { cursor: pointer; color: var(--accent); font-size: 10px; }
.password-form { display: flex; gap: 6px; position: absolute; right: 0; top: 23px; z-index: 4; width: 260px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.password-form input { min-width: 0; }
.alert { border-radius: 10px; padding: 12px 15px; margin-bottom: 18px; font-size: 12px; }
.alert-error { color: var(--red); background: var(--red-soft); }
.alert-success { color: var(--green); background: var(--green-soft); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 10%, var(--accent-soft), var(--bg) 55%); }
.login-card { width: min(100%, 410px); padding: 38px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-card h1 { text-align: center; font-size: 23px; }
.login-card > p { text-align: center; margin-bottom: 27px; font-size: 12px; }
.login-card form { display: grid; gap: 16px; }
.login-card label { color: var(--text); }
.sidebar-collapsed .sidebar { width: 76px; padding-inline: 12px; }
.sidebar-collapsed .main-content { margin-left: 76px; }
.sidebar-collapsed .brand { padding: 0 8px; }
.sidebar-collapsed .brand-name, .sidebar-collapsed .nav-caption, .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-version { display: none; }
.sidebar-collapsed .nav-menu a, .sidebar-collapsed .nav-collapse { justify-content: center; padding-inline: 8px; }
@media (max-width: 1100px) {
    .main-content { padding: 27px 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .sidebar { width: 68px; padding: 18px 9px; }
    .brand { margin-bottom: 32px; padding: 0 7px; }
    .brand-name, .nav-caption, .nav-label, .sidebar-version { display: none; }
    .nav-menu a, .nav-collapse { justify-content: center; padding: 12px 7px; }
    .main-content, .sidebar-collapsed .main-content { margin-left: 68px; padding: 20px 13px; }
    .topbar { align-items: flex-start; gap: 12px; }
    h1 { font-size: 20px; }
    .topbar-actions { gap: 6px; }
    .user-chip { font-size: 0; }
    .stats-grid { gap: 9px; }
    .stat-card { padding: 14px; min-height: 120px; }
    .stat-value { font-size: 23px; }
    .stat-icon { width: 28px; height: 28px; right: 12px; top: 12px; }
    .panel { padding: 15px; }
    .add-user-form { grid-template-columns: 1fr; }
    .setting-row { flex-wrap: wrap; }
    .setting-copy { flex-basis: 100%; }
    .chart-wrap { height: 210px; }
}
