/* ============================================================
   SGD — Sistema de Gestión de Diseño
   Eljuri Licores · Bootstrap 5 + Fénix UI Kit
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
/* Los tokens --fx-* (navy, blue, purple, cyan, teal, warning, danger, success…)
   ya llegan definidos por assets/fenix-ui/css/fenix-ui.min.css, cargado antes
   que este archivo. Aquí solo mapeamos los alias que consumen los módulos JS. */
:root {
  --brand:        var(--fx-blue);
  --brand-dark:   var(--fx-blue-hover);
  --brand-light:  var(--fx-blue-softer);
  --brand-medium: var(--fx-blue-dark);
  --navy:         var(--fx-navy);

  --bg:          #f3f6f9;
  --surface:     #ffffff;
  --surface-muted: #edf0f3;
  --border:      #d9dee5;
  --border-soft: #e7ebef;
  --text:        #495057;
  --text-muted:  #6c7680;
  --text-faint:  #91a1ad;
  --shadow-sm:   0 1px 3px rgba(50,58,70,.08), 0 1px 2px rgba(50,58,70,.04);
  --shadow-md:   0 2px 8px rgba(50,58,70,.10);
  --shadow-lg:   0 8px 24px rgba(50,58,70,.14);
  --shadow-modal:0 15px 40px rgba(0,0,0,.20);
  --radius-sm:   4px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --radius-xl:   8px;
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --bottom-nav-h:64px;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }

body {
  font-family: "Century Gothic", "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3ccd4; border-radius: 99px; }

.d-none { display: none !important; }
.hidden { display: none !important; }
#modals-container .modal { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */

#app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.sidebar-brand img { height: 28px; width: auto; flex-shrink: 0; }
.sidebar-brand-name { display: block; font-size: 1.1rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em; line-height: 1.2; }
.sidebar-brand-sub  { display: block; font-size: .625rem; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; line-height: 1; }

.sidebar-nav { flex: 1; list-style: none; padding: .5rem; margin: 0; overflow-y: auto; }

.sidebar-section-label {
  font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); padding: .75rem .75rem .25rem;
}

