/* ============================================================
   DocuLinker — Enterprise design system
   Base: Bootstrap 5.3 (kept as utility/grid base, fully restyled)
   Direction: refined modern light SaaS (Linear/Notion-style)
   Palette: deep blue (primary) + amber/gold (accents)
   ============================================================ */

:root {
  /* ---- Deep blue palette (brand / primary) ---- */
  --dl-blue-50: #eef6fc;
  --dl-blue-100: #d8eaf8;
  --dl-blue-200: #b3d5f0;
  --dl-blue-300: #7fb6e4;
  --dl-blue-400: #3f8fd2;
  --dl-blue-500: #0f5f9c;
  --dl-blue-600: #004682;
  --dl-blue-700: #003b73;
  --dl-blue-800: #002f5b;
  --dl-blue-900: #002243;
  --dl-blue-950: #00152b;

  /* ---- Amber palette (secondary accent) ---- */
  --dl-amber-50: #fff9e8;
  --dl-amber-100: #fff0c4;
  --dl-amber-200: #ffe08a;
  --dl-amber-300: #ffd054;
  --dl-amber-400: #ffbe24;
  --dl-amber-500: #ffb208;
  --dl-amber-600: #e69d00;
  --dl-amber-700: #c77f00;
  --dl-amber-800: #9f6100;
  --dl-amber-900: #6b4200;
  --dl-amber-950: #3d2500;

  /* ---- Gold palette (tertiary accent) ---- */
  --dl-gold-400: #f3c51d;
  --dl-gold-500: #ebb612;
  --dl-gold-600: #d09f0a;
  --dl-gold-700: #a87c05;

  /* ---- Brand aliases ---- */
  --dl-primary: var(--dl-blue-600);
  --dl-primary-hover: var(--dl-blue-700);
  --dl-primary-active: var(--dl-blue-800);
  --dl-primary-strong: var(--dl-blue-800);
  --dl-primary-light: var(--dl-blue-50);
  --dl-primary-soft: var(--dl-blue-100);
  --dl-primary-rgb: 0, 70, 130;
  --dl-primary-gradient: linear-gradient(135deg, var(--dl-blue-600) 0%, var(--dl-blue-800) 100%);
  --dl-on-primary: #ffffff;

  --dl-secondary: var(--dl-amber-500);
  --dl-secondary-hover: var(--dl-amber-600);
  --dl-secondary-active: var(--dl-amber-700);
  --dl-secondary-light: var(--dl-amber-50);
  --dl-secondary-rgb: 255, 178, 8;
  --dl-on-secondary: #3d2500;

  --dl-tertiary: var(--dl-gold-500);
  --dl-tertiary-rgb: 235, 182, 18;
  --dl-tertiary-light: var(--dl-amber-50);
  --dl-on-tertiary: #3d2500;

  /* ---- Neutrals (near-white slate) ---- */
  --dl-text: #101828;
  --dl-text-soft: #344054;
  --dl-text-muted: #667085;
  --dl-text-faint: #98a2b3;
  --dl-bg: #f5f6f8;
  --dl-bg-subtle: #fafbfc;
  --dl-surface: #ffffff;
  --dl-surface-hover: #f6f7f9;
  --dl-border: #e4e7ec;
  --dl-border-strong: #d0d5dd;
  --dl-divider: #eef1f4;

  /* ---- Semantic ---- */
  --dl-success: #059669;
  --dl-success-bg: #ecfdf5;
  --dl-success-border: #34d399;
  --dl-warning: #b45309;
  --dl-warning-bg: #fffaeb;
  --dl-warning-border: #fbbf24;
  --dl-danger: #d92d20;
  --dl-danger-bg: #fef3f2;
  --dl-danger-border: #f97066;
  --dl-info: #0e7490;
  --dl-info-bg: #ecfeff;
  --dl-info-border: #22d3ee;
  --dl-neutral: #667085;
  --dl-neutral-bg: #f2f4f7;

  /* ---- Elevation (soft layered SaaS shadows) ---- */
  --dl-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --dl-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --dl-shadow-md: 0 2px 4px rgba(16, 24, 40, 0.05), 0 4px 8px -2px rgba(16, 24, 40, 0.06);
  --dl-shadow-lg: 0 4px 8px rgba(16, 24, 40, 0.06), 0 12px 20px -6px rgba(16, 24, 40, 0.10);
  --dl-shadow-xl: 0 8px 16px rgba(16, 24, 40, 0.08), 0 24px 40px -8px rgba(16, 24, 40, 0.14);
  --dl-shadow-primary: 0 1px 2px rgba(var(--dl-primary-rgb), 0.25), 0 2px 6px rgba(var(--dl-primary-rgb), 0.2);

  /* ---- Geometry ---- */
  --dl-radius-sm: 8px;
  --dl-radius: 12px;
  --dl-radius-lg: 16px;
  --dl-radius-xl: 20px;
  --dl-radius-pill: 999px;

  --dl-sidebar-width: 252px;
  --dl-topbar-height: 64px;

  /* ---- Type ---- */
  --dl-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --dl-h1: clamp(1.4rem, 2vw, 1.75rem);
  --dl-h2: 1.05rem;
  --dl-h3: 0.95rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: var(--dl-bg);
  color: var(--dl-text);
  font-family: var(--dl-font);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}

a {
  color: var(--dl-primary);
  text-decoration: none;
}

a:hover {
  color: var(--dl-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dl-text);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

::selection {
  background: var(--dl-amber-200);
  color: var(--dl-amber-950);
}

/* ============================================================
   Icons
   ============================================================ */

.dl-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.125em;
}

/* Soft rounded icon chip */
.dl-icon-chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--dl-primary);
  background: var(--dl-primary-light);
}

.dl-icon-chip .dl-icon {
  width: 20px;
  height: 20px;
}

/* ============================================================
   App shell (sidebar + topbar + main)
   ============================================================ */

.dl-app {
  display: flex;
  min-height: 100vh;
}

.dl-sidebar {
  width: var(--dl-sidebar-width);
  flex-shrink: 0;
  background: var(--dl-surface);
  border-right: 1px solid var(--dl-border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
}

.dl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dl-text);
  text-decoration: none;
  padding: 0 10px 22px 10px;
  letter-spacing: -0.015em;
}

.dl-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--dl-primary-gradient);
  padding: 6px;
  box-shadow: var(--dl-shadow-primary);
}

.dl-nav-cta {
  margin: 6px 0 20px 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(var(--dl-secondary-rgb), 0.32), 0 2px 6px rgba(var(--dl-secondary-rgb), 0.24);
}

.dl-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dl-text-faint);
  padding: 10px 12px 8px 12px;
}

.dl-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.dl-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--dl-radius-sm);
  color: var(--dl-text-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dl-nav-link:hover {
  background: var(--dl-surface-hover);
  color: var(--dl-text);
}

.dl-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-secondary);
  color: var(--dl-on-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dl-nav-link.active {
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  font-weight: 600;
}

.dl-nav-link.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--dl-primary);
}

