/**
 * base.css — Agro Space Design System
 * Базові стилі та уніфіковані компоненти.
 * Підключати на КОЖНІЙ сторінці після tokens.css.
 *
 * Порядок підключення:
 *   <link rel="stylesheet" href="css/tokens.css">
 *   <link rel="stylesheet" href="css/base.css">
 *   <link rel="stylesheet" href="css/<page-specific>.css">  (опційно)
 */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-md);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea {
  font-family: var(--font-family);
  font-size: inherit;
}

button { cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ════════════════════════════════════════
   ТИПОГРАФІКА
   ════════════════════════════════════════ */
.text-display {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: -1px;
  line-height: var(--leading-tight);
}

.text-headline {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.5px;
  line-height: var(--leading-tight);
}

.text-title-lg {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  letter-spacing: -0.3px;
}

.text-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.text-title-sm {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
}

.text-body-lg { font-size: var(--text-md); }
.text-body    { font-size: var(--text-base); }
.text-body-sm { font-size: var(--text-sm); }

.text-label-lg {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.02em;
}

.text-label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Допоміжні кольори тексту */
.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-error     { color: var(--color-error); }
.text-muted     { color: var(--color-text-muted); }
.text-mid       { color: var(--color-text-secondary); }

/* ════════════════════════════════════════
   LAYOUT — Page shell
   ════════════════════════════════════════ */

/* Головний контейнер сторінки з сайдбаром */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
}

/* Сторінки без сайдбару (наприклад карта) */
.app-layout-full {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
}

/* Основна область контенту */
.app-main {
  padding: var(--content-padding);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ════════════════════════════════════════
   TOP BAR
   ════════════════════════════════════════ */
.topbar {
  grid-column: 1 / -1;
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-outline-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  box-shadow: var(--shadow-1);
  z-index: var(--z-topbar);
  position: sticky;
  top: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  letter-spacing: -0.3px;
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-brand-icon {
  width: 30px;
  height: 30px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-primary);
}

.topbar-brand-icon .material-icons-round { font-size: 16px; }

.topbar-sep { flex: 1; }

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--color-outline);
}

/* Chip (маленька інфо-пігулка в топбарі) */
.topbar-chip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-surface-container);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
}

.topbar-chip:hover {
  background: var(--color-surface-variant);
}

.topbar-chip .material-icons-round { font-size: 15px; }
.topbar-chip .material-icons { font-size: 15px; }

/* Nav links (горизонтальна навігація всередині topbar) */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-4);
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 7px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.topbar-link:hover {
  background: var(--color-surface-container);
  color: var(--color-text);
}

.topbar-link.active {
  background: var(--color-primary-100);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
}

.topbar-link .material-icons-round,
.topbar-link .material-icons { font-size: 16px; opacity: 0.75; }
.topbar-link.active .material-icons-round,
.topbar-link.active .material-icons { opacity: 1; }

/* Right section */
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Mobile hamburger */
.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast);
  margin-left: auto;
}

.topbar-hamburger:hover { background: var(--color-surface-container); }
.topbar-hamburger .material-icons-round,
.topbar-hamburger .material-icons { font-size: 22px; }

/* Bootstrap dropdown menu — override to match design system */
.topbar-dropdown .dropdown-menu {
  border: 1px solid var(--color-outline-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  padding: var(--space-1);
  background: var(--color-surface);
  min-width: 190px;
}

.topbar-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.topbar-dropdown .dropdown-item:hover {
  background: var(--color-surface-container);
  color: var(--color-text);
}

.topbar-dropdown .dropdown-item .material-icons-round,
.topbar-dropdown .dropdown-item .material-icons { font-size: 16px; color: var(--color-text-muted); }

.topbar-dropdown .dropdown-divider {
  margin: var(--space-1) 0;
  border-color: var(--color-outline-subtle);
}

@media (max-width: 991px) {
  .topbar-hamburger { display: flex; }
  .topbar-nav { display: none; }

  /* Bootstrap collapse — стилізуємо мобільне меню */
  .topbar-collapse {
    position: absolute;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-outline-subtle);
    box-shadow: var(--shadow-2);
    padding: var(--space-2);
    z-index: var(--z-overlay);
  }

  .topbar-collapse .topbar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0 0 var(--space-2);
    gap: 2px;
  }

  .topbar-collapse .topbar-link {
    justify-content: flex-start;
  }

  .topbar-collapse .topbar-right {
    flex-wrap: wrap;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-outline-subtle);
  }
}

