:root {
  color-scheme: light;
  --ink: #10263a;
  --muted: #526574;
  --navy: #10263a;
  --line: #ccd6dd;
  --pale: #eaf3fb;
  --blue: #0756aa;
  --blue-dark: #064682;
  --display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --red: #a33122;
  --radius: 8px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f4f7f8; font-size: 1rem; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; letter-spacing: -.015em; }
a { color: var(--blue-dark); }
button, input, textarea, select { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #1689c3; outline-offset: 3px;
}
:target { scroll-margin-top: 1rem; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 4; padding: 10px; background: #fff; }
.skip:focus { top: 8px; }
.mast { background: var(--navy); color: white; border-bottom: 3px solid #0789ff; }
.mast-inner, #section-nav, .workspace { margin: 0 auto; width: min(1250px, calc(100% - 64px)); }
.mast-inner { min-height: 76px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: white; font: 700 1.65rem/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.brand b { color: #79bdff; }
.brand-mark { flex-shrink: 0; }
.mast-rule { height: 24px; width: 1px; background: #507082; }
.mast-label { color: #c8dae4; font-size: .9375rem; }
.mast-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.store-link, .quiet { color: white; font-size: .9rem; }
.store-link { text-underline-offset: 4px; }
.quiet { border: 1px solid #7995a5; background: transparent; padding: 7px 13px; border-radius: 5px; }
.nav-bar { background: #fff; border-bottom: 1px solid var(--line); }
#section-nav { display: flex; gap: 26px; overflow-x: auto; }
#section-nav a { padding: 14px 0 12px; border-bottom: 3px solid transparent; text-decoration: none; color: var(--muted); font-size: .96rem; font-weight: 600; white-space: nowrap; }
#section-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); }
.workspace { padding: 42px 0 75px; }
.page-head, .head-actions, .tools, .form-actions, .dialog-top, .pagination, .inline-group, .section-head { display: flex; align-items: center; gap: 12px; }
.page-head, .dialog-top, .pagination, .section-head { justify-content: space-between; }
.page-head { margin-bottom: 26px; }
.page-head .muted { margin-top: 7px; }
.head-actions { flex-wrap: wrap; justify-content: end; }
.muted, .field-hint, .sub, .optional { color: var(--muted); }
.sub { display: block; font-size: .84rem; margin-top: 3px; overflow-wrap: anywhere; }
.optional { font-weight: 400; font-size: .86rem; }
.login-wrap { padding: clamp(28px, 8vh, 88px) 16px; }
.login-card { max-width: 454px; margin: 0 auto; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 16px 45px #1434480c; padding: clamp(24px, 4vw, 40px); }
.login-card h1 { margin: 0 0 9px; font-size: 2.5rem; }
#login-form, .setup { margin-top: 24px; }
.setup p, .setup button { margin-top: 14px; }
code { display: block; overflow-wrap: anywhere; background: var(--pale); padding: 10px 13px; border-radius: 5px; font-size: .95rem; }
.setup code { margin-top: 12px; }
label { display: block; font-weight: 650; margin-bottom: 5px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 43px; border: 1px solid #91a4b1; border-radius: 5px; background: white; color: var(--ink); padding: 8px 11px; }
textarea { resize: vertical; min-height: 88px; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='12' fill='none' stroke='%233a5366' stroke-width='1.6'%3E%3Cpath d='m2 4 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
#login-form input { margin-bottom: 17px; }
.primary, .secondary, .danger, .small-btn { border: 1px solid transparent; border-radius: 5px; padding: 9px 15px; min-height: 42px; font-weight: 650; font-size: .9375rem; line-height: 1.4; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-dark); }
.secondary, .small-btn { color: var(--ink); background: #fff; border-color: #a7b7c1; }
.secondary:hover, .small-btn:hover { background: #eaf1f5; }
.small-btn { padding: 6px 12px; min-height: 35px; font-size: .875rem; }
.danger { color: white; background: var(--red); }
.wide { width: 100%; }
.notice, .error { padding: 10px 14px; border-radius: 5px; font-size: .9375rem; }
.notice { color: #13435b; background: #e3f1f8; border: 1px solid #bad9e8; }
.error, .notice.is-error { color: #77251e; background: #fff0ed; border: 1px solid #e2b4a9; }
#feedback { margin-bottom: 18px; }
#session-status, #dialog-error { margin-top: 20px; }
#login-error { margin: 0 0 15px; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; padding: 20px 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
.metric { padding: 0 23px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: .9rem; }
.metric strong { display: block; margin-top: 2px; font-size: 1.85rem; line-height: 1.25; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.tools { flex-wrap: wrap; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.tools .search { width: min(340px,100%); }
.tools .filter { width: auto; min-width: 145px; }
.tools .result { margin-left: auto; font-size: .875rem; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 12px 16px; }
th { font-size: .84rem; color: var(--muted); font-weight: 650; background: #f6f8fa; white-space: nowrap; }
td { border-top: 1px solid #e3e9ed; vertical-align: middle; }
.numeric { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.product-name, .order-number { font-weight: 650; overflow-wrap: anywhere; }
.product-cell { min-width: 210px; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.badge { display: inline-block; border-radius: 4px; font-size: .81rem; font-weight: 650; color: #405362; background: #e8edf0; padding: 4px 8px; white-space: nowrap; }
.badge.preview, .badge.pending, .badge.refund_pending { color: #77500b; background: #fff1cc; }
.badge.paid { color: #155831; background: #def2e5; }
.badge.fulfilled { color: #155574; background: #ddedf5; }
.badge.refunded { color: #673757; background: #f4e6f0; }
.pagination { padding: 12px 17px; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); }
.pagination button:disabled { cursor: default; }
.positive { color: #196238; font-weight: 650; }
.negative { color: #813426; font-weight: 650; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr); gap: 22px; align-items: start; }
.settings-form, .security-panel { padding: clamp(18px,3vw,30px); }
.section-head { margin-bottom: 14px; }
.field { margin-top: 15px; }
.field-hint { margin-top: 5px; font-size: .86rem; }
.field-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 23px; }
.check { display: flex; align-items: baseline; gap: 9px; font-weight: 500; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); align-self: start; margin-top: 4px; flex-shrink: 0; }
.form-actions { justify-content: end; flex-wrap: wrap; margin-top: 23px; }
.security-panel .badge { margin-bottom: 14px; }
.security-panel p { margin: 10px 0 18px; }
dialog { padding: clamp(20px, 4vw, 32px); color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; width: min(570px,calc(100% - 30px)); max-height: 88vh; max-height: 88dvh; overflow-y: auto; box-shadow: 0 22px 85px #12233130; }
dialog::backdrop { background: #0a213788; }
.dialog-top { margin-bottom: 18px; gap: 18px; }
.close { border: 1px solid var(--line); background: white; border-radius: 5px; width: 35px; height: 35px; flex-shrink: 0; display: grid; place-content: center; color: var(--ink); font-size: 1.55rem; line-height: 1; }
.summary { background: #f0f5f7; padding: 13px 15px; border-radius: 6px; }
.inventory-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.summary dl, .totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 8px 0 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.order-info { margin-top: 15px; overflow-wrap: anywhere; }
.order-info p { margin: 4px 0; }
.items { list-style: none; margin: 16px 0 12px; padding: 0; border-top: 1px solid var(--line); }
.items li { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.total { font-weight: 700; color: var(--ink); }
.order-action { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; font-weight: 650; }
.order-action .form-actions { margin-top: 12px; }
.refund summary { color: var(--red); }
.secret { font-family: "Courier New", monospace; }
.nav-count { font-size: .8rem; font-variant-numeric: tabular-nums; border-radius: 12px; padding: 2px 7px; margin-left: 2px; background: #e4edf3; color: var(--navy); }
.text-link { border: 0; background: none; padding: 0; color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; text-align: left; overflow-wrap: anywhere; }
.ticket-subject { min-width: 170px; }
.ticket-subject .text-link { font-weight: 650; }
.ticket-open { color: #155574; background: #ddedf5; }
.ticket-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--muted); }
.ticket-info { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; padding: 15px; background: var(--pale); border-radius: 6px; }
.ticket-info dd { text-align: left; overflow-wrap: anywhere; }
.related-tickets, .thread { list-style: none; padding: 0; margin: 12px 0 0; }
.related-tickets li + li, .ticket-message + .ticket-message { margin-top: 10px; }
.ticket-message { padding: 10px 14px; border-left: 3px solid var(--line); }
.ticket-message.staff { background: #f0f6f9; border-color: var(--blue); }
.ticket-message div { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.ticket-message time { color: var(--muted); font-size: .84rem; }
.ticket-message p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media(max-width: 780px) {
  .settings-grid { grid-template-columns: 1fr; }
  .mast-inner, #section-nav, .workspace { width: calc(100% - 36px); }
  .mast-label, .mast-rule { display: none; }
  .workspace { padding-top: 26px; }
  .metric { padding: 0 13px; }
}
@media(max-width: 580px) {
  .mast-inner { min-height: 60px; gap: 8px; }
  .brand { font-size: 1.25rem; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; }
  .mast-actions { gap: 10px; }
  .store-link, .quiet { font-size: .84rem; }
  .quiet { padding: 5px 9px; }
  #section-nav { gap: 16px; }
  #section-nav a { font-size: .88rem; }
  .page-head { align-items: start; flex-direction: column; gap: 12px; }
  .head-actions { justify-content: start; }
  .metrics { padding: 13px 0; }
  .metric { padding: 0 9px; }
  .metric span { font-size: .8rem; }
  .metric strong { font-size: 1.4rem; }
  .tools { padding: 12px; }
  .tools .search { width: 100%; }
  th, td { padding: 9px 10px; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
}
