:root {
  font: 14px/1.5 "Inter", "Segoe UI", sans-serif;
  color: #212529;
  background: #f2f4f7;
  --primary: #3762ea;
  --sidebar: #18253b;
  --muted: #646e7b;
  --border: #e8ebef;
  --sidebar-width: 250px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
  background: var(--sidebar); color: #b9c3d3; z-index: 2; padding: 0 14px; overflow: auto;
}
.brand, .login-brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 750; }
.brand { height: 70px; padding: 0 10px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 800; font-size: 18px; }
.menu-label { margin: 22px 10px 9px; color: #a6b2c5; font-size: 10px; font-weight: 650; letter-spacing: .08em; }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 5px; color: inherit; text-decoration: none; }
nav a span { width: 20px; font-size: 19px; line-height: 1; text-align: center; }
nav a:hover, nav a[aria-current] { background: #2c3b55; color: #fff; }
header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 14px;
  height: 70px; margin-left: var(--sidebar-width); padding: 0 24px; border-bottom: 1px solid var(--border); background: #fff;
}
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account small { display: block; color: var(--muted); }
.avatar { display: grid; place-items: center; background: #e9edff; color: #2b4dc0; border-radius: 50%; width: 36px; height: 36px; font-weight: 700; }
.icon-button { width: 36px; padding: 0; font-size: 18px; }
main { padding: 24px; }
.signed-in main { margin-left: var(--sidebar-width); }
.nav-collapsed .sidebar { display: none; }
.nav-collapsed header, .nav-collapsed main { margin-left: 0; }
.heading, .panel-heading, .issue { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.heading, .panel-heading { justify-content: space-between; }
.heading { margin-bottom: 20px; }
.breadcrumb { color: var(--muted); }
.breadcrumb span { padding: 0 5px; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
p { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 1px 2px #23364a08; }
.panel { margin-bottom: 18px; padding: 20px; scroll-margin-top: 90px; }
.panel > p { margin-top: 5px; }
#overview { scroll-margin-top: 90px; }
.login { width: min(430px, 100%); margin: 10vh auto 0; padding: 30px; }
.login-brand { justify-content: center; margin-bottom: 24px; }
.login h1, .login p { text-align: center; }
.login p { margin: 7px 0 22px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { padding: 18px; min-width: 0; display: flex; align-items: center; gap: 13px; color: var(--muted); }
.stat strong { display: block; font-size: 24px; font-weight: 650; line-height: 1.2; color: #212529; margin-top: 4px; }
.stat-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: #e9edff; color: #2b4dc0; font-size: 21px; }
.stat:nth-child(2) .stat-icon { background: #fff3df; color: #925800; }
.stat:nth-child(3) .stat-icon { background: #fce7ea; color: #aa3046; }
.stat:nth-child(4) .stat-icon { background: #dcf4ed; color: #14735b; }
form label { display: block; font-weight: 600; }
.login form { display: grid; gap: 14px; }
.issue { align-items: end; margin-top: 16px; }
.issue label:first-child { flex: 1 1 240px; }
.issue input[type=number] { width: 145px; }
input, button { font: inherit; min-height: 37px; border: 1px solid #d6dce4; border-radius: 5px; }
input { display: block; width: 100%; padding: 7px 11px; margin-top: 5px; color: inherit; }
button { background: #fff; color: #343e4c; cursor: pointer; padding: 7px 13px; }
button:hover { background: #f0f3fa; }
button:disabled { opacity: .6; cursor: wait; }
.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.primary:hover { background: #284fc9; }
:focus-visible { outline: 2px solid #4169de; outline-offset: 2px; }
.issued { background: #eff3ff; border-radius: 5px; margin-top: 16px; padding: 13px; }
.issued p { margin-bottom: 7px; }
code { margin-right: 10px; overflow-wrap: anywhere; user-select: all; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
td, th { padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { background: #f3f5f8; color: #4b5666; font-weight: 650; white-space: nowrap; }
.status { display: inline-block; border-radius: 4px; padding: 2px 7px; background: #fff3df; color: #805000; font-size: 12px; white-space: nowrap; }
.status.active { background: #dcf4ed; color: #14644f; }
.status.expired { background: #fce7ea; color: #972f42; }
.status.stopped { background: #fce7ea; color: #972f42; }
.danger { color: #972f42; white-space: nowrap; }
.backup-filter { display: block; width: min(280px, 100%); margin: 12px 0 8px; }
select { display: block; width: 100%; min-height: 37px; margin-top: 5px; padding: 7px 11px; border: 1px solid #d6dce4; border-radius: 5px; background: #fff; color: inherit; font: inherit; }
dialog { width: min(500px, 92vw); max-height: 80vh; border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
dialog::backdrop { background: #18253b88; }
.modal-form { display: grid; gap: 14px; margin-top: 16px; }
.modal-form button { justify-self: start; }
.modal-form textarea { display: block; width: 100%; padding: 8px 11px; margin-top: 5px; border: 1px solid #d6dce4; border-radius: 5px; font: inherit; resize: vertical; }
.customer-contact-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.customer-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; }
.customer-details dt { font-weight: 650; }
.customer-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-actions { white-space: nowrap; }
.customer-actions button + button { margin-left: 6px; }
.modal-message:not(:empty) { margin-top: 12px; color: #245078; }
.table-actions { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.table-actions .backup-filter { flex: 1 1 175px; }
td a { color: #2854c7; }
#empty { padding-top: 14px; }
#message:not(:empty) {
  position: fixed; right: 20px; bottom: 20px; z-index: 3; max-width: min(400px, 90vw);
  padding: 12px 16px; border-radius: 6px; background: #253551; color: #fff; box-shadow: 0 4px 16px #17253a33;
}
@media (max-width: 1190px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .sidebar { display: none; }
  header, .signed-in main { margin-left: 0; }
  .nav-open .sidebar { display: block; top: 70px; }
  main, header { padding-inline: 15px; }
}
@media (max-width: 450px) {
  .account small, .breadcrumb { display: none; }
  .stat { padding: 10px; gap: 7px; }
  .stat-icon { flex-basis: 29px; height: 29px; font-size: 16px; }
}
