/* ЛК Логиста — оформление.
   Цвета блоков намеренно повторяют исходный Excel: логисты уже привыкли,
   что числа — красный блок, водители — жёлтый, проблемы — зелёный. */

:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1b2733;
  --muted: #64748b;
  --line: #dde3ea;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;

  --red-bg: #fdece8;
  --red-line: #e6b8af;
  --red-ink: #8c3a26;

  --yellow-bg: #fff8e1;
  --yellow-line: #f0d68a;
  --yellow-ink: #7a5c10;

  --green-bg: #e9f7ee;
  --green-line: #a8d8ba;
  --green-ink: #1e6b3a;

  --ok: #15803d;
  --err: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

/* ------------------------------------------------------------------ шапка */

.topbar { background: #16232f; color: #fff; }
.topbar__in {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; min-height: 56px;
}
.brand { color: #fff; font-weight: 600; letter-spacing: .2px; }
.brand:hover { text-decoration: none; opacity: .85; }
.nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.nav a { color: #c8d4e0; font-size: 14px; }
.nav a:hover { color: #fff; text-decoration: none; }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user__name { color: #c8d4e0; }
.user__pwd { color: #c8d4e0; }

/* ---------------------------------------------------------------- типовые */

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; margin-bottom: 20px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 7px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 500;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn--ghost { background: transparent; border-color: #4a5a6a; color: #dce4ec; }
.btn--ghost:hover { background: #24384a; }
.btn--light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--light:hover { background: #f1f5f9; }
.btn--sm { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(37, 99, 235, .35); outline-offset: -1px; border-color: var(--accent);
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.flashes { margin-bottom: 18px; }
.flash { padding: 11px 14px; border-radius: 7px; margin-bottom: 8px; font-size: 14px; }
.flash--success { background: #e7f6ec; color: var(--ok); border: 1px solid #b6e0c4; }
.flash--error { background: #fdeaea; color: var(--err); border: 1px solid #f2bcbc; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; background: #eef2f6; color: var(--muted);
}
.badge--ok { background: #dcfce7; color: var(--ok); }
.badge--warn { background: #fef3c7; color: #92400e; }
.badge--err { background: #fee2e2; color: var(--err); }

/* ------------------------------------------------------------------- вход */

.auth { max-width: 380px; margin: 10vh auto; }
.auth h1 { text-align: center; margin-bottom: 24px; }
.auth .field { margin-bottom: 14px; }
.auth .btn { width: 100%; margin-top: 8px; }
.auth__err {
  background: #fdeaea; color: var(--err); border: 1px solid #f2bcbc;
  padding: 10px 12px; border-radius: 7px; margin-bottom: 14px; font-size: 14px;
}

/* ------------------------------------------------------- кнопки проектов */

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 22px; color: var(--ink);
  border-left: 4px solid var(--accent);
}
.project-card:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(20,35,50,.09); }
.project-card--done { border-left-color: var(--ok); }
.project-card__name { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.project-card__links { margin-top: 14px; font-size: 13px; display: flex; gap: 14px; }

/* -------------------------------------------------------- блоки формы */

.block { border-radius: 10px; padding: 20px; margin-bottom: 20px; border: 1px solid; }
.block__title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.block__hint { font-size: 13px; margin: 0 0 16px; opacity: .8; }

.block--red { background: var(--red-bg); border-color: var(--red-line); }
.block--red .block__title { color: var(--red-ink); }
.block--yellow { background: var(--yellow-bg); border-color: var(--yellow-line); }
.block--yellow .block__title { color: var(--yellow-ink); }
.block--green { background: var(--green-bg); border-color: var(--green-line); }
.block--green .block__title { color: var(--green-ink); }

.grid-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.metric label { color: #5b4038; font-weight: 500; }
.metric input { background: #fff; }

.driver-row {
  display: grid; grid-template-columns: 1fr 190px; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--yellow-line);
}
.driver-row:last-child { border-bottom: 0; }
.hr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.hr-auto { font-size: 12px; color: var(--yellow-ink); margin-top: 3px; }

.issue-row { display: flex; gap: 10px; margin-bottom: 10px; }
.issue-row input { flex: 1; }

.sticky-actions {
  position: sticky; bottom: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: 0 -2px 12px rgba(20,35,50,.07);
}
.sticky-actions .spacer { flex: 1; }

.locked {
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px;
}

/* --------------------------------------------------------------- дашборд */

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.kpi__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi__value { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

.period-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.period-bar a {
  padding: 7px 15px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px;
}
.period-bar a:hover { text-decoration: none; background: #f1f5f9; }
.period-bar a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.issue-card {
  border-left: 3px solid var(--green-line); background: var(--panel);
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
}
.issue-card--new { border-left-color: #f59e0b; }
.issue-card__meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.issue-card__actions { margin-top: 10px; display: flex; gap: 8px; }

.pwd-box {
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 18px;
}
.pwd-box code {
  font-size: 18px; font-weight: 600; letter-spacing: 1px;
  background: #fff; padding: 3px 10px; border-radius: 5px; border: 1px solid #fcd34d;
}

.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
.row-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-form > div { flex: 1; min-width: 160px; }

@media (max-width: 700px) {
  .topbar__in { flex-wrap: wrap; padding-bottom: 10px; }
  .driver-row { grid-template-columns: 1fr; }
}
