/* Дизайн в стиле stingerpro.ru — тёмная тема, синий акцент */

:root {
  --bg-dark:    #0b1a2b;
  --bg-navy:    #0e2a44;
  --bg-blue:    #1d4e7c;
  --bg-card:    rgba(255,255,255,0.04);
  --bg-card-h:  rgba(255,255,255,0.07);
  --bg-input:   rgba(255,255,255,0.06);
  --fg:         #e6edf3;
  --fg-mut:     #7d96b0;
  --fg-dim:     #4d6680;
  --accent:     #3a7eb0;
  --accent-2:   #5fa3d4;
  --accent-3:   #a8c8e8;
  --pos:        #3fb950;
  --pos-bg:     rgba(63,185,80,0.12);
  --neg:        #f85149;
  --neg-bg:     rgba(248,81,73,0.10);
  --warn:       #d29922;
  --warn-bg:    rgba(210,153,34,0.10);
  --bord:       rgba(255,255,255,0.08);
  --bord-2:     rgba(255,255,255,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(145deg, var(--bg-dark) 0%, var(--bg-navy) 50%, #0a2238 100%);
  background-attachment: fixed;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }

input, button, select, textarea { font: inherit; outline: none; }

/* ═══════════════════════════════════════════════════════════════════
   LOGIN — center layout
   ═══════════════════════════════════════════════════════════════════ */

.center {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}

.card.narrow {
  max-width: 420px; width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 38px 36px 32px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.card.narrow::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.card.narrow .brand-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 26px; justify-content: center;
}
.card.narrow .brand-row .logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--bg-blue));
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 14px;
  box-shadow: 0 4px 14px rgba(0,60,130,0.4);
}
.card.narrow .brand-row .name {
  font-size: 19px; font-weight: 700;
}
.card.narrow .brand-sub {
  font-size: 11.5px; color: var(--fg-dim);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 2px;
}
.card.narrow h1 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px; text-align: center;
}
.card.narrow .login-hint {
  text-align: center; color: var(--fg-mut);
  font-size: 13px; margin-bottom: 26px;
}
.card.narrow form { display: flex; flex-direction: column; gap: 14px; }
.card.narrow .field { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════
   HEADER (вверху страницы для авторизованных)
   ═══════════════════════════════════════════════════════════════════ */

.header {
  border-bottom: 1px solid var(--bord);
  padding: 18px 28px;
  background: rgba(11, 26, 43, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header .row {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
}
.header .brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.header .brand:hover { color: var(--accent-2); }
.header .brand .logo-mini {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--bg-blue));
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 12px;
  box-shadow: 0 3px 10px rgba(0,60,130,0.35);
}
.header .brand .sub {
  color: var(--fg-mut);
  font-weight: 400;
  font-size: 12px;
  margin-left: 14px;
}
.header .brand .brand-line2 {
  font-size: 11px;
  color: var(--fg-mut);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.nav-staff {
  display: flex; gap: 4px;
  flex-wrap: wrap;
}
.nav-staff a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mut);
}
.nav-staff a:hover { background: var(--bg-card); color: #fff; }
.nav-staff a.active {
  background: var(--bg-card);
  color: var(--accent-2);
  border: 1px solid var(--bord);
}
.header .who { font-size: 13px; color: var(--fg-mut); }
.header .who strong { color: var(--fg); }

/* ═══════════════════════════════════════════════════════════════════
   CONTAINER + page-title
   ═══════════════════════════════════════════════════════════════════ */

.container {
  max-width: 1200px; margin: 0 auto;
  padding: 28px;
}

.page-title {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 22px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════ */

.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-mut);
}
.field input, .field textarea, .field select {
  background: var(--bg-input);
  border: 1px solid var(--bord);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--fg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--fg-dim); }
.field input:hover, .field textarea:hover, .field select:hover {
  border-color: var(--bord-2);
  background: rgba(255,255,255,0.08);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  background: rgba(58,126,176,0.05);
  box-shadow: 0 0 0 3px rgba(58,126,176,0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  background: linear-gradient(135deg, var(--accent), var(--bg-blue));
  color: #fff;
  border: none;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(58,126,176,0.3);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(58,126,176,0.45); }
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.45; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
}

.btn.secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--bord-2);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--bg-card-h);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(58,126,176,0.15);
}

