/* Washomat — общие стили сервиса поддержки: светлый фон, белые панели,
   основной текст #111827, тонкие границы, зелёный — умеренно. Системный
   шрифт как на основном сайте, без внешних шрифтов. */
:root {
  --ws-page: #f9fafb;
  --ws-surface: #ffffff;
  --ws-ink: #111827;
  --ws-muted: #6b7280;
  --ws-border: #e5e7eb;
  --ws-green: #05632a;
  --ws-green-soft: #f0f7f2;
  --ws-green-line: #cfe3d6;
  --ws-danger: #b91c1c;
  --ws-danger-soft: #fef2f2;
  --ws-focus: #05632a;
  --ws-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ws-header: 52px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ws-page); color: var(--ws-ink); font: 16px/1.5 var(--ws-font); }
a { color: var(--ws-green); }
:focus-visible { outline: 2px solid var(--ws-focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

/* --- публичные страницы ---------------------------------------------------- */
.site-header { display: flex; align-items: center; min-height: 56px; padding: 8px max(16px, env(safe-area-inset-left)); background: var(--ws-surface); border-bottom: 1px solid var(--ws-border); }
.site-logo img { display: block; height: 28px; width: auto; }
.site, .auth, .order { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 16px 120px; }
.site h1, .auth h1, .order h1 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; }
.muted, .site p { color: var(--ws-muted); }
.card { background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: 12px; padding: 12px 16px; margin-top: 12px; }
.card p { margin: 4px 0 0; }

/* --- вход сотрудника --------------------------------------------------------- */
.auth { max-width: 420px; }
.auth-form { display: grid; gap: 8px; padding: 16px; background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: 12px; }
.auth-form label { font-size: 14px; color: var(--ws-muted); }
.auth-form input[type=email], .auth-form input[type=password], .order input, .order select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ws-border); border-radius: 8px;
  background: var(--ws-surface); color: var(--ws-ink); font: inherit; font-size: 16px;
}
.button-primary { min-height: 44px; margin-top: 8px; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--ws-ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 8px; background: var(--ws-danger-soft); color: var(--ws-danger); }

/* --- учебная форма заказа ---------------------------------------------------- */
.order form { display: grid; gap: 10px; padding: 16px; background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: 12px; }
.order label { font-size: 14px; color: var(--ws-muted); }
.order .check { display: flex; gap: 8px; align-items: flex-start; color: var(--ws-ink); }
.order .check input { width: 20px; min-height: 20px; margin-top: 2px; }
.order .pay { min-height: 48px; border: 0; border-radius: 8px; background: var(--ws-ink); color: #fff; font: inherit; font-weight: 600; }
.order .help { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--ws-border); border-radius: 8px; background: var(--ws-surface); color: var(--ws-ink); font: inherit; }

/* --- кабинет: шапка и бургер-меню ------------------------------------------- */
.agent-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.agent-header {
  position: sticky; top: 0; z-index: 30; flex: 0 0 var(--ws-header);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--ws-header); padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--ws-surface); border-bottom: 1px solid var(--ws-border);
}
.agent-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ws-ink); font-weight: 600; text-decoration: none; }
.agent-brand img { flex: 0 0 auto; width: 28px; height: auto; }
.agent-menu { position: relative; }
.agent-menu-button {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--ws-border); border-radius: 10px; background: var(--ws-surface); color: var(--ws-ink); cursor: pointer;
}
.agent-menu-button[aria-expanded="true"] { background: var(--ws-page); }
/* Выпадающая панель поверх содержимого: ничего не сдвигает и не шире экрана. */
.agent-menu-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  width: 260px; max-width: calc(100vw - 24px);
  padding: 6px; background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .12);
}
.agent-menu-panel[hidden] { display: none; }
@media (max-height: 480px) {
  :root { --ws-header: 44px; }
  .agent-menu-button { width: 40px; height: 40px; }
}
.agent-menu-user { margin: 4px 8px 6px; color: var(--ws-muted); font-size: 13px; overflow-wrap: anywhere; }
.agent-menu-form { margin: 0; }
.agent-menu-item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ws-ink); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer;
}
.agent-menu-item:hover { background: var(--ws-page); }
.agent-menu-signout { color: var(--ws-danger); }
.agent-flash { margin: 8px 12px 0; padding: 8px 12px; border: 1px solid var(--ws-green-line); border-radius: 8px; background: var(--ws-green-soft); color: var(--ws-ink); }

/* --- кабинет: уведомления ----------------------------------------------------- */
.agent-page { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; }
.agent-page h1 { margin: 0 0 8px; font-size: 22px; }
.agent-page .panel { padding: 16px; background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: 12px; margin-top: 12px; }
.agent-page .button, .agent-page button {
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--ws-border); border-radius: 8px;
  background: var(--ws-surface); color: var(--ws-ink); font: inherit; cursor: pointer;
}
.agent-page .button-primary { border-color: var(--ws-ink); background: var(--ws-ink); color: #fff; }
.agent-page .status { margin: 8px 0; color: var(--ws-muted); }
.agent-page .status[data-state="error"] { color: var(--ws-danger); }
/* Причина, по которой push не включить: ошибка — красным, запрет —
   предупреждением, инструкция для Safari на iPhone — спокойной панелью. */
.agent-page .push-reason { margin: 8px 0; }
.agent-page .push-reason[hidden] { display: none; }
.agent-page .push-reason[data-kind="error"] { color: var(--ws-danger); }
.agent-page .push-reason[data-kind="warning"] { color: #92400e; }
.agent-page .push-reason[data-kind="info"] { padding: 12px 14px; border: 1px solid var(--ws-green-line); border-radius: 10px; background: var(--ws-green-soft); color: var(--ws-ink); }
.agent-page .push-reason[data-kind="info"] p { margin: 0 0 6px; }
.agent-page .push-reason[data-kind="info"] ol { margin: 0 0 6px; padding-left: 20px; color: var(--ws-ink); }
.agent-page ul { padding-left: 18px; color: var(--ws-muted); }
