/* ============================================================
   THPRI Print Shop Management — components.css
   Reusable UI components: cards, buttons, forms, modals, etc.
   ============================================================ */

/* ─────────────────────────────────────────────
   1. CARD
   ───────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: var(--sp-2);
}

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

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

.card-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-color);
  background: var(--gray-50);
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
}

/* Card variants */
.card-flat { border: none; box-shadow: none; }
.card-hover { cursor: pointer; transition: box-shadow var(--t-normal), transform var(--t-normal); }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ─────────────────────────────────────────────
   2. STATS CARD
   ───────────────────────────────────────────── */
.stats-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: box-shadow var(--t-normal);
}

.stats-card:hover { box-shadow: var(--shadow-md); }

.stats-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
}

.stats-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.stats-icon.icon-primary { background: rgba(26,86,219,0.1);  color: var(--primary); }
.stats-icon.icon-success { background: rgba(16,185,129,0.1); color: var(--success); }
.stats-icon.icon-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.stats-icon.icon-danger  { background: rgba(239,68,68,0.1);  color: var(--danger); }
.stats-icon.icon-info    { background: rgba(6,182,212,0.1);  color: var(--info); }
.stats-icon.icon-gray    { background: var(--gray-100);       color: var(--gray-500); }

.stats-number {
  font-size: 1.625rem; font-weight: 800; color: var(--text-primary);
  line-height: 1.2; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats-label {
  font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
}

.stats-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 600;
}

.stats-trend.up   { color: var(--success); }
.stats-trend.down { color: var(--danger); }
.stats-trend.flat { color: var(--text-muted); }

/* ─────────────────────────────────────────────
   3. BUTTONS
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-lg); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  line-height: 1.4; white-space: nowrap;
  transition: all var(--t-fast); user-select: none;
  text-decoration: none; position: relative; overflow: hidden;
}

.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled      { opacity: 0.55; cursor: not-allowed; }

/* Size variants */
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: var(--r-md); }
.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: 0.8rem; }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: 1rem; border-radius: var(--r-xl); }
.btn-xl { padding: var(--sp-4) var(--sp-8); font-size: 1.1rem; border-radius: var(--r-xl); }
.btn-block { width: 100%; }
.btn-icon  { padding: var(--sp-2); border-radius: var(--r-lg); aspect-ratio: 1; }
.btn-icon.btn-sm { padding: var(--sp-1); border-radius: var(--r-md); }

/* Colour variants */
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(26,86,219,0.3); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }

.btn-secondary {
  background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-300); }

.btn-success {
  background: var(--success); color: #fff; border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #059669; border-color: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-danger:hover:not(:disabled)  { background: #dc2626; border-color: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

.btn-warning {
  background: var(--warning); color: #000; border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: #d97706; border-color: #d97706; }

.btn-info {
  background: var(--info); color: #fff; border-color: var(--info);
}
.btn-info:hover:not(:disabled) { background: #0891b2; border-color: #0891b2; }

.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--text-primary); }

.btn-ghost-danger {
  background: transparent; border-color: transparent; color: var(--danger);
}
.btn-ghost-danger:hover:not(:disabled) { background: var(--danger-light); }

/* Outlined */
.btn-outline-primary { background:transparent; color:var(--primary); border-color:var(--primary); }
.btn-outline-primary:hover:not(:disabled) { background:var(--primary-50); }
.btn-outline-danger  { background:transparent; color:var(--danger);  border-color:var(--danger); }
.btn-outline-danger:hover:not(:disabled)  { background:var(--danger-light); }

/* Loading state */
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: '';
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
  margin-left: var(--sp-1);
}

/* Button group */
.btn-group {
  display: inline-flex;
}
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.btn-group .btn:last-child  { border-radius: 0 var(--r-lg) var(--r-lg) 0; border-right-width: 1px; }
.btn-group .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); z-index: 1; }

/* ─────────────────────────────────────────────
   4. FORMS
   ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-1); }

.form-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: var(--sp-1);
}

.form-label .required { color: var(--danger); }
.form-hint  { font-size: 0.75rem; color: var(--text-muted); }
.form-error { font-size: 0.75rem; color: var(--danger); display: none; }
.form-error.visible { display: block; }

.input,
.select,
.textarea {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  font-size: 0.875rem; color: var(--text-primary);
  background: var(--bg-surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.5;
  appearance: none; -webkit-appearance: none;
}

.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }

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

.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--gray-50); color: var(--text-muted); cursor: not-allowed;
}

.input.error, .select.error, .textarea.error { border-color: var(--danger); }
.input.error:focus, .select.error:focus, .textarea.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

/* Select with arrow */
.select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 16px;
  padding-right: var(--sp-8);
}

