/*
 * ══════════════════════════════════════════════════
 *  ServiSoft Cloud — Design Tokens v1.0
 *  Junio 2026
 *
 *  INSTRUCCIONES:
 *  Copiar este bloque en el CSS global del proyecto
 *  (ej: static/css/base.css). Nunca usar los valores
 *  hex directamente en los componentes — siempre usar
 *  las variables CSS.
 * ══════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {

  /* ── Colores primarios ServiSoft Cloud ── */
  --ss-teal:            #0891b2;   /* CTA principal, links, focus ring */
  --ss-teal-mid:        #38bcd4;   /* hover states, highlights */
  --ss-teal-light:      #cff0f8;   /* backgrounds de badges, chips */
  --ss-teal-ultralight: #e0f6fb;   /* card hover, sidebar active bg */

  /* ── Heredados de ServiCenter ── */
  --ss-navy:            #1a2e5a;   /* sidebar, headings, logo */
  --ss-blue:            #3d7cc9;   /* links secundarios, info */
  --ss-blue-light:      #d4e3f5;   /* info chips, fondos informativos */
  --ss-blue-accent:     #6a9fe0;   /* textos secundarios, íconos */

  /* ── Semánticos ── */
  --ss-success:         #16a34a;
  --ss-success-bg:      #dcfce7;
  --ss-warning:         #ca8a04;
  --ss-warning-bg:      #fef9c3;
  --ss-danger:          #dc2626;
  --ss-danger-bg:       #fee2e2;
  --ss-info:            #3d7cc9;
  --ss-info-bg:         #d4e3f5;

  /* ── Neutros ── */
  --ss-text:            #1a1f36;   /* body text, datos */
  --ss-text-secondary:  #6b7894;   /* labels, placeholders, metadatos */
  --ss-bg:              #f5f8fc;   /* fondo de la app */
  --ss-border:          #dfe6f0;   /* bordes, dividers */
  --ss-white:           #ffffff;

  /* ── Tipografía ── */
  --ss-font:            'Plus Jakarta Sans', sans-serif;
  --ss-font-mono:       'JetBrains Mono', monospace;

  /* ── Escala de espaciado (base 4px) ── */
  --ss-space-xs:        4px;
  --ss-space-sm:        8px;
  --ss-space-md:        12px;
  --ss-space-lg:        16px;
  --ss-space-xl:        24px;
  --ss-space-2xl:       32px;
  --ss-space-3xl:       48px;
  --ss-space-4xl:       64px;

  /* ── Border radius ── */
  --ss-radius-sm:       4px;    /* inputs pequeños, chips */
  --ss-radius-md:       8px;    /* botones, tags */
  --ss-radius-lg:       10px;   /* inputs, rows */
  --ss-radius-xl:       14px;   /* cards, panels */
  --ss-radius-2xl:      20px;   /* modals, drawers */
  --ss-radius-full:     9999px; /* badges, avatares, pills */

  /* ── Sombras ── */
  --ss-shadow-xs:       0 1px 4px rgba(0,0,0,0.06);
  --ss-shadow-sm:       0 2px 8px rgba(0,0,0,0.08);
  --ss-shadow-md:       0 4px 16px rgba(0,0,0,0.10);
  --ss-shadow-lg:       0 8px 32px rgba(0,0,0,0.12);
  --ss-shadow-focus:    0 0 0 3px rgba(8,145,178,0.18); /* focus ring teal */

  /* ── Layout ── */
  --ss-sidebar-width:   220px;   /* ancho fijo del sidebar desktop */
  --ss-bottomnav-h:     60px;    /* alto de la bottom nav mobile */

  /* ── Breakpoints (usar en @media) ── */
  /* mobile:  < 768px  → bottom nav, sin sidebar          */
  /* desktop: ≥ 768px  → sidebar fijo 220px, sin bottom nav */
}


/*
 * ──────────────────────────────────────────────────
 *  RESET MÍNIMO RECOMENDADO
 * ──────────────────────────────────────────────────
 */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--ss-font);
  color: var(--ss-text);
  background: var(--ss-bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}


/*
 * ──────────────────────────────────────────────────
 *  TIPOGRAFÍA — ESCALA
 * ──────────────────────────────────────────────────
 */

/* Display / H1 */
.ss-display {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ss-navy);
}

/* Heading / H2 */
.ss-heading {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ss-navy);
}

