:root {
  color-scheme: light;
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  color: #172d4c;
  background: #f3f6fb;
  line-height: 1.7;
  --muted: #54657b;
  --line: #d8e2ef;
  --blue: #234977;
}

* { box-sizing: border-box; }
body { margin: 0; }

.masthead { background: #132842; color: #fff; }
.masthead-inner {
  max-width: 960px;
  min-height: 76px;
  margin-inline: auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand, .session, .actions { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; letter-spacing: .17em; line-height: 1.2; }
.brand small { display: block; color: #d1deef; font-size: .8rem; }
.brand-mark { display: flex; align-items: end; gap: 3px; direction: ltr; }
.brand-mark i { background: #83bf73; width: 5px; height: 15px; border-radius: 2px; }
.brand-mark i:nth-child(2) { height: 22px; background: #9bbde7; }
.brand-mark i:nth-child(3) { height: 30px; background: #fff; }
.session bdi { max-width: 25vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-layout { width: min(100% - 32px, 912px); margin: 30px auto 52px; }
.login-layout { width: min(100% - 32px, 420px); margin: clamp(32px, 12vh, 100px) auto; }
.heading { margin-block-end: 20px; }
h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.35; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 14px; }
.heading p, .hint, label small { color: var(--muted); }
.heading p, .hint { margin: 0; }
.hint, label small { font-size: .86rem; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 25px);
  box-shadow: 0 4px 12px rgb(19 40 66 / 3%);
}

.login-panel h1 { margin-block-end: 20px; }
.stack { display: grid; gap: 16px; }
.field-grid, .quota-grid { display: grid; gap: 14px; }
.field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block-start: 16px; }
.quota-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block-end: 10px; }
label { display: grid; gap: 6px; font-weight: 600; min-width: 0; }
label small { font-weight: 400; }

input, button { font: inherit; }
input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #9fadc0;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font-weight: 400;
}

input[name="instanceId"], input[name="override-company"] { font-family: Consolas, monospace; font-size: .9rem; }
button, summary { cursor: pointer; }
button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
}
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #132842; }
.secondary { background: #fff; color: var(--blue); border-color: #a5b5c9; }
.secondary:hover:enabled { background: #edf3fa; }
.logout { background: transparent; color: #fff; border-color: #8395af; }
.logout:hover:enabled { background: #234977; }
:focus-visible { outline: 3px solid #34744a; outline-offset: 3px; }
.logout:focus-visible { outline-color: #b2eca3; }

.notice {
  background: #fff3ed;
  color: #832f17;
  border: 1px solid #efc5b4;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
}
.company-overrides { margin-block-start: 17px; padding-block-start: 13px; border-top: 1px solid var(--line); }
.company-overrides summary { color: var(--blue); font-weight: 700; }
.company-overrides > button { margin-block-start: 12px; }
.override {
  min-width: 0;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9fd;
}
.override > label { margin-block-end: 10px; }
.remove-override { font-size: .83rem; }
.actions span { color: var(--muted); font-family: Consolas, monospace; font-size: .85rem; }

@media (max-width: 620px) {
  .masthead-inner { min-height: 66px; padding-inline: 16px; }
  .quota-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; gap: 4px; }
  .actions span { align-self: center; }
}
