/* ==========================================================================
   Sales Performance Dashboard - ANC (Afaq Alnama Co.) Theme
   ========================================================================== */

:root {
  --bg-deep: #f6f2ec;
  --bg-gradient: radial-gradient(circle at 15% 0%, rgba(163, 38, 56, 0.05) 0%, transparent 45%),
                 radial-gradient(circle at 85% 15%, rgba(242, 183, 5, 0.09) 0%, transparent 40%),
                 linear-gradient(160deg, #faf7f2 0%, #f5efe6 45%, #efe3d3 100%);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(60, 40, 28, 0.1);
  --glass-blur: 18px;
  /* Fully opaque (not translucent like --glass-bg*) - used behind sticky
     table columns, which must fully hide whatever scrolls underneath them
     rather than let it bleed through. */
  --surface-solid: #faf7f2;

  --text-primary: #2b211d;
  --text-secondary: #6e5a52;
  --text-muted: #93807a;

  --accent: #a32638;
  --accent-strong: #7a1d2a;
  --accent-soft: rgba(163, 38, 56, 0.12);

  --gold: #d69e00;
  --gold-strong: #a87d00;
  --gold-soft: rgba(214, 158, 0, 0.15);

  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --orange: #d97706;
  --orange-soft: rgba(217, 119, 6, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.1);

  --overlay-soft: rgba(50, 32, 22, 0.035);
  --overlay-medium: rgba(50, 32, 22, 0.06);
  --overlay-strong: rgba(50, 32, 22, 0.1);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-lg: 0 24px 48px rgba(60, 40, 28, 0.14);
  --shadow-sm: 0 10px 24px rgba(60, 40, 28, 0.08);
}

* {
  box-sizing: border-box;
}

/* .login-view and other sections set their own `display` (flex/grid) for
   layout, which otherwise wins over the browser's default [hidden] rule
   since author styles beat the UA stylesheet regardless of specificity -
   the section would stay in flow and visible even with hidden="true" set
   in JS. This override guarantees hidden always actually hides. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-gradient), var(--bg-deep);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------------- Glass surface ---------------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------------- Loading overlay ---------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(246, 242, 236, 0.9);
  backdrop-filter: blur(6px);
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Login view ---------------- */
.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.16;
  z-index: 0;
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: var(--accent-strong);
}

