/* ============================================================
   L'art Dore POS — Reusable Component Styles
   Left Sidebar SaaS Dashboard — 2025/2026
   ============================================================ */

/* =========================
   BUTTONS
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: var(--weight-medium);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  position: relative;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn svg,
.btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background-color: var(--surface2);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0);
}

.btn-danger {
  background-color: var(--error);
  color: #ffffff;
  border-color: var(--error);
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-danger:active {
  transform: translateY(0);
}

.btn-ghost {
  background-color: transparent;
  color: var(--accent);
  border-color: transparent;
}
.btn-ghost:hover {
  background-color: var(--accent-light);
  color: var(--accent-hover);
}
.btn-ghost:active {
  background-color: var(--accent-mid);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn-sm svg,
.btn-sm .icon {
  width: 15px;
  height: 15px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius);
}
.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
}

.btn-group {
  display: flex;
  gap: var(--space-sm);
}

/* =========================
   CARDS
   ========================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--weight-semibold);
}
.card-header h3,
.card-header h4 {
  margin: 0;
}

.card-body {
  padding: 24px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) 24px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* =========================
   FORMS
   ========================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 200ms ease;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--text-muted);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
  background-color: var(--surface);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}
.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.form-error.visible {
  display: block;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}

/* Inline checkbox / radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Password toggle wrapper */
.input-password-wrap {
  position: relative;
}
.input-password-wrap .form-input {
  padding-right: 44px;
}
.input-password-wrap .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.input-password-wrap .toggle-password:hover {
  color: var(--text-sub);
  background-color: var(--surface2);
}

/* =========================
   BADGES
   ========================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.badge-error {
  background-color: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}
.badge-info {
  background-color: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-mid);
}
.badge-purple {
  background-color: var(--purple-bg);
  color: var(--purple);
  border-color: #ddd6fe;
}
.badge-teal {
  background-color: var(--teal-bg);
  color: var(--teal);
  border-color: #99f6e4;
}
.badge-neutral {
  background-color: var(--surface2);
  color: var(--text-sub);
  border-color: var(--border);
}

/* =========================
   CHIPS
   ========================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  background-color: var(--surface2);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--transition);
}
.chip-success {
  background-color: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.chip-error {
  background-color: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}
.chip-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.chip-info {
  background-color: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-mid);
}
.chip-purple {
  background-color: var(--purple-bg);
  color: var(--purple);
  border-color: #ddd6fe;
}
.chip-teal {
  background-color: var(--teal-bg);
  color: var(--teal);
  border-color: #99f6e4;
}

/* Chip-select (toggleable multi-select chips) */
.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  background-color: var(--surface2);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.chip-option:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-light);
}
.chip-option.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

.chip-select .chip {
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.chip-select .chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-light);
}
.chip-select .chip.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

/* =========================
   TABLES
   ========================= */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.table-wrap table {
  width: 100%;
  min-width: 600px;
}

.table-wrap thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.table-wrap thead th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}
.table-wrap thead th.sortable:hover {
  color: var(--text);
}
.table-wrap thead th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.table-wrap thead th.sorted .sort-icon {
  opacity: 1;
  color: var(--accent);
}

