:root {
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #182c47;
  background: #f0f5fb;
  --blue: #154eaa;
  --ink: #183454;
  --muted: #4a617c;
  --line: #cbd9e8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; }
h2 { font-size: 1.15rem; line-height: 1.3; }
h3 { font-size: 1rem; }
a { color: var(--blue); }
.vacation-return { color: #17613a; }
:focus-visible { outline: 3px solid #2677cb; outline-offset: 3px; }
#title:focus { outline: none; }

.width { width: min(100% - 32px, 1100px); margin-inline: auto; }
.masthead { background: #16375e; color: white; }
.masthead-content, .headline, .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.masthead-content, .headline { justify-content: space-between; }
.masthead-content { min-height: 72px; padding-block: 12px; }
.identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.identity strong { font-size: 1.28rem; letter-spacing: .1em; }
.identity span, #actor-role { color: #d9e8fa; font-size: .875rem; }
#actor-role { display: block; }

.layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 22px; padding-block: 24px; }
nav { display: flex; flex-direction: column; gap: 5px; }
nav a { padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
nav a[aria-current="page"] { background: #d8e8fc; }
nav a:hover, .tile:hover { background: #e3effc; }
main { grid-column: 2; background: white; border: 1px solid var(--line); border-radius: 14px; min-height: 400px; padding: clamp(16px, 3.4vw, 30px); overflow-wrap: anywhere; }
main.personal-login { width: min(100% - 24px, 32rem); margin: 24px auto; }
.personal-login > p { margin-top: 20px; }
nav[hidden] + main { grid-column: 1 / -1; }
#back { display: inline-block; margin-bottom: 8px; }
#notice:not(:empty), #request-error, #sign-in, #retry-dashboard { margin-top: 12px; }
#notice:not(:empty), #request-error { border-radius: 8px; padding: 9px 12px; }
#notice:not(:empty) { color: #193f6c; background: #edf5ff; }
#request-error { color: #852c25; background: #fff1ee; }
.meta, .optional { color: var(--muted); font-size: .875rem; }
[aria-label="Состав сводки"] button[aria-pressed="true"] { background: #d8e8fc; }

section { margin-top: 20px; }
section > * + *, .card > * + * { margin-top: 14px; }
.tiles, .stack { display: grid; gap: 12px; }
#recovery-key-choice { min-width: 0; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.tile, .card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.tile { display: block; min-height: 52px; color: var(--ink); background: #f5f9fe; text-decoration: none; font-weight: 600; }
.tile small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: 6px; font-weight: 700; }
fieldset > label, #manual-field { display: block; margin-top: 12px; }
fieldset > label:first-child { margin-top: 0; }
label { font-weight: 600; }
button, input, textarea, select, .control {
  min-height: 44px;
  border: 1px solid #a0b3ca;
  border-radius: 7px;
  background: white;
  color: inherit;
  font: inherit;
  padding: 7px 11px;
}
input:not([type="checkbox"]), textarea, select { display: block; width: 100%; margin-top: 4px; }
textarea { resize: vertical; }
button, .control { display: inline-block; color: var(--blue); font-weight: 600; text-decoration: none; cursor: pointer; }
button:hover:enabled, .control:hover { background: #edf5ff; }
button:disabled { opacity: .55; cursor: default; }
.primary { color: white; background: #1859ae; border-color: #1859ae; }
.primary:hover:enabled, a.primary:hover { background: #104888; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check-row input { flex: 0 0 1.15rem; height: 1.15rem; min-height: 1.15rem; accent-color: var(--blue); }
.feed-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
#publication-period { width: auto; max-width: 100%; margin: 0; }
ol { margin: 0; padding-left: 1.6rem; }
li { padding: 4px 0 4px 3px; white-space: pre-line; }
details > * + * { margin-top: 8px; }
summary { cursor: pointer; color: var(--blue); }
main:has(#page-pilot-calendar:not([hidden])) { grid-column: 1 / -1; }
#page-pilot-calendar table { border-collapse: collapse; width: 100%; }
#page-pilot-calendar caption { text-align: left; font-weight: 650; margin-bottom: 8px; }
#page-pilot-calendar :is(th, td) { text-align: left; border-bottom: 1px solid var(--line); padding: 6px 4px; }
#page-pilot-calendar details > :is(section,article) + :is(section,article) { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

#manager-shift { background: #f5f9fe; }
#manager-shift[data-status="short"] { background: #fff6e5; border-color: #d9ae64; }
#manager-shift[data-status="covered"] { background: #eef7ef; border-color: #a4c4aa; }
#shift-metrics, .shift-operation-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); gap: 12px; }
#shift-metrics dt, .shift-operation-metrics dt { color: var(--muted); font-size: .875rem; }
#shift-metrics dd, .shift-operation-metrics dd { margin: 0; font-size: 1.2rem; font-weight: 650; }
.shift-attendance-choices, .shift-attendance-list { max-height: 22rem; overflow: auto; }
.shift-attendance-choices > label { margin: 0; }
#shift-shortage { font-weight: 600; }
#shift-roster > summary { padding-block: 10px; }
#shift-areas section { border-top: 1px solid var(--line); padding-top: 12px; }
#shift-areas ul { padding-left: 1.4rem; margin-block: 4px; }

@media (max-width: 650px) {
  .width { width: min(100% - 24px, 1100px); }
  .layout { display: block; padding-block: 12px; }
  nav { flex-direction: row; flex-wrap: wrap; margin-bottom: 10px; }
  nav a { padding-inline: 10px; }
  .layout:has(nav.manager-nav:not([hidden])) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  nav.manager-nav { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 5px 4px max(5px, env(safe-area-inset-bottom));
    background: white; border-top: 1px solid var(--line); }
  nav.manager-nav a { display: grid; place-items: center; min-height: 44px; padding: 4px 2px; text-align: center;
    font-size: clamp(.6875rem, 3.3vw, .875rem); }
  #account { width: 100%; }
  #actor-role { display: inline; margin-left: 8px; }
  main { min-height: 320px; }
}
.report-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#privacy-dialog { width: min(36rem, calc(100% - 24px)); color: var(--ink); }
#privacy-dialog::backdrop { background: rgb(24 44 71 / 45%); }