.sidebar-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-md);
  font-size: .8125rem; font-weight: 500;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  cursor: pointer; text-decoration: none;
}
.sidebar-link i { font-size: .875rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.sidebar-link.active i { color: var(--brand); }

.sidebar-user { border-top: 1px solid var(--border-soft); padding: .625rem; flex-shrink: 0; }
.sidebar-user-inner {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .625rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background .12s;
}
.sidebar-user-inner:hover { background: var(--bg); }
.sidebar-user-inner:hover .sidebar-logout-btn { opacity: 1; }

.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.sidebar-avatar i { color: var(--brand); font-size: 1.1rem; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: .8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .6875rem; color: var(--text-faint); }

.sidebar-logout-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  cursor: pointer; opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { background: var(--brand-light); color: var(--brand); }

/* ── Topbar ──────────────────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; gap: .75rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}

.topbar-brand { display: none; align-items: center; gap: .5rem; flex-shrink: 0; }
.topbar-brand-text { font-weight: 700; font-size: .875rem; color: var(--navy); }

.topbar-breadcrumb { display: none; align-items: center; gap: .375rem; font-size: .8125rem; flex: 1; }
.topbar-breadcrumb a { color: var(--text-faint); }
.topbar-breadcrumb a:hover { color: var(--brand); }
.topbar-crumb-sep { font-size: .625rem; color: var(--text-faint); }
.topbar-crumb-active { color: var(--text); font-weight: 500; }

.topbar-title { display: none; flex: 1; text-align: center; font-size: .875rem; font-weight: 600; }
.topbar-date  { font-size: .75rem; color: var(--text-faint); flex-shrink: 0; display: none; }

.topbar-user-wrap { position: relative; flex-shrink: 0; margin-left: auto; }
.topbar-user-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .625rem .375rem .375rem;
  border: 1px solid transparent; border-radius: 9999px;
  background: none; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.topbar-user-btn:hover { background: var(--bg); border-color: var(--border); }

.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.topbar-avatar i { color: var(--brand); font-size: .875rem; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-user-name { font-size: .8125rem; font-weight: 500; display: none; }
.topbar-chevron   { font-size: .625rem; color: var(--text-faint); display: none; }

.topbar-menu {
  position: absolute; right: 0; top: calc(100% + .5rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  min-width: 200px; z-index: 50; overflow: hidden; padding: .375rem 0;
}
.topbar-menu.hidden { display: none; }
.topbar-menu-header {
  padding: .625rem 1rem .5rem; font-size: .6875rem; font-weight: 600;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border-soft);
}
.topbar-menu-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem 1rem; font-size: .8125rem; color: var(--text);
  transition: background .1s; border: none; background: none; cursor: pointer;
  width: 100%; text-align: left; text-decoration: none;
}
.topbar-menu-item:hover { background: var(--bg); }
.topbar-menu-item i { font-size: .875rem; color: var(--text-faint); width: 16px; }
.topbar-menu-danger { color: var(--brand) !important; }
.topbar-menu-danger i { color: var(--brand) !important; }
.topbar-menu-divider { border-top: 1px solid var(--border-soft); margin: .25rem 0; }

/* ── Main content ────────────────────────────────────────────── */
#main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#app { flex: 1; padding: 1.25rem 1.5rem 1.5rem; overflow-y: auto; min-height: 0; }

/* ── Bottom nav (mobile) ─────────────────────────────────────── */
#bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 40; padding-bottom: env(safe-area-inset-bottom);
}
#bottom-nav-list { list-style: none; margin: 0; padding: 0; display: flex; }
.bottom-nav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: .625rem .5rem; flex: 1;
  text-decoration: none; color: var(--text-faint);
  transition: color .12s; -webkit-tap-highlight-color: transparent;
}
.bottom-nav-link i { font-size: 1.25rem; line-height: 1; }
.bottom-nav-link span { font-size: .625rem; font-weight: 500; }
.bottom-nav-link.active { color: var(--brand); }
.bottom-nav-link.active i { color: var(--brand); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  #sidebar { transform: translateX(-100%); }
  #main-content { margin-left: 0; height: 100dvh; }
  #app { padding: 1rem; padding-bottom: calc(var(--bottom-nav-h) + 1rem); }
  #bottom-nav { display: block; }
  .topbar-brand { display: flex; }
  .topbar-title  { display: block; }
}
@media (min-width: 768px) {
  .topbar-breadcrumb { display: flex; }
  .topbar-date       { display: block; }
  .topbar-user-wrap  { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   MODAL SYSTEM (sin Bootstrap)
   ══════════════════════════════════════════════════════════ */
.sgd-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fadeIn .15s ease;
}
@media (min-width: 768px) { .sgd-backdrop { align-items: center; padding: 1rem; } }

.sgd-dialog {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: slideUp .2s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 768px) {
  .sgd-dialog { border-radius: var(--radius-xl); max-width: 520px; animation: scaleIn .15s cubic-bezier(.4,0,.2,1); }
  .sgd-dialog.lg { max-width: 760px; }
  .sgd-dialog.xl { max-width: 1100px; }
}

.sgd-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; background: var(--navy); border-bottom: none; flex-shrink: 0;
}
.sgd-modal-title { font-size: 1rem; font-weight: 600; color: #fff; }
.sgd-modal-header .sgd-close-btn { color: rgba(255,255,255,.75); }
.sgd-modal-header .sgd-close-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.sgd-modal-body  { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.sgd-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border-soft); flex-shrink: 0;
}
.sgd-close-btn {
  width: 32px; height: 32px; border: none; background: none;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-faint); font-size: 1.1rem;
  transition: background .1s, color .1s;
}
.sgd-close-btn:hover { background: var(--bg); color: var(--text); }

@keyframes fadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes slideUp { from { transform:translateY(40px); opacity:0 } to { transform:translateY(0); opacity:1 } }
@keyframes scaleIn { from { transform:scale(.96); opacity:0 } to { transform:scale(1); opacity:1 } }

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .5rem 1rem; font-size: .8125rem; font-weight: 600;
  border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  text-decoration: none; line-height: 1; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #eeebe7; }
