/* =============================================================
 * suite-polish.css — Renovación profesional Suite LeanCP
 * Capa ADITIVA: refina look existente sin romper tokens propios
 * Cargar DESPUÉS del CSS principal de cada app:
 *   <link rel="stylesheet" href="assets/css/suite-polish.css?v=1">
 *
 * Identidad: dorado #C9A227 + dark + Montserrat/Inter
 * v1 — 2026-04-19
 * ============================================================= */

/* --- GUARD: iconos SVG nunca explotan, max 24px en cualquier slot --- */
.tool-icon svg,
.switcher-app-icon svg,
.nav-item svg,
.nav-item span svg,
.btn svg,
button svg,
.switcher-app svg {
  max-width: 22px !important;
  max-height: 22px !important;
  width: 22px;
  height: 22px;
}
.stat-card svg,
.section-title svg {
  max-width: 28px !important;
  max-height: 28px !important;
}

/* --- Font smoothing & rendering crisp --- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
  -webkit-tap-highlight-color: rgba(201, 162, 39, 0.15);
}

img, svg, video, canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* --- Selección de texto con color de marca --- */
::selection {
  background: rgba(201, 162, 39, 0.32);
  color: #FFFFFF;
  text-shadow: none;
}
::-moz-selection {
  background: rgba(201, 162, 39, 0.32);
  color: #FFFFFF;
}

/* --- Scrollbar custom oscuro premium --- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.35) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.32), rgba(201, 162, 39, 0.18));
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 200ms ease;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.55), rgba(201, 162, 39, 0.35));
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* --- Focus visible accesible (sólo teclado, no click) --- */
*:focus {
  outline: none;
}
*:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.85);
  outline-offset: 2px;
  border-radius: 4px;
  transition: outline-offset 120ms ease;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.85);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.12);
}

/* --- Microinteracciones: hover lift en cards y tool-cards --- */
.tool-card,
.project-card,
.stat-card,
.card {
  transition:
    transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 220ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 220ms ease;
  will-change: transform;
}
.tool-card:not(.disabled):hover,
.project-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(201, 162, 39, 0.08);
}

/* --- Botones primarios: feedback de presión sutil --- */
button,
.btn,
[role="button"] {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 100ms ease,
    box-shadow 180ms ease;
}
button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

/* --- Inputs y textareas: ring suave al enfocar --- */
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
  border-color: rgba(201, 162, 39, 0.6);
}

/* --- Links inline: subrayado animado dorado --- */
a:not(.btn):not(.nav-item):not(.tool-card):not(.project-card):not(.switcher-app) {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 180ms ease, color 180ms ease;
}

/* --- Loading spinner: que se vea premium --- */
.spinner,
.loading-spinner {
  border-color: rgba(255, 255, 255, 0.08);
  border-top-color: #C9A227;
  border-radius: 50%;
}

/* --- Toasts y notifications: sombra elegante --- */
.toast,
.notification,
.toast-container > * {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(201, 162, 39, 0.12);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

/* --- Skeleton/placeholder loading shimmer --- */
.skeleton,
.loading-placeholder {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(201, 162, 39, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: suite-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes suite-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Tablas: hover row + zebra suave --- */
table tbody tr {
  transition: background-color 120ms ease;
}
table tbody tr:hover {
  background: rgba(201, 162, 39, 0.04);
}

/* --- Imágenes lazy: fade-in elegante --- */
img[loading="lazy"] {
  animation: suite-fade-in 360ms ease-out;
}
@keyframes suite-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Print: limpio para PDFs --- */
@media print {
  *::-webkit-scrollbar { display: none; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- Reducir movimiento si el usuario lo prefiere --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
