@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --page: #f6f3ef;
  --surface: #fffefa;
  --surface-soft: #f1eeea;
  --dark: #191918;
  --dark-soft: #282826;
  --text: #1b1a18;
  --muted: #77716b;
  --line: #e6dfd8;
  --accent: #ff4b38;
  --accent-dark: #d93929;
  --accent-soft: #fff0eb;
  --green: #3c7d4b;
  --green-soft: #eef7ef;
  --orange: #a76720;
  --orange-soft: #fff5e5;
  --blue: #356e9f;
  --blue-soft: #edf5fb;
  --red: #bc3931;
  --red-soft: #fff0ef;
  font-family: "Manrope", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--page); color: var(--text); overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(255,75,56,.25); outline-offset: 2px; }
.is-hidden { display: none !important; }
.loading-view, .login-view { min-height: 100dvh; display: grid; place-items: center; }
.loading-view { gap: 18px; align-content: center; }
.loading-view img { width: 180px; }
.loading-line { width: 178px; height: 3px; overflow: hidden; border-radius: 8px; background: var(--line); }
.loading-line::after { content: ""; display: block; width: 45%; height: 100%; background: var(--accent); animation: load 1s ease-in-out infinite alternate; }
@keyframes load { from { transform: translateX(-20%); } to { transform: translateX(150%); } }