.dl-nav-link.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--dl-radius-sm);
  box-shadow: inset 0 0 0 1px rgba(var(--dl-primary-rgb), 0.18);
  pointer-events: none;
}

.dl-nav-link .dl-icon {
  color: var(--dl-text-faint);
  transition: color 0.15s ease;
}

.dl-nav-link.active .dl-icon,
.dl-nav-link:hover .dl-icon {
  color: var(--dl-primary);
}

.dl-sidebar-footer {
  border-top: 1px solid var(--dl-border);
  padding-top: 14px;
  margin-top: 14px;
}

.dl-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: var(--dl-text-soft);
  border-radius: var(--dl-radius-sm);
}

.dl-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--dl-primary-gradient);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-user .text-truncate {
  min-width: 0;
  font-weight: 500;
}

.dl-sidebar-footer form {
  margin-top: 4px;
}

.dl-sidebar-footer .dl-nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

/* ---- Shell (topbar + main) ---- */

.dl-shell {
  flex: 1;
  min-width: 0;
  margin-left: var(--dl-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dl-topbar {
  height: var(--dl-topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--dl-border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.dl-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.dl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dl-breadcrumb-item {
  font-size: 0.82rem;
  color: var(--dl-text-muted);
  white-space: nowrap;
}

.dl-breadcrumb-item.is-current {
  color: var(--dl-text);
  font-weight: 600;
}

.dl-breadcrumb-sep {
  color: var(--dl-text-faint);
  font-size: 0.8rem;
}

.dl-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 6px 12px;
  border-left: 1px solid var(--dl-border);
  text-decoration: none;
  border-radius: var(--dl-radius-pill);
  transition: opacity 0.15s ease;
}

.dl-topbar-user:hover {
  opacity: 0.8;
}

.dl-topbar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dl-text-soft);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-main {
  flex: 1;
  min-width: 0;
  padding: 30px 32px 48px 32px;
  width: 100%;
}

/* ---- Page header ---- */

.dl-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dl-page-title {
  margin: 0;
  font-size: var(--dl-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dl-page-subtitle {
  margin: 6px 0 0 0;
  color: var(--dl-text-muted);
  font-size: 0.92rem;
}

.dl-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dl-heading {
  font-size: var(--dl-h2);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ============================================================
   Buttons (enterprise SaaS style)
   ============================================================ */

.btn {
  border-radius: var(--dl-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.005em;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  --bs-btn-bg: var(--dl-primary);
  --bs-btn-border-color: var(--dl-primary);
  --bs-btn-hover-bg: var(--dl-primary-hover);
  --bs-btn-hover-border-color: var(--dl-primary-hover);
  --bs-btn-focus-shadow-rgb: var(--dl-primary-rgb);
  --bs-btn-active-bg: var(--dl-primary-active);
  --bs-btn-active-border-color: var(--dl-primary-active);
  color: var(--dl-on-primary);
  background: var(--dl-primary);
  border: 1px solid var(--dl-primary);
  box-shadow: var(--dl-shadow-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  color: var(--dl-on-primary);
  box-shadow: 0 2px 6px rgba(var(--dl-primary-rgb), 0.3), 0 4px 12px -2px rgba(var(--dl-primary-rgb), 0.24);
}

/* Amber accent button (secondary brand highlight) */
.btn-accent {
  --bs-btn-bg: var(--dl-secondary);
  --bs-btn-border-color: var(--dl-secondary);
  --bs-btn-hover-bg: var(--dl-secondary-hover);
  --bs-btn-hover-border-color: var(--dl-secondary-hover);
  --bs-btn-focus-shadow-rgb: var(--dl-secondary-rgb);
  --bs-btn-active-bg: var(--dl-secondary-active);
  --bs-btn-active-border-color: var(--dl-secondary-active);
  color: var(--dl-on-secondary);
  background: var(--dl-secondary);
  border: 1px solid var(--dl-secondary);
  box-shadow: 0 1px 2px rgba(var(--dl-secondary-rgb), 0.3), 0 2px 6px rgba(var(--dl-secondary-rgb), 0.22);
}

.btn-accent:hover,
.btn-accent:focus {
  color: var(--dl-on-secondary);
  box-shadow: 0 2px 6px rgba(var(--dl-secondary-rgb), 0.32), 0 4px 12px -2px rgba(var(--dl-secondary-rgb), 0.26);
}

.btn-outline-primary {
  --bs-btn-color: var(--dl-primary);
  --bs-btn-border-color: var(--dl-blue-300);
  --bs-btn-hover-bg: var(--dl-primary);
  --bs-btn-hover-border-color: var(--dl-primary);
  --bs-btn-active-bg: var(--dl-primary-active);
  --bs-btn-active-border-color: var(--dl-primary-active);
}

.btn-outline-secondary {
  --bs-btn-color: var(--dl-text-muted);
  --bs-btn-border-color: var(--dl-border-strong);
  --bs-btn-hover-bg: var(--dl-surface-hover);
  --bs-btn-hover-color: var(--dl-text);
  --bs-btn-hover-border-color: var(--dl-text-faint);
  --bs-btn-active-bg: var(--dl-border);
  --bs-btn-active-border-color: var(--dl-border-strong);
}

.btn-outline-danger {
  --bs-btn-color: var(--dl-danger);
  --bs-btn-border-color: #fca5a5;
  --bs-btn-hover-bg: var(--dl-danger);
  --bs-btn-hover-border-color: var(--dl-danger);
  --bs-btn-active-bg: #b91c1c;
  --bs-btn-active-border-color: #b91c1c;
}

.btn-light {
  --bs-btn-bg: var(--dl-bg-subtle);
  --bs-btn-border-color: var(--dl-border);
  --bs-btn-color: var(--dl-text-soft);
  --bs-btn-hover-bg: var(--dl-border);
  --bs-btn-hover-border-color: var(--dl-border-strong);
  --bs-btn-hover-color: var(--dl-text);
  --bs-btn-active-bg: var(--dl-border);
  --bs-btn-active-border-color: var(--dl-border-strong);
}

.btn-link {
  --bs-btn-color: var(--dl-primary);
  text-decoration: none;
}

.btn-link:hover {
  --bs-btn-hover-color: var(--dl-primary-hover);
  text-decoration: underline;
}

.btn-lg {
  padding: 0.68rem 1.25rem;
  font-size: 0.99rem;
  border-radius: 10px;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 7px;
}

.dl-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dl-btn-icon .dl-icon {
  width: 1.05em;
  height: 1.05em;
}

/* Ghost / text toolbar buttons (rows in tables) */
.dl-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dl-text-muted);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 7px;
  transition: background-color 0.12s ease, color 0.12s ease;
  text-decoration: none;
}

.dl-action-link:hover {
  background: var(--dl-primary-light);
  color: var(--dl-primary);
}

.dl-action-link.danger:hover {
  background: var(--dl-danger-bg);
  color: var(--dl-danger);
}

/* ============================================================
   Forms
   ============================================================ */

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dl-text-soft);
  margin-bottom: 4px;
}

.form-label.is-required::after {
  content: " *";
  color: var(--dl-danger);
}

.form-control,
.form-select {
  border-radius: var(--dl-radius-sm);
  border-color: var(--dl-border-strong);
  font-size: 0.88rem;
  padding: 0.42rem 0.72rem;
  color: var(--dl-text);
  background-color: var(--dl-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
  color: var(--dl-text-faint);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.16);
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid {
  border-color: var(--dl-danger) !important;
  background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-text {
  color: var(--dl-text-muted);
  font-size: 0.8rem;
}

.text-danger {
  color: var(--dl-danger) !important;
}

.text-muted {
  color: var(--dl-text-muted) !important;
}

.invalid-feedback {
  font-size: 0.8rem;
  font-weight: 500;
}

.invalid-feedback::first-letter,
.text-danger::first-letter {
  text-transform: capitalize;
}

/* Checkboxes / radios */
.form-check-input {
  border-color: var(--dl-border-strong);
}

.form-check-input:checked {
  background-color: var(--dl-primary);
  border-color: var(--dl-primary);
}

.form-check-input:focus {
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.16);
}

/* Input group with leading icon */
.dl-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.dl-input-group .dl-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--dl-text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.dl-input-group .form-control {
  padding-left: 40px;
}

.dl-input-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  margin: 0;
  background: none;
  border: none;
  color: var(--dl-text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dl-radius-sm);
  line-height: 1;
  box-sizing: border-box;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.dl-input-toggle .dl-icon {
  width: 19px;
  height: 19px;
}

.dl-input-toggle:hover {
  color: var(--dl-text);
  background: var(--dl-neutral-bg);
}

.dl-input-group:has(.dl-input-toggle) .form-control {
  padding-right: 42px;
}

/* ============================================================
   Cards & stat tiles
   ============================================================ */

.dl-card {
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-sm);
  padding: 22px;
}

.dl-card + .dl-card {
  margin-top: 18px;
}

.dl-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.dl-stat-tile {
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-xs);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.dl-stat-tile:hover {
  box-shadow: var(--dl-shadow-md);
  border-color: var(--dl-border-strong);
  transform: translateY(-1px);
}

.dl-stat-label {
  font-size: 0.82rem;
  color: var(--dl-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.dl-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--dl-text);
}

/* Icon chip tones */
.dl-stat-tile .dl-icon-chip.tone-info { background: var(--dl-info-bg); color: var(--dl-info); }
.dl-stat-tile .dl-icon-chip.tone-success { background: var(--dl-success-bg); color: var(--dl-success); }
.dl-stat-tile .dl-icon-chip.tone-danger { background: var(--dl-danger-bg); color: var(--dl-danger); }
.dl-stat-tile .dl-icon-chip.tone-warning { background: var(--dl-warning-bg); color: var(--dl-warning); }
.dl-stat-tile .dl-icon-chip.tone-neutral { background: var(--dl-neutral-bg); color: var(--dl-neutral); }

/* ============================================================
   Alerts (Material banners)
   ============================================================ */

.alert {
  border: 0;
  border-left: 4px solid;
  border-radius: var(--dl-radius);
  box-shadow: var(--dl-shadow-sm);
  font-size: 0.9rem;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: dl-alert-in 0.25s ease both;
}

.alert .dl-icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

@keyframes dl-alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: var(--dl-success-bg);
  color: var(--dl-success);
  border-left-color: var(--dl-success-border);
}

.alert-danger {
  background: var(--dl-danger-bg);
  color: var(--dl-danger);
  border-left-color: var(--dl-danger-border);
}

.alert-warning {
  background: var(--dl-warning-bg);
  color: var(--dl-warning);
  border-left-color: var(--dl-warning-border);
}

.alert-info {
  background: var(--dl-info-bg);
  color: var(--dl-info);
  border-left-color: var(--dl-info-border);
}

/* ============================================================
   Tables
   ============================================================ */

.dl-card > .table,
.table.dl-table {
  margin-bottom: 0;
}

.table {
  --bs-table-border-color: var(--dl-border);
  color: var(--dl-text-soft);
  font-size: 0.9rem;
}

.dl-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dl-text-faint);
  border-bottom: 1px solid var(--dl-border);
  font-weight: 600;
  background: var(--dl-bg-subtle);
  padding: 12px 14px;
  white-space: nowrap;
}