.btn.success {
  background: linear-gradient(135deg, #2da043, #1f7a32);
  box-shadow: 0 4px 14px rgba(63,185,80,0.3);
}
.btn.success:hover { box-shadow: 0 8px 22px rgba(63,185,80,0.45); }

.btn.danger {
  background: linear-gradient(135deg, #d83a3a, #a92121);
  box-shadow: 0 4px 14px rgba(248,81,73,0.3);
}
.btn.danger:hover { box-shadow: 0 8px 22px rgba(248,81,73,0.45); }

.btn.sm {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: none;
}
.btn.sm:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(58,126,176,0.25); }
.btn.secondary.sm { box-shadow: none; }

/* ═══════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════ */

.alert {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert.error    { background: var(--neg-bg);  border: 1px solid rgba(248,81,73,0.30); color: var(--neg); }
.alert.success  { background: var(--pos-bg);  border: 1px solid rgba(63,185,80,0.30); color: var(--pos); }
.alert.warn     { background: var(--warn-bg); border: 1px solid rgba(210,153,34,0.30); color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════ */

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--bord);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
table.data th {
  background: rgba(0,0,0,0.2);
  color: var(--fg-mut);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bord);
}
table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bord);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: rgba(255,255,255,0.025); }
table.data tfoot td {
  border-top: 1px solid var(--bord-2);
  border-bottom: none;
  background: rgba(0,0,0,0.15);
  font-weight: 600;
}
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--accent-3);
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.draft     { background: var(--warn-bg); color: var(--warn); }
.badge.confirmed { background: var(--pos-bg); color: var(--pos); }
.badge.cancelled { background: rgba(125,150,176,0.15); color: var(--fg-mut); }

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--fg-mut);
  background: var(--bg-card);
  border: 1px dashed var(--bord-2);
  border-radius: 12px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   SEARCH BOX (форма поиска по артикулу)
   ═══════════════════════════════════════════════════════════════════ */

.search-box {
  background: var(--bg-card);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 22px;
}
.search-box h3 {
  font-size: 12px;
  margin-bottom: 14px;
  color: var(--fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

#product-info {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--bord);
  display: none;
  font-size: 13.5px;
}
#product-info.visible { display: block; }
#product-info.found {
  background: var(--pos-bg);
  border-color: rgba(63,185,80,0.30);
  color: var(--fg);
}
#product-info.found .name { color: var(--pos); font-weight: 600; }
#product-info.error {
  background: var(--neg-bg);
  border-color: rgba(248,81,73,0.30);
  color: var(--neg);
}
#product-info .name { font-weight: 600; }
#product-info .meta {
  font-size: 12px;
  color: var(--fg-mut);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   ROW + helpers
   ═══════════════════════════════════════════════════════════════════ */

.row {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
}
.row .grow { flex: 1; min-width: 220px; }

form.inline { display: inline; }

/* Heading на странице */
h3.section-h {
  margin: 22px 0 12px;
  font-size: 12px;
  color: var(--fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   METRICS GRID (admin dashboard)
   ═══════════════════════════════════════════════════════════════════ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 1180px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .metrics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .metrics-grid { grid-template-columns: 1fr; } }

.metric {
  position: relative;
  background:
    linear-gradient(135deg, rgba(58,126,176,0.06) 0%, rgba(255,255,255,0.02) 100%),
    var(--bg-card);
  border: 1px solid var(--bord);
  border-radius: 14px;
  padding: 14px 18px 14px;
  overflow: hidden;
  transition: all 0.25s ease;
  text-align: center;
}
.metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.85;
  transition: opacity 0.25s;
}
.metric::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(58,126,176,0.18) 0%, transparent 65%);
  pointer-events: none;
  transition: transform 0.35s ease;
}
.metric:hover {
  border-color: var(--bord-2);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(58,126,176,0.2);
}
.metric:hover::after { transform: scale(1.15); }
.metric:hover .metric-icon { transform: scale(1.08) rotate(-4deg); }

