/* ============================================================
   MK SYSTEM — Sistema de Diseño Global
   Versión 1.0 | Corporativo Premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Sora:wght@400;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Colores primarios — Paleta Violeta/Mauve */
  --c-primary:       #6d3567;   /* púrpura medio */
  --c-primary-dark:  #3a1442;   /* plum oscuro   */
  --c-primary-light: #f3e8f3;   /* lavanda claro */
  --c-primary-mid:   #9b6095;   /* violeta medio */

  /* Colores de acento (se mantienen funcionales) */
  --c-success:       #0e9f6e;
  --c-success-light: #def7ec;
  --c-warning:       #c87941;
  --c-warning-light: #fef3c7;
  --c-danger:        #c0354f;
  --c-danger-light:  #fde8e8;
  --c-info:          #5b6ec9;
  --c-info-light:    #eaecfb;
  --c-purple:        #6d3567;
  --c-purple-light:  #f3e8f3;

  /* Grises con tinte violáceo */
  --c-white:        #ffffff;
  --c-bg:           #fdf8fc;   /* fondo general levemente rosado     */
  --c-bg-alt:       #f5edf5;   /* fondo alternativo mauve muy claro  */
  --c-border:       #e8d5e8;   /* borde mauve suave                  */
  --c-border-dark:  #d4b0d0;   /* borde mauve más marcado            */
  --c-gray-100:     #f8f2f8;
  --c-gray-200:     #f0e3f0;
  --c-gray-300:     #dcc5dc;
  --c-gray-400:     #c4a0c4;
  --c-gray-500:     #a07aa0;
  --c-gray-600:     #7a5580;
  --c-gray-700:     #573060;
  --c-gray-800:     #3a1442;
  --c-gray-900:     #200b28;

  /* Texto */
  --t-primary:   #2d1133;   /* texto principal — plum oscuro    */
  --t-secondary: #6b4d72;   /* texto secundario — violeta medio */
  --t-muted:     #b088aa;   /* texto atenuado — mauve           */
  --t-inverse:   #ffffff;
  --t-link:      #6d3567;

  /* Tipografía — Inter como fuente universal */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', sans-serif;

  --fs-xs: 0.6875rem;
  /* 11px */
  --fs-sm: 0.75rem;
  /* 12px */
  --fs-base: 0.875rem;
  /* 14px */
  --fs-md: 1rem;
  /* 16px */
  --fs-lg: 1.125rem;
  /* 18px */
  --fs-xl: 1.25rem;
  /* 20px */
  --fs-2xl: 1.5rem;
  /* 24px */
  --fs-3xl: 1.875rem;
  /* 30px */
  --fs-4xl: 2.25rem;
  /* 36px */

  --fw-light: 300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi: 600;
  --fw-bold: 700;
  --fw-black: 800;

  --lh-tight: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.625;

  /* Espaciado */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Bordes */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Sombras — con tinte plum */
  --shadow-xs:    0 1px 2px 0 rgba(58, 20, 66, .06);
  --shadow-sm:    0 1px 3px 0 rgba(58, 20, 66, .08), 0 1px 2px -1px rgba(58, 20, 66, .05);
  --shadow-md:    0 4px 6px -1px rgba(58, 20, 66, .08), 0 2px 4px -2px rgba(58, 20, 66, .05);
  --shadow-lg:    0 10px 15px -3px rgba(58, 20, 66, .08), 0 4px 6px -4px rgba(58, 20, 66, .04);
  --shadow-xl:    0 20px 25px -5px rgba(58, 20, 66, .08), 0 8px 10px -6px rgba(58, 20, 66, .04);
  --shadow-2xl:   0 25px 50px -12px rgba(58, 20, 66, .16);
  --shadow-inner: inset 0 2px 4px 0 rgba(58, 20, 66, .06);

  /* Transiciones */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index */
  --z-sidebar: 100;
  --z-header: 200;
  --z-dropdown: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-width-mini: 72px;
  --header-height: 64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--t-primary);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--t-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--c-primary-dark);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--fs-base);
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Tipografía ─────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--t-primary);
}

h1 {
  font-size: var(--fs-3xl);
}

h2 {
  font-size: var(--fs-2xl);
}

h3 {
  font-size: var(--fs-xl);
}

h4 {
  font-size: var(--fs-lg);
}

h5 {
  font-size: var(--fs-md);
}

h6 {
  font-size: var(--fs-base);
}

p {
  color: var(--t-secondary);
  line-height: var(--lh-relaxed);
}

small {
  font-size: var(--fs-sm);
}

strong {
  font-weight: var(--fw-semi);
  color: var(--t-primary);
}

/* ── Utilidades ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-primary {
  color: var(--c-primary) !important;
}

.text-success {
  color: var(--c-success) !important;
}

.text-warning {
  color: var(--c-warning) !important;
}

.text-danger {
  color: var(--c-danger) !important;
}

.text-info {
  color: var(--c-info) !important;
}

.text-muted {
  color: var(--t-muted) !important;
}

.text-secondary {
  color: var(--t-secondary) !important;
}

.fw-medium {
  font-weight: var(--fw-medium) !important;
}

.fw-semi {
  font-weight: var(--fw-semi) !important;
}

.fw-bold {
  font-weight: var(--fw-bold) !important;
}

.fs-xs {
  font-size: var(--fs-xs) !important;
}

.fs-sm {
  font-size: var(--fs-sm) !important;
}

.fs-base {
  font-size: var(--fs-base) !important;
}

.fs-md {
  font-size: var(--fs-md) !important;
}

.fs-lg {
  font-size: var(--fs-lg) !important;
}

.fs-xl {
  font-size: var(--fs-xl) !important;
}

.text-left {
  text-align: left !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

.d-block {
  display: block !important;
}

.d-none {
  display: none !important;
}

.d-inline {
  display: inline !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.flex-none {
  flex: none;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.gap-1 {
  gap: var(--sp-1);
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.gap-4 {
  gap: var(--sp-4);
}

.gap-6 {
  gap: var(--sp-6);
}

.gap-8 {
  gap: var(--sp-8);
}

.w-full {
  width: 100% !important;
}

.h-full {
  height: 100% !important;
}

.mt-1 {
  margin-top: var(--sp-1);
}

.mt-2 {
  margin-top: var(--sp-2);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-6 {
  margin-top: var(--sp-6);
}

.mt-8 {
  margin-top: var(--sp-8);
}

.mb-1 {
  margin-bottom: var(--sp-1);
}

.mb-2 {
  margin-bottom: var(--sp-2);
}

.mb-4 {
  margin-bottom: var(--sp-4);
}

.mb-6 {
  margin-bottom: var(--sp-6);
}

.mb-8 {
  margin-bottom: var(--sp-8);
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-2 {
  padding: var(--sp-2);
}

.p-4 {
  padding: var(--sp-4);
}

.p-6 {
  padding: var(--sp-6);
}

.p-8 {
  padding: var(--sp-8);
}

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: var(--radius-full);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

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

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.cursor-pointer {
  cursor: pointer;
}

.pointer-events-none {
  pointer-events: none;
}

.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--c-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--c-gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-gray-400);
}

/* ── Selección ─────────────────────────────────────────────── */
::selection {
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
}

/* ── Focus ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Impresión ─────────────────────────────────────────────── */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  .app-sidebar,
  .app-header {
    display: none !important;
  }

  .app-content {
    margin: 0 !important;
  }
}

/* ── Bloqueo de Zoom en Móviles ────────────────────────────── */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important;
    touch-action: manipulation;
  }
}