/* ================================================================
   ViewRelay — Portal Theme
   ================================================================
   Design system CSS para el portal de licencias ViewRelay.
   Basado en el mockup aprobado (Abril 2026).

   Referencia visual: Linear, Stripe Dashboard, Vercel
   Tipografía: Inter (sans), JetBrains Mono (mono)
   Grid: 8pt, 12 columnas responsive
   Escala tipográfica: Major Third (1.250)
   Accesibilidad: WCAG 2.2 AA

   Uso:
     1. Importar este archivo como base del portal
     2. Los componentes referencian tokens semánticos (--vr-*)
     3. Nunca usar valores crudos (hex) directamente en componentes
   ================================================================ */


/* ================================================================
   1. DESIGN TOKENS — Custom Properties
   ================================================================ */
:root {

  /* ---- 1.1 Brand Primitives ---- */
  --vr-brand-blue:           #0A84FF;
  --vr-brand-teal:           #00D4AA;
  --vr-brand-cyan:           #00B4D8;
  --vr-brand-dark:           #1A1A2E;

  /* ---- 1.2 Palette — Blue scale ---- */
  --vr-blue-50:              #EBF5FF;
  --vr-blue-100:             #D6EBFF;
  --vr-blue-500:             #0A84FF;
  --vr-blue-600:             #0070E0;
  --vr-blue-700:             #005CBB;
  --vr-blue-800:             #1E40AF;

  /* ---- 1.3 Palette — Neutral scale ---- */
  --vr-neutral-0:            #FFFFFF;
  --vr-neutral-50:           #FAFBFD;
  --vr-neutral-100:          #F4F6F9;
  --vr-neutral-150:          #F1F5F9;
  --vr-neutral-200:          #E8ECF2;
  --vr-neutral-300:          #CBD5E1;
  --vr-neutral-400:          #758698;  /* Adjusted from #94A3B8 for WCAG 3:1 on page bg */
  --vr-neutral-500:          #64748B;
  --vr-neutral-600:          #475569;
  --vr-neutral-800:          #1E293B;
  --vr-neutral-900:          #0F172A;

  /* ---- 1.4 Palette — Semantic status ---- */
  --vr-success-50:           #ECFDF5;
  --vr-success-500:          #10B981;
  --vr-success-800:          #065F46;

  --vr-warning-50:           #FFFBEB;
  --vr-warning-500:          #F59E0B;
  --vr-warning-800:          #92400E;

  --vr-danger-50:            #FEF2F2;
  --vr-danger-500:           #EF4444;
  --vr-danger-800:           #991B1B;

  --vr-info-50:              var(--vr-blue-50);
  --vr-info-500:             var(--vr-blue-500);
  --vr-info-800:             var(--vr-blue-800);

  /* ---- 1.5 Teal accent ---- */
  --vr-teal-50:              #E6FAF5;
  --vr-teal-600:             #059669;


  /* ================================================================
     2. SEMANTIC TOKENS — Intención de uso
     ================================================================ */

  /* ---- 2.1 Backgrounds ---- */
  --bg-page:                 var(--vr-neutral-100);
  --bg-card:                 var(--vr-neutral-0);
  --bg-card-hover:           var(--vr-neutral-50);
  --bg-elevated:             var(--vr-neutral-0);
  --bg-sidebar:              var(--vr-brand-dark);
  --bg-sidebar-hover:        #2C2C4A;
  --bg-sidebar-soft:         #232340;
  --bg-input:                var(--vr-neutral-0);
  --bg-code:                 var(--vr-neutral-100);
  --bg-table-header:         var(--vr-neutral-100);

  /* ---- 2.2 Borders ---- */
  --border-default:          var(--vr-neutral-200);
  --border-subtle:           var(--vr-neutral-150);
  --border-input:            var(--vr-neutral-300);
  --border-focus:            var(--vr-brand-blue);
  --border-sidebar:          rgba(255, 255, 255, 0.06);

  /* ---- 2.3 Text ---- */
  --text-primary:            var(--vr-neutral-900);
  --text-secondary:          var(--vr-neutral-600);
  --text-tertiary:           var(--vr-neutral-400);
  --text-link:               var(--vr-brand-blue);
  --text-inverse:            #FFFFFF;
  --text-inverse-secondary:  rgba(255, 255, 255, 0.60);
  --text-on-accent:          #FFFFFF;

  /* ---- 2.4 Action (botones, links) ---- */
  --action-primary:          var(--vr-brand-blue);
  --action-primary-hover:    var(--vr-blue-600);
  --action-primary-active:   var(--vr-blue-700);
  --action-primary-text:     #FFFFFF;
  --action-secondary:        transparent;
  --action-secondary-hover:  var(--vr-blue-50);
  --action-secondary-text:   var(--vr-brand-blue);
  --action-ghost-hover:      var(--vr-neutral-100);

  /* ---- 2.5 Status — badge / indicator ---- */
  --status-success-bg:       var(--vr-success-50);
  --status-success-text:     var(--vr-success-800);
  --status-success-dot:      var(--vr-success-500);

  --status-warning-bg:       var(--vr-warning-50);
  --status-warning-text:     var(--vr-warning-800);
  --status-warning-dot:      var(--vr-warning-500);

  --status-danger-bg:        var(--vr-danger-50);
  --status-danger-text:      var(--vr-danger-800);
  --status-danger-dot:       var(--vr-danger-500);

  --status-info-bg:          var(--vr-info-50);
  --status-info-text:        var(--vr-info-800);
  --status-info-dot:         var(--vr-info-500);

  --status-neutral-bg:       var(--vr-neutral-150);
  --status-neutral-text:     var(--vr-neutral-600);


  /* ================================================================
     3. TYPOGRAPHY TOKENS
     ================================================================
     Escala: Major Third (1.250)
     Base: 16px
     Escala: 10 · 11 · 12 · 13 · 14 · 16 · 20 · 24 · 32 · 40
  */

  --font-sans:               'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:               'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Size scale */
  --text-2xs:                10px;
  --text-xs:                 11px;
  --text-sm:                 12px;
  --text-base-sm:            13px;
  --text-base:               14px;
  --text-md:                 15px;
  --text-lg:                 16px;
  --text-xl:                 20px;
  --text-2xl:                24px;
  --text-3xl:                32px;
  --text-4xl:                40px;

  /* Weight */
  --weight-light:            300;
  --weight-regular:          400;
  --weight-medium:           500;
  --weight-semibold:         600;
  --weight-bold:             700;

  /* Line height */
  --leading-tight:           1.1;
  --leading-snug:            1.2;
  --leading-normal:          1.5;
  --leading-relaxed:         1.6;

  /* Letter spacing */
  --tracking-tighter:        -0.02em;
  --tracking-tight:          -0.01em;
  --tracking-normal:         0;
  --tracking-wide:           0.04em;
  --tracking-wider:          0.06em;
  --tracking-widest:         0.08em;


  /* ================================================================
     4. SPACING TOKENS (8pt grid)
     ================================================================ */
  --space-0:                 0;
  --space-1:                 2px;
  --space-2:                 4px;
  --space-3:                 6px;
  --space-4:                 8px;
  --space-5:                 10px;
  --space-6:                 12px;
  --space-8:                 16px;
  --space-10:                20px;
  --space-12:                24px;
  --space-14:                28px;
  --space-16:                32px;
  --space-20:                40px;
  --space-24:                48px;
  --space-32:                64px;


  /* ================================================================
     5. BORDER RADIUS
     ================================================================ */
  --radius-xs:               4px;
  --radius-sm:               6px;
  --radius-md:               8px;
  --radius-lg:               12px;
  --radius-xl:               16px;
  --radius-full:             9999px;


  /* ================================================================
     6. SHADOWS
     ================================================================ */
  --shadow-xs:               0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:               0 1px 3px rgba(0, 0, 0, 0.06),
                             0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:               0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg:               0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl:               0 12px 48px rgba(0, 0, 0, 0.12);
  --shadow-accent:           0 2px 8px rgba(10, 132, 255, 0.3);
  --shadow-float:            0 8px 32px rgba(0, 0, 0, 0.20);


  /* ================================================================
     7. TRANSITIONS
     ================================================================ */
  --ease-default:            cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:                 cubic-bezier(0.4, 0, 1, 1);
  --ease-out:                cubic-bezier(0, 0, 0.2, 1);
  --duration-fast:           100ms;
  --duration-normal:         150ms;
  --duration-slow:           200ms;
  --duration-slower:         300ms;
  --transition-colors:       color var(--duration-normal) var(--ease-default),
                             background-color var(--duration-normal) var(--ease-default),
                             border-color var(--duration-normal) var(--ease-default);
  --transition-shadow:       box-shadow var(--duration-slow) var(--ease-default);


  /* ================================================================
     8. Z-INDEX SCALE
     ================================================================ */
  --z-base:                  0;
  --z-dropdown:              10;
  --z-sticky:                20;
  --z-header:                30;
  --z-sidebar:               40;
  --z-overlay:               50;
  --z-modal:                 60;
  --z-toast:                 70;
  --z-tooltip:               80;


  /* ================================================================
     9. LAYOUT CONSTANTS
     ================================================================ */
  --sidebar-width:           240px;
  --header-height:           64px;
  --content-padding-x:       32px;
  --content-padding-y:       28px;
  --content-max-width:       1200px;
}


