/* ==========================================================================
   MyManageRH — Corporate Fintech Design System
   Core values: Clear, Secure, Precise, Ordered, Efficient.
   ========================================================================== */

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

:root {
  /* Brand - Premium Humand-inspired Indigo/Blue Palette */
  --brand-900: #312e81;
  --brand-800: #3730a3;
  --brand-700: #4f46e5;
  --brand-600: #6366f1;
  --brand-100: #e0e7ff;
  --brand-50: #f5f3ff;
  --brand-gradient: linear-gradient(135deg, var(--brand-600) 0%, #3b82f6 100%);

  /* Neutrals */
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;

  /* Semantic */
  --success-text: #16a34a;
  --success-solid: #166534;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;

  /* Warning */
  --warning-text: #d97706;
  --warning-solid: #92400e;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;

  /* Error */
  --error-text: #dc2626;
  --error-solid: #991b1b;
  --error-bg: #fee2e2;
  --error-border: #fecaca;

  /* Info */
  --info-text: #4f46e5;
  --info-solid: #3730a3;
  --info-bg: #e0e7ff;
  --info-border: #c7d2fe;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 18px;
  --text-body: 14px;
  --text-label: 13px;
  --text-caption: 12px;

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  /* Motion */
  --duration-fast: 0.15s;
  --duration-base: 0.2s;
  --duration-smooth: 0.3s;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-height: 64px;
  --container-max: 1120px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body,
input,
button,
select,
textarea {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--slate-50);
  color: var(--slate-700);
  font-size: var(--text-body);
  line-height: 1.6;
  letter-spacing: -0.01em; /* Estilo SaaS moderno */
}

/* Tabular numbers for stable data alignment */
.tabular-nums,
table,
.amount,
.kpi-value,
.table td,
input[type='number'] {
  font-feature-settings: 'tnum' on, 'lnum' on;
  font-variant-numeric: tabular-nums;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  background: var(--slate-100);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ==========================================================================
   Base Typography & Colors (Reducing eye strain)
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6,
.card-title {
  margin: 0 0 0.5em;
  color: var(--slate-900);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em; /* Títulos más compactos y Premium */
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

p,
.text-muted {
  margin: 0 0 1em;
  color: #64748b; /* Slate 500 para textos secundarios */
}

a {
  color: var(--brand-700);
  text-decoration: none;
  font-weight: 500;
  transition:
    color var(--duration-base) var(--ease-spring),
    background-color var(--duration-base) var(--ease-spring),
    box-shadow var(--duration-base) var(--ease-spring);
}

a:hover {
  color: var(--brand-900);
  text-decoration: none;
}

/* Reemplazo global del focus feo por un anillo estético */
button:focus-visible, 
a:focus-visible, 
input:focus-visible, 
select:focus-visible,
textarea:focus-visible,
.card:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--brand-700) !important;
  transition: box-shadow 0.2s ease;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

.grid {
  display: grid;
  gap: 24px;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.flex-1 { flex: 1 1 0%; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:flex-row { flex-direction: row; }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:w-\[320px\] { width: 320px; }
}

.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-slate-900 { color: var(--slate-900); }
.text-slate-800 { color: var(--slate-800); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-400 { color: var(--slate-400); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.tracking-widest { letter-spacing: 0.1em; }

.gap-4 {
  gap: 4px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.gap-24 {
  gap: 24px;
}

.gap-32 {
  gap: 32px;
}

.mt-4 {
  margin-top: 4px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

.mb-4 {
  margin-bottom: 4px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

.ml-8 {
  margin-left: 8px;
}

.pt-24 {
  padding-top: 24px;
}

.pb-24 {
  padding-bottom: 24px;
}

.px-24 {
  padding-left: 24px;
  padding-right: 24px;
}

.w-full {
  width: 100%;
}

.text-muted,
.text-subtle,
.small-muted {
  color: var(--slate-500);
}

.text-subtle,
.small-muted {
  font-size: var(--text-caption);
}

.text-danger {
  color: var(--error-text);
}

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

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

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

.td-right,
.th-right {
  text-align: right;
}

.input-auto {
  width: auto;
}

.fade-out {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

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

/* ==========================================================================
   Scrollbars
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-500);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  flex: 1;
  padding: 32px 0 64px;
  animation: fade-in var(--duration-fast) ease-out;
}

.page-header {
  gap: 16px;
}

.page-title {
  margin: 0;
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--slate-950);
}

.page-subtitle {
  color: var(--slate-500);
  font-size: var(--text-caption);
}

.site-header {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  gap: 8px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-700);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-actions .link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  color: var(--slate-500);
  font-size: var(--text-label);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--duration-smooth) var(--ease-spring);
}

.header-actions .link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}

.header-actions .link.active {
  background: var(--brand-100);
  color: var(--brand-800);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.05);
}

.nav-role {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--slate-400);
  padding: 0 8px;
}

.btn-logout {
  background: var(--slate-50);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--duration-smooth) var(--ease-spring);
}

.btn-logout:hover {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: rgba(239, 68, 68, 0.2);
}

.footer,
.footer-trust {
  text-align: center;
  padding: 32px 24px;
  font-size: var(--text-caption);
  color: var(--slate-400);
  border-top: 1px solid var(--slate-100);
  margin-top: 64px;
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */

.card {
  background: var(--white);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition:
    border-color var(--duration-base) ease,
    transform var(--duration-smooth) var(--ease-spring),
    box-shadow var(--duration-smooth) ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card.full {
  grid-column: 1 / -1;
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--slate-200);
}

.card-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 600;
}

.notice-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  font-size: var(--text-body);
}

.notice-panel.info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-solid);
}

.notice-panel.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-solid);
}

.empresa-logo-container {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--slate-100);
  overflow: hidden;
  border: 1px solid var(--slate-200);
}

.empresa-logo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
  font-size: var(--text-label);
  font-weight: 600;
  background: var(--white);
  color: var(--slate-700);
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--duration-base) ease,
    border-color var(--duration-base) ease,
    color var(--duration-base) ease,
    box-shadow var(--duration-base) ease,
    transform var(--duration-smooth) var(--ease-spring);
}

