@font-face { font-family: "Onest"; src: url("/static/fonts/onest-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/static/fonts/onest-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/static/fonts/onest-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/static/fonts/onest-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/ibm-plex-mono-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --nav: #111827;
  --nav-soft: #1c2638;
  --nav-muted: #8e9ab0;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --line: #e2e6ee;
  --line-strong: #ced4df;
  --text: #182033;
  --muted: #687389;
  --accent: #3457d5;
  --accent-dark: #2845b4;
  --accent-soft: #eef1ff;
  --cyan: #1594a8;
  --green: #16845b;
  --green-soft: #e8f7f0;
  --amber: #a96d08;
  --amber-soft: #fff5df;
  --red: #bc3e4b;
  --red-soft: #fcecef;
  --violet: #7055c5;
  --focus-ring: rgb(52 87 213 / 32%);
  --disabled-surface: #eef0f4;
  --disabled-text: #8a93a3;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --space-section: 12px;
  --space-panel: 14px;
  --space-compact: 10px;
  --sidebar-width: 240px;
  font-family: "Onest", "Segoe UI", sans-serif;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--canvas); font-size: 15px; line-height: 1.42; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, p { margin-top: 0; }
h1, h2 { hyphens: none; letter-spacing: -0.035em; }
code { font-family: "IBM Plex Mono", "Cascadia Mono", monospace; font-variant-numeric: tabular-nums lining-nums; }

.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; height: 100vh; flex-direction: column; overflow-y: auto; padding: 16px 12px 12px; background: var(--nav); color: #f8fafc; }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { position: relative; display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border-radius: 10px; background: #eef1ff; }
.brand-mark span { position: absolute; width: 6px; border-radius: 4px; background: var(--accent); transform: rotate(38deg); }
.brand-mark span:nth-child(1) { height: 22px; left: 9px; top: 5px; }
.brand-mark span:nth-child(2) { height: 26px; left: 17px; top: 7px; background: #7990ee; }
.brand-mark span:nth-child(3) { height: 17px; right: 7px; bottom: 5px; background: var(--cyan); }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 17px; letter-spacing: -0.02em; }
.brand small { color: var(--nav-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 3px; margin-top: 24px; }
.nav-label { margin: 0 10px 8px; color: #68758d; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 17px; }
.nav-item { position: relative; display: grid; min-height: 44px; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 0 10px; border-radius: 9px; color: #aeb8c9; font-weight: 500; transition: color 150ms ease, background-color 150ms ease, transform 150ms ease; }
.nav-item:hover { color: #ffffff; background: #1a2537; transform: translateX(2px); }
.nav-item.active { color: #ffffff; background: #263657; }
.nav-item.active::before { position: absolute; left: 0; width: 3px; height: 26px; border-radius: 0 4px 4px 0; background: #8297f1; content: ""; }
.nav-item-child { min-height: 40px; margin-left: 14px; padding-left: 10px; font-size: 12px; }
.nav-item-child::before { position: absolute; left: -8px; top: -4px; width: 1px; height: 50px; background: #2d384b; content: ""; }
.nav-item-child svg { width: 17px; height: 17px; }
.nav-state { width: 8px; height: 8px; border-radius: 50%; }
.nav-state-ready { background: #44d09c; box-shadow: 0 0 0 4px rgb(68 208 156 / 9%); }
.nav-state-pending { background: #e2a13a; box-shadow: 0 0 0 4px rgb(226 161 58 / 10%); }
.nav-item b { min-width: 23px; padding: 2px 6px; border-radius: 999px; background: #273248; color: #c7cfdb; font-size: 11px; text-align: center; }
.nav-item > span:not(.nav-state) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active b { background: #405383; color: #ffffff; }
.nav-item-add { color: #91a4c5; }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; }
.system-state { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #263249; border-radius: 10px; background: #151f30; }
.system-state div, .admin-profile > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; }
.system-state strong, .admin-profile strong { font-size: 12px; font-weight: 600; }
.system-state small, .admin-profile small { color: var(--nav-muted); font-size: 10px; }
.status-light { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid #183e34; border-radius: 50%; background: #44d09c; box-shadow: 0 0 0 4px rgb(68 208 156 / 9%); }
.admin-profile { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 10px 6px 2px; border-top: 1px solid #263249; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #2e3d59; color: #dbe3f0; font-size: 12px; font-weight: 700; }
.icon-button, .menu-button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 9px; cursor: pointer; }
.icon-button { color: #8996aa; background: transparent; }
.icon-button:hover { color: #ffffff; background: #202d42; }
.icon-button svg { width: 18px; height: 18px; }

.dashboard-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(18px, 2.5vw, 34px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 96%); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 18px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumbs i { color: #b4bbc8; font-style: normal; }
.breadcrumbs strong { color: var(--text); font-weight: 600; }
.menu-button { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.refresh-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.legend i, .company-online i, .status-badge i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2eb989; }
.refresh-pill b { color: var(--text); font-variant-numeric: tabular-nums lining-nums; }

.dashboard-content { max-width: 1580px; margin: 0 auto; padding: 18px clamp(18px, 2.5vw, 34px) 36px; }
.page-intro { margin-bottom: var(--space-section); }
.kicker, .panel-caption { margin-bottom: 8px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.page-intro h1 { margin-bottom: 0; font-size: clamp(25px, 2.6vw, 31px); line-height: 1.12; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; transition: transform 120ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--accent); color: #ffffff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: #aab3c3; background: var(--surface-soft); }
.button-danger { border-color: #e3aeb6; background: var(--surface); color: var(--red); }
.button-danger:hover { border-color: var(--red); background: var(--red-soft); }
.button-compact { min-height: 36px; padding-inline: 12px; }
.button[aria-busy="true"] { cursor: wait; opacity: 0.72; }
.button:disabled, .row-action:disabled, .command-box button:disabled, .credential-grid button:disabled { cursor: not-allowed; border-color: var(--line); background: var(--disabled-surface); color: var(--disabled-text); box-shadow: none; transform: none; opacity: 1; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--space-section); }
.stat-card { display: flex; min-width: 0; align-items: center; gap: var(--space-compact); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); animation: rise-in 360ms both; }
.stat-card:nth-child(2) { animation-delay: 45ms; }
.stat-card:nth-child(3) { animation-delay: 90ms; }
.stat-card:nth-child(4) { animation-delay: 135ms; }
.stat-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon-violet { color: var(--violet); background: #f0edfb; }
.stat-icon-cyan { color: var(--cyan); background: #e7f6f8; }
.stat-icon-green { color: var(--green); background: var(--green-soft); }
.stat-icon-amber { color: var(--amber); background: var(--amber-soft); }
.stat-card > div:last-child { display: grid; min-width: 0; flex: 1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 9px; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-card strong { grid-column: 2; color: var(--text); font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.04em; }

.alert { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 20px; padding: 13px 16px; border: 1px solid #efc4cb; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); }
.alert strong { font-size: 13px; }
.alert span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.alert-warning { border-color: #ead09d; background: var(--amber-soft); color: #895b0d; }
.router-settings { margin-bottom: var(--space-section); }
.router-settings-header { min-height: 56px; }
.router-settings-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.router-settings-form { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(190px, 1fr) auto; align-items: end; gap: 10px; padding: var(--space-compact) var(--space-panel); background: var(--surface-soft); }
.router-setup-guide { border-top: 1px solid var(--line); background: var(--surface); }
.router-setup-guide summary { display: flex; min-height: 44px; align-items: center; padding: 0 var(--space-panel); cursor: pointer; color: var(--accent); font-size: 11px; font-weight: 600; list-style: none; }
.router-setup-guide summary::-webkit-details-marker { display: none; }
.router-setup-guide summary::after { margin-left: auto; color: var(--muted); content: "+"; font-size: 17px; font-weight: 400; }
.router-setup-guide[open] summary::after { content: "−"; }
.router-setup-guide > div { display: grid; max-width: 900px; gap: 8px; padding: 0 var(--space-panel) 14px; }
.router-setup-guide p, .router-setup-guide small { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.router-setup-guide > div > code { display: block; padding: 9px 11px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--text); font-size: 10px; white-space: nowrap; }
.router-setup-guide p code, .router-setup-guide small code { color: var(--text); font-size: 10px; }
.router-setup-steps { display: grid; gap: 14px; margin: 4px 0; padding-left: 20px; }
.router-setup-steps li { padding-left: 3px; color: var(--text); font-size: 11px; }
.router-setup-steps li::marker { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }
.router-setup-steps strong { display: block; margin-bottom: 4px; }
.router-setup-steps p { margin-bottom: 6px; max-width: 78ch; }
.router-setup-steps code { display: block; margin-top: 5px; padding: 9px 11px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--text); font-size: 10px; white-space: nowrap; }
.router-delete-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: var(--space-panel); padding: 6px var(--space-panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.install-banner { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 16px; margin-bottom: 22px; padding: 20px; overflow: hidden; border: 1px solid #b8c4f3; border-radius: var(--radius-lg); background: linear-gradient(115deg, #f0f3ff 0%, #f8f9ff 62%, #edf8f6 100%); animation: rise-in 360ms both; }
.install-banner::after { position: absolute; right: -55px; top: -80px; width: 190px; height: 190px; border: 1px solid rgb(52 87 213 / 12%); border-radius: 50%; content: ""; }
.install-banner-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 12px; background: var(--accent); color: #ffffff; box-shadow: 0 9px 22px rgb(52 87 213 / 22%); }
.install-banner-content { position: relative; z-index: 1; min-width: 0; }
.install-banner h2 { margin-bottom: 6px; font-size: 20px; }
.install-banner p:not(.kicker) { max-width: 82ch; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.creation-result { display: grid; gap: 9px; margin: 15px 0; padding: 13px; border: 1px solid #d4daf2; border-radius: 10px; background: rgb(255 255 255 / 70%); }
.creation-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.creation-result-heading strong { font-size: 12px; }
.creation-result-heading span { color: var(--muted); font-size: 10px; font-weight: 700; }
.result-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.result-rail span { height: 6px; border-radius: 999px; background: #dfe4ed; }
.result-rail .done { background: var(--green); }
.result-rail .pending { background: #d79a2d; }
.result-steps, .creation-steps { display: grid; margin: 0; padding: 0; list-style: none; }
.result-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.result-steps li, .creation-steps li { display: flex; min-width: 0; align-items: center; gap: 8px; }
.result-steps i, .creation-steps i { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #e3e7ef; color: #778196; font-size: 9px; font-style: normal; font-weight: 700; }
.result-steps span, .creation-steps span { display: grid; min-width: 0; gap: 1px; }
.result-steps strong, .creation-steps strong { font-size: 10px; }
.result-steps small, .creation-steps small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.result-steps .done i, .creation-steps .done i { background: var(--green-soft); color: var(--green); }
.result-steps .pending i, .creation-steps .active i { background: var(--amber-soft); color: var(--amber); box-shadow: 0 0 0 4px rgb(255 245 223 / 72%); }
.command-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #c9d1ec; border-radius: 9px; background: #151d2d; }
.command-box code { display: block; padding: 12px 14px; overflow-x: auto; color: #dfe7ff; font-size: 11px; white-space: nowrap; }
.command-box button { min-width: 108px; border: 0; border-left: 1px solid #35415a; cursor: pointer; background: #202c43; color: #ffffff; font-size: 12px; font-weight: 600; }
.command-box button:hover { background: #2a3854; }
.install-commands { display: grid; gap: 11px; }
.platform-command > span { display: block; margin-bottom: 5px; color: #596682; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.management-grid { display: grid; grid-template-columns: minmax(236px, 274px) minmax(0, 1fr); align-items: start; gap: 12px; }
.management-grid-single { grid-template-columns: minmax(280px, 420px); }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-header { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: var(--space-panel); padding: 10px var(--space-panel); border-bottom: 1px solid var(--line); }
.panel-header h2 { margin-bottom: 0; font-size: 16px; }
.panel-actions { display: flex; align-items: center; gap: 7px; }
.panel-actions form { display: contents; }
.panel-header-wide { align-items: start; }
.panel-header-wide p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel-caption { display: block; margin-bottom: 4px; color: var(--muted); }
.metric-badge { display: grid; min-width: 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.company-list { max-height: 440px; overflow-y: auto; padding: 5px; }
.company-row { display: grid; min-height: 48px; grid-template-columns: 30px minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; transition: background-color 150ms ease, color 150ms ease; }
.company-row:hover { background: var(--surface-soft); }
.company-row.active { background: var(--accent-soft); }
.company-avatar, .person-avatar { display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #edf0f5; color: #58647a; font-size: 12px; font-weight: 700; }
.company-avatar { width: 30px; height: 30px; border-radius: 8px; }
.company-row.active .company-avatar { background: var(--accent); color: #ffffff; }
.company-copy { display: grid; min-width: 0; gap: 2px; }
.company-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.company-copy small { color: var(--muted); font-size: 10px; }
.company-online { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums lining-nums; }
.company-online i { width: 6px; height: 6px; }
.company-row > svg { width: 15px; height: 15px; color: #a5adba; }
.company-form { padding: var(--space-compact); border-top: 1px solid var(--line); background: var(--surface-soft); }
label { display: block; margin-bottom: 6px; color: #535e72; font-size: 12px; font-weight: 600; }
input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; background: var(--surface); color: var(--text); font-size: 16px; transition: border-color 150ms ease, box-shadow 150ms ease; }
input::placeholder { color: #a3abba; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(52 87 213 / 12%); }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.compact-empty { display: grid; justify-items: start; padding: 22px 16px; }
.compact-empty strong { font-size: 13px; }
.compact-empty p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.employee-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.9fr) auto; align-items: end; gap: 10px; padding: var(--space-compact) var(--space-panel); border-bottom: 1px solid var(--line); background: #fbfcfe; }
.field { min-width: 0; }
.field-hint { display: block; min-height: 16px; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.table-toolbar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: var(--space-compact); padding: 0 var(--space-panel); }
.table-toolbar > div { display: flex; align-items: center; gap: 8px; }
.toolbar-title { font-size: 12px; font-weight: 700; }
.toolbar-count { color: var(--muted); font-size: 10px; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.legend i { width: 6px; height: 6px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
th, td { padding: 7px 8px; text-align: left; vertical-align: middle; }
th:first-child, td:first-child { padding-left: var(--space-panel); }
th:last-child, td:last-child { padding-right: var(--space-panel); }
th { border-bottom: 1px solid var(--line); background: var(--surface-soft); color: #7d8799; font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
td { border-bottom: 1px solid #edf0f4; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
tbody tr[data-row-link] { cursor: pointer; transition: background-color 150ms ease, box-shadow 150ms ease; }
tbody tr[data-row-link]:hover { background: var(--accent-soft); }
tbody tr[data-row-link]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.disabled-row { opacity: 0.58; }
.person-cell { display: flex; min-width: 145px; align-items: center; gap: 8px; }
.person-link { border-radius: 7px; }
.person-link:hover strong { color: var(--accent); }
.person-avatar { width: 28px; height: 28px; border-radius: 8px; }
.person-cell > span:last-child { display: grid; min-width: 0; gap: 2px; }
.person-cell strong { font-size: 11px; }
.person-cell small, .cell-note { display: block; max-width: 210px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge, .sync-badge { display: inline-flex; min-height: 24px; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-badge i { width: 5px; height: 5px; }
.status-online { background: var(--green-soft); color: var(--green); }
.status-stale { background: var(--amber-soft); color: var(--amber); }
.status-stale i { background: #d69826; }
.status-offline { background: #f0f2f5; color: #747e90; }
.status-offline i { background: #9ca5b5; }
.sync-ok { background: var(--green-soft); color: var(--green); }
.sync-error { background: var(--red-soft); color: var(--red); }
.ip-value { color: var(--accent); font-weight: 500; }
td code { font-size: 10px; white-space: nowrap; }
td time { white-space: nowrap; }
.muted { color: var(--muted); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-action { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer; background: var(--surface); color: var(--muted); font-size: 9px; font-weight: 600; }
.row-action:hover { border-color: #b6becc; color: var(--text); }
.row-action-positive { border-color: #9cd2bd; background: var(--green-soft); color: var(--green); }
.row-action-positive:hover { border-color: var(--green); background: #dcf2e8; color: var(--green); }
.employee-detail { display: grid; gap: 10px; padding: var(--space-panel); }
.employee-hero { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--space-compact); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-avatar { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 11px; background: var(--accent); color: #ffffff; font-size: 16px; font-weight: 700; }
.employee-hero h3, .detail-command-card h3, .credential-card h3, .danger-zone h3 { margin: 0; letter-spacing: -0.025em; }
.employee-hero h3 { font-size: 18px; }
.employee-hero p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.detail-item { display: grid; min-width: 0; align-content: start; gap: 4px; padding: 9px 10px; background: var(--surface); }
.detail-item span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.detail-item strong, .detail-item code { min-width: 0; overflow: hidden; color: var(--text); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.detail-command-card { display: grid; justify-items: start; padding: 12px; border: 1px solid #cbd4f2; border-radius: 10px; background: var(--accent-soft); }
.detail-command-heading { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; }
.detail-command-card h3 { font-size: 16px; }
.detail-command-card p { max-width: 78ch; margin: 6px 0 var(--space-compact); color: var(--muted); font-size: 11px; line-height: 1.5; }
.credential-card { display: grid; gap: var(--space-compact); padding: 12px; border: 1px solid #b9dfcf; border-radius: 10px; background: #f4fbf7; }
.credential-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.credential-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.credential-card h3 { font-size: 16px; }
.credential-card > p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 11px; }
.sync-explanation { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #edcf99; border-radius: 8px; background: var(--amber-soft); color: #75500f; }
.sync-explanation strong { font-size: 11px; }
.sync-explanation span { overflow-wrap: anywhere; font-size: 10px; line-height: 1.45; }
.sync-explanation small { color: #98722f; font-size: 9px; }
.credential-grid { display: grid; grid-template-columns: 0.8fr 1fr 1.15fr 1.15fr; gap: 9px; }
.credential-grid > div { min-width: 0; }
.credential-grid > div > span { display: block; margin-bottom: 5px; color: #517061; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.credential-grid > div > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #c9ded2; border-radius: 7px; background: var(--surface); }
.credential-grid code { display: block; min-width: 0; padding: 9px 10px; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.credential-grid button { min-width: 76px; border: 0; border-left: 1px solid #d7e7df; cursor: pointer; background: #edf7f1; color: #28674a; font-size: 9px; font-weight: 700; }
.credential-grid button:hover { background: #e3f2e9; }
.credential-grid button:disabled { cursor: wait; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: var(--space-panel); padding: 12px; border: 1px solid #efcbd0; border-radius: 10px; background: #fffafb; }
.danger-zone h3 { font-size: 15px; }
.danger-zone p { max-width: 68ch; margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.detail-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.table-empty { display: grid; min-height: 240px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.table-empty svg { width: 34px; height: 34px; margin-bottom: 13px; color: #9da8bb; }
.table-empty strong { font-size: 13px; }
.table-empty p { max-width: 45ch; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.large-empty { display: grid; min-height: 420px; place-items: center; align-content: center; padding: 40px; text-align: center; }
.large-empty h2 { margin: 20px 0 7px; font-size: 20px; }
.large-empty p { max-width: 52ch; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.empty-orbit { position: relative; display: grid; width: 62px; height: 62px; place-items: center; border: 1px solid #ccd4e4; border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { position: absolute; border: 1px solid #e1e5ee; border-radius: 50%; content: ""; }
.empty-orbit::before { width: 88px; height: 32px; transform: rotate(28deg); }
.empty-orbit::after { width: 32px; height: 88px; transform: rotate(28deg); }
.empty-orbit i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 7px var(--accent-soft); }

.sidebar-overlay { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.creation-overlay[hidden] { display: none; }
.creation-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(9 16 30 / 60%); backdrop-filter: blur(4px); }
.creation-dialog { width: min(100%, 510px); padding: 28px; border: 1px solid #dbe1ec; border-radius: 16px; background: var(--surface); box-shadow: 0 28px 80px rgb(5 12 27 / 32%); animation: rise-in 240ms both; }
.creation-dialog h2 { margin-bottom: 7px; font-size: 23px; }
.creation-dialog > p:not(.kicker) { margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.connection-activity { position: relative; height: 5px; margin-bottom: 19px; overflow: hidden; border-radius: 999px; background: #e4e8f1; }
.connection-activity span { position: absolute; inset-block: 0; width: 38%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: connection-sweep 1.3s ease-in-out infinite; }
.creation-steps { gap: 10px; margin-bottom: 18px; }
.creation-steps li { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.creation-steps i { width: 27px; height: 27px; }
.creation-steps strong { font-size: 11px; }
.creation-steps small { font-size: 10px; }
.creation-steps em { color: #929bad; font-size: 9px; font-style: normal; font-weight: 700; }
.creation-steps .done em { color: var(--green); }
.creation-steps .active em { color: var(--amber); }
.creation-steps .active { border-color: #e0bf7f; background: #fffbf2; }
.creation-wait { display: block; color: var(--muted); font-size: 9px; line-height: 1.5; }
.creation-running { overflow: hidden; }

/* Login */
.login-page { min-height: 100vh; background: var(--surface); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-form { display: grid; width: min(100%, 430px); gap: 18px; }
.login-form input { min-height: 50px; }
.button-login { min-height: 50px; margin-top: 4px; }
.alert-login { display: grid; gap: 2px; margin-bottom: 0; }

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes connection-sweep { from { left: -42%; } to { left: 104%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

@media (max-width: 1240px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .router-settings-form { grid-template-columns: 1fr 1fr; }
  .router-settings-form .button { grid-column: 1 / -1; }
  .management-grid { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
  .employee-form { grid-template-columns: 1fr 1fr; }
  .employee-form .button { grid-column: 1 / -1; margin-top: 0; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1021px) and (max-width: 1500px) {
  th, td { padding-inline: 9px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .table-previous { display: none; }
}

@media (max-width: 1020px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); transform: translateX(-102%); transition: transform 220ms ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; border: 0; background: rgb(10 17 31 / 52%); opacity: 0; transition: opacity 220ms ease, visibility 220ms ease; }
  .sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .menu-button { display: grid; }
  .management-grid { grid-template-columns: 1fr; }
  .company-list { max-height: 300px; }
}

@media (max-width: 680px) {
  .dashboard-content { padding: 16px 12px 32px; }
  .topbar { min-height: 60px; padding: 0 12px; }
  .breadcrumbs { display: none; }
  .topbar-actions { margin-left: auto; }
  .refresh-pill { padding-left: 0; border-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { align-items: start; flex-direction: column; padding: 10px; }
  .stat-card > div:last-child { width: 100%; }
  .install-banner { grid-template-columns: 1fr; padding: 16px; }
  .result-steps { grid-template-columns: 1fr; }
  .command-box { grid-template-columns: 1fr; }
  .command-box button { min-height: 44px; border-top: 1px solid #35415a; border-left: 0; }
  .router-settings-form { grid-template-columns: 1fr; padding: 12px; }
  .router-settings-form .button { grid-column: auto; }
  .router-setup-guide summary { padding-inline: 15px; }
  .router-setup-guide > div { padding-inline: 15px; }
  .router-delete-row { align-items: stretch; flex-direction: column; padding: 12px; }
  .router-delete-row .button { width: 100%; }
  .employee-form { grid-template-columns: 1fr; padding: 12px; }
  .employee-form .button { grid-column: auto; margin-top: 0; }
  .table-toolbar { align-items: start; flex-direction: column; justify-content: center; padding-block: 10px; }
  .table-scroll { overflow: visible; }
  table, tbody, tr, td { display: block; }
  table { min-width: 0; }
  thead { display: none; }
  tbody { padding: 6px; }
  tr { margin-bottom: 6px; padding: 6px 0; border: 1px solid var(--line); border-radius: 9px; }
  tr:last-child { margin-bottom: 0; }
  td, th:first-child, td:first-child, th:last-child, td:last-child { padding: 6px 10px; border: 0; }
  td { display: grid; grid-template-columns: minmax(105px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; }
  td::before { color: #8992a2; content: attr(data-label); font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  td:first-child { display: block; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
  td:first-child::before { display: none; }
  .person-cell { min-width: 0; }
  .row-actions { justify-content: flex-start; }
  .row-action, .credential-grid button { min-height: 44px; }
  .employee-detail { padding: 12px; }
  .employee-hero { grid-template-columns: 46px minmax(0, 1fr); }
  .employee-hero .status-badge { grid-column: 2; justify-self: start; }
  .detail-command-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .detail-avatar { width: 46px; height: 46px; }
  .detail-grid { grid-template-columns: 1fr; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .credential-heading { align-items: flex-start; flex-direction: column; }
  .credential-heading-actions { width: 100%; justify-content: space-between; }
  .credential-copy-all { min-height: 44px; }
  .detail-actions { align-items: stretch; flex-direction: column; }
  .detail-actions .button { width: 100%; }
  .table-empty { min-height: 210px; }
  .table-empty::before { display: none; }
  .login-shell { padding: 20px; }
}

@media (max-width: 430px) {
  .stat-card { align-items: center; flex-direction: row; }
  .panel-header { padding-inline: 12px; }
  .company-form { padding: 12px; }
  .input-action { grid-template-columns: 1fr; }
  .input-action .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
