:root {
  --bg: #0b0b0c;
  --panel: #131316;
  --panel-2: #18181c;
  --line: #2a2a31;
  --text: #ece9e4;
  --muted: #9b9790;
  --accent: #e11d25;
  --ok: #2e9e6b;
  --err: #c0392b;
  --warn: #d9a441;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: #ff8d92; text-decoration: none; }
a:hover { text-decoration: underline; }

.top { display: block; padding: 10px 22px 0; background: rgba(11, 11, 12, .97); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top__brand { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.top__brand span { display: block; font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.tabs { margin-top: 10px; padding-bottom: 8px; display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.tab:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.tab.is-active { background: var(--accent); color: #fff; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 22px 80px; }
h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
h2 { margin: 0 0 14px; font-size: 17px; }
h3 { margin: 22px 0 10px; font-size: 15px; }
.muted { color: var(--muted); font-size: 12.5px; }
.back { display: inline-block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.stat strong { display: block; font-size: 22px; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.pagehead .muted { margin: 6px 0 0; }

.card { margin-bottom: 18px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.form { display: grid; gap: 12px; }
.form--compact { padding-top: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.field input, .field textarea, .field select, .search input, .inline input, .inline select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e0e11;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .search input:focus { outline: 2px solid rgba(225, 29, 37, .4); border-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #1b1b20;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: #45454f; text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #f02a32; }
.btn--ghost { background: transparent; }
.btn--danger { background: rgba(192, 57, 43, .16); border-color: rgba(192, 57, 43, .5); color: #f0a49c; }
.btn--sm { padding: 7px 11px; font-size: 12.5px; }
.iconbtn { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #1b1b20; color: var(--muted); cursor: pointer; line-height: 1; }
.iconbtn:hover { color: #ffb3b7; border-color: rgba(225, 29, 37, .5); }

.search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1 1 260px; width: auto; }
.inline { display: flex; align-items: end; gap: 8px; }
.inline input { width: auto; }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid rgba(42, 42, 49, .7); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: rgba(255, 255, 255, .02); }

.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.status--new { background: rgba(217, 164, 65, .15); color: #e7c47e; }
.status--done { background: rgba(46, 158, 107, .16); color: #9fe3c1; }
.status--cancel { background: rgba(192, 57, 43, .16); color: #f0a49c; }

.carlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.carlist li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.carlist .muted { display: block; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pager__item { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 13px; }
.pager__item.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.flash { margin: 0 0 18px; padding: 10px 14px; border-radius: 9px; font-size: 14px; }
.flash--ok { background: rgba(46, 158, 107, .14); border: 1px solid rgba(46, 158, 107, .4); color: #9fe3c1; }
.flash--error { background: rgba(192, 57, 43, .14); border: 1px solid rgba(192, 57, 43, .45); color: #f0a49c; }

.login-page { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(360px, calc(100vw - 36px)); padding: 28px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.login__brand { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px; text-align: center; }
.login__brand span { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .2em; color: var(--muted); }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.login input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #0e0e11; color: var(--text); font: inherit; }
.login .btn { width: 100%; margin-top: 14px; }
.login__hint { margin: 14px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .wrap { padding: 18px 14px 60px; }
  h1 { font-size: 22px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .pagehead { flex-direction: column; }
  .pagehead .btn { width: 100%; }
  .search .btn { flex: 1 1 auto; }
  .inline { width: 100%; }
  .inline input { flex: 1; }
  .table { font-size: 12.5px; }
  .table td, .table th { padding: 8px 6px; }
  .stat strong { font-size: 19px; }
}
