:root {
  color-scheme: light;
  --ink: #171d37;
  --muted: #59617a;
  --line: #e5e5ed;
  --bg: #f5f5fa;
  --white: #fff;
  --accent: #9d1657;
  --orange: #ff922b;
  --magenta: #db1b68;
  --accent-bg: #f8e9f1;
  --shadow: 0 16px 46px #22244d0d;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #f6712b; outline-offset: 3px; }
.header { background: #171c36; color: white; }
.top, main { width: min(1190px, calc(100% - 48px)); margin-inline: auto; }
.top { display: flex; align-items: center; min-height: 76px; gap: 38px; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; color: white; font-weight: 720; line-height: 1.15; }
.brand small { display: block; font-size: .75rem; letter-spacing: .14em; color: #e4d9e8; margin-top: 5px; }
.brand-mark { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 15px 15px 15px 5px; color: #23152d; font-size: 1.28rem; font-weight: 850; background: linear-gradient(145deg,#ffa543 18%,#fc6f4a 55%,#f761a7); }
.top nav { display: flex; align-self: stretch; gap: 26px; }
.nav, .logout { border: 0; background: transparent; color: #eee8f5; font-weight: 630; padding-inline: 5px; }
.nav { position: relative; }
.nav.active { color: white; }
.nav.active::after { content: ""; height: 3px; border-radius: 3px; position: absolute; inset: auto 0 0; background: linear-gradient(90deg,#ff9b35,#fa5b9e); }
.logout { margin-left: auto; }
main { padding-block: 36px 64px; }
.queue-strip, .login-cover { isolation: isolate; overflow: hidden; position: relative; background: #1b2041; color: white; }
.shift-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 0 2px 18px; }
.shift-heading h1 { font-size: clamp(1.65rem,3vw,2.1rem); line-height: 1.16; letter-spacing: -.045em; font-weight: 780; }
.shift-heading p { margin-top: 4px; font-size: .9rem; }
.queue-strip { border-radius: 16px; padding: 14px 19px; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); margin-bottom: 18px; }
.ribbon { position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 82% -20%,#ffb03d 0,transparent 58%), radial-gradient(ellipse at 100% 30%,#e7437d 0,transparent 61%), radial-gradient(ellipse at 69% 105%,#90276b 0,transparent 72%), linear-gradient(119deg,#181d3b 24%,#352148 61%,#973762); }
.queue-info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: .88rem; }
#telephony { color: #fff3f5; }
.state { border-radius: 40px; background: #ffffff22; color: #fff; padding: 4px 11px; }
.shift-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.queue-count { display: flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 12px; white-space: nowrap; background: #221732a8; border: 1px solid #ffffff32; }
.queue-count strong { font-size: 1.2rem; line-height: 1; }
.queue-count span { color: #fff1ea; font-size: .85rem; }
.sim-panel { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: .88rem; }
.sim-panel .button { min-height: 36px; padding: 6px 11px; font-size: .85rem; }
.desk { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.08fr); gap: 18px; align-items: start; }
.card { background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 25px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
h2 { font-size: 1.19rem; letter-spacing: -.025em; }
h3 { font-size: 1.32rem; line-height: 1.2; letter-spacing: -.025em; }
.muted, dt, .empty p { color: var(--muted); }
.empty { padding: 30px 12px 42px; display: grid; justify-items: center; text-align: center; gap: 10px; }
.empty p { max-width: 280px; }
.phone-symbol { width: 55px; height: 55px; border-radius: 17px; display: grid; place-items: center; font-size: 1.55rem; background: #f9eaf4; color: #a02267; }
.tag { display: inline-flex; background: var(--accent-bg); border-radius: 99px; color: #85154f; font-size: .86rem; font-weight: 700; padding: 4px 10px; }
.facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.facts div { min-width: 0; padding: 12px 14px; background: #fafaff; }
.facts .full { grid-column: 1 / -1; }
dt { font-size: .88rem; }
dd { margin: 3px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.button { border: 1px solid transparent; border-radius: 12px; min-height: 44px; padding: 9px 16px; font-weight: 720; }
.primary { color: white; background: linear-gradient(112deg,#9f3305,#a21459 75%); }
.primary:hover { background: linear-gradient(112deg,#8c2905,#89114c 75%); }
.secondary { background: white; border-color: var(--line); color: var(--ink); }
.soft { background: var(--accent-bg); color: #84204f; }
.shift-button { display: inline-flex; gap: 8px; align-items: center; background: var(--control-bg); color: var(--control-ink); border-color: var(--control-border); transition: background .18s ease, box-shadow .18s ease; }
.shift-button:hover { background: var(--control-border); box-shadow: 0 4px 12px #28293b14; }
.shift-button.play { --control-bg: #e7f6ec; --control-ink: #195f38; --control-border: #bfe7ce; }
.shift-button.pause { --control-bg: #fff4d8; --control-ink: #74500a; --control-border: #f3dd9f; }
.shift-button.stop { --control-bg: #fcebee; --control-ink: #942d41; --control-border: #f3c5ce; }
.shift-icon { width: 14px; height: 14px; flex: 0 0 14px; position: relative; display: inline-grid; place-items: center; }
.shift-icon::before { content: ""; display: block; }
.play .shift-icon::before { border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.pause .shift-icon::before { width: 9px; height: 12px; border-inline: 3px solid currentColor; }
.stop .shift-icon::before { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.wide { width: 100%; }
.text-button { border: 0; padding: 4px 0; background: none; color: #8b184e; text-decoration: underline; text-underline-offset: 3px; font-weight: 650; text-align: left; }
form { display: grid; gap: 9px; }
form label { font-size: .9rem; font-weight: 670; }
input:not([type=checkbox]), textarea, select { width: 100%; min-width: 0; border: 1px solid #c8c8d8; border-radius: 10px; padding: 10px 12px; background: white; color: var(--ink); }
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,#59506b 50%),linear-gradient(135deg,#59506b 50%,transparent 50%); background-position: calc(100% - 16px) 50%,calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
form .button { margin-top: 6px; }
fieldset { margin: 0; padding: 13px; border-radius: 12px; border: 1px solid var(--line); }
legend { padding-inline: 5px; font-weight: 660; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-grid label { display: block; margin-bottom: 3px; }
.form-grid .full { grid-column: 1 / -1; }
#appointment { display: grid; gap: 11px; }
.prefilled { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(126px,100%),1fr)); gap: 8px; margin: 0 0 12px; }
.prefilled div { padding: 7px 9px; border-radius: 9px; background: #f6f5fb; }
.prefilled dd { font-size: .88rem; }
#save-hint { font-size: .88rem; }
#save-result:disabled { cursor: default; }
.message { color: #8b184e; font-weight: 640; margin-top: 13px; font-size: .91rem; }
.message:empty { display: none; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 510px; max-width: 950px; margin: 30px auto; border-radius: 25px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.login-cover { display: grid; align-items: end; padding: clamp(30px,5vw,55px); }
.login-cover .ribbon { transform: scale(1.05); }
.cover-copy p { font-size: .86rem; letter-spacing: .15em; font-weight: 730; }
.cover-copy h1 { font-size: clamp(4rem,8vw,7.4rem); letter-spacing: -.085em; line-height: .89; margin-top: 16px; }
.cover-copy h1 span { color: #ffab58; }
.login-panel { padding: clamp(28px,5vw,54px); display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.login-panel h2 { font-size: 2rem; letter-spacing: -.045em; }
.login-panel form { margin-top: 9px; }
.check { display: flex; gap: 8px; align-items: center; margin-block: 6px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.mode-label { color: #8b184e; font-weight: 720; font-size: .87rem; }
.startup { text-align: center; color: var(--muted); margin-top: 32px; }
.stats-header { margin-bottom: 20px; }
.stats-header h1 { font-size: clamp(2rem,4vw,3rem); letter-spacing: -.06em; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; margin-bottom: 18px; }
.metric strong { display: block; font-size: 2.45rem; line-height: 1; margin-top: 10px; letter-spacing: -.045em; }
.metric span { color: var(--muted); }
.chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); align-items: end; gap: 9px; margin-top: 20px; }
.chart-day { display: grid; gap: 5px; justify-items: center; font-size: .85rem; min-width: 0; }
.chart-day meter { width: 100%; accent-color: #b72867; }
@media (max-width: 730px) {
  .top, main { width: calc(100% - 24px); }
  .top { gap: 14px; flex-wrap: wrap; padding-top: 13px; }
  .top nav { order: 3; width: 100%; min-height: 45px; }
  main { padding-top: 18px; }
  .shift-heading { padding-bottom: 13px; }
  .queue-strip { padding: 11px 12px; }
  .desk, .login-layout { grid-template-columns: 1fr; }
  .login-layout { margin: 8px auto; }
  .login-cover { min-height: 185px; }
  .cover-copy h1 br { display: none; }
  .cover-copy h1 { font-size: clamp(2.4rem,9vw,4rem); }
  .metrics { grid-template-columns: 1fr 1fr; }
  .card { padding: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ribbon { transform-origin: 75% 30%; animation: gradient-drift 16s ease-in-out infinite alternate; }
  #record:not([hidden]), #result-form:not([hidden]), #statistics:not([hidden]) { animation: fade-in .25s ease both; }
}
@keyframes gradient-drift {
  from { transform: scale(1.02); }
  to { transform: scale(1.10) translateX(-1%); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