.btn:hover:not(:disabled) {
  border-color: var(--slate-200);
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.99);
}

.btn-primary {
  background: var(--brand-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-gradient);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35), var(--shadow-glow);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-200);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-900);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.06);
  color: var(--brand-700);
  border-color: transparent;
}

.btn-danger {
  background: var(--error-text);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-solid);
  border-color: var(--error-solid);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.btn-sign {
  background: var(--brand-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-sign:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.btn:disabled, 
.input:disabled, 
select:disabled,
textarea:disabled,
button[disabled] {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  background-color: var(--slate-100) !important;
  border-color: var(--slate-200) !important;
  box-shadow: none !important;
  transform: none !important; /* Desactiva el bounce-spring de hover */
  color: var(--slate-400) !important;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  min-height: 46px;
  padding: 10px 24px;
  font-size: var(--text-body);
}

.btn-icon-only {
  min-width: 38px;
  padding: 8px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--slate-800);
}

.form-group label .required {
  color: var(--error-text);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50)/50;
  color: var(--slate-900);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
  transition:
    border-color var(--duration-base) ease,
    background-color var(--duration-base) ease,
    color var(--duration-base) ease,
    box-shadow var(--duration-base) ease;
}

.input::placeholder,
textarea::placeholder {
  color: var(--slate-400);
}

.input:hover,
select:hover,
textarea:hover {
  border-color: var(--slate-300);
  background-color: var(--white);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  background-color: var(--white);
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.input:disabled,
select:disabled,
textarea:disabled {
  background: var(--slate-50);
  color: var(--slate-500);
  cursor: not-allowed;
}

.input.error,
select.error,
textarea.error {
  border-color: var(--error-text);
}

.input.error:focus,
select.error:focus,
textarea.error:focus {
  box-shadow: 0 0 0 3px var(--error-bg);
}

.form-error-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--error-text);
  font-size: var(--text-caption);
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--text-body);
  color: var(--slate-700);
  user-select: none;
}

.checkbox-label input[type='checkbox'],
.radio-label input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.form-hint {
  display: flex;
  align-items: center;
}

.form-hint .link {
  color: var(--slate-500);
  font-size: var(--text-caption);
  transition: color var(--duration-fast);
}

.form-hint .link:hover {
  color: var(--brand-700);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-container {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-body);
}