/* ================================================================
   10. RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

/* Focus visible — accesibilidad */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}


/* ================================================================
   11. LAYOUT — App shell
   ================================================================ */
.vr-app {
  display: flex;
  min-height: 100vh;
}

.vr-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.vr-content {
  padding: var(--content-padding-y) var(--content-padding-x);
  max-width: var(--content-max-width);
}


/* ================================================================
   12. SIDEBAR
   ================================================================ */
.vr-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
}

/* Logo block */
.vr-sidebar__logo {
  padding: var(--space-10) var(--space-10) var(--space-8);
  border-bottom: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.vr-sidebar__logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.vr-sidebar__logo-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-inverse);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.vr-sidebar__logo-tag {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  color: var(--text-inverse-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* Navigation */
.vr-sidebar__nav {
  flex: 1;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.vr-sidebar__section-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-inverse-secondary);
  padding: var(--space-8) var(--space-6) var(--space-3);
}

.vr-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  transition: var(--transition-colors);
  cursor: pointer;
}

.vr-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.vr-nav-item.is-active {
  background: var(--action-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.vr-nav-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.vr-nav-item.is-active .vr-nav-item__icon {
  opacity: 1;
}

/* Sidebar footer */
.vr-sidebar__footer {
  padding: var(--space-8);
  border-top: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.vr-sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--vr-brand-blue), var(--vr-brand-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.vr-sidebar__user-name {
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vr-sidebar__user-role {
  font-size: var(--text-xs);
  color: var(--text-inverse-secondary);
}

.vr-sidebar__logout {
  color: var(--text-inverse-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-xs);
  transition: color var(--duration-normal);
  background: none;
  border: none;
}

.vr-sidebar__logout:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* ================================================================
   13. HEADER
   ================================================================ */
.vr-header {
  height: var(--header-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-padding-x);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.vr-header__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.vr-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.vr-header__icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-colors);
}

.vr-header__icon-btn:hover {
  background: var(--bg-page);
  color: var(--text-secondary);
}

.vr-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--vr-brand-blue), var(--vr-brand-teal));
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


/* ================================================================
   14. KPI CARDS
   ================================================================ */

/* Primary KPI — large */
.vr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.vr-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: var(--transition-shadow);
}

