/* ===== Design tokens ===== */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e4e8f0;
  --text: #1c2433;
  --text-muted: #6b7385;
  --text-faint: #9aa2b1;

  --primary: #2f6fed;
  --primary-dark: #1f56c9;
  --primary-soft: #eaf1ff;
  --accent: #17b1a3;
  --accent-soft: #e6f8f5;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warning: #f2a93b;
  --warning-soft: #fdf3e2;
  --success: #22a35a;
  --success-soft: #e7f7ee;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 27, 45, 0.06);
  --shadow: 0 4px 16px rgba(20, 27, 45, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 27, 45, 0.14);

  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ===== App shell ===== */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #151a2b;
  color: #cdd3e6;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 16px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.25;
}
.brand-text small { font-weight: 400; color: #8891ab; font-size: 12px; }

.nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c6482;
  padding: 14px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #b7bdd3;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), #4a7ff5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 111, 237, 0.35);
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 10px 6px;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11.5px; color: #8891ab; }

.logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  color: #ff8f8f;
  font-size: 13px;
  font-weight: 500;
}
.logout-link:hover { background: rgba(229, 72, 77, 0.12); }

/* ===== Main column ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 68px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.page-title { font-size: 19px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.page-subtitle { font-size: 12.5px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

.warehouse-switch select {
  min-width: 180px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.content {
  padding: 24px 28px 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Toasts ===== */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 4px solid var(--primary);
  animation: toast-in 0.25s ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cards / stats ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.stat-icon.blue { background: var(--primary-soft); color: var(--primary-dark); }
.stat-icon.teal { background: var(--accent-soft); color: var(--accent); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }

.stat-num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

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

/* ===== Report export actions ===== */
.report-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.export-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn-export svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-export:hover { box-shadow: var(--shadow-sm); }
.btn-export:active { transform: translateY(1px); }

