/* Демо-макет «Свежо» — учёт прачечной и химчистки. Светлый минимализм. */

:root {
  --bg: #ffffff;
  --surface: #f6f8f9;
  --surface-2: #eef2f3;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e4e8ea;
  --accent: #0ea5a9;
  --accent-ink: #0b7a7d;
  --accent-weak: #e6fbfa;

  --ok-fg: #15803d;   --ok-bg: #dcfce7;
  --info-fg: #1d4ed8; --info-bg: #dbeafe;
  --warn-fg: #b45309; --warn-bg: #fef3c7;
  --danger-fg: #b91c1c; --danger-bg: #fee2e2;
  --neutral-fg: #475569; --neutral-bg: #eef2f6;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ------------------------------------------------------------------ login */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.auth__aside {
  background: linear-gradient(160deg, #0d9598 0%, #0b7a7d 55%, #075e61 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth__aside .brand__name { color: #fff; }
.auth__aside .brand__sub { color: rgba(255, 255, 255, .75); }

.auth__pitch h2 {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 650;
  margin: 0 0 16px;
  max-width: 15ch;
}
.auth__pitch p { color: rgba(255, 255, 255, .82); max-width: 42ch; margin: 0; }

.auth__points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.auth__points li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255, 255, 255, .9); }
.auth__points svg { flex: none; margin-top: 2px; }

.auth__foot { color: rgba(255, 255, 255, .6); font-size: 12px; }

.auth__main {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth__card { width: 100%; max-width: 360px; }
.auth__card h1 { font-size: 22px; margin: 0 0 4px; }
.auth__card .sub { color: var(--muted); margin: 0 0 28px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
  font-size: 13px;
}
.form-row label { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.form-row a { color: var(--accent-ink); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s ease, background .12s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--block { width: 100%; }
.btn--ghost { background: var(--bg); border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--surface); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.auth__note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 22px; }

/* ------------------------------------------------------------------ shell */

.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-weak);
  display: grid; place-items: center;
  color: var(--accent-ink);
}
.brand__name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand__sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 550;
}
.nav a svg { flex: none; }
.nav a:hover { background: var(--surface); color: var(--ink-soft); }
.nav a.is-active { background: var(--accent-weak); color: var(--accent-ink); font-weight: 650; }

.nav__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 16px 10px 6px;
}

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.user__name { font-weight: 600; font-size: 13px; }
.user__mail { font-size: 11px; color: var(--muted); }
.sidebar__foot a.logout {
  display: block; margin-top: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--muted); border-radius: var(--radius-sm);
}
.sidebar__foot a.logout:hover { background: var(--surface); color: var(--danger-fg); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar__meta { display: flex; align-items: center; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-soft); font-weight: 550;
}

.content { padding: 26px 32px 48px; }
.section { margin-bottom: 30px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section__head h2 { font-size: 15px; margin: 0; }
.section__head .hint { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__pad { padding: 18px 20px; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi__value { font-size: 24px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.01em; }
.kpi__sub { font-size: 12px; color: var(--muted); }
.kpi__sub b { color: var(--ink-soft); font-weight: 650; }
.kpi--accent { background: linear-gradient(160deg, #0d9598, #0b7a7d); border-color: transparent; color: #fff; }
.kpi--accent .kpi__label, .kpi--accent .kpi__sub { color: rgba(255,255,255,.8); }
.kpi--accent .kpi__sub b { color: #fff; }
.kpi--danger .kpi__value { color: var(--danger-fg); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

.panel__title { font-size: 14px; font-weight: 650; margin: 0 0 2px; }
.panel__sub { font-size: 12px; color: var(--muted); margin: 0 0 16px; }

/* chart: bars */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars__bar {
  width: 100%; max-width: 34px;
  background: linear-gradient(180deg, #22b8bc, #0ea5a9);
  border-radius: 6px 6px 3px 3px;
}
.bars__col:last-child .bars__bar { background: linear-gradient(180deg, #7dd3d6, #34c3c6); }
.bars__val { font-size: 11px; font-weight: 650; color: var(--ink-soft); }
.bars__lbl { font-size: 11px; color: var(--muted); }

/* chart: donut */
.donut { display: flex; align-items: center; gap: 22px; }
.donut__legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-row .lv { margin-left: auto; font-weight: 650; color: var(--ink-soft); padding-left: 18px; }

/* ------------------------------------------------------------------ table */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { font-weight: 650; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge--ok { color: var(--ok-fg); background: var(--ok-bg); }
.badge--info { color: var(--info-fg); background: var(--info-bg); }
.badge--warn { color: var(--warn-fg); background: var(--warn-bg); }
.badge--danger { color: var(--danger-fg); background: var(--danger-bg); }
.badge--neutral { color: var(--neutral-fg); background: var(--neutral-bg); }
.badge--plain::before { display: none; }

/* ------------------------------------------------------------------ warehouse */

.filterbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--muted); min-width: 300px;
}
.search input { border: none; outline: none; background: none; font-size: 13px; width: 100%; color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 13px; color: var(--muted); font-weight: 550; cursor: pointer;
}
.chip:hover { background: var(--surface); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.strip { display: flex; gap: 26px; flex-wrap: wrap; padding: 14px 20px; margin-bottom: 18px; }
.strip__item .l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.strip__item .v { font-size: 17px; font-weight: 700; margin-top: 3px; }

.orders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.order {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.order__top { display: flex; align-items: center; justify-content: space-between; }
.order__no { font-weight: 700; letter-spacing: .02em; }
.order__client { font-size: 13px; color: var(--ink-soft); }
.order__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.order__grid .l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.order__grid .v { font-size: 13px; font-weight: 600; margin-top: 1px; }
.order__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.order__foot .who { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ roles */

.userline { display: flex; align-items: center; gap: 11px; }
.userline .avatar { background: var(--accent-weak); color: var(--accent-ink); }
.userline .nm { font-weight: 600; }
.userline .ml { font-size: 12px; color: var(--muted); }

table.matrix td:not(:first-child), table.matrix th:not(:first-child) { text-align: center; }
table.matrix td:first-child { font-weight: 600; color: var(--ink-soft); }

.perm-panel { display: grid; gap: 10px; }
.perm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg);
}
.perm-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.perm-row .pt { font-weight: 600; }
.perm-row .pd { font-size: 12px; color: var(--muted); }
.perm-row.is-off { opacity: .55; }
.perm-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--bg); border-radius: var(--radius); width: 100%; max-width: 440px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__head h3 { margin: 0; font-size: 16px; }
.modal__head button { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal__body { padding: 20px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 14px; color: var(--ink);
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .orders { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__label, .sidebar__foot { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .orders, .kpis { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
