/* ASPO Design System — токени + база (от дизайн handoff-а).
   Шрифтовете (Golos Text / Roboto Mono) се зареждат през <link> в layout-а. */
:root {
  /* Brand */
  --aspo-red: #c81d25; --aspo-red-dark: #9d1119; --aspo-red-bright: #e42630; --aspo-red-deep: #a01219; --aspo-red-tint: #fdecec;
  --aspo-ink: #1f2530; --aspo-ink-2: #2a313e;
  /* Neutral */
  --gray-50:#f9fafb; --gray-100:#f3f4f6; --gray-200:#e5e7eb; --gray-300:#d1d5db; --gray-400:#9ca3af;
  --gray-500:#6b7280; --gray-600:#4b5563; --gray-700:#374151; --gray-800:#1f2937; --gray-900:#111827; --white:#ffffff;
  /* Status */
  --status-received:#2563eb; --status-received-bg:#eff6ff; --status-progress:#b45309; --status-progress-bg:#fef3c7;
  --status-ready:#15803d; --status-ready-bg:#dcfce7; --status-delivered:#4b5563; --status-delivered-bg:#f3f4f6;
  --status-invoiced:#6d28d9; --status-invoiced-bg:#ede9fe;
  --danger:#dc2626; --success:#15803d; --warning:#b45309;
  /* Semantic */
  --bg-app:var(--gray-100); --surface-card:var(--white); --surface-hover:var(--gray-50); --surface-ink:var(--aspo-ink);
  --text-strong:var(--gray-900); --text-body:var(--gray-800); --text-muted:var(--gray-500); --text-faint:var(--gray-400);
  --border:var(--gray-200); --border-strong:var(--gray-300); --accent:var(--aspo-red); --accent-hover:var(--aspo-red-dark);
  --focus-ring: color-mix(in srgb, var(--aspo-red) 35%, transparent);
  --scrim: rgba(0,0,0,.40);
  /* Type */
  --font-sans: "Golos Text", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Radii / shadow */
  --radius-sm:.375rem; --radius-lg:.5rem; --radius-xl:.75rem; --radius-pill:999px;
  --shadow-card:0 1px 3px rgba(17,24,39,.08),0 1px 2px rgba(17,24,39,.04);
  --shadow-pop:0 10px 25px rgba(17,24,39,.12),0 4px 10px rgba(17,24,39,.07);
}
body { font-family: var(--font-sans); }
.font-mono, code, .mono { font-family: var(--font-mono) !important; }
/* фокус по бранда */
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--aspo-red); }



/* ── Loader контейнер (loader-ът е самостоятелен SVG в loader.blade.php) ── */
.aspo-loader { display: inline-block; color: var(--aspo-ink); line-height: 0; vertical-align: middle; }


/* ════════════════════════════════════════════════════════════════════
   DS компонентни класове (от дизайн handoff-а — Badge/Button/Table/Card/
   Field/Input/Select/Modal/Drawer). Префикс .aspo- → не засягат др. екрани.
   ════════════════════════════════════════════════════════════════════ */

/* Рег. номер чип */
.aspo-plate { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-strong); background: var(--gray-100); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 8px; letter-spacing: .02em; display: inline-block; }
.aspo-plate--lg { font-size: 1rem; font-weight: 600; padding: 4px 10px; }

/* Stat карта */
.aspo-stat { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.25rem; }
.aspo-stat__label { font-weight: 500; font-size: .75rem; line-height: 1; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.aspo-stat__value { font-family: var(--font-mono); font-size: 1.875rem; font-weight: 600; color: var(--text-strong); margin-top: .25rem; line-height: 1.1; }
.aspo-stat__value--warning { color: var(--warning); }
.aspo-stat__value--success { color: var(--success); }

/* Карта */
.aspo-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }

/* Badge (статус на работна карта) */
.aspo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.aspo-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.aspo-badge--received    { color: var(--status-received);  background: var(--status-received-bg); }
.aspo-badge--in_progress { color: var(--status-progress);  background: var(--status-progress-bg); }
.aspo-badge--ready       { color: var(--status-ready);     background: var(--status-ready-bg); }
.aspo-badge--delivered   { color: var(--status-delivered); background: var(--status-delivered-bg); }
.aspo-badge--invoiced    { color: var(--status-invoiced);  background: var(--status-invoiced-bg); }

/* Бутон */
.aspo-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: var(--font-sans); font-weight: 600; font-size: .875rem; line-height: 1.2; padding: .5rem 1rem; border-radius: var(--radius-lg); border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.aspo-btn:disabled { opacity: .55; cursor: not-allowed; }
.aspo-btn--full { width: 100%; }
.aspo-btn--primary   { background: var(--accent); color: #fff; }
.aspo-btn--primary:hover:not(:disabled)   { background: var(--accent-hover); }
.aspo-btn--secondary { background: #fff; color: var(--text-body); border-color: var(--border-strong); }
.aspo-btn--secondary:hover:not(:disabled) { background: var(--surface-hover); }
.aspo-btn--ghost     { background: transparent; color: var(--text-body); }
.aspo-btn--ghost:hover:not(:disabled)     { background: var(--surface-hover); }
.aspo-btn--danger    { background: #fff; color: var(--danger); border-color: var(--border-strong); }
.aspo-btn--danger:hover:not(:disabled)    { background: var(--danger-bg, #fef2f2); }

/* Таблица */
.aspo-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); }
.aspo-table thead th { text-align: left; padding: .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.aspo-table tbody td { padding: .75rem .5rem; font-size: .875rem; color: var(--text-body); border-bottom: 1px solid var(--border); }
.aspo-table tbody tr:last-child td { border-bottom: none; }
.aspo-table tbody tr.is-clickable { cursor: pointer; transition: background-color .12s ease; }
.aspo-table tbody tr.is-clickable:hover { background: var(--surface-hover); }
.aspo-table .col-strong { font-weight: 600; }
.aspo-table .col-mono { font-family: var(--font-mono); }
.aspo-table .col-right { text-align: right; }
.aspo-table .col-nowrap { white-space: nowrap; }
.aspo-table .is-empty { text-align: center; color: var(--text-faint); padding: 1.5rem; }

/* Field / Input / Select */
.aspo-field { display: flex; flex-direction: column; }
.aspo-field--span2 { grid-column: span 2; }
.aspo-field__label { display: block; font-family: var(--font-sans); font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .25rem; }
.aspo-field__opt { text-transform: none; color: var(--text-faint); letter-spacing: 0; }
.aspo-field__err { color: var(--danger); font-size: .75rem; margin-top: .25rem; }
.aspo-input, .aspo-select { width: 100%; box-sizing: border-box; font-family: var(--font-sans); font-size: 1rem; color: var(--text-body); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: .5rem .75rem; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.aspo-input--mono { font-family: var(--font-mono); }
.aspo-input:focus, .aspo-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.aspo-input.is-invalid, .aspo-select.is-invalid { border-color: var(--danger); }
.aspo-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Drawer (детайл панел отдясно) */
.aspo-scrim { position: fixed; inset: 0; background: var(--scrim, rgba(0,0,0,.4)); z-index: 40; animation: aspoScrimIn .15s ease; }
.aspo-drawer { position: absolute; top: 0; right: 0; height: 100%; width: 460px; max-width: 92vw; background: var(--surface-card); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow-y: auto; font-family: var(--font-sans); animation: aspoDrawerIn .2s ease; }
@keyframes aspoScrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes aspoDrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Modal */
.aspo-modal-scrim { position: fixed; inset: 0; background: var(--scrim, rgba(0,0,0,.4)); display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; z-index: 50; animation: aspoScrimIn .15s ease; }
.aspo-modal { background: var(--surface-card); border-radius: var(--radius-xl); width: 100%; max-width: 42rem; margin-top: 2.5rem; box-shadow: var(--shadow-pop); font-family: var(--font-sans); }
