:root {
  font: 14px/1.5 Arial, Helvetica, sans-serif;
  color: #203b48;
  background: #f4f6f7;
  --navy: #153b50;
  --blue: #14618a;
  --line: #dce5e9;
  --muted: #58727f;
  --light-blue: #eaf3f8;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; color: inherit; }
button, .button, select, input, textarea {
  border: 1px solid #cddbe2; border-radius: 6px; background: #fff; padding: 9px 12px;
}
button, .button { cursor: pointer; font-weight: 600; text-decoration: none; text-align: center; }
button:hover, .button:hover { background: #edf5f9; }
:where(button, select, input, textarea, a):focus-visible { outline: 3px solid #59a9d5; outline-offset: 2px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: default; }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.primary:hover { background: #104e70; }
.danger, .error, .overdue { color: #9c3938; }
a { color: var(--blue); }
small, .muted { color: var(--muted); }
input[type=checkbox] { accent-color: var(--blue); width: 18px; height: 18px; flex: 0 0 auto; }
textarea { width: 100%; min-height: 95px; resize: vertical; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.5px; }
h2 { font-size: 19px; line-height: 1.3; }
h3 { font-size: 15px; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; min-height: 100vh; align-self: start;
  background: var(--navy); color: #ddeaf0; padding: 22px 14px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 2px 35px; color: #fff; }
.brand-mark { display: grid; place-items: center; border: 1px solid #ffffff50; border-radius: 9px; background: #ffffff10; width: 36px; height: 36px; font-size: 22px; }
.brand b { font-size: 18px; letter-spacing: -.45px; }
.brand small { display: block; color: #bad1dc; font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; margin-bottom: 20px; }
.sidebar nav button { display: flex; gap: 10px; align-items: center; border-color: transparent; background: transparent; color: inherit; text-align: left; }
.sidebar nav button:hover { background: #254c61; }
.sidebar nav button[aria-current=page] { background: #31596e; color: #fff; }
.nav-caption { color: #b6ccd8; font-size: 11px; padding: 0 12px 3px; }
.sidebar footer { margin-top: auto; padding: 14px 9px 0; border-top: 1px solid #426477; color: #c4d7e1; font-size: 12px; }
.topbar {
  min-height: 66px; padding: 10px clamp(16px, 2.4vw, 34px); background: white; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar img { max-width: 154px; max-height: 38px; object-fit: contain; display: block; }
.account { display: flex; gap: 9px; align-items: center; }
.account button { white-space: nowrap; }
.account-label { display: block; text-align: right; line-height: 1.3; padding-right: 5px; }
.workspace { padding: clamp(17px, 2.4vw, 34px); max-width: 1760px; margin-inline: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 23px; flex-wrap: wrap; }
.page-heading p { color: var(--muted); margin-top: 6px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.panel { padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.stat { min-height: 94px; padding: 13px 17px; display: flex; flex-direction: column; justify-content: center; }
.stat strong { font-size: 26px; font-weight: 600; line-height: 1.2; margin-top: 7px; }
.toolbar { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border-color: transparent; padding: 8px 10px; background: transparent; }
.tabs button[aria-pressed=true] { color: #155677; background: var(--light-blue); }
.search { width: min(100%, 290px); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; gap: 10px; padding: 12px 16px 15px; background: #f8fafb; border-bottom: 1px solid var(--line); }
.filters :is(input, select) { width: 100%; min-width: 0; padding-inline: 8px; }
label { min-width: 0; display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
label > small { font-weight: 400; }
.check { display: flex; gap: 9px; align-items: center; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.ticket-table { min-width: 775px; }
th, td { padding: 12px 13px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: #f8fafb; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid #edf1f3; font-size: 13px; }
tbody tr:hover { background: #f8fbfd; }
.ticket-link { padding: 0; border: 0; background: transparent; color: #175676; text-align: left; }
.ticket-link:hover { text-decoration: underline; background: transparent; }
.nowrap { white-space: nowrap; }
.tag { display: inline-flex; border-radius: 5px; padding: 3px 7px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #eef2f5; color: #435d69; }
.tag.working { background: #e4f1fa; color: #115c82; }
.tag.closed, .tag.active { background: #e2f1e8; color: #286044; }
.tag.test { background: #fff3d6; color: #72510c; }
progress { display: block; width: 100%; margin-top: 6px; height: 7px; border: 0; color: #1d7ba3; background: #e6eef1; border-radius: 6px; }
progress::-webkit-progress-bar { background: #e6eef1; border-radius: 6px; }
progress::-webkit-progress-value { background: #1d7ba3; border-radius: 6px; }
progress::-moz-progress-bar { background: #1d7ba3; border-radius: 6px; }
.table-footer { padding: 11px 16px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.login { width: min(440px, calc(100% - 32px)); margin: 10vh auto; padding: 32px; box-shadow: 0 12px 45px #12384a12; }
.login img { width: min(100%, 220px); margin-bottom: 24px; }
.login form, .stack { display: grid; gap: 14px; }
.login form { margin-top: 22px; }
.login .hint { margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
.loading { padding: 25px; }
dialog { padding: 0; color: inherit; border: 1px solid var(--line); border-radius: 10px; width: min(900px, calc(100% - 22px)); max-height: 92vh; box-shadow: 0 20px 70px #112c4260; }
dialog::backdrop { background: #17384977; }
.dialog-head { position: sticky; top: 0; z-index: 1; background: white; padding: 13px 21px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.icon-button { min-width: 39px; font-size: 22px; line-height: 1; }
#dialog-body { padding: 19px 21px; }
#dialog-error { position: sticky; bottom: 0; background: #fff0ed; border-top: 1px solid #edc0b9; padding: 10px 21px; white-space: pre-wrap; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.ticket-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 11px; margin: 0; }
.ticket-meta dt { font-size: 11px; color: var(--muted); }
.ticket-meta dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.special { background: #f0f7fb; border: 1px solid #ccdfed; padding: 12px; border-radius: 7px; }
.notes { padding: 12px 0; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.checklist li { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.checklist li:last-child { border-bottom: 0; }
.checklist li:has(:checked) { background: #f6faf8; }
.checklist p, .history .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.checklist small { display: block; margin-top: 4px; }
.history { background: #f8fafb; border: 1px solid var(--line); border-radius: 7px; padding: 11px 13px; }
summary { cursor: pointer; font-weight: 600; color: #285d78; }
.history ol { padding-left: 21px; }
.history li { margin: 8px 0; }
.history .change-list { margin-top: 8px; }
.history .change-list li { font-size: 12px; }
.hint { background: #fff7e6; border: 1px solid #ebdfc4; border-radius: 6px; color: #70531e; padding: 9px 12px; }
.preview-table { min-width: 540px; }
.step-card { border: 1px solid var(--line); border-radius: 7px; padding: 11px; display: grid; gap: 10px; }
.step-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.step-head button { padding: 4px 8px; }
.step-card textarea { min-height: 52px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 15px; }
.template-grid .panel { display: grid; gap: 9px; align-content: start; }
#toast { position: fixed; bottom: 19px; right: 19px; max-width: min(440px, calc(100% - 38px)); background: var(--navy); color: #fff; border-radius: 7px; padding: 11px 16px; z-index: 4; }
@media (max-width: 1050px) { .shell { grid-template-columns: 175px minmax(0, 1fr); } .brand b { font-size: 15px; } }
@media (max-width: 720px) {
  .shell { display: block; } .sidebar { position: static; min-height: auto; padding: 12px 14px; display: block; }
  .brand { margin: 0 0 9px; } .sidebar nav { display: flex; flex-wrap: wrap; margin-bottom: 3px; }
  .sidebar nav button { padding: 6px 9px; } .nav-caption, .sidebar footer, .account-label { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; } .stat { min-height: 74px; }
  .grid { grid-template-columns: 1fr; } .wide { grid-column: auto; } .account { gap: 5px; }
}