.dl-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--dl-divider);
  vertical-align: middle;
}

.dl-table tbody tr {
  transition: background-color 0.12s ease;
}

.dl-table tbody tr:hover {
  background: var(--dl-bg-subtle);
}

.dl-table tbody tr:last-child td {
  border-bottom: 0;
}

.dl-table .text-end {
  white-space: nowrap;
}

/* ============================================================
   Document list (card rows)
   ============================================================ */

.dl-doc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-doc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  background: var(--dl-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dl-doc-row:hover {
  border-color: var(--dl-blue-300);
  box-shadow: var(--dl-shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.dl-doc-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-doc-row-thumb .dl-icon {
  width: 20px;
  height: 20px;
}

.dl-doc-row-main {
  flex: 1;
  min-width: 0;
}

.dl-doc-row-title {
  font-weight: 600;
  color: var(--dl-text);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-doc-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--dl-text-muted);
}

.dl-doc-row-sep {
  color: var(--dl-text-faint);
}

.dl-doc-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.dl-doc-row-date {
  font-size: 0.78rem;
  color: var(--dl-text-faint);
}

.dl-doc-row-chevron {
  color: var(--dl-text-faint);
  display: flex;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.dl-doc-row-chevron .dl-icon {
  width: 18px;
  height: 18px;
}

.dl-doc-row:hover .dl-doc-row-chevron {
  color: var(--dl-primary);
  transform: translateX(3px);
}

/* ============================================================
   Status badges
   ============================================================ */

.dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--dl-radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.dl-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.dl-badge.status-borrador { color: var(--dl-neutral); background: var(--dl-neutral-bg); }
.dl-badge.status-enprocesodefirma { color: var(--dl-info); background: var(--dl-info-bg); }
.dl-badge.status-pendientedefirma { color: var(--dl-warning); background: var(--dl-warning-bg); }
.dl-badge.status-firmado { color: var(--dl-success); background: var(--dl-success-bg); }
.dl-badge.status-finalizado { color: var(--dl-success); background: var(--dl-success-bg); }
.dl-badge.status-rechazado { color: var(--dl-danger); background: var(--dl-danger-bg); }
.dl-badge.status-anulado { color: var(--dl-neutral); background: var(--dl-neutral-bg); }
.dl-badge.status-pendiente { color: var(--dl-warning); background: var(--dl-warning-bg); }
.dl-badge.dl-badge-neutral { color: var(--dl-neutral); background: var(--dl-neutral-bg); }

/* ============================================================
   Empty state
   ============================================================ */

.dl-empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--dl-text-muted);
}

.dl-empty-state .dl-icon {
  width: 44px;
  height: 44px;
  color: var(--dl-blue-300);
  margin-bottom: 10px;
}

.dl-empty-state p {
  font-size: 0.95rem;
}

/* ---- Description banner (document detail) ---- */
.dl-desc-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  background: var(--dl-bg-subtle);
  color: var(--dl-text-soft);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.dl-desc-banner .dl-icon {
  width: 18px;
  height: 18px;
  color: var(--dl-primary);
  margin-top: 1px;
  flex-shrink: 0;
}

/* ---- Result state (post-action feedback) ---- */

.dl-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  color: var(--dl-text-soft);
  font-size: 0.95rem;
}