/* Subheading / H3 */
.ss-subheading {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ss-navy);
}

/* Title / H4 */
.ss-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ss-text);
}

/* Body */
.ss-body {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ss-text);
}

/* Body small */
.ss-body-sm {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ss-text-secondary);
}

/* Label / caption */
.ss-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ss-text-secondary);
}

/* Mono (precios, códigos) */
.ss-mono {
  font-family: var(--ss-font-mono);
  font-size: 13px;
  color: var(--ss-teal);
}


/*
 * ──────────────────────────────────────────────────
 *  BOTONES
 * ──────────────────────────────────────────────────
 */
.ss-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--ss-radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--ss-font);
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, opacity 0.15s;
}
.ss-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Variantes */
.ss-btn-primary   { background: var(--ss-teal);       color: #fff; }
.ss-btn-primary:hover { background: #0781a0; }

.ss-btn-secondary { background: var(--ss-teal-light); color: var(--ss-teal); }
.ss-btn-secondary:hover { background: #b8e8f4; }

.ss-btn-outline   { background: transparent; color: var(--ss-teal); border: 1.5px solid var(--ss-teal); }
.ss-btn-outline:hover { background: var(--ss-teal-light); }

.ss-btn-ghost     { background: transparent; color: var(--ss-text-secondary); border: 1.5px solid var(--ss-border); }
.ss-btn-ghost:hover { color: var(--ss-text); border-color: #c8d4e0; background: var(--ss-bg); }

.ss-btn-danger    { background: var(--ss-danger-bg);  color: var(--ss-danger); }
.ss-btn-danger:hover { background: #fecaca; }

/* Tamaños */
.ss-btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--ss-radius-md); }
.ss-btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--ss-radius-lg); }


/*
 * ──────────────────────────────────────────────────
 *  INPUTS
 * ──────────────────────────────────────────────────
 */
.ss-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--ss-border);
  border-radius: var(--ss-radius-lg);
  font-size: 14px;
  font-family: var(--ss-font);
  color: var(--ss-text);
  background: var(--ss-white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ss-input::placeholder { color: var(--ss-text-secondary); opacity: 0.7; }
.ss-input:focus {
  border-color: var(--ss-teal);
  box-shadow: var(--ss-shadow-focus);
}
.ss-input--error {
  border-color: var(--ss-danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}
.ss-input--disabled {
  background: var(--ss-bg);
  color: var(--ss-text-secondary);
  cursor: not-allowed;
}

.ss-label-text { font-size: 12px; font-weight: 600; color: var(--ss-text); margin-bottom: 6px; display: block; }
.ss-hint       { font-size: 11px; color: var(--ss-text-secondary); margin-top: 4px; }
.ss-hint--error { color: var(--ss-danger); font-weight: 500; }


/*
 * ──────────────────────────────────────────────────
 *  CHIPS / BADGES DE ESTADO
 * ──────────────────────────────────────────────────
 */
.ss-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--ss-radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.ss-chip__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.ss-chip--teal   { background: var(--ss-teal-light);   color: var(--ss-teal);    }
.ss-chip--green  { background: var(--ss-success-bg);   color: var(--ss-success); }
.ss-chip--yellow { background: var(--ss-warning-bg);   color: var(--ss-warning); }
.ss-chip--red    { background: var(--ss-danger-bg);    color: var(--ss-danger);  }
.ss-chip--blue   { background: var(--ss-blue-light);   color: var(--ss-blue);    }
.ss-chip--gray   { background: #f1f3f7;                color: var(--ss-text-secondary); }


/*
 * ──────────────────────────────────────────────────
 *  CARDS
 * ──────────────────────────────────────────────────
 */
.ss-card {
  background: var(--ss-white);
  border-radius: var(--ss-radius-xl);
  border: 1px solid var(--ss-border);
  box-shadow: var(--ss-shadow-xs);
  padding: var(--ss-space-xl);
}


/*
 * ──────────────────────────────────────────────────
 *  SIDEBAR (desktop, ≥ 768px)
 * ──────────────────────────────────────────────────
 */
.ss-sidebar {
  width: var(--ss-sidebar-width);
  background: var(--ss-navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.ss-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--ss-radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.50);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
}
.ss-nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}
.ss-nav-item--active {
  background: rgba(8,145,178,0.20);
  color: #fff;
  font-weight: 600;
}
.ss-nav-item--active svg,
.ss-nav-item--active .ss-nav-icon { color: var(--ss-teal-mid); }


/*
 * ──────────────────────────────────────────────────
 *  BOTTOM NAV (mobile, < 768px)
 * ──────────────────────────────────────────────────
 */
.ss-bottom-nav {
  display: none; /* visible solo en mobile */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--ss-bottomnav-h);
  background: var(--ss-white);
  border-top: 1px solid var(--ss-border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 50;
}

@media (max-width: 767px) {
  .ss-sidebar { display: none; }
  .ss-bottom-nav { display: flex; }
}

.ss-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ss-text-secondary);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.14s;
}
.ss-bottom-nav-item--active { color: var(--ss-teal); }