.table-wrap tbody td {
  padding: 14px 16px;
  font-size: var(--text-base);
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table-wrap tbody tr:last-child td {
  border-bottom: none;
}
.table-wrap tbody tr {
  transition: background-color var(--transition-fast);
}
.table-wrap tbody tr:hover {
  background-color: var(--surface2);
}
.table-wrap tbody tr.clickable {
  cursor: pointer;
}

/* Cell helpers */
.cell-name {
  font-weight: var(--weight-medium);
}
.cell-muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Compact variant */
.table-wrap.compact thead th,
.table-wrap.compact tbody td {
  padding: 8px 12px;
}

/* Text alignment helpers for table cells */
.table-wrap th.text-right,
.table-wrap td.text-right {
  text-align: right;
}
.table-wrap th.text-center,
.table-wrap td.text-center {
  text-align: center;
}

/* =========================
   MODALS
   ========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: modalFadeIn 200ms ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: var(--z-modal);
  animation: modalSlideUp 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.modal-lg {
  max-width: 720px;
}
.modal.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 1;
}
.modal-header h3 {
  margin: 0;
  font-size: var(--text-lg);
}
.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.modal-close:hover {
  background-color: var(--surface3);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

/* =========================
   TOASTS
   ========================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 300ms cubic-bezier(0.16, 1, 0.3, 1), toastSlideOut 300ms ease 2.7s forwards;
  max-width: 420px;
  border-left: 3px solid transparent;
}
.toast svg,
.toast .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-success {
  background-color: var(--surface);
  color: var(--text);
  border-left-color: var(--success);
}
.toast-error {
  background-color: var(--surface);
  color: var(--text);
  border-left-color: var(--error);
}
.toast-warning {
  background-color: var(--surface);
  color: var(--text);
  border-left-color: var(--warning);
}
.toast-info {
  background-color: var(--surface);
  color: var(--text);
  border-left-color: var(--accent);
}

/* =========================
   LOADING SPINNER
   ========================= */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-spinner.sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}
.loading-spinner.lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}
.loading-spinner.white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
}

/* Full page loader */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* Btn loading state */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-secondary.loading::after {
  border-color: var(--border);
  border-top-color: var(--text-sub);
}

/* =========================
   EMPTY STATE
   ========================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-lg);
  color: var(--text-muted);
  opacity: 0.4;
}
.empty-state h4 {
  margin-bottom: var(--space-sm);
  color: var(--text);
}
.empty-state p {
  color: var(--text-sub);
  font-size: 15px;
  max-width: 360px;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* =========================
   SUMMARY CARDS
   ========================= */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.summary-card:hover {
  box-shadow: var(--shadow-sm);
}

.summary-label {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 28px;
  font-weight: var(--weight-bold);
  color: var(--text);
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.summary-value.accent { color: var(--accent); }
.summary-value.success { color: var(--success); }
.summary-value.warning { color: var(--warning); }
.summary-value.error { color: var(--error); }

.summary-trend {
  font-size: 12px;
  font-weight: var(--weight-medium);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.summary-trend.up {
  color: var(--success);
}
.summary-trend.down {
  color: var(--error);
}

.summary-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   Modern Filter Bar — SaaS style
   ══════════════════════════════════════ */

/* Row 1: Search bar */
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Row 2: Filter chips */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Compact filter dropdown button (replaces old selects) */
.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

/* Select as chip */
select.filter-chip {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-chip:hover {
  border-color: var(--text-muted);
  background: var(--surface2);
}

/* Active state — when a filter is applied (not default) */
.filter-chip.active,
.filter-chip:has(option:checked:not([value=""])):not(:has(option[value=""]:checked)) {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  color: var(--accent);
}

/* JS-applied active class for better browser support */
select.filter-chip.chip-active {
  background-color: var(--accent-light);
  border-color: var(--accent-mid);
  color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236366f1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.filter-chip:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}

/* Separator between filter groups */
.filter-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* Date preset pills */
.date-presets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-full);
  padding: 2px;
}

.date-presets button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.date-presets button:hover {
  color: var(--text);
  background: var(--surface);
}

.date-presets button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* Custom date inputs (hidden by default, shown via JS) */
.date-inputs {
  display: none;
  align-items: center;
  gap: 6px;
}

.date-inputs.visible {
  display: inline-flex;
}

.date-inputs input[type="date"] {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 12px;
  color: var(--text-sub);
  background: var(--surface);
  outline: none;
  width: 130px;
}

.date-inputs input[type="date"]:focus {
  border-color: var(--accent);
}

.date-inputs span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filter count / results info */
.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.results-info strong {
  color: var(--text);
  font-weight: 600;
}

/* Mobile filter toggle */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
}

.mobile-filter-toggle svg {
  width: 16px;
  height: 16px;
}

.mobile-filter-toggle .filter-badge {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}

.mobile-filter-toggle .filter-badge.visible {
  display: inline-block;
}