.dl-result-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dl-success-bg);
  color: var(--dl-success);
}

.dl-result-icon .dl-icon {
  width: 30px;
  height: 30px;
}

.dl-result-error .dl-result-icon {
  background: var(--dl-danger-bg);
  color: var(--dl-danger);
}

/* ============================================================
   Dropzone & file preview
   ============================================================ */

.dl-dropzone {
  border: 2px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--dl-text-muted);
  background: var(--dl-bg-subtle);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-dropzone:hover,
.dl-dropzone.is-dragover {
  border-color: var(--dl-primary);
  background: var(--dl-primary-light);
  box-shadow: inset 0 0 0 1px rgba(var(--dl-primary-rgb), 0.2);
}

.dl-dropzone .dl-icon {
  width: 30px;
  height: 30px;
  color: var(--dl-primary);
  margin-bottom: 8px;
}

.dl-dropzone strong {
  color: var(--dl-text);
}

.dl-dropzone .form-text {
  margin-top: 4px;
}

.dl-file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  padding: 12px 14px;
  background: var(--dl-bg-subtle);
}

.dl-file-preview .dl-icon {
  width: 26px;
  height: 26px;
  color: var(--dl-primary);
  flex-shrink: 0;
}

.dl-file-preview-info {
  flex: 1;
  min-width: 0;
}

.dl-file-preview-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dl-text);
  font-size: 0.9rem;
}

.dl-file-preview-size {
  font-size: 0.8rem;
  color: var(--dl-text-muted);
}

/* ============================================================
   Choice cards (orden de firma)
   ============================================================ */

.dl-choice-card {
  position: relative;
  border: 2px solid var(--dl-border);
  border-radius: var(--dl-radius);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  background: var(--dl-surface);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-choice-card:hover {
  border-color: var(--dl-blue-300);
  box-shadow: var(--dl-shadow-sm);
}

.dl-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dl-choice-card .dl-icon {
  width: 20px;
  height: 20px;
  color: var(--dl-text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.dl-choice-card strong {
  display: block;
  font-size: 0.9rem;
}

.dl-choice-card small {
  color: var(--dl-text-muted);
  font-size: 0.78rem;
}

.dl-choice-card:has(input:checked) {
  border-color: var(--dl-primary);
  background: var(--dl-primary-light);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.1);
}

.dl-choice-card:has(input:checked) .dl-icon {
  color: var(--dl-primary);
}

/* ============================================================
   Participant rows
   ============================================================ */

.dl-participants-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dl-participants-head .dl-heading {
  font-size: 0.95rem;
}

.dl-participants-hint {
  font-size: 0.8rem;
  color: var(--dl-text-muted);
}

.dl-participants-count {
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--dl-primary);
  background: var(--dl-primary-light);
  padding: 3px 10px;
  border-radius: var(--dl-radius-pill);
}

.dl-participants-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 16px;
  border: 1px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius);
  background: var(--dl-bg-subtle);
  text-align: center;
  margin-bottom: 8px;
}

.dl-participants-empty .dl-icon {
  width: 22px;
  height: 22px;
  color: var(--dl-text-faint);
  margin-bottom: 2px;
}

.dl-participants-empty strong {
  font-size: 0.88rem;
  color: var(--dl-text-soft);
}

.dl-participants-empty span {
  font-size: 0.78rem;
  color: var(--dl-text-muted);
}

.dl-participant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--dl-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.dl-participant-row:hover {
  border-color: var(--dl-border-strong);
  background: var(--dl-bg-subtle);
}

.dl-participant-row:focus-within {
  border-color: var(--dl-blue-300);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.08);
}

.dl-participant-row.row-in {
  animation: dl-row-in 0.22s ease;
}

.dl-participant-row.row-out {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes dl-row-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dl-participant-row.dragging {
  opacity: 0.55;
  border-style: dashed;
  border-color: var(--dl-primary);
}

.dl-participant-row.drag-over {
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.12);
}

.dl-participant-grip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--dl-text-faint);
  cursor: grab;
  border-radius: 6px;
  padding: 0;
}

.dl-participant-grip:hover {
  color: var(--dl-text-muted);
  background: var(--dl-neutral-bg);
}

.dl-participant-grip .dl-icon {
  width: 15px;
  height: 15px;
}

[data-ref="participantes"]:not(.is-secuencial) .dl-participant-grip {
  display: none;
}

.dl-participant-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  user-select: none;
}

[data-ref="participantes"].is-secuencial .dl-participant-avatar {
  font-size: 0.85rem;
}

.dl-pc-1 { background: var(--dl-blue-600); }
.dl-pc-2 { background: var(--dl-blue-500); }
.dl-pc-3 { background: var(--dl-amber-700); }
.dl-pc-4 { background: var(--dl-amber-800); }
.dl-pc-5 { background: var(--dl-blue-800); }

.dl-participant-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
}

.dl-participant-field {
  flex: 1;
  min-width: 0;
}

.dl-participant-field .dl-field-label {
  position: static;
  display: block;
  padding: 0 0 3px;
  color: var(--dl-text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}

.dl-participant-input {
  width: 100%;
  border: 1.5px solid var(--dl-border-strong);
  border-radius: var(--dl-radius-sm);
  background: var(--dl-surface);
  color: var(--dl-text);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 6px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-participant-input::placeholder {
  color: var(--dl-text-faint);
}

.dl-participant-input:focus {
  outline: none;
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.14);
}

.dl-participant-input.is-invalid {
  border-color: var(--dl-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.dl-participant-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}

.dl-participant-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--dl-text-faint);
  border-radius: 6px;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.dl-participant-row:hover .dl-participant-action,
.dl-participant-row:focus-within .dl-participant-action,
.dl-participant-action:focus-visible {
  opacity: 1;
}

.dl-participant-action:hover {
  color: var(--dl-text-muted);
  background: var(--dl-neutral-bg);
}

.dl-participant-action.is-danger:hover {
  color: var(--dl-danger);
  background: var(--dl-danger-bg);
}

.dl-participant-action .dl-icon {
  width: 15px;
  height: 15px;
}

.dl-add-participant {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  border: 1px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius);
  padding: 8px 10px;
  margin-top: 2px;
  background: var(--dl-surface);
}