.textarea { resize: vertical; min-height: 80px; }

/* Input with icon */
.input-wrapper { position: relative; }
.input-wrapper .input { padding-left: 38px; }
.input-wrapper .input-icon {
  position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: 1rem; line-height: 0;
}
.input-wrapper .input-suffix {
  position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.8rem;
}

/* Input sizes */
.input-sm { padding: var(--sp-1) var(--sp-3); font-size: 0.8rem; }
.input-lg { padding: var(--sp-3) var(--sp-4); font-size: 1rem; }

/* Checkbox & Radio */
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.checkbox-label, .radio-label {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  cursor: pointer; font-size: 0.875rem; color: var(--text-primary);
  user-select: none;
}

.checkbox-label input[type="checkbox"],
.radio-label    input[type="radio"] {
  width: 16px; height: 16px; margin-top: 2px;
  accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
}

/* Toggle switch */
.toggle-wrapper { display: flex; align-items: center; gap: var(--sp-3); }

.toggle {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--gray-300); border-radius: var(--r-full);
  transition: background var(--t-normal);
}

.toggle-track::after {
  content: ''; position: absolute;
  left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform var(--t-normal);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }
.toggle input:disabled + .toggle-track { opacity: 0.5; cursor: not-allowed; }

.toggle-label { font-size: 0.875rem; color: var(--text-primary); cursor: pointer; }

/* File input */
.file-input-wrapper {
  position: relative; display: flex; align-items: center;
  gap: var(--sp-3); padding: var(--sp-4);
  border: 2px dashed var(--border-color);
  border-radius: var(--r-xl); cursor: pointer;
  transition: all var(--t-fast); background: var(--gray-50);
}

.file-input-wrapper:hover { border-color: var(--primary); background: var(--primary-50); }
.file-input-wrapper input[type="file"] { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.file-input-icon { font-size: 1.5rem; color: var(--text-muted); flex-shrink: 0; }
.file-input-text { font-size: 0.875rem; color: var(--text-secondary); }
.file-input-text strong { color: var(--primary); }

/* Form row grid */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-full { grid-column: 1 / -1; }

/* ─────────────────────────────────────────────
   5. MODAL
   ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-normal), visibility var(--t-normal);
}

.modal-backdrop.open { opacity: 1; visibility: visible; }

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: var(--sp-4);
  }
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--r-2xl);
    max-width: 540px;
    transform: scale(0.94) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
  }
}

.modal-backdrop.open .modal {
  transform: translateY(0);
  opacity: 1;
}

/* Size variants */
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-full { max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); }

/* Modal sheet handle (mobile) */
.modal-handle {
  width: 40px; height: 4px; background: var(--gray-300);
  border-radius: var(--r-full); margin: var(--sp-3) auto 0;
}
@media (min-width: 640px) { .modal-handle { display: none; } }

.modal-header {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; gap: var(--sp-3);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.125rem; font-weight: 700; color: var(--text-primary);
  flex: 1;
}

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: var(--sp-1);
  border-radius: var(--r-lg); line-height: 0;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-100); color: var(--text-primary); }

.modal-body    { padding: var(--sp-5); flex: 1; overflow-y: auto; }
.modal-footer  {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--sp-3); flex-shrink: 0;
  background: var(--gray-50);
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────
   6. SKELETON LOADING
   ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
  display: inline-block;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-text  { height: 14px; border-radius: var(--r-sm); display: block; }
.skeleton-title { height: 20px; border-radius: var(--r-sm); display: block; }
.skeleton-circle { border-radius: 50%; }
.skeleton-btn   { height: 36px; border-radius: var(--r-lg); display: block; }

/* ─────────────────────────────────────────────
   7. SEARCH INPUT
   ───────────────────────────────────────────── */
.search-wrapper { position: relative; display: flex; align-items: center; }

.search-input {
  padding-left: 36px !important;
  padding-right: 36px;
  border-radius: var(--r-full) !important;
  background: var(--gray-50);
  border-color: var(--border-color);
  font-size: 0.875rem;
}

.search-input:focus { color: var(--primary); box-shadow: var(--shadow-focus); }

.search-icon {
  position: absolute; left: var(--sp-3); color: var(--text-muted);
  font-size: 1rem; pointer-events: none;
}