.metric-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.metric-icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(58,126,176,0.22), rgba(58,126,176,0.08));
  border: 1px solid rgba(58,126,176,0.30);
  border-radius: 9px;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.metric .l {
  font-size: 10.5px;
  color: var(--fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  line-height: 1.3;
}
.metric .v {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.metric .sub {
  font-size: 11.5px;
  color: var(--fg-dim);
  letter-spacing: 0.01em;
  margin-top: 2px;
}

/* Цветовые варианты */
.metric.metric-success::before { background: linear-gradient(90deg, #2da043, var(--pos)); }
.metric.metric-success { background: linear-gradient(135deg, rgba(63,185,80,0.07) 0%, rgba(255,255,255,0.02) 100%), var(--bg-card); }
.metric.metric-success::after { background: radial-gradient(circle, rgba(63,185,80,0.20) 0%, transparent 65%); }
.metric.metric-success .metric-icon {
  background: linear-gradient(135deg, rgba(63,185,80,0.24), rgba(63,185,80,0.08));
  border-color: rgba(63,185,80,0.34);
  color: var(--pos);
}
.metric.metric-success .v {
  background: linear-gradient(135deg, #fff 0%, #8be09c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric.metric-info::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.metric.metric-info { background: linear-gradient(135deg, rgba(95,163,212,0.08) 0%, rgba(255,255,255,0.02) 100%), var(--bg-card); }
.metric.metric-info::after { background: radial-gradient(circle, rgba(95,163,212,0.22) 0%, transparent 65%); }
.metric.metric-info .metric-icon {
  background: linear-gradient(135deg, rgba(95,163,212,0.26), rgba(95,163,212,0.08));
  border-color: rgba(95,163,212,0.36);
  color: var(--accent-2);
}
.metric.metric-info .v {
  background: linear-gradient(135deg, #fff 0%, #a8c8e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric.metric-warn::before { background: linear-gradient(90deg, #b07300, var(--warn)); }
.metric.metric-warn { background: linear-gradient(135deg, rgba(210,153,34,0.07) 0%, rgba(255,255,255,0.02) 100%), var(--bg-card); }
.metric.metric-warn::after { background: radial-gradient(circle, rgba(210,153,34,0.22) 0%, transparent 65%); }
.metric.metric-warn .metric-icon {
  background: linear-gradient(135deg, rgba(210,153,34,0.22), rgba(210,153,34,0.08));
  border-color: rgba(210,153,34,0.34);
  color: var(--warn);
}

/* ═══════════════════════════════════════════════════════════════════
   NOTE block (заметка магазина)
   ═══════════════════════════════════════════════════════════════════ */

.note-block {
  position: relative;
  background:
    linear-gradient(135deg, rgba(210,153,34,0.08) 0%, rgba(255,255,255,0.02) 100%),
    var(--bg-card);
  border: 1px solid rgba(210,153,34,0.25);
  border-left: 3px solid var(--warn);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0 4px;
}
.note-block .note-head {
  font-size: 11px;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 8px;
}
.note-block .note-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════
   ITEMS-TABLE улучшения
   ═══════════════════════════════════════════════════════════════════ */

table.data.items-table tbody tr td:nth-child(2) { color: var(--fg); }
table.data.items-table tbody tr:hover td { background: rgba(58,126,176,0.05); }

.qty-pill {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 11px;
  background: rgba(95,163,212,0.14);
  border: 1px solid rgba(95,163,212,0.30);
  color: var(--accent-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════════════════
   FILTERS / details summary как кнопка
   ═══════════════════════════════════════════════════════════════════ */

.filters.card { padding: 16px 20px; }

details {
  position: relative;
  display: inline-block;
}
details summary {
  list-style: none;
  display: inline-block;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details[open] summary { background: var(--accent); color: #fff; }
details[open] form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-card-h);
  border: 1px solid var(--bord-2);
  border-radius: 8px;
  position: absolute;
  z-index: 5;
  min-width: 240px;
  right: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
details[open] form input { width: 100%; }
details[open] + form, details[open] ~ form { z-index: 5; }

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */

.footer {
  text-align: center;
  padding: 40px 20px 30px;
  color: var(--fg-dim);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .header .row { flex-direction: column; align-items: flex-start; }
  .container { padding: 20px 16px; }
  .page-title { font-size: 20px; }
  .row { gap: 10px; }
  .row .grow { min-width: 100%; }
  table.data { font-size: 12px; }
  table.data th, table.data td { padding: 10px 12px; }
}