/* ── Old class compatibility (keep for pages not yet migrated) ── */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-select {
  height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius-full); font-family: inherit; font-size: 13px;
  color: var(--text-sub); background: var(--surface); outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { border-color: var(--accent); }
.filter-input {
  height: 42px; padding: 0 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--surface); outline: none; min-width: 200px;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.filter-count { font-size: 13px; color: var(--text-muted); }

/* Mobile responsive for new filter bar */
@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
    gap: 8px;
  }

  .search-row .btn {
    width: 100%;
    justify-content: center;
  }

  .filter-chips {
    display: none;
  }

  .filter-chips.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-chips.mobile-open .filter-chip,
  .filter-chips.mobile-open select.filter-chip {
    width: 100%;
    border-radius: var(--radius);
    height: 38px;
  }

  .filter-chips.mobile-open .date-presets {
    flex-wrap: wrap;
    border-radius: var(--radius);
  }

  .filter-chips.mobile-open .date-inputs {
    width: 100%;
  }

  .filter-chips.mobile-open .date-inputs input[type="date"] {
    flex: 1;
    border-radius: var(--radius);
  }

  .mobile-filter-toggle {
    display: inline-flex;
  }

  .filter-separator {
    display: none;
  }
}

/* =========================
   PAGINATION
   ========================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-md) 0;
}

.pagination button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-sub);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}
.pagination button:hover {
  background-color: var(--surface3);
  color: var(--text);
}
.pagination button.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}
.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.pagination .page-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* =========================
   DROPDOWN
   ========================= */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  padding: var(--space-xs) 0;
  display: none;
  transform-origin: top right;
  animation: dropdownOpen 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 8px 14px;
  font-size: var(--text-sm);
  color: var(--text);
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  border-radius: 0;
}
.dropdown-item:hover {
  background-color: var(--surface2);
}
.dropdown-item.danger {
  color: var(--error);
}
.dropdown-item.danger:hover {
  background-color: var(--error-bg);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}

/* =========================
   TABS
   ========================= */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}
.tab-item:hover {
  color: var(--text);
}
.tab-item.tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-item .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background-color: var(--surface2);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.tab-item.tab-active .tab-count {
  background-color: var(--accent-light);
  color: var(--accent);
}

/* =========================
   DIVIDER
   ========================= */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: 24px 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider:empty::after {
  display: none;
}
.divider:empty {
  height: 1px;
  background: var(--border);
}
.divider:empty::before {
  display: none;
}

/* =========================
   ALERTS
   ========================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: var(--text-base);
  line-height: 1.5;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
}
.alert svg,
.alert .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info);
  border-color: #bfdbfe;
  border-left-color: var(--info);
}
.alert-success {
  background-color: var(--success-bg);
  color: #065f46;
  border-color: var(--success-border);
  border-left-color: var(--success);
}
.alert-warning {
  background-color: var(--warning-bg);
  color: #92400e;
  border-color: var(--warning-border);
  border-left-color: var(--warning);
}
.alert-error {
  background-color: var(--error-bg);
  color: #991b1b;
  border-color: var(--error-border);
  border-left-color: var(--error);
}

/* =========================
   FILE UPLOAD DROPZONE
   ========================= */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 40px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface2);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background-color: var(--accent-light);
}

.upload-zone .upload-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.upload-zone:hover .upload-icon {
  color: var(--accent);
}
.upload-zone .upload-text {
  font-size: var(--text-base);
  color: var(--text-sub);
}
.upload-zone .upload-text strong {
  color: var(--accent);
}
.upload-zone .upload-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow var(--transition);
}
.upload-preview:hover {
  box-shadow: var(--shadow-xs);
}
.upload-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.upload-preview .file-info {
  flex: 1;
  min-width: 0;
}
.upload-preview .file-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-preview .file-size {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownOpen {
  from {
    opacity: 0;
    transform: scaleY(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Legacy toast animations (kept for JS compatibility) */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
}
.skeleton-text:last-child {
  width: 60%;
}
.skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--space-md);
}