.vr-kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.vr-kpi-card__label {
  font-size: var(--text-base-sm);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
}

.vr-kpi-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  margin: var(--space-2) 0;
}

.vr-kpi-card__sub {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.vr-kpi-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vr-kpi-card__icon svg {
  width: 20px;
  height: 20px;
}

.vr-kpi-card__icon--blue  { background: var(--status-info-bg);    color: var(--vr-brand-blue); }
.vr-kpi-card__icon--teal  { background: var(--vr-teal-50);        color: var(--vr-teal-600); }
.vr-kpi-card__icon--amber { background: var(--status-warning-bg); color: var(--vr-warning-500); }

/* Secondary KPI — compact */
.vr-kpi-grid--sm {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.vr-kpi-card--sm {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-10);
  display: flex;
  align-items: center;
  gap: var(--space-7, 14px);
  transition: var(--transition-shadow);
}

.vr-kpi-card--sm:hover {
  box-shadow: var(--shadow-md);
}

.vr-kpi-card--sm .vr-kpi-card__icon {
  width: 36px;
  height: 36px;
}

.vr-kpi-card--sm .vr-kpi-card__icon svg {
  width: 18px;
  height: 18px;
}

.vr-kpi-card--sm__label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
}

.vr-kpi-card--sm__value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}


/* ================================================================
   15. PANELS
   ================================================================ */
.vr-panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.vr-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-12);
}

.vr-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.vr-panel__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.vr-panel__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-link);
  text-decoration: none;
  cursor: pointer;
}

.vr-panel__link:hover {
  text-decoration: underline;
}

/* Empty state */
.vr-empty-state {
  font-size: var(--text-base-sm);
  color: var(--text-tertiary);
  padding: var(--space-12) 0;
  text-align: center;
}

.vr-empty-state__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-4);
  background: var(--bg-page);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}


/* ================================================================
   16. TABLE
   ================================================================ */
.vr-table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.vr-table-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-10, 18px) var(--space-12);
  border-bottom: 1px solid var(--border-default);
}

.vr-table-section__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

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

.vr-table thead th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  text-align: left;
  padding: var(--space-5) var(--space-12);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-default);
}