.table th {
  padding: 12px 16px;
  background: var(--slate-50);
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-caption);
  font-weight: 600;
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  color: var(--slate-900);
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color var(--duration-fast);
}

.table tbody tr:hover {
  background: var(--slate-50);
}

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

.table-actions {
  white-space: nowrap;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-caption);
  font-weight: 500;
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge.success {
  background: var(--success-bg);
  color: var(--success-solid);
}

.badge.success.badge-dot::before {
  background: var(--success-solid);
}

.badge.warning {
  background: var(--warning-bg);
  color: var(--warning-solid);
}

.badge.warning.badge-dot::before {
  background: var(--warning-solid);
}

.badge.error {
  background: var(--error-bg);
  color: var(--error-solid);
}

.badge.error.badge-dot::before {
  background: var(--error-solid);
}

.badge.neutral {
  background: var(--slate-100);
  color: var(--slate-700);
}

.badge.neutral.badge-dot::before {
  background: var(--slate-500);
}

/* ==========================================================================
   Alerts / Messages
   ========================================================================== */

.error,
.success {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-body);
}

.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-solid);
}

.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-solid);
}

.error-hint {
  margin-top: 4px;
  font-size: 0.7em;
  opacity: 0.75;
}

/* ==========================================================================
   KPIs
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-smooth) var(--ease-spring);
}

/* Un borde superior interno ultra sutil que simula reflejo de luz */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(99, 102, 241, 0.15);
}

.kpi-label {
  margin-bottom: 8px;
  color: var(--slate-400);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  color: var(--slate-900);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in var(--duration-base) ease-out;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  animation: modal-slide-up var(--duration-smooth) var(--ease-spring);
}

.modal-content-sm {
  max-width: 420px;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 800;
  color: var(--slate-900);
}

.modal-body {
  padding: 28px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer,
.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.modal-footer {
  padding: 20px 28px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}

.modal-actions {
  margin-top: 12px;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toasts,
.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  max-width: 380px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  font-size: var(--text-body);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modal-slide-up var(--duration-smooth) var(--ease-spring);
}

.toast.success {
  background: rgba(22, 101, 52, 0.95);
  border-color: rgba(34, 197, 94, 0.2);
}

.toast.error {
  background: rgba(153, 27, 27, 0.95);
  border-color: rgba(239, 68, 68, 0.2);
}

.toast.warning {
  background: var(--warning-solid);
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--slate-500);
}

.empty-icon {
  margin-bottom: 16px;
  color: var(--slate-300);
}

.empty-title {
  margin-bottom: 8px;
  color: var(--slate-900);
  font-size: var(--text-h3);
  font-weight: 500;
}

.empty-desc {
  max-width: 400px;
  margin: 0 auto 24px;
  font-size: var(--text-body);
}

/* ==========================================================================
   Canvas / Signature
   ========================================================================== */

.canvas-wrap,
.canvas-wrapper {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
  touch-action: none;
}

.canvas-wrapper.focus,
.canvas-wrap.focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: var(--text-caption);
}

/* ==========================================================================
   Definition Lists / Data pairs
   ========================================================================== */

.dl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dl-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dl-label {
  color: var(--slate-500);
  font-size: var(--text-caption);
  text-transform: uppercase;
  font-weight: 500;
}

.dl-value {
  color: var(--slate-900);
  font-size: var(--text-body);
  font-weight: 500;
}

/* ==========================================================================
   Steps
   ========================================================================== */

.steps-container {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-500);
  font-size: var(--text-label);
  font-weight: 500;
}

.step-item.active {
  color: var(--slate-900);
}

.step-item.completed {
  color: var(--brand-700);
}

.step-circle {
  width: 24px;
  height: 24px;
  border: 1px solid var(--slate-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.active .step-circle {
  background: var(--slate-900);
  border-color: var(--slate-900);
  color: var(--white);
}

.completed .step-circle {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: var(--white);
}

.step-line {
  flex: 1;
  min-width: 24px;
  height: 1px;
  margin: 0 16px;
  background: var(--slate-200);
}

.step-line.completed {
  background: var(--brand-700);
}

/* ==========================================================================
   Action bars / lists / receipts
   ========================================================================== */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--slate-200);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.receipt-item,
.sample-url-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-100);
}