.btn-danger   { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning  { background: #d97706; color: #fff; border-color: #d97706; }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-success  { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-outline-primary { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover:not(:disabled) { background: var(--brand-light); }
.btn-outline-secondary { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-outline-secondary:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.btn-outline-danger { background: transparent; color: #dc2626; border-color: #fca5a5; }
.btn-outline-danger:hover:not(:disabled) { background: #fef2f2; }
.btn-outline-success { background: transparent; color: #16a34a; border-color: #86efac; }
.btn-outline-success:hover:not(:disabled) { background: #f0fdf4; }
.btn-outline-warning { background: transparent; color: #d97706; border-color: #fcd34d; }
.btn-outline-warning:hover:not(:disabled) { background: #fffbeb; }
.btn-sm { padding: .35rem .75rem; font-size: .75rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .9375rem; }
.w-full, .w-100 { width: 100%; }

.badge {
  display: inline-flex; align-items: center; padding: .2rem .55rem;
  font-size: .6875rem; font-weight: 600; border-radius: 9999px; line-height: 1.4;
}
.badge-brand   { background: var(--brand-light); color: var(--brand); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-purple  { background: #f3e8ff; color: #7e22ce; }
.badge-neutral { background: var(--surface-muted); color: var(--text-muted); }
.badge.bg-primary   { background: var(--brand-light) !important; color: var(--brand) !important; }
.badge.bg-success   { background: #dcfce7 !important; color: #15803d !important; }
.badge.bg-danger    { background: #fee2e2 !important; color: #b91c1c !important; }
.badge.bg-warning   { background: #fef3c7 !important; color: #b45309 !important; }
.badge.bg-secondary { background: var(--surface-muted) !important; color: var(--text-muted) !important; }
.badge.bg-info      { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.rounded-pill { border-radius: 9999px !important; }

.card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.card.border-0 { border: none; box-shadow: var(--shadow-sm); }
.card.shadow-sm { box-shadow: var(--shadow-sm); }
.card-body   { padding: 1.25rem; }
.card-header { padding: .875rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border-soft); font-size: .875rem; font-weight: 600; }
.card-header.bg-white { background: var(--surface); }

.form-control, .form-select {
  width: 100%; padding: .575rem .875rem; font-size: .8125rem; font-family: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); outline: none;
  transition: border-color .15s, box-shadow .15s; line-height: 1.5;
  appearance: none; -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,113,188,.15); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239c9187' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; cursor: pointer;
}
.form-label { font-size: .8125rem; font-weight: 600; color: var(--text); display: block; margin-bottom: .375rem; }
.form-text { font-size: .75rem; color: var(--text-faint); margin-top: .25rem; }
.form-control-sm, .form-select-sm { padding: .35rem .75rem; font-size: .75rem; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check-input { width: 1rem; height: 1rem; border: 1.5px solid var(--border); border-radius: .25rem; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.form-check-label { font-size: .8125rem; color: var(--text); cursor: pointer; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
table.table th {
  font-size: .6875rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: .06em; padding: .75rem 1rem; border-bottom: 1px solid var(--border-soft);
  white-space: nowrap; background: var(--surface);
}
table.table td { padding: .875rem 1rem; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table.table-hover tbody tr:hover { background: var(--bg); }

/* Fila separadora que agrupa filas de tabla por categoría (rol, área,
   grupo gráfico…) — Utils.groupedRows() la intercala. */
tr.sgd-group-row td {
  background: var(--bg); color: var(--text-faint); font-size: .6875rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .5rem 1rem; border-bottom: 1px solid var(--border-soft);
}
tr.sgd-group-row:hover td { background: var(--bg); }
/* Agrupado de dos niveles (ej. Tipos de ítem: Competencia > Grupo
   gráfico) — el nivel 1 pesa más visualmente, el nivel 2 va indentado. */
tr.sgd-group-row-lvl1 td { background: var(--brand-light); color: var(--brand); font-weight: 800; border-bottom: 1px solid var(--border); }
tr.sgd-group-row-lvl2 td { padding-left: 1.75rem; }

/* Informe PDF del Dashboard — mismo patrón que .ficha-print-mode
   (css/ficha-doc.css): oculta el chrome de la app vía body class y
   deja que window.print() haga el resto. El padding va en el propio
   .dashboard-print-wrap (no tocamos @page — ya lo define ficha-doc.css
   con margin:0, global para toda la app). */
.dashboard-print-mode #sidebar,
.dashboard-print-mode #topbar,
.dashboard-print-mode #bottom-nav { display: none !important; }
.dashboard-print-mode #main-content { margin-left: 0 !important; }
.dashboard-print-wrap { max-width: 900px; margin: 0 auto; padding: 24px 12px 48px; }

@media print {
  .dashboard-print-mode #app,
  .dashboard-print-mode .dashboard-print-wrap { margin: 0 !important; max-width: none !important; overflow: visible !important; }
  .dashboard-print-mode .dashboard-print-wrap { padding: 12mm !important; }
  .dashboard-print-mode .dashboard-print-actions { display: none !important; }
  .dashboard-print-mode .card { break-inside: avoid; page-break-inside: avoid; }
}

.alert { padding: .875rem 1rem; border-radius: var(--radius-md); font-size: .8125rem; display: flex; align-items: flex-start; gap: .5rem; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.sgd-loader { display: flex; align-items: center; justify-content: center; min-height: 180px; gap: .625rem; color: var(--text-faint); flex-direction: column; }
.sgd-spinner { width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.sgd-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; gap: .5rem; color: var(--text-faint); text-align: center; padding: 2rem; }
.sgd-empty i { font-size: 2.5rem; opacity: .35; }
.sgd-empty p { font-size: .875rem; margin: 0; }

.spinner-border { display: inline-block; width: 1.5rem; height: 1.5rem; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-border-sm { width: .9rem; height: .9rem; border-width: 1.5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

#toast-container {
  position: fixed; bottom: calc(var(--bottom-nav-h) + .75rem); right: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: .5rem; max-width: 360px; width: calc(100% - 2rem);
}
@media (min-width: 768px) { #toast-container { bottom: 1.25rem; } }
.sgd-toast {
  display: flex; align-items: center; gap: .75rem; padding: .875rem 1rem;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  border: 1px solid var(--border); animation: slideUp .2s ease; font-size: .8125rem; font-weight: 500;
}
.sgd-toast-success { border-left: 3px solid #16a34a; }
.sgd-toast-danger  { border-left: 3px solid #dc2626; }
.sgd-toast-warning { border-left: 3px solid #d97706; }
.sgd-toast-info    { border-left: 3px solid #0ea5e9; }
.sgd-toast-icon    { font-size: 1rem; flex-shrink: 0; }
.sgd-toast-msg     { flex: 1; color: var(--text); }
.sgd-toast-close   { border: none; background: none; cursor: pointer; color: var(--text-faint); font-size: 1rem; padding: 0; line-height: 1; }

.sgd-pagination { display: flex; gap: .25rem; align-items: center; }
.sgd-page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .75rem; font-weight: 500;
  color: var(--text-muted); background: var(--surface); cursor: pointer;
  transition: background .1s, color .1s, border-color .1s; text-decoration: none;
}
.sgd-page-btn:hover  { background: var(--bg); color: var(--brand); border-color: var(--brand); }
.sgd-page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.sgd-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   MODULE-SPECIFIC
   ══════════════════════════════════════════════════════════ */

.avatar-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.avatar-thumb-lg { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; }

.kpi-bar-track { height: 6px; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.kpi-bar-fill  { height: 100%; border-radius: 99px; transition: width .3s ease; }
.kpi-pct-text  { font-size: 1.75rem; font-weight: 700; color: var(--brand); line-height: 1; }
.kpi-card      { transition: box-shadow .2s; }
.kpi-card:hover{ box-shadow: var(--shadow-md); }

.semaforo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* Check-in / check-out en curso (barra flotante sobre el detalle del ticket) */
.sgd-session-bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 1rem; border-radius: var(--radius-lg);
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  font-size: .8125rem; font-weight: 500; margin-bottom: 1rem;
}
.sgd-session-bar .sgd-session-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #16a34a;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.text-primary   { color: var(--brand) !important; }
.cursor-pointer { cursor: pointer; }

/* Login page */
#login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, var(--fx-blue-softer) 0%, var(--bg) 60%, var(--fx-purple-soft) 100%);
}

/* ── Ficha técnica: editor de texto enriquecido (Quill) ───────── */
.ft-rich .ql-toolbar {
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--surface-muted);
}
.ft-rich .ql-container {
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: inherit; font-size: .875rem; min-height: 90px;
}
.ft-rich .ql-editor { min-height: 90px; }
.ft-rich-ro {
  font-size: .875rem; line-height: 1.5; color: var(--text);
  border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: .5rem .75rem; background: var(--surface-muted);
}
.ft-rich-ro p:last-child { margin-bottom: 0; }
.ft-rich-ro ul, .ft-rich-ro ol { margin: 0 0 .5rem; padding-left: 1.25rem; }

/* ── Ficha técnica: secciones repetibles (editor) ─────────────
   Las clases .annot-* base viven en css/ficha-doc.css (las comparten
   el editor y el documento imprimible). */
.ft-sec-card { background: var(--surface); }
.ft-sec-thumb { max-width: 100%; max-height: 120px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.ft-sec-imgwrap { position: relative; display: inline-block; }
.ft-sec-imgdel-btn { position: absolute; top: 4px; right: 4px; padding: 0 .35rem; line-height: 1.4; }
.ft-sec-texto .ql-container { min-height: 70px; }
.ft-sec-texto .ql-editor { min-height: 70px; }