.vr-table tbody td {
  font-size: var(--text-base-sm);
  color: var(--text-secondary);
  padding: var(--space-7, 14px) var(--space-12);
  border-bottom: 1px solid var(--border-subtle);
}

.vr-table tbody tr:last-child td {
  border-bottom: none;
}

.vr-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Monospace key cells */
.vr-table-key {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-code);
  padding: 3px var(--space-4);
  border-radius: var(--radius-xs);
  font-weight: var(--weight-medium);
}


/* ================================================================
   17. BADGES
   ================================================================ */
.vr-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.vr-badge--success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.vr-badge--info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

.vr-badge--warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.vr-badge--danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.vr-badge--neutral {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-text);
}

/* Dot indicator inside badge */
.vr-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.vr-badge--success .vr-badge__dot { background: var(--status-success-dot); }
.vr-badge--info    .vr-badge__dot { background: var(--status-info-dot); }
.vr-badge--warning .vr-badge__dot { background: var(--status-warning-dot); }
.vr-badge--danger  .vr-badge__dot { background: var(--status-danger-dot); }


/* ================================================================
   18. BUTTONS
   ================================================================ */

/* Primary */
.vr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-colors);
  white-space: nowrap;
}

.vr-btn svg {
  width: 16px;
  height: 16px;
}

.vr-btn--primary {
  padding: var(--space-4) var(--space-8);
  background: var(--action-primary);
  color: var(--action-primary-text);
}

.vr-btn--primary:hover {
  background: var(--action-primary-hover);
}

.vr-btn--primary:active {
  background: var(--action-primary-active);
}

/* Secondary / outline */
.vr-btn--secondary {
  padding: var(--space-4) var(--space-8);
  background: var(--action-secondary);
  color: var(--action-secondary-text);
  border: 1px solid var(--border-default);
}

.vr-btn--secondary:hover {
  background: var(--action-secondary-hover);
  border-color: var(--vr-brand-blue);
}

/* Ghost */
.vr-btn--ghost {
  padding: var(--space-4) var(--space-4);
  background: transparent;
  color: var(--text-secondary);
}

.vr-btn--ghost:hover {
  background: var(--action-ghost-hover);
  color: var(--text-primary);
}

/* Disabled state */
.vr-btn:disabled,
.vr-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sizes */
.vr-btn--sm {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
}

.vr-btn--lg {
  padding: var(--space-6) var(--space-12);
  font-size: var(--text-md);
}


/* ================================================================
   19. FORM INPUTS
   ================================================================ */
.vr-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
  outline: none;
}

.vr-input::placeholder {
  color: var(--text-tertiary);
}

.vr-input:hover {
  border-color: var(--vr-neutral-400);
}

.vr-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.vr-input--error {
  border-color: var(--vr-danger-500);
}

.vr-input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.vr-label {
  display: block;
  font-size: var(--text-base-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.vr-helper-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.vr-error-text {
  font-size: var(--text-sm);
  color: var(--vr-danger-500);
  margin-top: var(--space-2);
}

/* Select */
.vr-select {
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 var(--space-16) 0 var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
  outline: none;
  cursor: pointer;
}

.vr-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}


/* ================================================================
   20. UTILITY CLASSES
   ================================================================ */

/* Gradient text (brand) */
.vr-text-gradient {
  background: linear-gradient(135deg, var(--vr-brand-blue), var(--vr-brand-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Brand gradient bar (decorative) */
.vr-gradient-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--vr-brand-blue), var(--vr-brand-cyan), var(--vr-brand-teal));
}

/* Text helpers */
.vr-text-primary   { color: var(--text-primary); }
.vr-text-secondary  { color: var(--text-secondary); }
.vr-text-tertiary   { color: var(--text-tertiary); }

/* Truncate */
.vr-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Monospace */
.vr-mono {
  font-family: var(--font-mono);
}

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


/* ================================================================
   21. RESPONSIVE BREAKPOINTS
   ================================================================
   Breakpoints (mobile-first):
     sm:  640px
     md:  768px
     lg: 1024px
     xl: 1200px
*/

@media (max-width: 1200px) {
  .vr-kpi-grid      { grid-template-columns: repeat(2, 1fr); }
  .vr-kpi-grid--sm  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .vr-kpi-grid      { grid-template-columns: 1fr; }
  .vr-kpi-grid--sm  { grid-template-columns: 1fr; }
  .vr-panels-row    { grid-template-columns: 1fr; }

  .vr-sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-slower) var(--ease-default);
  }

  .vr-sidebar.is-open {
    transform: translateX(0);
  }

  .vr-main {
    margin-left: 0;
  }

  .vr-content {
    padding: var(--space-8);
  }
}


