/**
 * GOS Design System — Design Tokens
 *
 * All design variables + local font-face declarations.
 * No external imports. Fonts must be placed in fonts/ folder — see fonts/README.md.
 *
 * Include this file FIRST, before components.css.
 */

/* ═══════════════════════════════════════════════════════════════════
   FONTS — все локальные, без Google Fonts / CDN
   ═══════════════════════════════════════════════════════════════════ */

/* Druk Text Wide Cyr — заголовки + логотип
   Поддерживается .woff2 / .woff / .otf — любой формат что лежит в папке.
   Браузер возьмёт первый доступный в списке. */
@font-face {
  font-family: 'Druk Text Wide Cyr';
  src: url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Medium.woff2') format('woff2'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Medium.woff') format('woff'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Druk Text Wide Cyr';
  src: url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Bold.woff2') format('woff2'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Bold.woff') format('woff'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Druk Text Wide Cyr';
  src: url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Super.woff2') format('woff2'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Super.woff') format('woff'),
       url('/assets/fonts/Druk-Wide-Cyr/DrukTextWideCyr-Super.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Golos Text — body + подзаголовки
   Поддерживается .woff2 / .woff / .ttf / .otf — любой формат. */
@font-face {
  font-family: 'Golos Text';
  src: url('/assets/fonts/Golos-Text/GolosText-Regular.woff2') format('woff2'),
       url('/assets/fonts/Golos-Text/GolosText-Regular.woff') format('woff'),
       url('/assets/fonts/Golos-Text/GolosText-Regular.ttf') format('truetype'),
       url('/assets/fonts/Golos-Text/GolosText-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Golos Text';
  src: url('/assets/fonts/Golos-Text/GolosText-Medium.woff2') format('woff2'),
       url('/assets/fonts/Golos-Text/GolosText-Medium.woff') format('woff'),
       url('/assets/fonts/Golos-Text/GolosText-Medium.ttf') format('truetype'),
       url('/assets/fonts/Golos-Text/GolosText-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Golos Text';
  src: url('/assets/fonts/Golos-Text/GolosText-SemiBold.woff2') format('woff2'),
       url('/assets/fonts/Golos-Text/GolosText-SemiBold.woff') format('woff'),
       url('/assets/fonts/Golos-Text/GolosText-SemiBold.ttf') format('truetype'),
       url('/assets/fonts/Golos-Text/GolosText-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Golos Text';
  src: url('/assets/fonts/Golos-Text/GolosText-Bold.woff2') format('woff2'),
       url('/assets/fonts/Golos-Text/GolosText-Bold.woff') format('woff'),
       url('/assets/fonts/Golos-Text/GolosText-Bold.ttf') format('truetype'),
       url('/assets/fonts/Golos-Text/GolosText-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ═══════════════════════════════════════════════════════════════
     COLORS
     ═══════════════════════════════════════════════════════════════ */

  /* Brand accent */
  --accent: #0fbe61;
  --accent2: #3dd87a;
  --accent-light: #89d6ad;
  --accent-soft: rgba(15, 190, 97, 0.1);
  --accent-softer: rgba(15, 190, 97, 0.04);

  /* Brand gradient (от #0FBE61 top-left → #89D6AD bottom-right, 135°) */
  --accent-gradient: linear-gradient(135deg, #0FBE61 0%, #89D6AD 100%);

  /* Semantic */
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.08);
  --blue: #2563eb;

  /* Neutrals / UI */
  --bg: #f5f6f8;
  --white: #fff;
  --panel: #fff;
  --panel2: #f5f6f8;

  /* Text */
  --text: #0f172a;
  --text2: #475569;
  --muted: #94a3b8;

  /* Borders */
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);

  /* ═══════════════════════════════════════════════════════════════
     SHADOWS
     ═══════════════════════════════════════════════════════════════ */

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-xl:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 60px rgba(15, 23, 42, 0.18);

  /* ═══════════════════════════════════════════════════════════════
     TYPOGRAPHY
     ═══════════════════════════════════════════════════════════════ */

  /* Headings + logo */
  --font-h: 'Druk Text Wide Cyr', system-ui, -apple-system, sans-serif;

  /* Body + subheadings */
  --font: 'Golos Text', system-ui, -apple-system, sans-serif;

  /* ═══════════════════════════════════════════════════════════════
     MOTION
     ═══════════════════════════════════════════════════════════════ */

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --dur-fast: 120ms;
  --dur-med: 200ms;
  --dur-slow: 280ms;

  /* ═══════════════════════════════════════════════════════════════
     SHAPE
     ═══════════════════════════════════════════════════════════════ */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* Honour user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-med: 1ms;
    --dur-slow: 1ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/**
 * GOS Design System — Components
 *
 * All reusable component styles. Requires tokens.css to be loaded first.
 *
 * Components included:
 *  - Reset + base typography
 *  - Buttons (primary, secondary, soft, ghost, danger, icon)
 *  - Pill groups (icon button clusters)
 *  - Cards
 *  - Accordion (with glassmorphism)
 *  - Forms (input, select, textarea, inline-edit, steppers)
 *  - Range slider
 *  - Switch / toggle (regular + small)
 *  - Tables (with thumbnail, actions, badges)
 *  - Modal (overlay + dialog)
 *  - Toast notification
 *  - Spinner
 *  - Filter tabs
 *  - Breadcrumbs
 *  - Badges
 *  - Empty state
 *  - Search input
 *  - Divider
 *  - Swatches (color picker grid)
 */

/* ═══════════════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
}

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

/* Primary CTA — filled brand accent, elevated shadow */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font: 600 13px var(--font);
  letter-spacing: 0.1px;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(15, 190, 97, 0.32);
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--accent2);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.04),
      0 6px 22px rgba(15, 190, 97, 0.42);
  }
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-primary:disabled {
  background: var(--border-strong);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary — white with border */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font: 600 13px var(--font);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    background-color var(--dur-med) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    border-color: var(--border-strong);
    background: var(--panel2);
  }
}
.btn-secondary:active {
  transform: scale(0.97);
}
.btn-secondary:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Soft — dashed border, accent on hover (for upload / add actions) */
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    background-color var(--dur-med) var(--ease-out),
    color var(--dur-med) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-soft:hover {
    border-color: var(--accent);
    background: var(--accent-softer);
    color: var(--accent);
  }
}
.btn-soft:active {
  transform: scale(0.98);
}