.login-view {
  grid-template-columns: minmax(320px, 520px) minmax(340px, 450px);
  gap: 10vw;
  padding: 40px;
  background: radial-gradient(circle at 18% 14%, rgba(255,75,56,.13), transparent 26%), var(--page);
}
.login-copy img { width: 220px; margin-bottom: 42px; }
.login-copy > p { margin: 0 0 12px; color: var(--accent); font-weight: 800; }
.login-copy h1 { margin: 0 0 22px; font-size: clamp(38px, 5vw, 62px); line-height: 1.02; letter-spacing: -.06em; }
.login-copy > span { display: block; max-width: 480px; color: var(--muted); line-height: 1.7; }
.login-card { width: 100%; padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,250,.96); box-shadow: 0 24px 70px rgba(70,52,39,.12); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.login-card h2 { margin: 8px 0 28px; font-size: 28px; letter-spacing: -.04em; }
.login-card label:not(.remember) { display: grid; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-card input:not([type="checkbox"]), .search input, select, .comment-field {
  min-width: 0; height: 46px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 13px; color: var(--text);
}
.remember { display: flex; gap: 9px; align-items: center; margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.remember input { accent-color: var(--accent); }
.form-error { margin: -8px 0 16px; padding: 10px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; padding: 0 15px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: wait; transform: none; }
.button-primary { width: 100%; background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border: 1px solid var(--line); background: #fff; }
.button-dark { background: var(--dark); color: #fff; }
.button-danger { background: var(--red-soft); color: var(--red); }

.app { min-height: 100dvh; }
.topbar { height: 72px; display: flex; align-items: center; gap: 28px; padding: 0 24px; background: var(--dark); color: #fff; }
.brand { display: flex; align-items: center; gap: 17px; color: inherit; text-decoration: none; }
.brand img { width: 120px; filter: brightness(0) invert(1); }
.brand span { padding-left: 17px; border-left: 1px solid #3e3e3a; color: #b9b7b2; font-size: 13px; font-weight: 700; }
.topbar-status { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #b9b7b2; font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #63bf77; box-shadow: 0 0 0 4px rgba(99,191,119,.12); }
.live-dot.is-offline { background: #d5904b; box-shadow: 0 0 0 4px rgba(213,144,75,.14); }
.operator { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 750; }
.operator-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--dark-soft); color: var(--accent); font-size: 18px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #aaa7a2; cursor: pointer; font-size: 19px; }
.icon-button:hover { background: var(--dark-soft); color: #fff; }

.workspace { height: calc(100dvh - 72px); display: grid; grid-template-columns: 218px minmax(380px, 1fr) minmax(360px, 430px); }
.filters { padding: 24px 14px; border-right: 1px solid var(--line); background: #ece8e3; overflow: auto; }
.filters-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 16px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.filters-heading strong { min-width: 27px; padding: 4px 7px; border-radius: 20px; background: var(--dark); color: #fff; text-align: center; font-size: 11px; }
.status-filters { display: grid; gap: 4px; }
.status-filter { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 680; }
.status-filter i { font-size: 18px; color: var(--muted); }
.status-filter span:last-child { margin-left: auto; color: var(--muted); font-size: 11px; }
.status-filter:hover, .status-filter.is-active { background: var(--surface); }
.status-filter.is-active i { color: var(--accent); }
.filter-section { display: grid; gap: 8px; margin: 24px 8px 0; }
.filter-section > label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.filter-section select { width: 100%; height: 40px; font-size: 12px; }
.info-card { padding: 15px; border-radius: 10px; background: #ded9d3; color: var(--muted); }
.info-card i { color: var(--accent); font-size: 22px; }
.info-card strong { color: var(--text); font-size: 13px; }
.info-card p { margin: 0; font-size: 11px; line-height: 1.55; }

.orders-column { min-width: 0; padding: 24px; overflow: auto; }
.orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.orders-heading h1 { margin: 3px 0 0; font-size: 28px; letter-spacing: -.045em; }
.search { width: min(330px, 45%); height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); }
.search input { width: 100%; height: auto; padding: 0; border: 0; background: transparent; outline: 0; font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.summary-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,254,250,.75); }
.summary-card span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.summary-card strong { font-size: 20px; letter-spacing: -.03em; }
.order-list { display: grid; gap: 8px; padding-bottom: 25px; }
.order-card { width: 100%; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 12px; align-items: stretch; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; overflow: hidden; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.order-card:hover, .order-card.is-active { border-color: #cfc5bd; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(64,46,34,.07); }
.order-card.is-active { box-shadow: 0 0 0 2px rgba(255,75,56,.13), 0 10px 26px rgba(64,46,34,.07); }
.order-strip { background: var(--accent); }
.order-strip.status-cooking { background: #bc812b; }
.order-strip.status-ready, .order-strip.status-delivery { background: var(--green); }
.order-strip.status-completed { background: #9b9892; }
.order-strip.status-cancelled, .order-strip.status-iiko-error { background: var(--red); }
.order-main { min-width: 0; padding: 14px 0; }
.order-topline { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.order-number { font-size: 14px; font-weight: 800; }
.order-time { color: var(--muted); font-size: 11px; }
.order-main p { margin: 0 0 5px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.order-main p strong { color: var(--text); }
.order-side { min-width: 116px; display: grid; justify-items: end; align-content: center; gap: 8px; padding: 13px 14px 13px 4px; }
.order-total { font-size: 15px; font-weight: 800; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.status-cooking, .badge.status-confirmed { background: var(--orange-soft); color: var(--orange); }
.badge.status-ready, .badge.status-delivery, .badge.status-sent-to-iiko { background: var(--green-soft); color: var(--green); }
.badge.status-completed { background: var(--surface-soft); color: var(--muted); }
.badge.status-cancelled, .badge.status-iiko-error { background: var(--red-soft); color: var(--red); }
.empty-list { min-height: 320px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.empty-list i { display: block; margin-bottom: 10px; color: #bcb5ae; font-size: 38px; }

.order-detail { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; }
.detail-empty { height: 100%; display: grid; place-items: center; align-content: center; padding: 45px; color: var(--muted); text-align: center; }
.detail-empty > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--accent); font-size: 27px; }
.detail-empty h2 { margin: 16px 0 6px; color: var(--text); font-size: 19px; }
.detail-empty p { max-width: 260px; margin: 0; font-size: 12px; line-height: 1.6; }
.detail-head { padding: 23px 24px 20px; border-bottom: 1px solid var(--line); }
.detail-head-row { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.detail-head h2 { margin: 5px 0 3px; font-size: 24px; letter-spacing: -.04em; }
.detail-head p { margin: 0; color: var(--muted); font-size: 11px; }
.detail-total { font-size: 21px; font-weight: 800; white-space: nowrap; }
.detail-section { padding: 19px 24px; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.detail-row { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-top: 9px; font-size: 12px; }
.detail-row span { color: var(--muted); }
.detail-row strong { text-align: right; }
.detail-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 11px; font-size: 12px; }
.detail-item span { color: var(--muted); }
.detail-item strong { display: block; margin-bottom: 2px; }
.timeline { display: grid; gap: 11px; }
.timeline-item { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 9px; align-items: start; font-size: 11px; }
.timeline-item::before { content: ""; width: 7px; height: 7px; margin-top: 4px; border: 2px solid var(--accent); border-radius: 50%; }
.timeline-item span { color: var(--muted); }
.detail-actions { display: grid; gap: 8px; padding: 20px 24px 30px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.comment-field { width: 100%; height: 70px; padding: 10px 12px; resize: vertical; }
.terminal-field { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.terminal-field select { width: 100%; height: 42px; color: var(--text); font-size: 12px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 13px 16px; border-radius: 10px; background: var(--dark); color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.2); font-size: 12px; font-weight: 700; }
.toast.is-error { background: var(--red); }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 190px minmax(400px, 1fr); }
  .order-detail { position: fixed; z-index: 20; inset: 72px 0 0 auto; width: min(430px, 95vw); box-shadow: -18px 0 50px rgba(50,40,30,.15); }
  .order-detail:has(.detail-empty) { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .brand span, .topbar-status { display: none; }
  .operator > span:not(.operator-mark) { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace { display: block; overflow: auto; }
  .filters { display: none; }
  .orders-column { min-height: calc(100dvh - 72px); padding: 18px 14px; }
  .orders-heading { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card { padding: 10px; }
  .summary-card strong { font-size: 16px; }
  .order-side { min-width: 96px; }
  .order-detail { inset: 72px 0 0; width: 100%; }
}