/*
 * ──────────────────────────────────────────────────
 *  BANNER DE IMPERSONACIÓN (modo soporte admin)
 * ──────────────────────────────────────────────────
 */
.ss-impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  flex-shrink: 0;
  z-index: 80;
}


/*
 * ──────────────────────────────────────────────────
 *  TOASTS
 *  Posición: bottom-center en mobile / bottom-right en desktop
 * ──────────────────────────────────────────────────
 */
.ss-toast-container {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--ss-bottomnav-h) + 12px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 380px;
  padding: 0 16px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .ss-toast-container {
    left: auto;
    right: 24px;
    bottom: 24px;
    transform: none;
    max-width: 340px;
    padding: 0;
  }
}

.ss-toast {
  background: var(--ss-navy);
  color: white;
  padding: 12px 16px;
  border-radius: var(--ss-radius-xl);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--ss-shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  pointer-events: all;
  animation: ss-toast-in 0.2s ease;
}
.ss-toast--success { border-left: 4px solid var(--ss-success); }
.ss-toast--error   { border-left: 4px solid var(--ss-danger);  }
.ss-toast--info    { border-left: 4px solid var(--ss-teal);    }

@keyframes ss-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}


/*
 * ──────────────────────────────────────────────────
 *  PAGE HEADER
 * ──────────────────────────────────────────────────
 */
.ss-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--ss-space-lg);
}

.ss-h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ss-navy);
  margin: 0;
}


/*
 * ──────────────────────────────────────────────────
 *  TABS
 * ──────────────────────────────────────────────────
 */
.ss-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: var(--ss-space-lg);
  border-bottom: 1px solid var(--ss-border);
  padding-bottom: 0;
}

.ss-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ss-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.ss-tab:hover { color: var(--ss-text); }
.ss-tab--active {
  color: var(--ss-teal);
  border-bottom-color: var(--ss-teal);
}


/*
 * ──────────────────────────────────────────────────
 *  TABLE
 * ──────────────────────────────────────────────────
 */
.ss-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ss-white);
  border-radius: var(--ss-radius-xl);
  border: 1px solid var(--ss-border);
  overflow: hidden;
  box-shadow: var(--ss-shadow-xs);
}
.ss-table thead tr {
  background: var(--ss-bg);
}
.ss-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ss-text-secondary);
  border-bottom: 1px solid var(--ss-border);
}
.ss-table td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ss-text);
  border-bottom: 1px solid var(--ss-border);
}
.ss-table tbody tr:last-child td { border-bottom: none; }
.ss-table tbody tr:hover { background: var(--ss-teal-ultralight); }


/*
 * ──────────────────────────────────────────────────
 *  FORM GROUPS / ALERTS
 * ──────────────────────────────────────────────────
 */
.ss-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--ss-space-md);
}

.ss-alert {
  padding: 12px 16px;
  border-radius: var(--ss-radius-lg);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--ss-space-md);
}
.ss-alert--error {
  background: var(--ss-danger-bg);
  color: var(--ss-danger);
  border: 1px solid #fca5a5;
}
.ss-alert--success {
  background: var(--ss-success-bg);
  color: var(--ss-success);
  border: 1px solid #86efac;
}

/*
 * ──────────────────────────────────────────────────
 *  MODALES (Task 10)
 * ──────────────────────────────────────────────────
 */
.ss-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: ss-modal-fade-in 0.2s ease;
}

.ss-modal {
  background: var(--ss-white);
  padding: var(--ss-space-xl);
  border-radius: var(--ss-radius-2xl);
  box-shadow: var(--ss-shadow-lg);
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--ss-border);
  animation: ss-modal-scale-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ss-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ss-modal-scale-up {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
