@font-face {
  font-family: Geist;
  src: url('/fonts/geist-cyrillic-ext-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Geist;
  src: url('/fonts/geist-cyrillic-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0301, U+0400-045F, U+0490-04FF, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Geist;
  src: url('/fonts/geist-latin-ext-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: Geist;
  src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  font-family: Geist, Arial, sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --blue: #0088ff;
  --text: #182332;
  --muted: #84909f;
  --text-secondary: #637080;
  --text-strong: #243347;
  --text-soft: #68788b;
  --field: #ffffff;
  --field-border: #dfe5ed;
  --success: #16865c;
  --error: #bb4051;
  --page: #f6f8fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f2f5f8;
  --line: #edf0f4;
  --line-strong: #e5eaf0;
  --danger: #bd3a4c;
  --danger-bg: #fff1f3;
  --focus: #88c7ff;
  --nav-surface: #f7f9fb;
  --nav-icon: #e8eef6;
  --nav-active: #eaf5ff;
  --nav-hover: #f4f8fc;
  --radius: 20px;
  color: var(--text);
  background: var(--page);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  color: var(--text);
  background: var(--page);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.boot,
.loading {
  padding: 60px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* Buttons — same scale as My Work */
.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 11px;
  padding: 12px 17px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 10px #0088ff16;
}
.btn:hover {
  filter: brightness(0.985);
}
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--surface-hover);
}
.btn.danger {
  color: var(--danger);
  background: var(--danger-bg);
  box-shadow: none;
}

/* Login */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
}
.brand {
  display: flex;
  align-items: center;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -1px;
  color: var(--text);
}
.login-card .brand {
  margin-bottom: 35px;
  color: var(--blue);
}
.login h1 {
  margin-bottom: 8px;
}
.login h1 + .muted {
  font-size: 13px;
  line-height: 1.55;
}
.field {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13px;
  outline: none;
  box-shadow: none;
}
.input::placeholder {
  color: var(--muted);
}
.input:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.08);
}
.login .btn {
  width: 100%;
  margin-top: 8px;
}
.error {
  min-height: 18px;
  color: var(--error);
  font-size: 12px;
  margin-top: 12px;
}

/* Application shell */
.layout {
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  width: 234px;
  padding: 32px 19px 18px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
  z-index: 20;
}
.sidebar .brand {
  padding: 0 13px;
  margin-bottom: 35px;
  font-size: 17px;
  color: var(--blue);
  white-space: nowrap;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--muted);
  margin: 0 15px 11px;
  padding: 0;
  font-weight: 400;
}
.nav {
  display: block;
}
.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}
.nav button:hover {
  background: var(--nav-hover);
}
.nav button.active {
  background: var(--nav-active);
  color: var(--blue);
  font-weight: 550;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 7px 0;
}
.who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}
.role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.sidebar-foot .btn {
  width: 100%;
  margin-top: 14px !important;
}

.main {
  grid-column: 2;
  min-width: 0;
  padding: 34px 38px 60px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.topbar h1 {
  margin-bottom: 6px;
}
.topbar .muted {
  font-size: 12px;
}
.top-actions {
  display: flex;
  gap: 10px;
}

/* Metrics */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 22px #233c5603;
}
.metric-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.metric-value {
  margin: 15px 0 7px;
  color: var(--text-strong);
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -1px;
}
.metric-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

/* Sections */
.section {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 22px #233c5603;
}
.section-head {
  min-height: 62px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.section-head h2 {
  margin: 0;
}
.section-body {
  padding: 20px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .input {
  max-width: 330px;
}
.toolbar .select {
  width: auto;
  min-width: 170px;
}

/* Tables */
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: var(--surface-soft);
}
.table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.table td {
  color: var(--text-secondary);
}
.table td strong {
  color: var(--text);
  font-weight: 600;
}
.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.actions .btn {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  padding: 5px 8px;
  background: #f1f3f6;
  color: #81909d;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.good {
  background: #eaf8f0;
  color: #30936d;
}
.badge.bad {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.blue {
  background: #eef7ff;
  color: #0088e8;
}

.empty {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.empty b {
  display: block;
  margin-bottom: 6px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
}
.empty p {
  font-size: 12px;
}
.status-list {
  display: grid;
  gap: 0;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.status-row:last-child {
  border-bottom: 0;
}
.dot {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--success);
}
.dot.warn {
  background: #e7a13b;
}

/* Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 38, 0.35);
  backdrop-filter: blur(2px);
}
.modal {
  width: min(450px, 100%);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.18);
}
.modal h3 {
  margin: 0 0 10px;
}
.modal .muted {
  font-size: 12px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  padding: 12px 16px;
  background: var(--text);
  color: #fff;
  border-radius: 11px;
  box-shadow: 0 14px 38px rgba(31, 45, 61, 0.16);
  font-size: 12px;
}

@media (max-width: 1050px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    width: auto;
    margin: 12px;
    padding: 20px 16px;
    border-radius: 18px;
  }
  .sidebar .brand {
    margin-bottom: 20px;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .sidebar-foot {
    margin-top: 16px;
  }
  .main {
    padding: 22px 16px 50px;
  }
  .topbar {
    align-items: flex-start;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 25px;
  }
  .login-card {
    padding: 26px 22px;
  }
  .nav {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
  }
  .top-actions,
  .top-actions .btn {
    width: 100%;
  }
  .toolbar .input,
  .toolbar .select {
    width: 100%;
    max-width: none;
  }
}

.brand img {
  display: block;
  width: auto;
  height: 28px;
  max-width: 100%;
}