.receipt-item:last-child,
.sample-url-item:last-child {
  border-bottom: none;
}

.sample-url-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Loaders
   ========================================================================== */

.loader-small {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

.btn-secondary .loader-small,
.btn-ghost .loader-small,
.btn .loader-small:not(.btn-primary .loader-small) {
  border-color: rgba(51, 65, 85, 0.25);
  border-top-color: currentColor;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Public warning banner
   ========================================================================== */

.serve-warning {
  display: block;
  margin: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #ffe69c;
  background: #fff8db;
  color: #8a6d1f;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Empresa empleados
   ========================================================================== */

.empresa-empleados-topbar {
  gap: 16px;
}

.empresa-empleados-actions {
  flex-wrap: wrap;
}

.empresa-search-input {
  min-width: 220px;
}

.empresa-export-menu-wrap {
  position: relative;
}

.empresa-export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 180px;
  padding: 8px;
}

.empresa-export-debug {
  padding: 4px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--slate-200);
}

.empresa-export-debug-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  color: var(--slate-500);
}

.empresa-export-btn {
  justify-content: flex-start;
}

.empresa-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.empresa-form-full {
  grid-column: 1 / -1;
}

.empresa-seniority-display {
  padding: 10px 0;
  font-weight: 600;
  color: var(--brand-700);
}

.empresa-tabs-scroll {
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 2px solid var(--slate-200);
  margin: 12px 0 16px;
}

.empresa-tabs-row {
  display: inline-flex;
  gap: 4px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--slate-500);
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: var(--text-label);
  font-weight: 500;
}

.tab-btn.active {
  color: var(--slate-900);
  border-bottom-color: var(--brand-700);
}

.empresa-modal-xl {
  max-width: 760px;
}

.empresa-modal-lg {
  max-width: 680px;
}

.empresa-modal-md {
  max-width: 500px;
}

.empresa-modal-sm {
  max-width: 480px;
}

.empresa-modal-import {
  max-width: 900px;
  width: 95%;
}

.empresa-profile-header {
  justify-content: space-between;
  align-items: flex-start;
}

.empresa-profile-section {
  margin-bottom: 20px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.empresa-profile-section-title {
  padding: 8px 12px;
  font-weight: 600;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.empresa-profile-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.empresa-employee-name {
  font-weight: 600;
  color: var(--slate-900);
}

.empresa-icon-btn {
  min-width: 32px;
  padding: 6px 8px;
}

.empresa-import-header {
  justify-content: space-between;
  align-items: center;
}

.empresa-close-x {
  font-size: 24px;
  line-height: 1;
  padding: 4px;
}

.empresa-import-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.empresa-import-mode-card {
  padding: 16px;
  cursor: pointer;
}

.empresa-import-mode-title {
  font-weight: 600;
}

.empresa-import-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
}

.empresa-import-footer-between {
  justify-content: space-between;
  align-items: center;
}

.empresa-import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.empresa-import-name {
  font-weight: 500;
}

.empresa-json-box {
  background: var(--slate-50);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow: auto;
  max-height: 400px;
  font-size: 12px;
  border: 1px solid var(--slate-200);
}

.empresa-kpi-success {
  border-bottom: 3px solid var(--success-text);
}

.empresa-kpi-info {
  border-bottom: 3px solid var(--brand-700);
}

.empresa-kpi-error {
  border-bottom: 3px solid var(--error-text);
}

/* Legajo Preview Styles */
.empresa-preview-box {
  background: var(--white);
  border-radius: var(--radius-md);
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--slate-200);
}

.preview-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px;
}

@media (max-width: 600px) {
  .preview-sections-grid {
    grid-template-columns: 1fr;
  }
}

.preview-section {
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  overflow: hidden;
}

.preview-section-title {
  background: var(--slate-200);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--slate-700);
}

.preview-section-body {
  padding: 10px;
}

.preview-field {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.preview-field-label {
  color: var(--slate-500);
  font-weight: 500;
}

.preview-field-value {
  color: var(--slate-900);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.empresa-bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.empresa-bulk-count {
  font-weight: 600;
}

/* ==========================================================================
   Empresa historial
   ========================================================================== */

.empresa-historial-bar {
  margin-bottom: 24px;
}

.empresa-historial-actions {
  flex-wrap: wrap;
}

.empresa-historial-label {
  font-weight: 500;
}

.empresa-history-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--slate-500);
  font-size: var(--text-caption);
}

