:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #25364a;
  background: #f2f5f9;
  font-size: 15px;
  line-height: 1.5;
  --navy: #0b2239;
  --blue: #28577f;
  --line: #d9e1e9;
  --muted: #64748b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button,
.button {
  border: 1px solid #c5d0dc;
  border-radius: 5px;
  background: white;
  padding: 9px 15px;
  color: #243e58;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button:hover {
  background: #edf3fa;
  border-color: #7296b6;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #719bc7;
  outline-offset: 2px;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #1a4266;
  color: white;
}
.danger {
  color: #ad283c;
  border-color: #d7a9b0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand img {
  width: 46px;
  height: 46px;
  background: white;
  border-radius: 7px;
  padding: 3px;
}
.brand strong {
  font-size: 25px;
  letter-spacing: 0.7px;
  line-height: 1.2;
  display: block;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #c1aa6b;
  margin-top: 3px;
}
header {
  height: 72px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 26px;
}
header .account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
header button {
  background: transparent;
  border-color: #57708a;
  color: white;
  padding: 6px 12px;
}
.shell {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
aside {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
}
aside h2 {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.4px;
  margin: 0 10px 14px;
}
aside button {
  width: 100%;
  border-color: transparent;
  background: transparent;
  justify-content: flex-start;
  margin-bottom: 6px;
  font-weight: 500;
  gap: 10px;
}
aside button.active {
  background: #e4edf6;
  border-color: #c7d7e6;
  color: #173f63;
  font-weight: 700;
}
aside select {
  width: 100%;
  margin-bottom: 18px;
}
main {
  padding: 24px 28px;
  min-width: 0;
  max-width: 1600px;
  width: 100%;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.toolbar h1 {
  font-size: 22px;
  margin: 0;
}
.toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head input {
  max-width: 380px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th {
  background: #eaf0f6;
  text-align: left;
  padding: 12px 18px;
  font-size: 13px;
  color: #4a6075;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 18px;
  border-bottom: 1px solid #e8edf3;
  font-size: 14px;
}
tbody tr:hover {
  background: #f7faff;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
td button {
  padding: 5px 10px;
  font-size: 13px;
}
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 3px 9px;
  background: #edf2f7;
  font-size: 12px;
  font-weight: 600;
}
.tag.ok {
  color: #21664e;
  background: #e9f4ee;
}
.tag.warn {
  color: #8a5c16;
  background: #fff3dd;
}
.tag.off {
  color: #a53642;
  background: #fae9ec;
}
.table-foot {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.empty {
  text-align: center;
  padding: 58px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: #38526b;
  font-size: 18px;
  margin-bottom: 8px;
}
.form {
  display: grid;
  gap: 18px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.span-2 {
  grid-column: 1/-1;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
input,
select,
textarea {
  min-width: 0;
  width: 100%;
  padding: 10px 11px;
  background: white;
  border: 1px solid #bbcbd9;
  border-radius: 5px;
  color: #24364a;
  outline: none;
  font-weight: 400;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #2c618f;
  box-shadow: 0 0 0 3px #2c618f16;
}
textarea {
  resize: vertical;
  min-height: 78px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 12px;
  font-weight: 400;
}
.checks input {
  width: 16px;
  height: 16px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 8px;
}
.note {
  font-size: 13px;
  color: #566b80;
  background: #f0f5fa;
  border: 1px solid #d7e3ee;
  padding: 11px 13px;
  border-radius: 5px;
}
.error {
  color: #aa263e;
  background: #fdf0f2;
  border: 1px solid #ecc3cd;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
}
.error:empty {
  display: none;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 44%) 1fr;
}
.login-brand {
  background: var(--navy);
  color: white;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand .brand img {
  height: 64px;
  width: 64px;
}
.login-brand .brand strong {
  font-size: 36px;
}
.login-brand h1 {
  font-size: 36px;
  line-height: 1.3;
  max-width: 390px;
  font-weight: 500;
  margin-bottom: 20px;
}
.login-brand p {
  color: #adc1d3;
  max-width: 350px;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}
.login-form {
  width: 100%;
  max-width: 410px;
}
.login-form h1 {
  font-size: 26px;
  margin: 0 0 8px;
}
.login-form > p {
  color: var(--muted);
  margin: 0 0 28px;
}
.login-form .primary {
  width: 100%;
  padding: 12px;
}
.login-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  max-width: 750px;
  width: calc(100% - 36px);
  max-height: 92vh;
  box-shadow: 0 24px 100px #07192b50;
}
dialog::backdrop {
  background: #142c4766;
  backdrop-filter: blur(2px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.dialog-head h2 {
  font-size: 19px;
  margin: 0;
}
.dialog-head button {
  border: 0;
  background: transparent;
  font-size: 23px;
  padding: 0 5px;
}
.dialog-body {
  padding: 24px;
  max-height: 75vh;
  overflow: auto;
}
.link-output {
  word-break: break-all;
  font-size: 13px;
  padding: 14px;
  background: #edf4fa;
  border: 1px solid #c8d9e8;
  border-radius: 5px;
}
.secret {
  font-family: monospace;
  font-size: 20px;
  letter-spacing: 2px;
  word-break: break-all;
  background: #f0f4f8;
  padding: 14px;
  border-radius: 5px;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #173f5e;
  color: white;
  border-radius: 6px;
  padding: 12px 22px;
  z-index: 100;
  box-shadow: 0 4px 20px #0b223933;
}
.loading {
  padding: 70px;
  text-align: center;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid #3b709b;
  border-radius: 6px;
  padding: 20px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}
.space {
  height: 20px;
}
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.muted {
  color: var(--muted);
}
.release-note {
  font-size: 12px;
  color: var(--muted);
  margin: 24px 0;
}
.technical {
  font-family: monospace;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  header {
    padding: 0 18px;
  }
  .account > span {
    display: none;
  }
  main {
    padding: 20px 18px;
  }
  .login-brand {
    padding: 30px;
  }
  .login-brand h1 {
    font-size: 27px;
  }
  .grid {
    gap: 14px;
  }
}
@media (max-width: 650px) {
  .login-shell {
    display: block;
  }
  .login-brand {
    padding: 22px;
  }
  .login-brand h1,
  .login-brand p,
  .login-brand > small {
    display: none;
  }
  .login-brand .brand img {
    width: 44px;
    height: 44px;
  }
  .login-brand .brand strong {
    font-size: 26px;
  }
  .login-form-wrap {
    padding: 28px 22px;
  }
  .shell {
    display: block;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
    display: flex;
    overflow: auto;
    gap: 8px;
    align-items: center;
  }
  aside h2 {
    display: none;
  }
  aside button {
    white-space: nowrap;
    width: auto;
    margin: 0;
  }
  aside select {
    width: 180px;
    margin: 0;
    flex-shrink: 0;
  }
  main {
    padding: 18px 12px;
  }
  header .brand small {
    display: none;
  }
  header .brand strong {
    font-size: 20px;
  }
  header .brand img {
    width: 36px;
    height: 36px;
  }
  header {
    height: 64px;
    padding: 0 14px;
  }
  .grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .toolbar {
    align-items: flex-start;
  }
  .toolbar h1 {
    font-size: 20px;
  }
  td,
  th {
    padding: 12px;
  }
  .dialog-body {
    padding: 18px;
  }
  .toolbar p {
    max-width: 230px;
  }
}

.brand-monogram {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid currentColor;
  border-radius: 10px;
  font-size: 34px;
  font-weight: 750;
  line-height: 1;
}

.contact-phone {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid #e1e6ee;
}
.contact-phone .tag {
  grid-column: 1 / -1;
  justify-self: start;
}
.contact-phone .check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
}
.contact-phone .check input {
  width: auto;
}
.contact-access {
  border: 1px solid #c5d0dc;
  border-radius: 5px;
  padding: 14px;
  margin: 10px 0;
}
.contact-access legend {
  font-weight: 600;
  padding: 0 5px;
}
.contact-access small {
  display: block;
  margin-top: 12px;
}
@media (max-width: 620px) {
  .contact-phone {
    grid-template-columns: 1fr;
  }
}

.trade-menu summary {
  cursor: pointer;
  padding: 8px 12px;
  color: #f4f8fc;
  font-weight: 600;
}
.trade-menu button {
  padding-left: 23px;
}
.trade-work {
  min-width: 0;
}
.trade-work .panel,
.trade-work .trade-filter {
  margin-bottom: 12px;
}
.trade-edit {
  padding: 16px;
}
.trade-line,
.trade-filter {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.trade-line {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.trade-line > label {
  flex: 1 1 85px;
}
.trade-line > label:first-child {
  flex: 3 1 200px;
}
.trade-line input,
.trade-line select,
.trade-work label {
  min-width: 0;
}
.trade-work label {
  display: grid;
  gap: 3px;
}
.trade-total {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 10px;
  text-align: right;
  border-top: 1px solid var(--line);
}
.trade-picker {
  position: relative;
}
.trade-options {
  position: absolute;
  z-index: 5;
  top: 100%;
  background: white;
  border: 1px solid var(--line);
  min-width: 100%;
  max-height: 250px;
  overflow: auto;
}
.trade-options button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  white-space: normal;
}
.trade-options [aria-selected="true"] {
  background: #e3f3f1;
}
.trade-table {
  overflow-x: auto;
}
.trade-work .panel > p {
  padding: 0 14px;
}
.trade-work .trade-filter label {
  font-size: 0.85rem;
}
.print-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  border: 0;
}
@media (max-width: 750px) {
  .trade-line {
    padding: 12px;
    border: 1px solid var(--line);
  }
  .trade-line > label {
    flex: 1 1 38%;
  }
  .trade-filter > * {
    max-width: 100%;
  }
  .trade-picker input {
    width: 100%;
  }
  .trade-work button {
    min-height: 42px;
  }
}

#work-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
  background: white;
  flex-wrap: wrap;
}
.work-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.work-tab {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.work-tab.chosen {
  border-color: #098681;
}
.work-tab button {
  border: 0;
  background: transparent;
  padding: 5px 8px;
  font-size: 0.87rem;
}
#work-tabs > .inline button {
  font-size: 0.85rem;
  padding: 5px 9px;
}
#work-results {
  display: grid;
  margin-top: 8px;
  gap: 3px;
}
#work-results button {
  justify-content: start;
}

.trade-sort{border:0;background:transparent;color:inherit;font:inherit;padding:0;text-align:inherit}.trade-filter details label{display:flex;align-items:center;gap:6px}.trade-filter input[type=checkbox]{width:auto}

.invoice-review {display:grid;gap:1rem}
.invoice-head,.invoice-effect {display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:1rem;border-radius:8px;background:#edf4f5}
.invoice-review small,.invoice-match span,.invoice-match b,.invoice-effect b,.invoice-head small {display:block}
.invoice-review small {font-size:.82rem;color:#415869}
.invoice-review label {display:grid;gap:.3rem}
.invoice-review label:has(input[type=checkbox]) {display:flex;align-items:center;gap:.5rem}
.invoice-review details {margin:.45rem 0}
.invoice-review summary {cursor:pointer}
.invoice-match {display:grid;grid-template-columns:minmax(10rem,1fr) minmax(16rem,2fr);gap:1rem;align-items:start;border:1px solid #d4e0e4;border-radius:8px;padding:1rem}
.invoice-match>div {min-width:0;display:grid;gap:.4rem}
.invoice-review select {max-width:100%;width:100%}
.invoice-part {display:grid;grid-template-columns:minmax(9rem,1fr) 5rem auto;gap:.4rem;align-items:end}
.invoice-effect {background:#f0f5ed}
@media(max-width:680px){.invoice-match,.invoice-part{grid-template-columns:minmax(0,1fr)}.invoice-head,.invoice-effect{align-items:flex-start}}

dialog:has(.subscription-desk) { max-width: 1030px; }
.subscription-desk .toolbar, .subscription-desk .table-wrap { margin: 16px 0; }
.subscription-desk .stat strong { white-space: nowrap; }
.subscription-desk details summary { cursor: pointer; }