.orb-2 {
  width: 380px;
  height: 380px;
  bottom: -140px;
  right: -80px;
  background: var(--gold);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  animation: fadeUp 0.5s ease;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 auto 16px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.brand-mark.small {
  width: auto;
  height: 44px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.brand h1 {
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.brand p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.login-form input {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.login-form input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.95);
}

.form-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
}

.form-success {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------------- Change Password modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 33, 29, 0.45);
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 30px;
  animation: fadeUp 0.3s ease;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.modal-card-wide {
  max-width: 640px;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-card-header h2 {
  margin: 0;
}

.modal-card-wide h3 {
  margin: 22px 0 4px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn-primary {
  margin-top: 0;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.account-actions .reset-pw-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-you-tag {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 12px 24px rgba(163, 38, 56, 0.4);
  margin-top: 22px;
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(163, 38, 56, 0.55);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* ---------------- App shell ---------------- */
.app-shell {
  min-height: 100vh;
  animation: fadeUp 0.4s ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-brand h1 {
  font-size: 1.05rem;
  margin: 0;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-right: 4px;
}

.content {
  padding: 24px 28px 60px;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------------- Alerts ---------------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-error {
  background: var(--red-soft);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--red);
}

/* ---------------- Filters ---------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 18px 22px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1 1 160px;
}

.filter-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.filters select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.filters select:focus {
  border-color: var(--accent);
}

.filter-reset {
  flex: 0 0 auto;
  align-self: flex-end;
}

/* ---------------- Searchable select (type-to-filter combobox) ---------------- */
.searchable-select {
  position: relative;
}

.searchable-select-native {
  display: none;
}

.searchable-select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.searchable-select-input:focus {
  border-color: var(--accent);
}

/* .glass elsewhere on the page (KPI cards, chart/table cards, ...) uses
   backdrop-filter, which creates its own stacking context regardless of
   z-index - without this, a later .glass section (e.g. the KPI cards row
   right after .filters) paints OVER this list's z-index:40 no matter how
   high it is, since that z-index is only compared within .filters' own
   stacking context, not against siblings of .filters. :has() lifts the
   whole hosting card above its siblings, but only while a list inside it
   is actually open, so nothing else on the page is affected. */
.filters:has(.searchable-select-list:not([hidden])),
.table-card:has(.searchable-select-list:not([hidden])) {
  position: relative;
  z-index: 30;
}

.searchable-select-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.searchable-select-list li {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchable-select-list li.highlighted,
.searchable-select-list li[data-value]:hover {
  background: var(--accent-soft);
}

.searchable-select-list li.searchable-select-empty {
  color: var(--text-muted);
  cursor: default;
}

.searchable-select-list li.searchable-select-empty:hover {
  background: none;
}

/* Table search dropdowns (DataTables' own "Search:" wrapper) are narrower
   and inline, unlike the filter bar - the combobox still fits naturally
   since .searchable-select is just an inline-flow wrapper by default. */
.dataTables_filter .searchable-select {
  display: inline-block;
  min-width: 180px;
  vertical-align: middle;
}

.dataTables_filter .searchable-select-input {
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* ---------------- KPI cards ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  white-space: nowrap;
}

.kpi-card.kpi-green .kpi-icon { background: var(--green-soft); color: var(--green); }
.kpi-card.kpi-orange .kpi-icon { background: var(--orange-soft); color: var(--orange); }
.kpi-card.kpi-red .kpi-icon { background: var(--red-soft); color: var(--red); }
.kpi-card.kpi-green .kpi-value { color: var(--green); }
.kpi-card.kpi-orange .kpi-value { color: var(--orange); }
.kpi-card.kpi-red .kpi-value { color: var(--red); }

/* ---------------- Charts + Tables ----------------
   One shared grid so a table can sit directly under its own chart
   (both use grid-column: 1/-1 to take a full row) instead of all charts
   being grouped first and all tables trailing at the end. Only the trend
   charts without a paired table (Weekly/Monthly) stay half-width, so they
   naturally sit side by side. */
.dashboard-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.chart-card {
  padding: 20px 22px 12px;
  min-width: 0;
}

.chart-card.chart-wide {
  grid-column: 1 / -1;
}

.chart-card h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.chart-canvas-wrap {
  position: relative;
  height: 260px;
}

.chart-wide .chart-canvas-wrap {
  height: 300px;
}

/* A little taller than the default 260px, and double the width of a
   normal slot (fills the leftover space in the Weekly/Monthly Sales row
   on wide screens) without spanning the entire row like .chart-wide. */
.chart-card.chart-tall {
  grid-column: span 2;
}

.chart-tall .chart-canvas-wrap {
  height: 300px;
}

/* ---------------- Tables ---------------- */
.table-card {
  padding: 20px 22px;
  min-width: 0;
}

.table-card-wide {
  grid-column: 1 / -1;
}

.table-card h2 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.table-card-header h2 {
  margin: 0;
}

.table-card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.missing-target-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.missing-target-toggle input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.import-result {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--overlay-soft);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-height: 260px;
  overflow-y: auto;
}

.import-result .import-summary {
  margin: 0 0 6px;
}

.import-result .import-summary:last-child {
  margin-bottom: 0;
}

.import-result .import-summary-warn {
  color: var(--orange);
  font-weight: 600;
}

.import-result .import-unmatched-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-result .import-unmatched-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--glass-border);
}

.import-result .import-unmatched-name {
  font-weight: 600;
  color: var(--text-primary);
}

.import-result .import-unmatched-reason {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.table-scroll {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
  font-size: 0.85rem;
}

table.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

table.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--overlay-soft);
  white-space: nowrap;
}

table.data-table tbody tr:hover {
  background: var(--overlay-soft);
}

/* Sticky ID / Sales-Rep-or-Customer / Region columns on the daily tables,
   so they stay visible while scrolling horizontally through the 28-31 day
   columns. `left` here is just the resting default for column 1 (always
   0) - columns 2/3's actual `left` offset is computed and set inline by
   syncStickyColumnOffsets() in app.js, because DataTables assigns each
   column its own auto-sized inline width (which can even change between
   renders, e.g. a long rep/customer name), so a hardcoded pixel offset
   here would drift out of sync and leave a gap that reveals scrolled-away
   day columns underneath. max-width still caps columns 2/3 so one very
   long name can't blow the sticky area out to an unreasonable width. */
#tableRepDaily th:nth-child(1), #tableRepDaily td:nth-child(1),
#tableCustomerDaily th:nth-child(1), #tableCustomerDaily td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface-solid);
}

#tableRepDaily th:nth-child(2), #tableRepDaily td:nth-child(2),
#tableCustomerDaily th:nth-child(2), #tableCustomerDaily td:nth-child(2) {
  position: sticky;
  z-index: 2;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-solid);
}

#tableCustomerDaily th:nth-child(3), #tableCustomerDaily td:nth-child(3) {
  position: sticky;
  z-index: 2;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-solid);
}

/* "Cliff edge" shadow on the last sticky column of each table - column 2
   for the rep table (no Region column there), column 3 for the customer
   table. */
#tableRepDaily th:nth-child(2), #tableRepDaily td:nth-child(2) {
  box-shadow: 2px 0 4px rgba(20, 20, 20, 0.08);
}

#tableCustomerDaily th:nth-child(3), #tableCustomerDaily td:nth-child(3) {
  box-shadow: 2px 0 4px rgba(20, 20, 20, 0.08);
}

#tableRepDaily thead th:nth-child(1),
#tableRepDaily thead th:nth-child(2),
#tableCustomerDaily thead th:nth-child(1),
#tableCustomerDaily thead th:nth-child(2),
#tableCustomerDaily thead th:nth-child(3) {
  z-index: 3;
}

.target-input {
  width: 100px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.target-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Independent of the page theme: the cell's own background is always a
   dark heat-gradient color (see heatColor() in app.js), so its text stays
   a fixed light color regardless of whether the page itself is light or
   dark - unlike everything else here, it must NOT follow --text-primary. */
.heat-cell {
  display: inline-block;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: right;
  color: #f7f0ec;
}

/* DataTables chrome re-skinned for the light glass theme */
.dataTables_wrapper {
  color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter select {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 4px 8px;
  margin-left: 6px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  padding: 4px 10px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--text-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  color: var(--text-muted) !important;
  opacity: 0.5;
}

/* ---------------- Achievement badges ---------------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-neutral { background: var(--overlay-medium); color: var(--text-muted); }

/* ---------------- Animations ---------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  .topbar {
    padding: 14px 16px;
  }

  .topbar h1 {
    font-size: 0.95rem;
  }

  .subtitle {
    display: none;
  }

  .content {
    padding: 16px 14px 48px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field {
    min-width: 0;
  }

  .filter-reset {
    align-self: stretch;
  }

  .kpi-value {
    font-size: 1.3rem;
  }

  .user-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card {
    padding: 14px;
    gap: 10px;
  }

  .kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}