.empresa-history-tree {
  padding: 24px;
}

/* Document Hub Tabs */
.empresa-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--slate-200);
  background: var(--white);
  padding: 0 4px;
}

.tab-item {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--slate-500);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tab-item:hover {
  color: var(--brand-600);
  background: var(--slate-50);
}

.tab-item.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-700);
}

.hub-tab-content {
  min-height: 400px;
}

.empresa-history-group {
  margin-bottom: 16px;
}

.empresa-history-year,
.empresa-history-employee-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--slate-200);
}

.empresa-history-employee-title {
  color: var(--brand-700);
}

.empresa-history-year-body {
  padding-left: 16px;
}

.empresa-history-month-block {
  margin-bottom: 12px;
}

.empresa-history-month {
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.empresa-history-nested {
  padding-left: 16px;
  border-left: 1px solid var(--slate-200);
  margin-left: 8px;
}

.empresa-history-day-block {
  margin-bottom: 8px;
}

.empresa-history-day {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 4px;
}

.empresa-history-day-plain {
  color: var(--slate-700);
}

.empresa-history-day-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-700);
}

.empresa-history-rows {
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empresa-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--slate-50);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.empresa-history-row-left,
.empresa-history-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.empresa-history-time {
  min-width: 45px;
}

.empresa-history-employee {
  font-weight: 500;
  color: var(--slate-900);
}

/* ==========================================================================
   Sign view
   ========================================================================== */

.sign-shell {
  max-width: 660px;
  margin: 0 auto;
  padding: 32px;
}

.sign-header {
  text-align: center;
  margin-bottom: 24px;
}

.sign-title {
  font-size: 24px;
}

.sign-token-notice {
  text-align: center;
  margin-bottom: 16px;
}

.sign-state-card {
  margin-top: 16px;
  text-align: center;
  padding: 48px 24px;
}

.sign-state-card-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.sign-state-card-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}

.sign-state-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.sign-state-text {
  max-width: 520px;
  margin: 0 auto;
}

.sign-info-box {
  padding: 16px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

.sign-pdf-box {
  margin-bottom: 20px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sign-pdf-header {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.sign-pdf-iframe {
  width: 100%;
  height: 420px;
  border: 0;
  background: var(--white);
}

.sign-canvas-wrap {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.sign-canvas {
  width: 100%;
  display: block;
  background: var(--white);
  cursor: crosshair;
}

.sign-canvas-hint {
  text-align: center;
  padding: 8px;
}

.sign-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.sign-submit-btn {
  min-width: 180px;
}

.sign-status {
  text-align: right;
}

.sign-final-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.sign-stored-card {
  padding: 16px;
}

.sign-stored-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.sign-stored-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.sign-stored-image {
  height: 60px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}

.sign-stored-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--slate-900);
}

.sign-profile-modal {
  max-width: 680px;
}

.sign-profile-header {
  justify-content: space-between;
  align-items: flex-start;
}

/* Unified Signature Layout */
.sign-shell-unified {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.sign-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .sign-grid {
    grid-template-columns: 1.6fr 1fr;
  }
}

.sign-sidebar-sticky {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sign-pdf-viewer {
  min-height: 500px;
  background: var(--slate-100);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  overflow: hidden;
}

.sign-pdf-iframe-unified {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 500px;
  border: 0;
}

.sign-action-card {
  border-left: 4px solid var(--slate-200);
  transition: border-color var(--duration-base);
}

.sign-action-card.verified {
  border-left-color: var(--success-text);
}

.sign-canvas-locked {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.sign-canvas-unlocked {
  opacity: 1;
  pointer-events: auto;
  filter: none;
}

.sign-otp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.sign-otp-pending {
  background: var(--slate-100);
  color: var(--slate-500);
}

.sign-otp-success {
  background: var(--success-bg);
  color: var(--success-solid);
  animation: pulse-success 1.5s infinite;
}

@keyframes pulse-success {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ==========================================================================
   Verify view
   ========================================================================== */

.verify-shell {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 24px;
}

.verify-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate-500);
}

.verify-card {
  padding: 0;
  overflow: hidden;
}

.verify-card-valid {
  border-top: 4px solid var(--success-solid);
}

.verify-card-invalid {
  border-top: 4px solid var(--error-solid);
}

.verify-card-header {
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
  text-align: center;
}

.verify-card-body {
  padding: 32px;
}

.verify-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.verify-icon-success {
  background: var(--success-bg);
  color: var(--success-solid);
}

.verify-icon-error {
  background: var(--error-bg);
  color: var(--error-solid);
}

.verify-title {
  font-size: 20px;
  margin: 0 0 8px;
}

.verify-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--slate-500);
}

.verify-badge-fit {
  width: fit-content;
}

.verify-certificate-box {
  margin-top: 8px;
  font-size: 12px;
}

.verify-hash-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  background: var(--slate-900);
  color: var(--success-text);
  padding: 10px;
  border-radius: 4px;
  word-break: break-all;
  margin-top: 8px;
}