.dl-add-participant .dl-participant-field {
  margin-bottom: 0;
}

.dl-add-participant .btn {
  flex-shrink: 0;
}

.dl-add-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px dashed var(--dl-border-strong);
  color: var(--dl-text-muted);
}

.dl-add-avatar .dl-icon {
  width: 16px;
  height: 16px;
}

.dl-row-error {
  color: var(--dl-danger);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 4px;
  flex-basis: 100%;
}

.dl-row-error::first-letter {
  text-transform: capitalize;
}

.dl-add-error {
  color: var(--dl-danger);
  font-size: 0.78rem;
  font-weight: 500;
  margin: 6px 0 0;
}

.dl-add-error::first-letter {
  text-transform: capitalize;
}

@media (max-width: 575px) {
  .dl-participant-action {
    opacity: 1;
  }
}

/* ============================================================
   Timeline (historial)
   ============================================================ */

.dl-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dl-timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--dl-divider);
}

.dl-timeline-item:last-child {
  border-bottom: none;
}

.dl-timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-timeline-item .text-muted {
  font-size: 0.85rem;
}

/* ============================================================
   Create document: stepper wizard + compact panels
   ============================================================ */

.dl-stepper .dl-stepper-header {
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-sm);
}

.dl-stepper .dl-stepper-circle {
  width: 28px;
  height: 28px;
  font-size: 13px;
  border-width: 2px;
}

.dl-stepper .dl-stepper-step.active .dl-stepper-circle {
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.16);
}

.dl-stepper .dl-stepper-label {
  font-size: 0.82rem;
}

.dl-stepper .dl-stepper-connector {
  height: 3px;
}

.dl-stepper .dl-stepper-footer {
  position: sticky;
  bottom: 12px;
  z-index: 1010;
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-lg);
  padding: 10px 14px;
  margin-top: 16px !important;
}

.dl-stepper .dl-stepper-btn {
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
}

.dl-step-panel {
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  background: var(--dl-surface);
  box-shadow: var(--dl-shadow-sm);
  padding: 18px 20px;
}

/* ---- Paso final: resumen ---- */
.dl-review {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
}

.dl-review-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--dl-border);
  font-size: 0.9rem;
}

.dl-review-row span {
  color: var(--dl-text-muted);
}

.dl-review-row strong {
  text-align: right;
  word-break: break-word;
}

.dl-review-participantes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dl-review-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-pill);
  background: var(--dl-bg-subtle);
}

.dl-review-chip .dl-participant-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.dl-review-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.dl-review-chip-info strong {
  font-size: 0.82rem;
}

.dl-review-chip-info small {
  font-size: 0.72rem;
  color: var(--dl-text-muted);
}

.dl-review-empty {
  color: var(--dl-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 760px) {
  .dl-stepper .dl-stepper-label {
    display: none;
  }

  .dl-stepper .dl-stepper-circle {
    width: 26px;
    height: 26px;
  }
}

/* ============================================================
   Tabs (Configurar firma)
   ============================================================ */

.nav-tabs {
  border-bottom: 1px solid var(--dl-border);
  gap: 4px;
}

.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dl-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--dl-text);
  border-bottom-color: var(--dl-border-strong);
}

.nav-tabs .nav-link.active {
  color: var(--dl-primary);
  border-bottom-color: var(--dl-primary);
  background: transparent;
  font-weight: 600;
}

.tab-content {
  padding-top: 18px;
}

/* ============================================================
   Modals
   ============================================================ */

.modal-content {
  border: 0;
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-xl);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  border-color: var(--dl-border);
  padding: 16px 22px;
}

.modal-header .modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 20px 22px;
}

.btn-close {
  border-radius: 50%;
  padding: 6px;
  transition: background-color 0.12s ease;
}

.btn-close:hover {
  background: var(--dl-neutral-bg);
}

/* ============================================================
   Auth / public layouts
   ============================================================ */

.dl-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 85% -10%, var(--dl-blue-100) 0%, transparent 60%),
    radial-gradient(760px 420px at -10% 105%, var(--dl-amber-100) 0%, transparent 55%),
    var(--dl-bg);
}

.dl-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  box-shadow: var(--dl-shadow-lg);
  padding: 28px;
}

.dl-auth-card:has(.dl-doc-preview),
.dl-auth-card-wide {
  max-width: 720px;
}

.dl-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 26px;
  color: var(--dl-text);
}

.dl-auth-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--dl-primary-gradient);
  padding: 6px;
  box-shadow: var(--dl-shadow-primary);
}

.dl-auth-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
}

.dl-auth-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.dl-auth-head-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-auth-head-icon .dl-icon {
  width: 22px;
  height: 22px;
}

.dl-auth-head h1 {
  margin-bottom: 2px !important;
}

.dl-auth-head .text-muted {
  font-size: 0.9rem;
}

/* Split-screen (login) */
.dl-split {
  min-height: 100vh;
  display: flex;
}

.dl-split-panel {
  flex: 1 1 46%;
  max-width: 560px;
  background:
    radial-gradient(520px 420px at 85% 110%, rgba(var(--dl-secondary-rgb), 0.22) 0%, transparent 60%),
    linear-gradient(165deg, #002243 0%, #004682 45%, #00152b 100%);
  color: #fff;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dl-split-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
}

.dl-split-logo img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px;
}

.dl-split-illustration {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.dl-split-illustration img {
  width: 100%;
  max-width: 300px;
  filter: drop-shadow(0 18px 28px rgba(3, 7, 18, 0.35));
}

.dl-split-copy h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.dl-split-copy p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  margin: 0;
  max-width: 420px;
}

.dl-split-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.dl-split-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--dl-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.dl-split-trust-badge .dl-icon {
  width: 14px;
  height: 14px;
}

.dl-split-form {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--dl-bg);
}

.dl-split-form-inner {
  width: 100%;
  max-width: 400px;
}

.dl-split-form-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dl-split-form-header p {
  color: var(--dl-text-muted);
  margin-bottom: 26px;
}

.dl-split-mobile-logo {
  display: none;
}

@media (max-width: 860px) {
  .dl-split-panel {
    display: none;
  }

  .dl-split-mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--dl-text);
  }

  .dl-split-mobile-logo img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
}

/* ============================================================
   Visor de documento & firma canvas
   ============================================================ */

.dl-doc-preview {
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  overflow: hidden;
  height: 62vh;
  min-height: 420px;
  background: var(--dl-neutral-bg);
  box-shadow: var(--dl-shadow-md);
}

.dl-doc-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.dl-firma-canvas {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 600 / 220;
  border: 2px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius);
  touch-action: none;
  cursor: crosshair;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-firma-canvas:active {
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.12);
}