.btn-export.xlsx { color: #1a7f4a; border-color: #bfe6cf; background: #eefaf3; }
.btn-export.pdf { color: #c0392b; border-color: #f3c9c4; background: #fdeeec; }

.card-title { font-size: 15px; font-weight: 700; }
.card-title .muted { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: var(--surface-alt); }
tbody tr:last-child td { border-bottom: none; }

.empty-row td {
  text-align: center;
  color: var(--text-faint);
  padding: 28px 12px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-neutral { background: var(--surface-alt); color: var(--text-muted); }
.badge-blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge-warning { background: var(--warning-soft); color: #b06d00; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(47, 111, 237, 0.4); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-alt); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #cf3a3f; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ===== Forms ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }

.usage-items-header { margin-top: 20px; margin-bottom: 8px; }

.usage-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.usage-item-row:first-child { padding-top: 0; }
.usage-item-field { display: flex; flex-direction: column; gap: 6px; }
.usage-item-product { flex: 2; min-width: 160px; }
.usage-item-quantity { flex: 1; min-width: 100px; }
.usage-item-price { flex: 1; min-width: 130px; }
.usage-item-remove {
  align-self: center;
  margin-top: 20px;
  flex-shrink: 0;
}
#usageItemTemplate, #movementItemTemplate { display: none; }

label, .form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.field, input[type="text"], input[type="date"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea { min-height: 70px; resize: vertical; }

.searchable-select-wrap { position: relative; }
.searchable-select-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.searchable-select-input { cursor: text; }
.searchable-select-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(20, 25, 40, 0.12);
}
.searchable-select-list.open { display: block; }
.searchable-select-option {
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.searchable-select-option.active,
.searchable-select-option:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.searchable-select-empty {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.field-errors { color: var(--danger); font-size: 12px; font-weight: 500; }
.non-field-errors {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.search-form input { max-width: 280px; }

/* ===== Login page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #2f6fed 0%, #151a2b 55%, #0b0e18 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-title { font-size: 18px; font-weight: 800; }
.login-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.login-card .form-group { margin-bottom: 16px; }

/* ===== Misc ===== */
.muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; }
.section-title { font-size: 14px; font-weight: 700; margin: 4px 0 10px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .big-icon { font-size: 34px; margin-bottom: 8px; }

/* ===== Filters, tabs, pagination ===== */
.filter-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-actions { flex-direction: row; gap: 8px; }
.filter-inline { display: flex; gap: 8px; max-width: 260px; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.count-badge, .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.count-badge.muted-badge { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.nav-badge { margin-left: auto; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ===== Layout helpers ===== */
.card.narrow { max-width: 720px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.items-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
  flex-wrap: wrap;
}
.doc-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.decision-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); max-width: 640px; }
.qty-input { max-width: 120px; }
.small { font-size: 12px; }
.link { color: var(--primary-dark); font-weight: 600; }
.link:hover { text-decoration: underline; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--surface-alt); }

.label-with-action { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.searchable-select-option.searchable-select-create {
  color: var(--primary-dark);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

details.collapsible > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible[open] > summary { margin-bottom: 14px; }

.logo-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.logo-preview img { max-height: 64px; max-width: 200px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; background: #fff; }

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 13, 24, 0.5);
  padding: 24px 16px;
  overflow-y: auto;
}
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  padding: 20px;
  margin-top: 6vh;
  animation: toast-in 0.2s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px 8px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
body.modal-open { overflow: hidden; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .form-group.span-2 { grid-column: span 1; }
}

/* ===== Телефон ===== */
@media (max-width: 640px) {
  html, body { font-size: 15px; }
  .topbar { position: sticky; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar-title { order: 1; flex: 1 1 calc(100% - 52px); }
  .menu-toggle { order: 0; font-size: 22px; padding: 6px 8px; }
  .topbar-actions { order: 2; width: 100%; justify-content: space-between; }
  .warehouse-switch { flex: 1; }
  .warehouse-switch select { min-width: 0; width: 100%; }
  .page-title { font-size: 16.5px; }
  .page-subtitle { display: none; }

  .content { padding: 12px 10px 32px; }
  .card { padding: 14px; border-radius: 10px; margin-bottom: 14px; }
  .card-header { margin-bottom: 10px; }
  .card-title { font-size: 14.5px; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; }
  .stat-num { font-size: 19px; overflow-wrap: anywhere; }
  .stat-icon { display: none; }

  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  /* Фильтры — в две колонки (даты, списки рядом), поиск и кнопки — на всю ширину. */
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filter-grid .form-group:first-of-type, .filter-grid .filter-actions { grid-column: 1 / -1; }
  .filter-grid label { font-size: 12px; }
  .filter-actions .btn { flex: 1; }
  .form-actions .btn, .modal-footer .btn { flex: 1; }
  .filter-inline { max-width: none; }

  /* Поля ввода не меньше 16px — иначе iOS увеличивает страницу при фокусе. */
  .field, input[type="text"], input[type="date"], input[type="number"],
  input[type="password"], select, textarea { font-size: 16px; padding: 11px 12px; }

  .usage-item-row { flex-wrap: wrap; gap: 8px; padding: 12px 0; position: relative; }
  .usage-item-product { flex: 1 1 100%; min-width: 0; padding-right: 44px; }
  .usage-item-quantity, .usage-item-price { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .usage-item-remove { position: absolute; top: 34px; right: 0; margin: 0; }
  .usage-item-row:first-child .usage-item-remove { top: 22px; }

  .table-wrap {
    margin: 0 -14px;
    padding: 0 14px;
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(90deg, var(--surface) 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat local,
      linear-gradient(270deg, var(--surface) 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(20,27,45,.14), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(20,27,45,.14), transparent) right / 10px 100% no-repeat scroll;
  }
  table { font-size: 13px; }
  th, td { padding: 9px 8px; }
  td { white-space: nowrap; }

  .report-actions { gap: 8px; }
  .btn-export { flex: 1; justify-content: center; }
  .export-label { width: 100%; }

  .doc-meta { gap: 12px 20px; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; }

  .modal { padding: 0; }
  .modal.open { align-items: stretch; }
  .modal-dialog { margin: 0; max-width: none; border-radius: 0; min-height: 100%; padding: 16px; }

  .toasts { left: 10px; right: 10px; top: 10px; max-width: none; }
  .login-card { padding: 28px 20px; }
  .pagination .btn { flex: 1; }
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 24, 0.45);
  z-index: 30;
}
.overlay.show { display: block; }