.verify-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
}

.verify-notice-center {
  text-align: center;
}

.verify-footer-note {
  text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 640px) {
  .dl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    min-height: unset;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    gap: 8px;
  }

  .nav-role {
    padding-right: 0;
    border-right: none;
  }

  .page {
    padding: 24px 0 48px;
  }

  .card {
    padding: 20px;
  }

  .action-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .steps-container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .step-line {
    display: none;
  }

  .modal {
    padding: 16px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-header,
  .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .toasts,
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .table th,
  .table td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .empresa-form-grid,
  .empresa-profile-grid,
  .empresa-import-mode-grid {
    grid-template-columns: 1fr;
  }

  .empresa-import-footer,
  .empresa-import-footer-between {
    flex-direction: column;
    align-items: stretch;
  }

  .empresa-history-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .empresa-history-row-right {
    width: 100%;
    justify-content: space-between;
  }

  .sign-shell {
    padding: 24px 16px;
  }

  .sign-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sign-submit-btn {
    min-width: 0;
    width: 100%;
  }

  .sign-stored-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .sign-pdf-iframe {
    height: 320px;
  }

  .verify-shell {
    margin: 24px auto;
    padding: 0 16px;
  }

  .verify-card-header,
  .verify-card-body {
    padding: 24px;
  }

  .verify-actions {
    justify-content: stretch;
  }

  .verify-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Signature Management
   ========================================================================== */

.signature-mgmt-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

@media (max-width: 768px) {
  .signature-mgmt-grid {
    grid-template-columns: 1fr;
  }
}

.signature-canvas-container {
  background: var(--slate-50);
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  max-width: 600px;
  height: 200px;
  cursor: crosshair;
  touch-action: none;
}

.signature-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.signature-preview-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.signature-preview-img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  filter: contrast(1.2);
}

.signature-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.signature-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.signature-badge.active {
  background: var(--success-bg);
  color: var(--success-solid);
}

.signature-badge.missing {
  background: var(--error-bg);
  color: var(--error-solid);
}

/* Modal specific for signature required */
.modal-sig-required {
  max-width: 450px !important;
}

.sig-required-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  text-align: center;
}

/* ==========================================================================
   Documentation System (Notion/Google Docs style)
   ========================================================================== */

.docs-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-height) - 100px);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

.docs-sidebar {
  background: var(--slate-50);
  border-right: 1px solid var(--slate-200);
  padding: 24px;
}

.docs-sidebar-header h3 {
  font-size: 16px;
  margin-bottom: 0;
}

.docs-nav-category {
  margin-top: 24px;
}

.category-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.docs-nav ul li {
  margin-bottom: 4px;
}

.docs-nav ul li a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  font-size: var(--text-body);
  transition: all var(--duration-fast);
}

.docs-nav ul li.active a {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

.docs-nav ul li a:hover:not(.active a) {
  background: var(--slate-200);
  color: var(--slate-900);
}

.docs-main {
  padding: 40px 60px;
  overflow-y: auto;
}

.docs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--slate-100);
}

.docs-header h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.docs-meta {
  font-size: var(--text-caption);
  color: var(--slate-400);
}