/* ============================================================
   Loading / progress
   ============================================================ */

.spinner-border {
  --bs-spinner-border-width: 2px;
  color: currentColor;
}

.btn-primary .spinner-border {
  color: #fff;
}

.btn-accent .spinner-border {
  color: var(--dl-on-secondary);
}

.dl-loading-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Core lib ask modal — inline SVG indicator (no FA loaded) */
.ask-radio::after { font-size: 10px; }
.ask-check::after { font-size: 10px; }
.ask-option.active .ask-radio,
.ask-option.active .ask-check {
  border-color: var(--dl-primary);
  background: var(--dl-primary);
}
.ask-option.active .ask-radio::after,
.ask-option.active .ask-check::after {
  content: "";
}
.ask-search-icon { color: var(--dl-text-muted); }
.ask-header-icon {
  background: var(--dl-primary-light);
  color: var(--dl-primary);
}

/* ============================================================
   Custom component kit (fields / search-select / anexos / toast)
   ============================================================ */

/* ---- Material field (floating label) ---- */
.dl-field {
  position: relative;
  margin-bottom: 14px;
}

.dl-field-inner {
  position: relative;
}

.dl-field--label {
  margin-bottom: 14px;
}

.dl-field--label .dl-field-label {
  position: static;
  display: block;
  padding: 0 0 4px;
  color: var(--dl-text-soft);
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
  line-height: 1.4;
}

.dl-field-control {
  width: 100%;
  border: 1.5px solid var(--dl-border-strong);
  border-radius: var(--dl-radius-sm);
  background: var(--dl-surface);
  color: var(--dl-text);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  padding: 8px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-field-control:focus {
  outline: none;
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.16);
}

.dl-field.is-invalid .dl-field-control {
  border-color: var(--dl-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.dl-field .form-control.is-invalid {
  border-color: inherit;
  box-shadow: none;
}

.dl-field-label {
  position: absolute;
  top: 8px;
  left: 13px;
  color: var(--dl-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: 0.15s ease-out;
  padding: 0 4px;
  background: transparent;
  line-height: 1.5;
  white-space: nowrap;
}

.dl-field-label.is-required::after {
  content: " *";
  color: var(--dl-danger);
}

.dl-field-control:focus ~ .dl-field-label,
.dl-field:not(:has(.dl-field-control:placeholder-shown)) .dl-field-label {
  top: -8px;
  left: 11px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dl-primary);
  background: var(--dl-surface);
  border-radius: 4px;
}

.dl-field.has-icon .dl-field-label {
  left: 42px;
}

.dl-field.has-icon .dl-field-control:focus ~ .dl-field-label,
.dl-field.has-icon:not(:has(.dl-field-control:placeholder-shown)) .dl-field-label {
  left: 40px;
}

.dl-field.is-invalid .dl-field-label {
  color: var(--dl-danger);
}

.dl-field-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--dl-text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
  display: flex;
}

.dl-field-icon .dl-icon {
  width: 18px;
  height: 18px;
}

.dl-field-control:focus ~ .dl-icon,
.dl-field-control:not(:placeholder-shown) ~ .dl-icon {
  color: var(--dl-primary);
}

.dl-field.has-icon .dl-field-control {
  padding-left: 40px;
}

.dl-field-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--dl-text-muted);
  border-radius: var(--dl-radius-sm);
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.dl-field-eye .dl-icon {
  width: 19px;
  height: 19px;
}

.dl-field-eye:hover {
  color: var(--dl-text);
  background: var(--dl-neutral-bg);
}

.dl-field.has-eye .dl-field-control {
  padding-right: 46px;
}

.dl-field-area:not(:placeholder-shown) ~ .dl-field-label,
.dl-field-area:focus ~ .dl-field-label {
  color: var(--dl-primary);
}

.dl-field-counter {
  text-align: right;
  font-size: 0.72rem;
  color: var(--dl-text-faint);
  margin-top: 2px;
}

.dl-field-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

.dl-field-select-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--dl-text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.dl-field-select-chevron .dl-icon {
  width: 16px;
  height: 16px;
}

.dl-field-select:focus ~ .dl-field-select-chevron {
  color: var(--dl-primary);
}

/* ---- Switch ---- */
.dl-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 16px;
}

.dl-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dl-switch-track {
  width: 42px;
  height: 24px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-border-strong);
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.18s ease;
}

.dl-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--dl-shadow-sm);
  transition: transform 0.18s ease;
}

.dl-switch-input:checked + .dl-switch-track {
  background: var(--dl-primary);
}

.dl-switch-input:checked + .dl-switch-track .dl-switch-thumb {
  transform: translateX(18px);
}

.dl-switch-input:focus-visible + .dl-switch-track {
  box-shadow: 0 0 0 3px rgba(var(--dl-primary-rgb), 0.25);
}

.dl-switch-label {
  font-size: 0.9rem;
  color: var(--dl-text);
}

/* ---- SearchSelect ---- */
.dl-search-select {
  position: relative;
  margin-bottom: 14px;
}

.dl-search-select .form-control {
  padding-right: 36px;
}

.dl-search-select .dl-icon {
  width: 16px;
  height: 16px;
}

.dl-search-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dl-text-muted);
  pointer-events: none;
}

.dl-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--dl-surface);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  box-shadow: var(--dl-shadow-lg);
  display: none;
}

.dl-search-dropdown.show {
  display: block;
}

.dl-search-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--dl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-search-item:hover,
.dl-search-item.active {
  background: var(--dl-primary-light);
  color: var(--dl-primary);
}

.dl-search-item.muted {
  color: var(--dl-text-muted);
  cursor: default;
}

.dl-search-item.muted:hover {
  background: none;
}

.dl-search-select.is-invalid .form-control {
  border-color: var(--dl-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* ---- Anexos (file queue) ---- */
.anexos-component {
  margin-bottom: 8px;
}

.anexos-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 14px;
  border: 2px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius);
  background: var(--dl-bg-subtle);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.anexos-drop:hover,
.anexos-drop.is-dragover {
  border-color: var(--dl-primary);
  background: var(--dl-primary-light);
}

.anexos-drop-icon .dl-icon {
  width: 26px;
  height: 26px;
  color: var(--dl-primary);
}

.anexos-drop-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--dl-text-muted);
}

.anexos-drop-text strong {
  color: var(--dl-text);
}

.anexos-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anexos-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-sm);
  background: var(--dl-sur-face, var(--dl-surface));
}

.anexos-item-icon .dl-icon {
  width: 20px;
  height: 20px;
  color: var(--dl-primary);
}

.anexos-item-info {
  flex: 1;
  min-width: 0;
}

.anexos-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--dl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anexos-item-size {
  font-size: 0.78rem;
  color: var(--dl-text-muted);
}