/* Аватар */
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-100);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow var(--transition-fast);
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px var(--color-primary-100);
}

/* ════════════════════════════════════════
   SIDEBAR / NAVIGATION
   ════════════════════════════════════════ */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-outline-subtle);
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
}

.nav-group-label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-3) var(--space-1);
  margin-top: var(--space-2);
}

.nav-group-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: var(--color-surface-container);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-100);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
}

.nav-item .material-icons-round {
  font-size: 18px;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-item.active .material-icons-round { opacity: 1; }

.nav-item-badge {
  margin-left: auto;
  min-width: 18px;
  padding: 1px var(--space-1);
  border-radius: var(--radius-full);
  background: var(--color-secondary-100);
  color: var(--color-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-align: center;
  flex-shrink: 0;
}

.nav-item.active .nav-item-badge {
  background: var(--color-primary-100);
  color: var(--color-primary);
}

.nav-item-alert {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.page-header-text { flex: 1; min-width: 0; }

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.5px;
  color: var(--color-text);
  line-height: var(--leading-tight);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   КНОПКИ
   ════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 8px var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
  transition: background var(--transition-fast),
              box-shadow var(--transition-fast),
              color var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn .material-icons-round { font-size: 16px; }

/* Розміри */
.btn-sm { padding: 5px var(--space-3); font-size: var(--text-sm); }
.btn-lg { padding: 11px var(--space-5); font-size: var(--text-md); }

/* Варіанти */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-1);
}
.btn-primary:hover {
  background: var(--color-primary-500);
  box-shadow: var(--shadow-2);
}
.btn-primary:active { background: var(--color-primary-700); }

.btn-tonal {
  background: var(--color-primary-100);
  color: var(--color-primary);
}
.btn-tonal:hover { background: var(--color-primary-200); }

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  box-shadow: var(--shadow-1);
}
.btn-secondary:hover { background: var(--color-secondary-500); }

.btn-outlined {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-outline);
}
.btn-outlined:hover {
  background: var(--color-surface-container);
  border-color: var(--color-text-muted);
}

.btn-text {
  background: transparent;
  color: var(--color-primary);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.btn-text:hover { background: var(--color-primary-50); }

.btn-danger {
  background: var(--color-error);
  color: var(--color-on-error);
}
.btn-danger:hover { background: var(--color-error-500); }

.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-md);
}
.btn-icon .material-icons-round { font-size: 20px; }
.btn-icon:hover { background: var(--color-surface-container); }

/* ════════════════════════════════════════
   КАРТКИ
   ════════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-outline-subtle);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.card-header {
  padding: var(--space-4) var(--space-5) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-outline-subtle);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon .material-icons-round { font-size: 18px; }
.card-icon-primary   { background: var(--color-primary-100);   color: var(--color-primary);   }
.card-icon-secondary { background: var(--color-secondary-100); color: var(--color-secondary); }
.card-icon-tertiary  { background: var(--color-tertiary-100);  color: var(--color-tertiary);  }
.card-icon-error     { background: var(--color-error-100);     color: var(--color-error);     }

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-header-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }

.card-body {
  padding: var(--space-4) var(--space-5);
}

.card-body-flush {
  padding: var(--space-2) var(--space-3);
}

.card-footer {
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface-container);
  border-top: 1px solid var(--color-outline-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

/* ════════════════════════════════════════
   STAT CARD (метрики на дашборді)
   ════════════════════════════════════════ */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid var(--color-outline-subtle);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card-primary::before   { background: var(--color-primary); }
