/* ============================================================
   Vape Shop Admin — design tokens
   Палитра от логотипа: глубокий navy + белый + акцент "дымки"
   ============================================================ */
:root {
  --ink: #0A0E1A;
  --panel: #131829;
  --panel-raised: #1B2136;
  --line: #262E47;
  --fog: #8891AA;
  --paper: #EDF1FA;
  --vapor: #6EE7D8;
  --vapor-strong: #3FCFC0;
  --ember: #F5A65B;
  --rose: #F16B6B;
  --leaf: #6FCF97;

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}

::selection { background: var(--vapor); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--vapor);
  outline-offset: 2px;
}

/* ---------------------------------------------------- layout --- */

.app {
  display: flex;
  min-height: 100vh;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  color: var(--fog);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fog);
  padding: 0 10px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--fog);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--panel-raised);
  color: var(--paper);
}

.nav-link.active {
  background: var(--panel-raised);
  color: var(--vapor);
}

.nav-link .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fog);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 60px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vapor);
  margin-bottom: 4px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}

.stat-card:hover { border-color: var(--vapor-strong); }

.stat-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.stat-card-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
}

.stat-card-numbers .big { font-size: 28px; font-weight: 700; color: var(--paper); }
.stat-card-numbers .of { color: var(--fog); font-size: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
}

.badge-ok { background: rgba(111, 207, 151, 0.12); color: var(--leaf); }
.badge-low { background: rgba(245, 166, 91, 0.14); color: var(--ember); }
.badge-out { background: rgba(241, 107, 107, 0.14); color: var(--rose); }
.badge-neutral { background: rgba(136, 145, 170, 0.14); color: var(--fog); }

/* --------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--vapor);
  color: #06231F;
}
.btn-primary:hover { background: var(--vapor-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--vapor); color: var(--vapor); }

.btn-danger {
  background: transparent;
  border-color: var(--line);
  color: var(--rose);
}
.btn-danger:hover { border-color: var(--rose); background: rgba(241, 107, 107, 0.08); }

.btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* ---------------------------------------------------- tables --- */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fog);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--panel-raised); }

.thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-raised);
  border: 1px solid var(--line);
}

.thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fog);
  font-size: 16px;
}

.price {
  font-family: var(--font-mono);
  font-weight: 600;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.bulk-row:last-child { border-bottom: none; }

.bulk-row-index {
  width: 20px;
  flex-shrink: 0;
  color: var(--fog);
  font-family: var(--font-mono);
  font-size: 12px;
  padding-top: 12px;
  text-align: center;
}

.bulk-row .thumb { width: 56px; height: 56px; flex-shrink: 0; }

.bulk-row-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

.bulk-row-fields textarea {
  grid-column: 1 / -1;
  min-height: 44px;
}

@media (max-width: 600px) {
  .bulk-row-fields { grid-template-columns: 1fr; }
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ----------------------------------------------------- forms --- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--paper);
}

.field .hint {
  font-size: 12.5px;
  color: var(--fog);
  margin-top: 6px;
  line-height: 1.5;
}

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--vapor);
}

textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

.error-box {
  background: rgba(241, 107, 107, 0.1);
  border: 1px solid rgba(241, 107, 107, 0.35);
  color: var(--rose);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* -------------------------------------------------- dropzone --- */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}

.dropzone.drag-over {
  border-color: var(--vapor);
  background: rgba(110, 231, 216, 0.06);
}

.dropzone-icon { font-size: 26px; margin-bottom: 8px; }
.dropzone-text { font-size: 13.5px; color: var(--paper); font-weight: 600; }
.dropzone-hint { font-size: 12px; color: var(--fog); margin-top: 4px; }

.dropzone-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  margin-top: 14px;
  display: none;
  object-fit: cover;
}

.dropzone-preview.visible { display: inline-block; }

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

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.login-card h1 {
  font-size: 19px;
  margin-bottom: 4px;
}

.login-card .sub {
  color: var(--fog);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-card .field { text-align: left; }

.wisp {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: none;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

.wisp path {
  stroke: var(--vapor);
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  opacity: 0.55;
}

@media (prefers-reduced-motion: no-preference) {
  .wisp .strand-1 { animation: drift 14s ease-in-out infinite; }
  .wisp .strand-2 { animation: drift 18s ease-in-out infinite reverse; }
}

@keyframes drift {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.45; }
  50% { transform: translateY(14px) translateX(10px); opacity: 0.75; }
}

/* ------------------------------------------------------- misc --- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--fog);
}

.empty-state .icon { font-size: 34px; margin-bottom: 10px; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.settings-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.settings-inline input { flex: 1; min-width: 220px; }

.orders-mini { display: flex; flex-direction: column; gap: 10px; }

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.order-row:last-child { border-bottom: none; }

.order-id { font-family: var(--font-mono); color: var(--vapor); }

/* mobile ------------------------------------------------------- */

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px;
  }
  .brand { border-bottom: none; padding: 0 10px 0 0; margin-bottom: 0; border-right: 1px solid var(--line); }
  .nav-group { display: flex; gap: 4px; margin-bottom: 0; }
  .nav-label { display: none; }
  .sidebar-footer { margin-top: 0; padding-top: 0; border-top: none; padding-left: 8px; }
  .main { padding: 20px 16px 40px; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  .table-wrap tr { border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .table-wrap td { border-bottom: none; padding: 6px 0; }
  .row-actions { justify-content: flex-start; margin-top: 8px; }
}