/* ================================================================
   22. LOGIN PAGE
   ================================================================ */

/* Two-column wrapper */
.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---- Left panel: brand ---- */
.login-brand {
  flex: 1;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient orb behind logo */
.login-brand::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,132,255,0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
}

/* Subtle grid pattern */
.login-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 360px;
}

.login-brand-logo {
  margin-bottom: 32px;
}

.login-brand-name {
  font-size: 28px;
  font-weight: var(--weight-bold);
  color: #FFFFFF;
  letter-spacing: var(--tracking-tighter);
  margin-bottom: 4px;
}

.login-brand-tag {
  font-size: var(--text-base-sm);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,0.45);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: 48px;
}

.login-brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.login-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(10, 132, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--vr-brand-blue);
}

.login-feature-text {
  font-size: var(--text-base-sm);
  color: rgba(255,255,255,0.55);
  line-height: var(--leading-normal);
}

.login-feature-text strong {
  color: rgba(255,255,255,0.85);
  font-weight: var(--weight-semibold);
  display: block;
  margin-bottom: 1px;
}

/* ---- Right panel: form ---- */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  max-width: 560px;
  min-width: 400px;
  background: var(--bg-page);
}

.login-card {
  width: 100%;
  max-width: 380px;
}

/* Mobile logo (hidden on desktop) */
.login-mobile-logo {
  display: none;
  margin-bottom: 32px;
  text-align: center;
}

.login-mobile-logo svg {
  display: inline-block;
  margin-bottom: 8px;
}

.login-mobile-logo-name {
  font-size: 22px;
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

/* Form header */
.login-header {
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tighter);
  margin-bottom: 6px;
}

.login-header p {
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

/* Form fields */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: var(--border-input);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.form-input.error {
  border-color: var(--vr-danger-500);
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Password field wrapper */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 42px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: color var(--duration-normal);
}

.password-toggle:hover {
  color: var(--text-secondary);
}

/* Form options row */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-base-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.form-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--vr-brand-blue);
  cursor: pointer;
}

.form-link {
  font-size: var(--text-base-sm);
  font-weight: var(--weight-medium);
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-normal);
}

.form-link:hover {
  color: var(--action-primary-hover);
  text-decoration: underline;
}

/* Submit button */
.btn-login {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--action-primary);
  color: var(--action-primary-text);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--duration-normal);
}

.btn-login:hover {
  background: var(--action-primary-hover);
}

.btn-login:active {
  background: var(--action-primary-active);
}

.btn-login:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error message */
.form-error-msg {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--status-danger-bg);
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  font-size: var(--text-base-sm);
  color: var(--status-danger-text);
  margin-bottom: 20px;
}

.form-error-msg.visible {
  display: flex;
}

/* Footer text */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: var(--text-base-sm);
  color: var(--text-tertiary);
}

.login-footer a {
  color: var(--text-link);
  text-decoration: none;
  font-weight: var(--weight-semibold);
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Copyright */
.login-copyright {
  position: absolute;
  bottom: 24px;
  right: 48px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.login-copyright-dark {
  position: absolute;
  bottom: 24px;
  left: 48px;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.25);
  z-index: 1;
}

/* ---- Login responsive ---- */
@media (max-width: 900px) {
  .login-brand {
    display: none;
  }

  .login-form-panel {
    max-width: 100%;
    min-width: 0;
    padding: 32px 24px;
  }

  .login-mobile-logo {
    display: block;
  }

  .login-copyright {
    position: static;
    text-align: center;
    margin-top: 32px;
  }
}


/* ================================================================
   23. FILTER BAR
   ================================================================ */
.vr-filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.vr-filter-bar .vr-input {
  flex: 1;
}

.vr-filter-bar .vr-select {
  width: 180px;
  flex-shrink: 0;
}


/* ================================================================
   24. TABLE FOOTER / PAGINATION
   ================================================================ */
.vr-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-7, 14px) var(--space-12);
  border-top: 1px solid var(--border-default);
  font-size: var(--text-base-sm);
  color: var(--text-tertiary);
}

.vr-pagination {
  display: flex;
  gap: var(--space-2);
}

.vr-page-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-colors);
}

.vr-page-btn:hover {
  background: var(--bg-page);
}

.vr-page-btn.is-active {
  background: var(--action-primary);
  color: var(--action-primary-text);
}


/* ================================================================
   25. NOTIFICATION TOAST
   ================================================================ */
.vr-toast {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  max-width: 360px;
  animation: slideInFromTop 0.2s ease-out;
}

@keyframes slideInFromTop {
  from { transform: translateY(-0.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