.stat-card-secondary::before { background: var(--color-secondary); }
.stat-card-tertiary::before  { background: var(--color-tertiary); }
.stat-card-error::before     { background: var(--color-error); }

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.8px;
  line-height: 1;
}

.stat-card-primary .stat-value   { color: var(--color-primary); }
.stat-card-secondary .stat-value { color: var(--color-secondary); }
.stat-card-tertiary .stat-value  { color: var(--color-tertiary); }
.stat-card-error .stat-value     { color: var(--color-error); }

.stat-unit {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  opacity: 0.55;
  margin-left: 2px;
}

.stat-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}
.stat-sub b { color: var(--color-text); font-weight: var(--font-semibold); }

/* ════════════════════════════════════════
   БЕЙДЖІ / CHIPS
   ════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge .material-icons-round { font-size: 10px; }

.badge-primary   { background: var(--color-primary-100);   color: var(--color-primary); }
.badge-secondary { background: var(--color-secondary-100); color: var(--color-secondary); }
.badge-tertiary  { background: var(--color-tertiary-100);  color: var(--color-tertiary); }
.badge-error     { background: var(--color-error-100);     color: var(--color-error); }
.badge-neutral   { background: var(--color-surface-variant); color: var(--color-text-secondary); }

/* ════════════════════════════════════════
   ВКЛАДКИ (TABS)
   ════════════════════════════════════════ */
.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--color-surface-container);
  border-radius: var(--radius-full);
  padding: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 7px var(--space-4);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  font-family: var(--font-family);
  white-space: nowrap;
}

.tab:hover { color: var(--color-text); }

.tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
  box-shadow: var(--shadow-1);
}

.tab-count {
  min-width: 18px;
  padding: 1px var(--space-1);
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.07);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-align: center;
}

.tab.active .tab-count {
  background: var(--color-primary-100);
  color: var(--color-primary);
}

/* ════════════════════════════════════════
   LIST ROWS (уніфіковані рядки списків)
   ════════════════════════════════════════ */
.list { display: flex; flex-direction: column; gap: 2px; }

.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  background: transparent;
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.list-row:hover { background: var(--color-surface-container); }

.list-row-primary   { border-left-color: var(--color-primary); }
.list-row-secondary { border-left-color: var(--color-secondary); }
.list-row-error     { border-left-color: var(--color-error); }
.list-row-neutral   { border-left-color: var(--color-outline); }

.list-row-idx {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.list-row-body { flex: 1; min-width: 0; }

.list-row-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-right {
  text-align: right;
  flex-shrink: 0;
}

.list-row-value {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.list-row-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* ════════════════════════════════════════
   SEGMENT BAR
   ════════════════════════════════════════ */
.seg-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
  background: var(--color-surface-variant);
}

.seg-bar-segment {
  border-radius: var(--radius-full);
  height: 100%;
  transition: width var(--transition-slow);
  flex-shrink: 0;
}

.seg-primary   { background: var(--color-primary); }
.seg-secondary { background: var(--color-secondary); }
.seg-error     { background: var(--color-error); }
.seg-neutral   { background: var(--color-outline); flex: 1; }

.seg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.seg-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.seg-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   УТИЛІТИ
   ════════════════════════════════════════ */

/* Розмітка */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }

/* Відступи */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.ml-auto { margin-left: auto; }

/* Текст */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-center { text-align: center; }
.text-right  { text-align: right; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.italic { font-style: italic; }

/* Розділювач */
.divider {
  height: 1px;
  background: var(--color-outline-subtle);
  margin: var(--space-3) 0;
}

/* Empty / No data */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-style: italic;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --content-padding: var(--space-4);
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
  }

  .sidebar {
    display: none; /* мобільна навігація — окремо */
  }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr 1fr; }

  .grid-4 { grid-template-columns: 1fr 1fr; }

  .page-title { font-size: var(--text-xl); }

  .stat-value { font-size: var(--text-2xl); }
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; gap: var(--space-3); }
  .page-actions { width: 100%; }
}