.anexos-item-remove {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--dl-text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.anexos-item-remove .dl-icon {
  width: 16px;
  height: 16px;
}

.anexos-item-remove:hover {
  color: var(--dl-danger);
  background: var(--dl-danger-bg);
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  .dl-sidebar,
  .dl-topbar {
    display: none !important;
  }

  .dl-shell {
    margin-left: 0;
  }

  .dl-main {
    padding: 0;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1200px) {
  .dl-main {
    padding: 24px 22px 36px 22px;
  }
}

@media (max-width: 768px) {
  .dl-app {
    flex-direction: column;
  }

  .dl-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--dl-border);
  }

  .dl-brand {
    padding: 0;
    margin-right: auto;
  }

  .dl-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    width: auto;
    order: 3;
    width: 100%;
    flex-basis: 100%;
  }

  .dl-nav-label {
    display: none;
  }

  .dl-nav-link.active::before {
    display: none;
  }

  .dl-nav-cta {
    margin: 0;
    width: auto;
  }

  .dl-sidebar-footer {
    display: none;
  }

  .dl-shell {
    margin-left: 0;
    min-height: auto;
  }

  .dl-topbar {
    padding: 0 16px;
  }

  .dl-main {
    padding: 18px 16px 32px 16px;
  }

  .dl-topbar-user-name {
    display: none;
  }
}

/* ============================================================
   Document detail page (Documents/Details)
   ============================================================ */

.dl-back-row {
  margin-bottom: 12px;
}

.dl-status-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-lg);
  margin-bottom: 18px;
}

.dl-status-band.tone-info { background: var(--dl-info-bg); color: var(--dl-info); }
.dl-status-band.tone-success { background: var(--dl-success-bg); color: var(--dl-success); }
.dl-status-band.tone-danger { background: var(--dl-danger-bg); color: var(--dl-danger); }
.dl-status-band.tone-neutral { background: var(--dl-neutral-bg); color: var(--dl-neutral); }

.dl-status-band-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--dl-surface);
  box-shadow: var(--dl-shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.dl-status-band-icon .dl-icon {
  width: 21px;
  height: 21px;
}

.dl-status-band-title {
  font-weight: 700;
  color: var(--dl-text);
}

.dl-status-band-caption {
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.85;
}

.dl-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.dl-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--dl-topbar-height) + 16px);
}

.dl-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dl-preview-filename {
  color: var(--dl-text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-segmented {
  display: inline-flex;
  background: var(--dl-neutral-bg);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-pill);
  padding: 3px;
  gap: 2px;
}

.dl-segmented button,
.dl-segmented a {
  border: 0;
  background: transparent;
  color: var(--dl-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: var(--dl-radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dl-segmented button.active,
.dl-segmented a.active {
  background: var(--dl-surface);
  color: var(--dl-primary);
  box-shadow: var(--dl-shadow-xs);
}

.dl-segmented button:focus-visible,
.dl-segmented a:focus-visible {
  outline: 2px solid rgba(var(--dl-primary-rgb), 0.4);
  outline-offset: 1px;
}

.dl-preview-pane {
  display: none;
}

.dl-preview-pane.is-active {
  display: block;
}

.dl-file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--dl-text-muted);
  border: 1px dashed var(--dl-border-strong);
  border-radius: var(--dl-radius-lg);
  background: var(--dl-bg-subtle);
}

.dl-file-placeholder .dl-icon {
  width: 44px;
  height: 44px;
  color: var(--dl-text-faint);
}

.dl-signing-count {
  color: var(--dl-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.dl-signing-progress {
  height: 8px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-neutral-bg);
  overflow: hidden;
  margin-bottom: 14px;
}

.dl-signing-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--dl-primary) 0%, var(--dl-primary-strong) 100%);
  transition: width 0.4s ease;
}

.dl-signing-progress-fill.is-complete {
  background: linear-gradient(90deg, var(--dl-success) 0%, #047857 100%);
}

.dl-avatar-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dl-avatar-chain.is-secuencial {
  flex-wrap: nowrap;
}

.dl-avatar-step {
  position: relative;
  display: inline-flex;
}

.dl-avatar-step.tone-warning .dl-participant-avatar {
  opacity: 0.6;
}

.dl-avatar-connector {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--dl-border-strong);
  align-self: center;
  flex-shrink: 0;
}

.dl-detail-sidebar .dl-avatar-chain.is-secuencial {
  flex-wrap: wrap;
}

.dl-detail-sidebar .dl-avatar-chain .dl-participant-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.dl-detail-sidebar .dl-avatar-connector {
  width: 14px;
}

.dl-avatar-status {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dl-surface);
  border: 2px solid var(--dl-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--dl-shadow-xs);
}

.dl-avatar-status .dl-icon {
  width: 11px;
  height: 11px;
}

.dl-avatar-step.tone-success .dl-avatar-status { color: var(--dl-success); }
.dl-avatar-step.tone-danger .dl-avatar-status { color: var(--dl-danger); }
.dl-avatar-step.tone-warning .dl-avatar-status { color: var(--dl-warning); }

.dl-participant-rows {
  display: flex;
  flex-direction: column;
}

.dl-participant-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--dl-divider);
}

.dl-participant-row:last-child {
  border-bottom: none;
}

.dl-participant-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dl-participant-row-name {
  font-weight: 600;
}

.dl-participant-row-email {
  color: var(--dl-text-muted);
  font-size: 0.85rem;
}

.dl-participant-row-note {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dl-danger);
  font-size: 0.82rem;
}

.dl-participant-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.dl-participant-row-date {
  color: var(--dl-text-faint);
  font-size: 0.78rem;
}

.dl-participant-row-action {
  margin-top: 2px;
}

.dl-timeline-icon.tone-info { background: var(--dl-info-bg); color: var(--dl-info); }
.dl-timeline-icon.tone-success { background: var(--dl-success-bg); color: var(--dl-success); }
.dl-timeline-icon.tone-danger { background: var(--dl-danger-bg); color: var(--dl-danger); }
.dl-timeline-icon.tone-neutral { background: var(--dl-neutral-bg); color: var(--dl-neutral); }

.dl-timeline-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dl-text-faint);
  font-size: 0.76rem;
}

