/* ===================================================================
   Elivation — Components (v2)
   Modern: gradient buttons, glass cards, layered shadows, smooth motion
   =================================================================== */

/* =================================================================
   Buttons — refined with subtle gradients and motion
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 13px 22px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  border-radius: var(--radius-full);
  transition: all var(--t-fast);
  white-space: nowrap;
  border: 1.5px solid transparent;
  line-height: 1.2;
  user-select: none;
  position: relative;
  isolation: isolate;
  min-height: 44px; /* mobile-friendly tap target */
}
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  color: var(--cream-50);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  color: var(--cream-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  color: var(--navy-900);
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-400));
  color: var(--navy-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold), 0 0 0 4px rgba(201,169,97,0.18), inset 0 1px 0 rgba(255,255,255,0.5);
}

.btn-ghost {
  background: var(--surface);
  color: var(--navy-800);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--cream-50);
  border-color: var(--navy-700);
  color: var(--navy-800);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream-50);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
}
.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--cream-50);
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-outline-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.btn-link {
  color: var(--navy-700);
  padding: 0;
  background: none;
  border: none;
  font-weight: 600;
  min-height: auto;
  border-radius: 0;
}
.btn-link:hover { color: var(--gold-700); }

.btn-sm { padding: 9px 14px; font-size: 0.85rem; min-height: 36px; }
.btn-lg { padding: 16px 28px; font-size: 1rem; min-height: 52px; }
.btn-xl { padding: 20px 36px; font-size: 1.05rem; min-height: 60px; }
.btn-block { width: 100%; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #9a3140; color: white; }
.btn-success { background: var(--success); color: white; }

.btn-whatsapp {
  background: linear-gradient(180deg, #2DDE6E, #25D366);
  color: #06291A;
  font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(37, 211, 102, 0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-whatsapp:hover { background: linear-gradient(180deg, #2DDE6E, #1ebe5a); color: #06291A; transform: translateY(-1px); }

/* Icon-only round button */
.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =================================================================
   Badges
   ================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--cream-200);
  color: var(--ink-700);
  white-space: nowrap;
}
.badge-gold   { background: var(--gold-100); color: var(--gold-800); }
.badge-navy   { background: var(--navy-50); color: var(--navy-800); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-info    { background: var(--info-soft); color: var(--info); }
.badge-glass {
  background: rgba(255,255,255,0.1);
  color: var(--cream-50);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(var(--blur-sm));
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =================================================================
   Cards — modern with layered shadows
   ================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  position: relative;
}
.card-interactive { cursor: pointer; }
.card-interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card-elevated { box-shadow: var(--shadow-md); border: 1px solid var(--border-soft); }
.card-elevated-lg { box-shadow: var(--shadow-lg); border: 1px solid var(--border-soft); }
.card-flush { padding: 0; overflow: hidden; }
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid rgba(255,255,255,0.4);
}
.card-glass-dark {
  background: rgba(10, 31, 68, 0.55);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid rgba(248, 245, 239, 0.12);
  color: var(--cream-50);
}
.card-dark {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--cream-50);
  border: 1px solid rgba(248,245,239,0.08);
}
.card-dark h1, .card-dark h2, .card-dark h3, .card-dark h4 { color: var(--cream-50); }
.card-gold {
  background: linear-gradient(135deg, var(--gold-100), var(--cream-50));
  border: 1.5px solid var(--gold-500);
}

.card-header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); }
.card-body { padding: var(--space-6); }
.card-footer { padding: var(--space-5) var(--space-6); border-top: 1px solid var(--border); background: var(--cream-50); }

/* Compact metric card */
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-400);
  font-weight: 600;
}
.metric-value {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy-800);
  font-weight: 400;
  line-height: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}
.metric-delta { font-size: 0.85rem; font-weight: 600; }
.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--danger); }

/* =================================================================
   Forms — modern with refined inputs
   ================================================================= */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.form-label {
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: -0.005em;
}
.form-hint { font-size: var(--t-xs); color: var(--ink-400); }
.form-error { font-size: 0.8rem; color: var(--danger); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink-900);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  min-height: 48px;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(10, 31, 68, 0.08);
}
.textarea { min-height: 120px; resize: vertical; font-family: var(--font-sans); }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234B5563' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-position: calc(100% - 18px) center;
  background-repeat: no-repeat;
  padding-right: 44px;
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-group:focus-within { border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(10, 31, 68, 0.08); }
.input-group .input { border: none; box-shadow: none !important; }
.input-group-prefix, .input-group-suffix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--cream-100); color: var(--ink-500);
  font-size: 0.88rem; font-weight: 600;
  border-left: 1px solid var(--border);
}
.input-group-prefix { border-left: none; border-right: 1px solid var(--border); }

.checkbox-row { display: flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; }
.checkbox-row input[type="checkbox"] { margin-top: 4px; accent-color: var(--navy-700); width: 18px; height: 18px; }

/* =================================================================
   Tables — refined
   ================================================================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 16px 18px; text-align: left; vertical-align: middle; }
.table thead th {
  background: var(--cream-50);
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--t-xs);
  border-bottom: 1px solid var(--border);
}
.table tbody tr { border-bottom: 1px solid var(--border-soft); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--cream-50); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* =================================================================
   Navigation — modern with backdrop blur
   ================================================================= */