/* Ghost — transparent, subtle border */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 13px var(--font);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.btn-ghost:hover {
  background: var(--bg);
}

/* Danger — destructive action, red soft */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border: none;
  border-radius: 6px;
  font: 500 12px var(--font);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.btn-danger:hover {
  background: rgba(225, 29, 72, 0.14);
}

/* Icon-only square button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text2);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.btn-icon:hover {
  background: var(--bg);
}

/* ═══════════════════════════════════════════════════════════════════
   PILL GROUPS (clustered icon buttons with a shared shell)
   ═══════════════════════════════════════════════════════════════════ */
.pill-group {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .pill-btn:hover {
    background: var(--panel2);
    color: var(--text);
  }
}
.pill-btn:active {
  transform: scale(0.93);
}
.pill-btn.on {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill-text {
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Standalone icon button (larger, elevated) */
.pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    background-color var(--dur-med) var(--ease-out),
    color var(--dur-med) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .pill-icon:hover {
    border-color: var(--border-strong);
    background: var(--panel2);
    color: var(--text);
  }
}
.pill-icon:active {
  transform: scale(0.93);
}
.pill-icon.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font: 700 18px var(--font-h);
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════════
   ACCORDION (with glassmorphism effect)
   ═══════════════════════════════════════════════════════════════════ */
.acc {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.acc > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  cursor: pointer;
  font: 600 14px var(--font);
  color: var(--text);
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.acc > summary::-webkit-details-marker {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .acc:not([open]) > summary:hover {
    background: var(--panel2);
  }
}
.acc-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform var(--dur-med) var(--ease-out);
}
.acc[open] > summary .acc-chevron {
  transform: rotate(90deg);
}
.acc-title {
  flex: 1;
}
.acc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 11px var(--font);
}
.acc-count.empty {
  background: var(--panel2);
  color: var(--muted);
}
/* Grid-rows animation for smooth open/close */
.acc-inner {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 300ms ease-out;
}
.acc:not([open]) > .acc-inner,
.acc[data-closing] > .acc-inner {
  grid-template-rows: 0fr;
}
.acc-body {
  overflow: hidden;
  padding: 4px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.acc:not([open]) .acc-body,
.acc[data-closing] .acc-body {
  padding-top: 0;
  padding-bottom: 0;
}

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

/* Simple form pattern (admin-style) */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font: 500 12px var(--font);
  color: var(--text2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: 400 14px var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input[type='file'] {
  padding: 8px 12px;
  height: auto;
}
.form-error {
  color: var(--danger);
  font: 500 12px var(--font);
  margin-top: 6px;
}

/* Inline-edit input (for table cell editing) */
.inline-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font: 400 13px var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
  width: 100%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Field pattern (viewer-style, rich input wrap with focus-within) */
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.field-label {
  font: 500 12px var(--font);
  color: var(--text2);
  letter-spacing: 0.1px;
}
.field-sublabel {
  font: 500 11px var(--font);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field-input-wrap {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  background: var(--panel2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}
.field-input-wrap.compact {
  padding: 0 10px;
  height: 38px;
}
.field-input-wrap.sm {
  height: 36px;
  padding: 0 8px;
}
.field-input-wrap:focus-within {
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: 500 14px var(--font);
  outline: none;
}
.field-input::-webkit-outer-spin-button,
.field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input[type='number'] {
  -moz-appearance: textfield;
}
.field-suffix {
  font: 500 12px var(--font);
  color: var(--muted);
  flex-shrink: 0;
  padding-left: 6px;
}
.field-select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Stepper buttons (−/+ inside input wraps) */
.field-stepper {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.field-stepper.sm {
  width: 26px;
  height: 26px;
  font-size: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .field-stepper:hover {
    background: var(--panel2);
    color: var(--text);
  }
}
.field-stepper:active {
  transform: scale(0.88);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   RANGE SLIDER
   ═══════════════════════════════════════════════════════════════════ */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
  outline: none;
  cursor: pointer;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.range-value {
  font: 600 13px var(--font);
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   SWITCH / TOGGLE
   ═══════════════════════════════════════════════════════════════════ */

/* Regular switch (iOS-style, with label) */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  width: 40px;
  height: 24px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
  position: relative;
  flex-shrink: 0;
  transition: background-color var(--dur-med) var(--ease-out);
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transition: transform var(--dur-med) var(--ease-out);
}
.switch input:checked + .switch-track {
  background: var(--accent);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}
.switch-label {
  font: 500 13px var(--font);
  color: var(--text);
}

/* Compact switch (for table rows) */
.switch-small {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch-small input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-small .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-strong);
  border-radius: 10px;
  transition: background var(--dur-med);
}
.switch-small .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: transform var(--dur-med);
}
.switch-small input:checked + .slider {
  background: var(--accent);
}
.switch-small input:checked + .slider::before {
  transform: translateX(16px);
}

/* ═══════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font: 600 11px var(--font);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
tr:hover td {
  background: rgba(15, 190, 97, 0.02);
}
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--accent-soft);
}
.td-thumb {
  width: 60px;
}
.td-thumb img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  display: block;
}
.thumb-placeholder {
  width: 48px;
  height: 36px;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
}
.td-actions {
  text-align: right;
  white-space: nowrap;
}
.td-actions .btn-icon {
  display: inline-flex;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font: 500 11px var(--font);
}
.badge-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-inactive {
  background: var(--bg);
  color: var(--muted);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font: 700 18px var(--font-h);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════ */
#toast,
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font: 500 13px var(--font);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out),
    opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
}
#toast.show,
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════════════════════════════ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gos-spin 0.6s linear infinite;
  margin: 40px auto;
}
.spin {
  width: 36px;
  height: 36px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gos-spin 0.7s linear infinite;
}
@keyframes gos-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FILTER TABS (segmented control)
   ═══════════════════════════════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.filter-tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--text2);
  font: 500 12px var(--font);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-tab:hover {
  background: rgba(15, 23, 42, 0.04);
}
.filter-tab.active {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════════════ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font: 500 13px var(--font);
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs .sep {
  color: var(--border-strong);
}

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font: 400 14px var(--font);
}
.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.hint-empty {
  padding: 24px 0;
  text-align: center;
  font: 500 12px var(--font);
  color: var(--muted);
  line-height: 1.7;
}
.hint-text {
  padding: 12px 14px;
  background: var(--panel2);
  border-radius: var(--radius-sm);
  font: 500 12px var(--font);
  color: var(--text2);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════
   SEARCH INPUT (with icon)
   ═══════════════════════════════════════════════════════════════════ */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  background: var(--panel2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 500 13px var(--font);
  outline: none;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}
.search-input:focus {
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-input::placeholder {
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════════ */
.divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SWATCHES (color picker grid)
   ═══════════════════════════════════════════════════════════════════ */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.swatch {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .swatch:hover {
    transform: scale(1.05);
  }
}
.swatch:active {
  transform: scale(0.94);
}
.swatch.active {
  box-shadow:
    inset 0 0 0 3px var(--white),
    inset 0 0 0 5px var(--accent);
}
.swatch-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ef4444, #f59e0b, #eab308, #22c55e, #3b82f6, #a855f7);
  color: #fff;
}
.swatch-picker input[type='color'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════════════════════════════ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

/* Logo emblem — works with both inline <svg> and <img src="...svg"> */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  flex-shrink: 0;
  overflow: hidden;
}
.logo-mark svg,
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Badge-вариант: зелёная подложка (solid или gradient) с белой эмблемой внутри.
   Используется когда нужен более заметный брендовый блок. */
.logo-mark.badge {
  background: var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px;
  width: 40px;
  height: 40px;
  box-shadow: var(--shadow-sm);
}
.logo-mark.badge.gradient {
  background: var(--accent-gradient);
  box-shadow: 0 2px 8px rgba(15, 190, 97, 0.32);
}
.logo-mark.badge.rounded {
  border-radius: var(--radius-md);
}

/* Размеры badge — подстраиваются под .logo.sm / .logo.lg */
.logo.sm .logo-mark.badge { width: 32px; height: 32px; padding: 5px; }
.logo.lg .logo-mark.badge { width: 52px; height: 52px; padding: 9px; border-radius: var(--radius-md); }

/* Logo text — общая база для всех вариантов (brand, product, tagline) */
.logo-text,
.logo-brand,
.logo-product {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Brand name (GOS / ГОС) — акцентный цвет */
.logo-brand {
  color: var(--accent);
}

/* Product name (3D, ПЛАНЭТАЖ, КОНСТРУКТОР, ВИДЖЕТ) — тёмный цвет */
.logo-product {
  color: var(--text);
}

/* Tagline / подпись под названием — Golos, lowercase, mute */
.logo-tagline {
  display: block;
  font-family: var(--font);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1;
}

/* Контейнер brand + product + tagline в одной колонке */
.logo-stack {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
}
.logo-stack .logo-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  white-space: nowrap;
}

/* Size modifiers (.sm / default / .lg) */
.logo-text.lg,
.logo-brand.lg,
.logo-product.lg { font-size: 26px; }
.logo-text.sm,
.logo-brand.sm,
.logo-product.sm { font-size: 16px; }

/* Когда .logo имеет модификатор размера — все дочерние элементы подстраиваются */
.logo.lg .logo-mark { width: 48px; height: 42px; }
.logo.lg .logo-text,
.logo.lg .logo-brand,
.logo.lg .logo-product { font-size: 28px; }
.logo.lg .logo-tagline { font-size: 12px; }

.logo.sm .logo-mark { width: 28px; height: 24px; }
.logo.sm .logo-text,
.logo.sm .logo-brand,
.logo.sm .logo-product { font-size: 16px; }
.logo.sm .logo-tagline { font-size: 9px; }

/* ═══════════════════════════════════════════════════════════════════
   BRAND GRADIENT UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

/* Fill any text with the brand gradient */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Primary CTA with gradient background (alternative to flat .btn-primary) */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font: 600 13px var(--font);
  letter-spacing: 0.1px;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(15, 190, 97, 0.32);
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    filter var(--dur-med) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-gradient:hover {
    filter: brightness(1.06);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.04),
      0 6px 22px rgba(15, 190, 97, 0.42);
  }
}
.btn-gradient:active {
  transform: scale(0.97);
}

/* Gradient background panel / banner */
.bg-gradient {
  background: var(--accent-gradient);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   MESSENGER ICONS (Telegram, MAX)
   ═══════════════════════════════════════════════════════════════════ */

.msg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
  flex-shrink: 0;
  overflow: hidden;
}
.msg-icon svg,
.msg-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.msg-icon:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-md);
}
.msg-icon:active {
  transform: scale(0.96);
}
.msg-icon.sm { width: 32px; height: 32px; }
.msg-icon.lg { width: 56px; height: 56px; }

/* Optional label next to messenger icon */
.msg-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font: 500 14px var(--font);
  padding: 8px 14px 8px 8px;
  border-radius: var(--radius-pill);
  background: var(--panel2);
  transition: background var(--dur-fast) var(--ease-out);
}
.msg-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.msg-link .msg-icon {
  width: 32px;
  height: 32px;
}
