/* =====================================================================
   MAIN.CSS — Design System
   SaaS Asistencia WhatsApp
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:          #6366f1;
  --primary-hover:    #4f46e5;
  --primary-light:    rgba(99, 102, 241, 0.12);
  --primary-glow:     rgba(99, 102, 241, 0.25);

  /* Attendance states */
  --entrada:          #10b981;
  --entrada-light:    rgba(16, 185, 129, 0.12);
  --entrada-border:   rgba(16, 185, 129, 0.3);
  --salida:           #ef4444;
  --salida-light:     rgba(239, 68, 68, 0.12);
  --salida-border:    rgba(239, 68, 68, 0.3);
  --warning:          #f59e0b;
  --warning-light:    rgba(245, 158, 11, 0.12);
  --info:             #3b82f6;
  --info-light:       rgba(59, 130, 246, 0.12);

  /* Sidebar */
  --sidebar-bg:       #0f172a;
  --sidebar-bg2:      #1e293b;
  --sidebar-text:     #cbd5e1;
  --sidebar-muted:    #64748b;
  --sidebar-active:   rgba(99, 102, 241, 0.18);
  --sidebar-active-border: #6366f1;
  --sidebar-hover:    rgba(255, 255, 255, 0.06);
  --sidebar-width:    260px;

  /* Surfaces */
  --bg:               #f1f5f9;
  --surface:          #ffffff;
  --surface-2:        #f8fafc;
  --surface-hover:    #f1f5f9;
  --border:           #e2e8f0;
  --border-light:     #f1f5f9;

  /* Text */
  --text-primary:     #0f172a;
  --text-secondary:   #475569;
  --text-muted:       #94a3b8;
  --text-light:       #cbd5e1;
  --text-inverted:    #ffffff;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-card: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.05);

  /* Layout */
  --header-h:   64px;
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --t-fast:   120ms ease;
  --t-normal: 220ms ease;
  --t-slow:   360ms ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img, svg { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 0.95rem; }
p { color: var(--text-secondary); }
small { font-size: 0.8125rem; }

/* ─── Utility classes ────────────────────────────────────────────────── */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--entrada) !important; }
.text-danger    { color: var(--salida) !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.text-sm        { font-size: 0.875rem; }
.text-xs        { font-size: 0.75rem; }
.text-lg        { font-size: 1.125rem; }
.text-xl        { font-size: 1.25rem; }
.text-center    { text-align: center; }
.uppercase      { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; font-weight: 600; }

.flex          { display: flex; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1   { gap: 0.25rem; }
.gap-2   { gap: 0.5rem; }
.gap-3   { gap: 0.75rem; }
.gap-4   { gap: 1rem; }
.gap-6   { gap: 1.5rem; }
.flex-1  { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.relative { position: relative; }
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Animations ────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.animate-fade { animation: fadeIn 0.3s ease both; }
.animate-slide { animation: slideInRight 0.3s ease both; }

/* ─── Skeleton loading ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-light) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; width: 100%; }
.skeleton-title { height: 20px; width: 60%; }

/* ─── Toast notifications ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: slideInRight 0.3s ease both;
  border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: var(--entrada); }
.toast.error   { border-left-color: var(--salida); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-exit { animation: slideInRight 0.3s ease reverse both; }