.dl-timeline-meta-ua {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .dl-detail-grid {
    grid-template-columns: 1fr;
  }

  .dl-detail-sidebar {
    position: static;
  }

  .dl-avatar-chain.is-secuencial {
    flex-wrap: wrap;
  }

  .dl-timeline-meta-ua {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .dl-participant-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .dl-participant-row-side {
    align-items: flex-start;
    margin-left: 0;
    width: 100%;
    padding-left: 48px;
  }
}

/* ============================================================
   Dashboard (Home/Index)
   ============================================================ */

.dl-stat-tile-link {
  text-decoration: none;
  color: inherit;
}

.dl-stat-tile-link:hover,
.dl-stat-tile-link:focus {
  text-decoration: none;
  color: inherit;
}

.dl-stat-tile-link:focus-visible {
  outline: 2px solid rgba(var(--dl-primary-rgb), 0.5);
  outline-offset: 2px;
}

.dl-attention {
  background: var(--dl-info-bg);
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-left: 4px solid var(--dl-info);
  border-radius: var(--dl-radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.dl-attention-clear {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--dl-success-bg);
  border: 1px solid rgba(5, 150, 105, 0.16);
  border-left: 4px solid var(--dl-success);
}

.dl-attention-action {
  background: var(--dl-secondary-light);
  border: 1px solid rgba(var(--dl-secondary-rgb), 0.22);
  border-left: 4px solid var(--dl-secondary);
}

.dl-attention-action .dl-attention-icon {
  color: var(--dl-secondary-active);
}

.dl-attention-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dl-attention-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--dl-surface);
  color: var(--dl-info);
  box-shadow: var(--dl-shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-attention-icon .dl-icon {
  width: 20px;
  height: 20px;
}

.dl-attention-clear .dl-attention-icon {
  color: var(--dl-success);
}

.dl-attention-title {
  font-weight: 700;
}

.dl-attention-sub {
  font-size: 0.85rem;
  color: var(--dl-text-muted);
}

.dl-attention-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dl-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  background: var(--dl-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dl-attention-item:hover {
  border-color: var(--dl-blue-300);
  box-shadow: var(--dl-shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.dl-attention-item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dl-attention-item-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.dl-attention-item-main span {
  font-size: 0.8rem;
  color: var(--dl-text-muted);
}

.dl-attention-item-side {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dl-text-faint);
  flex-shrink: 0;
}

.dl-signing-chip {
  padding: 2px 9px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.dl-badge-pending-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-secondary-light);
  color: var(--dl-secondary-active);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.dl-badge-pending-action .dl-icon {
  width: 13px;
  height: 13px;
}

.dl-dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.dl-dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--dl-topbar-height) + 16px);
}

.dl-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dl-activity li + li .dl-activity-item {
  border-top: 1px solid var(--dl-divider);
}

.dl-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.dl-activity-item:hover {
  text-decoration: none;
  color: var(--dl-text);
}

.dl-activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-activity-icon .dl-icon {
  width: 15px;
  height: 15px;
}

.dl-activity-icon.tone-info { background: var(--dl-info-bg); color: var(--dl-info); }
.dl-activity-icon.tone-success { background: var(--dl-success-bg); color: var(--dl-success); }
.dl-activity-icon.tone-danger { background: var(--dl-danger-bg); color: var(--dl-danger); }
.dl-activity-icon.tone-neutral { background: var(--dl-neutral-bg); color: var(--dl-neutral); }

.dl-activity-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.dl-activity-text {
  font-weight: 600;
  font-size: 0.85rem;
}

.dl-activity-doc {
  font-size: 0.78rem;
  color: var(--dl-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-activity-time {
  font-size: 0.74rem;
  color: var(--dl-text-faint);
  white-space: nowrap;
  margin-left: auto;
}

.dl-doc-row-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

.dl-doc-row-bar {
  width: 110px;
  height: 6px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-neutral-bg);
  overflow: hidden;
  flex-shrink: 0;
}

.dl-doc-row-bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--dl-primary) 0%, var(--dl-primary-strong) 100%);
}

.dl-doc-row-count {
  font-size: 0.76rem;
  color: var(--dl-text-muted);
  white-space: nowrap;
}

.dl-doc-row-constancia {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-left: 6px;
  color: var(--dl-primary);
}

.dl-doc-row-constancia .dl-icon {
  width: 15px;
  height: 15px;
}

.dl-empty-state-sm {
  padding: 28px 16px;
}

.dl-empty-state-sm .dl-icon {
  width: 30px;
  height: 30px;
}

@media (max-width: 991px) {
  .dl-dash-grid {
    grid-template-columns: 1fr;
  }

  .dl-dash-sidebar {
    position: static;
  }
}

/* ============================================================
   Sign flow (public: firmar / gestionar / configurar firma)
   ============================================================ */

.dl-status-band.tone-primary {
  background: var(--dl-primary-light);
  color: var(--dl-primary);
}

.dl-status-band.tone-warning {
  background: var(--dl-warning-bg);
  color: var(--dl-warning);
}

.dl-auth-card-workspace {
  max-width: 1120px;
}

.dl-sign-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.dl-sign-task {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dl-sign-greeting {
  color: var(--dl-text-muted);
  font-size: 0.92rem;
}

.dl-sign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dl-sign-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--dl-radius-pill);
  background: var(--dl-neutral-bg);
  color: var(--dl-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.dl-sign-chip .dl-icon {
  width: 14px;
  height: 14px;
}

.dl-sign-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dl-sign-actions .btn {
  width: 100%;
}

.dl-sign-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dl-sign-panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
}

.dl-sign-panel-icon .dl-icon {
  width: 18px;
  height: 18px;
}

.dl-sign-panel-icon.is-success { background: var(--dl-success-bg); color: var(--dl-success); }
.dl-sign-panel-icon.is-danger { background: var(--dl-danger-bg); color: var(--dl-danger); }
.dl-sign-panel-icon.is-neutral { background: var(--dl-neutral-bg); color: var(--dl-neutral); }

/* Firma actual (preview) en ConfigurarFirma */
.dl-firma-current {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  background: var(--dl-bg-subtle);
  margin-bottom: 18px;
}

.dl-firma-current img {
  max-height: 72px;
  max-width: 160px;
  background: #fff;
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius-sm);
  padding: 6px 10px;
  object-fit: contain;
}

.dl-firma-current-info {
  display: flex;
  flex-direction: column;
}

.dl-firma-current-info strong {
  font-size: 0.9rem;
}

.dl-firma-current-info span {
  font-size: 0.82rem;
  color: var(--dl-text-muted);
}

/* Lienzo de firma con sugerencia superpuesta */
.dl-firma-draw {
  position: relative;
}

.dl-firma-draw .dl-firma-canvas {
  width: 100%;
}

.dl-firma-pane {
  display: none;
}

.dl-firma-pane.is-active {
  display: block;
}

.dl-firma-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--dl-text-faint);
  font-size: 0.85rem;
  transition: opacity 0.15s ease;
}

.dl-firma-draw.is-drawn .dl-firma-hint {
  opacity: 0;
}

.dl-sign-add {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dl-sign-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dl-sign-add-grid .dl-field {
  margin-bottom: 0;
}

.dl-sign-add-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 575px) {
  .dl-sign-add-grid {
    grid-template-columns: 1fr;
  }

  .dl-sign-add-actions .btn {
    width: 100%;
  }
}

/* Resultado / enlace inválido */
.dl-result {
  animation: dl-result-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dl-result h1 {
  font-size: 1.25rem;
  margin: 0;
}

.dl-result-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

@keyframes dl-result-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 991px) {
  .dl-sign-grid {
    grid-template-columns: 1fr;
  }

  .dl-sign-task {
    position: static;
  }
}