.markdown-body {
  line-height: 1.6;
  color: var(--slate-800);
  max-width: 720px;
}

.markdown-body h1 { font-size: 28px; margin-bottom: 24px; color: var(--slate-950); }
.markdown-body h2 { font-size: 20px; margin-top: 32px; margin-bottom: 16px; border-bottom: 1px solid var(--slate-100); padding-bottom: 8px; color: var(--slate-900); }
.markdown-body p { margin-bottom: 16px; }
.markdown-body ul { margin-bottom: 16px; padding-left: 20px; }
.markdown-body ul li { list-style: disc; margin-bottom: 8px; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 13px; }
.markdown-body th, .markdown-body td { padding: 10px; border: 1px solid var(--slate-200); text-align: left; }
.markdown-body th { background: var(--slate-50); font-weight: 600; }

/* ==========================================================================
   TOS Gate
   ========================================================================== */

.tos-gate-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tos-gate-card {
  background: var(--white);
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: tos-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tos-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tos-gate-header {
  padding: 32px 40px;
  text-align: center;
  border-bottom: 1px solid var(--slate-100);
}

.tos-logo {
  height: 32px;
  margin-bottom: 20px;
}

.tos-gate-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.tos-gate-header p {
  color: var(--slate-500);
  margin-bottom: 0;
  font-size: 15px;
}

.tos-gate-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background: var(--slate-50);
}

.tos-viewer {
  background: var(--white);
  padding: 48px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.tos-gate-footer {
  padding: 32px 40px;
  border-top: 1px solid var(--slate-100);
  background: var(--white);
}

.tos-checkbox-wrapper {
  margin-bottom: 24px;
  background: var(--slate-50);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--slate-700);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tos-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.btn-block {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
}

/* Footer layout adjustment */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-legal {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-legal a {
  color: var(--slate-500);
  font-weight: 500;
}

.footer-legal a:hover {
  color: var(--brand-700);
}

.separator {
  color: var(--slate-300);
}
/* ==========================================================================
   GAP-010: Notifications & Badges
   ========================================================================== */

.nav-link { 
  position: relative; 
}

.notification-badge { 
  position: absolute; 
  top: -5px; 
  right: -10px; 
  background-color: var(--error-text); 
  color: white; 
  font-size: 0.65rem; 
  font-weight: bold; 
  padding: 2px 6px; 
  border-radius: var(--radius-pill); 
  min-width: 18px; 
  height: 18px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border: 2px solid white; 
  box-shadow: var(--shadow-sm); 
}

.unread-dot { 
  display: inline-block; 
  width: 8px; 
  height: 8px; 
  background-color: var(--brand-600); 
  border-radius: 50%; 
  margin-right: 8px; 
}

.notification-item { 
  padding: 16px; 
  border-bottom: 1px solid var(--slate-100); 
  transition: all var(--duration-base) ease; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  border-radius: var(--radius-md);
  margin-bottom: 4px;
}

.notification-item:hover { 
  background-color: var(--slate-50); 
}

.notification-item.unread { 
  background-color: var(--brand-50); 
  border-left: 4px solid var(--brand-600); 
}

.notification-meta { 
  font-size: var(--text-caption); 
  color: var(--slate-400); 
  margin-top: 4px; 
  font-weight: 500;
}

.notification-actions { 
  display: flex; 
  gap: 8px; 
}

.btn-delete-notif { 
  color: var(--slate-400); 
  background: none; 
  border: none; 
  cursor: pointer; 
  padding: 6px; 
  border-radius: var(--radius-sm); 
  transition: all var(--duration-base) ease;
}

.btn-delete-notif:hover { 
  color: var(--error-text); 
  background-color: var(--error-bg); 
}


/* GAP-010: Logo Fallback Styles */
.empresa-logo-container { 
  width: 48px; 
  height: 48px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  overflow: hidden; 
  border-radius: var(--radius-md); 
  background-color: var(--slate-50); 
  border: 1px solid var(--slate-200);
}

.empresa-logo { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain; 
}

.logo-fallback { 
  width: 100%; 
  height: 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: var(--brand-gradient); 
  color: white; 
  font-weight: 800; 
  font-size: 1.2rem; 
  border-radius: var(--radius-md); 
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Skeleton Shimmer effect
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