.nav {
  background: rgba(251, 249, 244, 0.72);
  backdrop-filter: saturate(180%) blur(var(--blur-lg));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-lg));
  border-bottom: 1px solid rgba(234, 227, 208, 0.6);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 72px;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}
.brand:hover { color: var(--navy-900); }
.brand-mark {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-500);
  font-family: var(--font-serif);
  font-weight: 600;
  border-radius: 10px;
  font-size: 1.15rem;
  letter-spacing: 0;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
}
.nav-links { display: flex; gap: var(--space-2); align-items: center; }
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-600);
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--navy-800); background: rgba(10, 31, 68, 0.04); }
.nav-link.active {
  color: var(--navy-800);
  font-weight: 600;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: -2px;
  height: 3px; width: 24px;
  background: var(--gold-500);
  border-radius: var(--radius-full);
}
.nav-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.nav-toggle { display: none; }

/* Mobile menu — full-screen slide-in */
.mobile-menu {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, var(--cream-50), var(--cream-100));
  z-index: var(--z-modal);
  transform: translateY(-100%);
  transition: transform 400ms var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-5) var(--container-px) var(--space-12);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
  margin-bottom: var(--space-8);
}
.mobile-menu-close {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--navy-800);
  font-size: 1.4rem;
}
.mobile-menu-links {
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.mobile-menu-links a {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--navy-900);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.mobile-menu-links a::after { content: "→"; color: var(--gold-600); opacity: 0; transform: translateX(-8px); transition: all var(--t-base); }
.mobile-menu-links a:hover::after, .mobile-menu-links a:active::after { opacity: 1; transform: translateX(0); }
.mobile-menu-actions {
  margin-top: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-3);
}

@media (max-width: 880px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
}

/* Mobile bottom bar — fixed action bar on small screens */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(var(--blur-lg));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-lg));
  border-top: 1px solid rgba(234, 227, 208, 0.6);
  padding: 10px var(--container-px) calc(10px + env(safe-area-inset-bottom, 0));
  z-index: var(--z-mobile-bar);
  gap: 10px;
  align-items: center;
}
.mobile-bar .btn { flex: 1; }
@media (max-width: 880px) {
  .mobile-bar { display: flex; }
}

/* =================================================================
   Footer — modernized
   ================================================================= */
.footer {
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: var(--cream-200);
  padding: var(--space-20) 0 var(--space-10);
  margin-top: var(--space-20);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 80%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}
.footer h5 {
  color: var(--cream-50);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: var(--space-4);
  font-weight: 600;
}
.footer a {
  color: rgba(248, 245, 239, 0.7);
  display: block;
  padding: 6px 0;
  font-size: 0.92rem;
  transition: color var(--t-fast), transform var(--t-fast);
}
.footer a:hover { color: var(--gold-400); transform: translateX(2px); }
.footer-bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--ink-300);
  flex-wrap: wrap; gap: var(--space-4);
}

/* =================================================================
   Modal / Overlay — refined
   ================================================================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(6, 18, 43, 0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-overlay);
  padding: var(--space-4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  max-width: 560px;
  width: 100%;
  padding: var(--space-8);
  box-shadow: var(--shadow-2xl);
  transform: translateY(24px) scale(0.98);
  transition: transform var(--t-base);
  border: 1px solid var(--border-soft);
}
.overlay.open .modal { transform: translateY(0) scale(1); }

/* =================================================================
   Toast — improved positioning
   ================================================================= */
.toast-container {
  position: fixed;
  top: var(--space-6); right: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--navy-700);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  display: flex; gap: 12px; align-items: flex-start;
  animation: slideIn 0.4s var(--ease-out);
  pointer-events: auto;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 640px) {
  .toast-container {
    top: auto; bottom: var(--space-6);
    left: var(--space-4); right: var(--space-4);
  }
  .toast { min-width: auto; max-width: none; width: 100%; }
}

/* =================================================================
   Avatar
   ================================================================= */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
}
.avatar-lg { width: 60px; height: 60px; font-size: 1.45rem; }

/* =================================================================
   Progress bar
   ================================================================= */
.progress {
  height: 8px;
  background: var(--cream-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
  border-radius: inherit;
  transition: width var(--t-slow);
  position: relative;
}
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), transparent);
  border-radius: inherit;
}
.progress-bar.navy { background: linear-gradient(90deg, var(--navy-700), var(--navy-500)); }
.progress-bar.success { background: linear-gradient(90deg, var(--success), #1ea672); }

/* =================================================================
   Empty state
   ================================================================= */
.empty {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--ink-400);
}
.empty-icon { font-size: 2.8rem; margin-bottom: var(--space-3); opacity: 0.4; }

/* =================================================================
   Chips / Tags
   ================================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--cream-100);
  color: var(--ink-700);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--border-soft);
  min-height: 36px;
}
.chip:hover { background: var(--cream-200); border-color: var(--border-strong); }
.chip.active {
  background: var(--navy-800);
  color: var(--cream-50);
  border-color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}

/* =================================================================
   Divider
   ================================================================= */
.divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--ink-400);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: var(--space-6) 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
