/*
 * Georgian Auto Shipping — общая дизайн-система (токены, шрифты, базовые компоненты).
 * Используется панелью сотрудников и будущей клиентской частью.
 * Тёмная тема по умолчанию; светлая — html[data-theme="light"].
 */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/cormorant-garamond-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/cormorant-garamond-cyrillic-600-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-cyrillic-600-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/inter-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/inter-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */

:root {
  color-scheme: dark;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Cormorant', Didot, 'Bodoni 72', 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  --gold-1: #b8913a;
  --gold-2: #e6c977;
  --gold-3: #a67c2e;
  --gold-gradient: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 48%, var(--gold-3) 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(184, 145, 58, 0.22), rgba(230, 201, 119, 0.12) 50%, rgba(166, 124, 46, 0.2));

  --bg: #0a0a0b;
  --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(214, 178, 94, 0.07), transparent 60%);
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #202024;
  --surface-input: #0e0e10;
  --border: #2a2a2f;
  --border-strong: #3a3934;
  --text: #f3eee4;
  --text-2: #d6d0c4;
  --muted: #a39d92;
  --faint: #77726a;
  --gold: #d9b968;
  --gold-text: #e2c47c;
  --gold-line: rgba(217, 185, 104, 0.35);
  --on-gold: #17120a;
  --accent: var(--gold);

  --ok: #7ad19b;
  --ok-bg: rgba(122, 209, 155, 0.12);
  --ok-line: rgba(122, 209, 155, 0.32);
  --warn: #f0c35a;
  --warn-bg: rgba(240, 195, 90, 0.12);
  --warn-line: rgba(240, 195, 90, 0.38);
  --danger: #ff7a70;
  --danger-bg: rgba(255, 122, 112, 0.12);
  --danger-line: rgba(255, 122, 112, 0.4);
  --info: #8fb8ff;
  --info-bg: rgba(143, 184, 255, 0.12);
  --info-line: rgba(143, 184, 255, 0.35);
  --neutral-bg: rgba(255, 255, 255, 0.06);

  --row-hover: rgba(217, 185, 104, 0.045);
  --focus-ring: 0 0 0 3px rgba(217, 185, 104, 0.35);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --scrim: rgba(4, 4, 5, 0.72);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --tap: 44px;
}

html[data-theme='light'] {
  color-scheme: light;

  --bg: #f5f2ea;
  --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(184, 145, 58, 0.1), transparent 60%);
  --surface: #ffffff;
  --surface-2: #faf7f0;
  --surface-3: #f1ece1;
  --surface-input: #ffffff;
  --border: #e4dccb;
  --border-strong: #d3c6ab;
  --text: #1b1915;
  --text-2: #36322b;
  --muted: #625b4f;
  --faint: #8a8273;
  --gold: #a47a2c;
  --gold-text: #8a6420;
  --gold-line: rgba(164, 122, 44, 0.4);
  --on-gold: #1a1408;

  --ok: #1f7a46;
  --ok-bg: #e5f3ea;
  --ok-line: #b9dfc8;
  --warn: #8f5d00;
  --warn-bg: #fbf0d6;
  --warn-line: #ecd18e;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --danger-line: #f3b8b2;
  --info: #1d4f9c;
  --info-bg: #e7eefb;
  --info-line: #bcd0f2;
  --neutral-bg: #efebe2;

  --row-hover: rgba(164, 122, 44, 0.06);
  --focus-ring: 0 0 0 3px rgba(164, 122, 44, 0.28);
  --shadow-1: 0 1px 2px rgba(60, 45, 20, 0.06), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-2: 0 24px 60px -24px rgba(60, 45, 20, 0.35);
  --scrim: rgba(30, 24, 14, 0.45);
}

/* ---------- База ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

::selection {
  background: rgba(217, 185, 104, 0.35);
  color: var(--text);
}

a {
  color: var(--gold-text);
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  background: var(--neutral-bg);
  color: var(--text-2);
}

h1,
h2,
h3,
h4 {
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.005em;
}

.eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* ---------- Логотип ---------- */

.gas-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  font-size: 16px;
}

.gas-logo__mark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.6em;
  letter-spacing: 0.06em;
  padding-left: 0.06em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gas-logo__sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.5em;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: var(--gold-text);
  white-space: nowrap;
}

html[data-theme='light'] .gas-logo--on-dark .gas-logo__sub {
  color: #e2c47c;
}

.gas-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0c;
  border-radius: var(--radius-sm);
}

/* ---------- Кнопки ---------- */

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--on-gold);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 18px -8px rgba(214, 178, 94, 0.6);
}

.btn-primary:hover {
  filter: brightness(1.06) saturate(1.05);
}

.btn-primary:active {
  filter: brightness(0.96);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--gold-line);
  background: var(--surface-3);
}

.btn-secondary.is-active {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-line);
  min-height: 34px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--neutral-bg);
  color: var(--text);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--gold-line);
  color: var(--gold-text);
}

/* ---------- Поля ввода ---------- */

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

label .req {
  color: var(--gold-text);
}

input[type='text'],
input[type='password'],
input[type='date'],
input[type='month'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-input);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input[type='date'],
input[type='month'] {
  color-scheme: inherit;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b8913a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--focus-ring);
}

input[readonly] {
  background: var(--surface-3);
  color: var(--text-2);
  cursor: default;
}

input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold-1);
  cursor: pointer;
}

input[type='file'] {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type='file']::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input.vin-invalid {
  border-color: var(--danger);
}

input.vin-valid {
  border-color: var(--ok);
}

/* ---------- Таблицы ---------- */

table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface-2);
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background: var(--row-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

.empty-msg {
  text-align: center !important;
  color: var(--muted);
  padding: 2.5rem 1rem !important;
}

/* ---------- Статусы ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.38rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--text-2);
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.status-pill.on-stock {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.status-pill.shipped {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.status-pill.pending {
  background: var(--neutral-bg);
  border-color: var(--border);
  color: var(--muted);
}

.status-pill.missing-cargo {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}

.status-pill.port-direct {
  background: var(--info-bg);
  border-color: var(--info-line);
  color: var(--info);
}

.status-pill.gold {
  background: var(--gold-gradient-soft);
  border-color: var(--gold-line);
  color: var(--gold-text);
}

/* ---------- Карточки и модальные окна ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  width: 100%;
  max-width: 34rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

.modal-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.15;
}

.modal-card label {
  display: block;
  margin: 0.9rem 0 0.35rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