.search-clear {
  position: absolute; right: var(--sp-3);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px;
  border-radius: 50%; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
}
.search-clear:hover { color: var(--text-primary); background: var(--gray-200); }

/* ─────────────────────────────────────────────
   8. DROPDOWN MENU
   ───────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--bg-surface);
  border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl); z-index: var(--z-overlay);
  padding: var(--sp-1) 0;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity var(--t-fast), visibility var(--t-fast), transform var(--t-fast);
}

.dropdown.open .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm, 0.875rem); color: var(--text-primary);
  cursor: pointer; background: none; border: none; width: 100%;
  text-align: left; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-item:hover { background: var(--gray-50); color: var(--text-primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.06); }

.dropdown-divider { height: 1px; background: var(--border-color); margin: var(--sp-1) 0; }

.dropdown-header {
  padding: var(--sp-2) var(--sp-4) var(--sp-1);
  font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────────
   9. EMPTY STATE
   ───────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--sp-16) var(--sp-8);
  text-align: center;
}

.empty-illustration {
  width: 120px; height: 120px; background: var(--gray-100);
  border-radius: 50%; margin-bottom: var(--sp-6);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--text-muted);
}

.empty-title {
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.empty-description {
  font-size: 0.875rem; color: var(--text-secondary);
  max-width: 380px; line-height: 1.7; margin-bottom: var(--sp-6);
}

.empty-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }

/* ─────────────────────────────────────────────
   10. AVATAR
   ───────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; user-select: none;
  overflow: hidden; text-transform: uppercase; letter-spacing: 0.05em;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* Letter-based colour variants */
.avatar-a,.avatar-b,.avatar-c { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.avatar-d,.avatar-e,.avatar-f { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.avatar-g,.avatar-h,.avatar-i { background: linear-gradient(135deg, #10b981, #34d399); }
.avatar-j,.avatar-k,.avatar-l { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.avatar-m,.avatar-n,.avatar-o { background: linear-gradient(135deg, #ef4444, #f87171); }
.avatar-p,.avatar-q,.avatar-r { background: linear-gradient(135deg, #1a56db, #3b82f6); }
.avatar-s,.avatar-t,.avatar-u { background: linear-gradient(135deg, #db2777, #ec4899); }
.avatar-v,.avatar-w,.avatar-x { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.avatar-y,.avatar-z            { background: linear-gradient(135deg, #0f766e, #14b8a6); }

/* Avatar with status */
.avatar-wrapper { position: relative; display: inline-flex; }
.avatar-status {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-surface);
}
.avatar-status.online  { background: var(--success); }
.avatar-status.offline { background: var(--gray-400); }

/* ─────────────────────────────────────────────
   11. ALERT BANNERS
   ───────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--r-lg);
  border: 1px solid transparent; font-size: 0.875rem; line-height: 1.6;
}
.alert-icon  { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.alert-body  { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: rgba(6,182,212,0.08);   border-color: rgba(6,182,212,0.3);   color: var(--info-dark); }
.alert-success { background: rgba(16,185,129,0.08);  border-color: rgba(16,185,129,0.3);  color: var(--success-dark); }
.alert-warning { background: rgba(245,158,11,0.10);  border-color: rgba(245,158,11,0.35); color: #92400e; }
.alert-danger  { background: rgba(239,68,68,0.08);   border-color: rgba(239,68,68,0.3);   color: var(--danger-dark); }

/* ─────────────────────────────────────────────
   12. TABS
   ───────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border-color); gap: 0; overflow-x: auto; }
.tab-item {
  padding: var(--sp-3) var(--sp-5); font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ─────────────────────────────────────────────
   13. DIVIDER
   ───────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: var(--sp-4) 0; color: var(--text-muted); font-size: 0.75rem;
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
}
.divider::before,.divider::after { content:''; flex:1; height:1px; background:var(--border-color); }
.divider-plain { margin: var(--sp-4) 0; border:none; border-top:1px solid var(--border-color); }

/* ─────────────────────────────────────────────
   14. TOOLTIP
   ───────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: #fff; font-size: 0.75rem; white-space: nowrap;
  padding: 4px 8px; border-radius: var(--r-sm);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-fast), visibility var(--t-fast);
  z-index: var(--z-tooltip);
}
[data-tooltip]:hover::before { opacity: 1; visibility: visible; }

/* ─────────────────────────────────────────────
   15. RESPONSIVE FORM ROWS
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}
