/* ═══════════════════════════════════════════════════════════
   ÁTICO PARTES — Hoja de estilos principal
   Estilo: minimalista, Linear/Notion/Apple
═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'SF Mono', 'Fira Code', monospace;

  --bg:          #ffffff;
  --bg-subtle:   #f8fafc;
  --bg-hover:    #f1f5f9;
  --bg-active:   #e2e8f0;

  --border:      #e2e8f0;
  --border-focus:#00C7FC;

  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --text-link:   #0088b0;

  --brand:       #00C7FC;
  --brand-dark:  #0097c2;
  --brand-glow:  rgba(0, 199, 252, 0.35);

  --sidebar-w:   220px;
  --sidebar-bg:  #f8fafc;
  --sidebar-border: #e2e8f0;

  --r-sm:  4px;
  --r:     8px;
  --r-lg:  12px;
  --r-xl:  16px;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .10), 0 1px 2px -1px rgb(0 0 0 / .06);
  --shadow:    0 4px 6px -1px rgb(0 0 0 / .07), 0 2px 4px -2px rgb(0 0 0 / .05);
  --shadow-md: 0 8px 16px -4px rgb(0 0 0 / .10), 0 4px 6px -2px rgb(0 0 0 / .06);
  --amber:     #f59e0b;

  /* Estado colores */
  --c-blue-bg:   #dbeafe; --c-blue-text:   #1d4ed8;
  --c-purple-bg: #ede9fe; --c-purple-text: #6d28d9;
  --c-green-bg:  #dcfce7; --c-green-text:  #15803d;
  --c-amber-bg:  #fef3c7; --c-amber-text:  #b45309;
  --c-gray-bg:   #f1f5f9; --c-gray-text:   #475569;
  --c-light-bg:  #f8fafc; --c-light-text:  #94a3b8;

  /* Urgente */
  --urgente-color:  #ef4444;
  --urgente-bg:     #fff5f5;
  --urgente-border: #fca5a5;
}

/* ── Reset base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
/* Evita que el box-shadow de los paneles laterales (bell/prio) sangre al viewport */
.atico-app { overflow-x: hidden; }

body.atico-app {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── Layout ─────────────────────────────────────────────── */
.atico-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.atico-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.atico-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem 1.25rem 1rem;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -.01em;
}
.atico-sidebar__brand span { color: var(--brand-dark); }

.atico-brand-icon {
  width: 20px; height: 20px;
  color: var(--brand);
  flex-shrink: 0;
}

.atico-nav {
  flex: 1;
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.atico-nav__item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .75rem;
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .1s, color .1s;
  /* Reset para cuando es <button> */
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.atico-nav__item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.atico-nav__item:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.atico-nav__item.is-active {
  background: #e8f9ff;
  color: #003d50;
  box-shadow: inset 3px 0 0 var(--brand);
}
.atico-nav__item.is-active svg { opacity: 1; }
.atico-brand-logo { max-width: 140px; max-height: 48px; object-fit: contain; }

/* Grupo inferior del nav — siempre al fondo */
.atico-nav__group-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.atico-nav__item--trash { color: var(--text-3); }
.atico-nav__item--settings { color: var(--text-3); }
.atico-nav__item--trash:hover { color: #ef4444; }
.atico-nav__item--trash.is-active { background: #fef2f2; color: #ef4444; }

/* Papelera toolbar */
.atico-papelera-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.atico-papelera-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.atico-papelera-before { display: flex; align-items: center; gap: .5rem; }
.atico-papelera-before .atico-label { margin: 0; white-space: nowrap; font-size: 12px; }

.atico-sidebar__footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.atico-user-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}

.atico-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.atico-user-name {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atico-user-role {
  font-size: 11px;
  color: var(--text-3);
}

.atico-logout-btn {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color .1s, background .1s;
  /* Neutraliza estilos de navegador para <button> */
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.atico-logout-btn:hover { color: var(--text-2); background: var(--bg-hover); text-decoration: none; }
.atico-logout-btn svg { width: 15px; height: 15px; }

/* ── Main ───────────────────────────────────────────────── */
.atico-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem;
  min-width: 0;
}

/* ── Page header ────────────────────────────────────────── */
.atico-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.atico-page-header__left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.atico-page-header__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.atico-page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.atico-id-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .4rem;
  letter-spacing: 0;
  flex-shrink: 0;
  cursor: default;
}
.atico-row__title + .atico-id-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .4rem;
  margin-left: .375rem;
  cursor: default;
  vertical-align: middle;
}

.atico-back-link {
  display: flex;
  align-items: center;
  gap: .25rem;
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.atico-back-link svg { width: 14px; height: 14px; }
.atico-back-link:hover { color: var(--text-2); text-decoration: none; }

/* ── Botones ────────────────────────────────────────────── */
.atico-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
}
.atico-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.atico-btn--full { width: 100%; justify-content: center; }
.atico-btn--sm { padding: .375rem .75rem; font-size: 12.5px; }

.atico-btn--primary {
  background: linear-gradient(160deg, #1ad4ff 0%, #00C7FC 50%, #00b3e6 100%);
  color: #003d50;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 175, 216, 0.25);
  transition: background .15s, box-shadow .2s, transform .1s, color .15s;
}
.atico-btn--primary:hover {
  background: linear-gradient(160deg, #33daff 0%, #12d0ff 50%, #00c2f5 100%);
  border-color: transparent;
  color: #003d50;
  box-shadow: 0 0 0 5px var(--brand-glow), 0 6px 24px rgba(0, 199, 252, 0.55);
  text-decoration: none;
  transform: translateY(-1px);
}
.atico-btn--primary:active { transform: translateY(0); box-shadow: 0 0 0 4px var(--brand-glow); }

.atico-btn--secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.atico-btn--secondary:hover {
  background: var(--bg-hover);
  border-color: #b0dce8;
  text-decoration: none;
}

.atico-btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.atico-btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.atico-btn--prio-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.atico-btn--prio-active:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  text-decoration: none;
}

.atico-btn--danger-ghost {
  background: transparent;
  color: #ef4444;
  border-color: transparent;
}
.atico-btn--danger-ghost:hover {
  background: #fef2f2;
  text-decoration: none;
}

.atico-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .1s, background .1s;
}
.atico-btn-icon svg { width: 14px; height: 14px; }
.atico-btn-icon:hover { color: var(--text-2); background: var(--bg-hover); }

/* ── Formularios ────────────────────────────────────────── */
.atico-field { display: flex; flex-direction: column; gap: .375rem; }
.atico-field--grow { flex: 1; min-width: 0; }
.atico-field--narrow { width: 120px; flex-shrink: 0; }
.atico-field--check { width: 80px; flex-shrink: 0; align-items: center; }
.atico-field-row { display: flex; gap: 1rem; }
.atico-field-row .atico-field { flex: 1; }

.atico-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.atico-required { color: #ef4444; }

.atico-input, .atico-select, .atico-textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.atico-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .625rem center;
  padding-right: 2rem;
}
.atico-input:focus, .atico-select:focus, .atico-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 199, 252, 0.15);
}
.atico-input::placeholder, .atico-textarea::placeholder { color: var(--text-3); }
.atico-textarea { resize: vertical; min-height: 80px; }
.atico-input--narrow { width: 100px; }
.atico-input--checklist {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: .25rem .5rem;
}
.atico-input--checklist:focus {
  border-color: var(--border-focus);
  box-shadow: none;
}

.atico-checkbox {
  width: 16px; height: 16px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Toggle switch */
.atico-toggle-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
}
.atico-toggle { display: none; }
.atico-toggle-track {
  position: relative;
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 99px;
  flex-shrink: 0;
  transition: background .2s;
}
.atico-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 99px;
  box-shadow: var(--shadow-xs);
  transition: transform .2s;
}
.atico-toggle:checked + .atico-toggle-track { background: var(--brand-dark); }
.atico-toggle:checked + .atico-toggle-track::after { transform: translateX(16px); }
.atico-toggle-text { display: flex; flex-direction: column; }
.atico-toggle-text__title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.atico-toggle-text__desc  { font-size: 12px; color: var(--text-3); }

/* ── Card ───────────────────────────────────────────────── */
.atico-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.atico-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06); border-color: #b0dce8; }
.atico-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.atico-card__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.atico-card__count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  background: var(--bg-subtle);
  padding: .1rem .45rem;
  border-radius: 99px;
}
.atico-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.atico-card__section {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.atico-card--facturacion { border-color: #e0e7ff; background: #fafafe; }

/* ── Filtros ────────────────────────────────────────────── */
.atico-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.atico-filter-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.atico-filters .atico-select { width: auto; min-width: 140px; font-size: 13px; padding: .375rem 2rem .375rem .625rem; }
.atico-filters .atico-select--active { border-color: var(--brand); color: var(--brand-dark); background-color: color-mix(in srgb, var(--brand) 8%, var(--bg)); font-weight: 500; }

.atico-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.atico-search-icon {
  position: absolute;
  left: .625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.atico-search-input {
  padding-left: 2rem;
  font-size: 13px;
}
.atico-search-clear {
  position: absolute;
  right: .625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}
.atico-search-clear:hover { color: var(--text); text-decoration: none; }

/* ── Tabla ──────────────────────────────────────────────── */
.atico-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: visible;
  position: relative;
}
/* Radio en esquinas sin overflow:hidden para que los dropdowns no se corten */
.atico-table thead th:first-child { border-radius: var(--r-lg) 0 0 0; }
.atico-table thead th:last-child  { border-radius: 0 var(--r-lg) 0 0; }
.atico-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--r-lg); }
.atico-table tbody tr:last-child td:last-child  { border-radius: 0 0 var(--r-lg) 0; }
.atico-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.atico-table thead th {
  padding: .625rem 1rem;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.atico-th-sort a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.atico-th-sort a:hover { color: var(--text-2); }
.atico-th-sort.is-sorted-asc a,
.atico-th-sort.is-sorted-desc a { color: var(--text); }
.atico-sort-icon { flex-shrink: 0; width: 10px; height: 14px; }
.atico-th-sort.is-sorted-asc  .atico-sort-asc  { opacity: 1; }
.atico-th-sort.is-sorted-desc .atico-sort-desc { opacity: 1; }
.atico-th-sort.is-sorted-asc  .atico-sort-desc { opacity: .15; }
.atico-th-sort.is-sorted-desc .atico-sort-asc  { opacity: .15; }
.atico-table tbody tr { border-bottom: 1px solid var(--border); }
.atico-table tbody tr:last-child { border-bottom: none; }
.atico-table--compact .atico-row td { padding: .625rem 1rem; }

.atico-row { background: var(--bg); cursor: pointer; transition: background .1s; }
.atico-row:hover { background: var(--bg-subtle); }
.atico-row td { padding: .75rem 1rem; vertical-align: middle; }

.atico-row--urgente {
  border-left: 3px solid var(--urgente-color) !important;
}
.atico-row--urgente td:first-child { padding-left: calc(1rem - 3px); }
.atico-row--urgente { background: var(--urgente-bg); }
.atico-row--urgente:hover { background: #fee2e2; }

.col-logo   { width: 48px; min-width: 48px; }
.col-encargado { width: 44px; text-align: center; }
.col-entrega   { width: 100px; }
.col-horas     { width: 54px; text-align: right; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.col-estado    { width: 140px; }
.col-flags     { width: 56px; text-align: right; }
.col-num       { width: 60px; text-align: center; }
.col-actions   { width: 44px; text-align: center; }

.atico-row__title { display: block; font-weight: 500; }
.atico-row__client { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }

.col-entrega.is-overdue { color: #ef4444; font-weight: 500; }

.atico-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .875rem;
  flex-wrap: wrap;
}

.atico-list-count {
  font-size: 12px;
  color: var(--text-3);
}

/* ── Paginación ─────────────────────────────────────────── */
.atico-pagination {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.atico-pagination__btn,
.atico-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .375rem;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background .12s, color .12s;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}

.atico-pagination__btn:hover,
.atico-pagination__page:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.atico-pagination__btn.is-disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.atico-pagination__page.is-current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.atico-pagination__ellipsis {
  font-size: 13px;
  color: var(--text-3);
  padding: 0 .25rem;
}

.atico-pagination__info {
  font-size: 11px;
  color: var(--text-3);
  margin-left: .5rem;
  white-space: nowrap;
}

/* ── Badges ─────────────────────────────────────────────── */
.atico-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.atico-badge--blue   { background: var(--c-blue-bg);   color: var(--c-blue-text); }
.atico-badge--purple { background: var(--c-purple-bg); color: var(--c-purple-text); }
.atico-badge--green  { background: var(--c-green-bg);  color: var(--c-green-text); }
.atico-badge--amber  { background: var(--c-amber-bg);  color: var(--c-amber-text); }
.atico-badge--gray   { background: var(--c-gray-bg);   color: var(--c-gray-text); }
.atico-badge--light  { background: var(--c-light-bg);  color: var(--c-light-text); }

.atico-badge--interactive { cursor: pointer; user-select: none; }
.atico-badge--interactive:hover { filter: brightness(.95); }

/* ── Avatar ─────────────────────────────────────────────── */
.atico-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}
.atico-avatar--sm  { width: 24px; height: 24px; font-size: 10px; }
.atico-avatar--md  { width: 28px; height: 28px; font-size: 12px; }
.atico-avatar--lg  { width: 36px; height: 36px; font-size: 14px; }
.atico-avatar--clickable { cursor: pointer; transition: opacity .15s; }
.atico-avatar--clickable:hover { opacity: .8; }

.atico-avatar-picker {
  position: fixed;
  z-index: 9999;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 5px;
}
.atico-avatar-picker__swatch {
  width: 28px;
  height: 28px;
  border-radius: 99px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  padding: 0;
}
.atico-avatar-picker__swatch:hover     { transform: scale(1.18); }
.atico-avatar-picker__swatch.is-active { border-color: var(--text-1); }
.atico-avatar-picker__custom {
  grid-column: 1 / -1;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-2);
  font-size: 11px;
  padding: 4px 0;
  text-align: center;
  margin-top: 2px;
}
.atico-avatar-picker__custom:hover { background: var(--bg-subtle); color: var(--text-1); }
.atico-avatar-picker__close {
  grid-column: 1 / -1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  padding: 2px 0 0;
  text-align: center;
}
.atico-avatar-picker__close:hover { color: var(--text-1); }

/* ── Logos de cliente ───────────────────────────────────── */
.atico-logo {
  border-radius: var(--r-sm);
  object-fit: contain;
  flex-shrink: 0;
  max-width: none;   /* anula el reset global img { max-width: 100% } */
  display: block;    /* normaliza block (ya lo pone el reset, pero aquí lo fijamos) */
}
.atico-logo--sm  { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.atico-logo--md  { width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
.atico-logo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
}

/* ── Flags en tabla (nuevos) ────────────────────────────── */
.col-flags  { width: 96px; white-space: nowrap; }
.col-menu   { width: 36px; text-align: center; }

.atico-flag-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: default;
  vertical-align: middle;
  padding: 0;
  font-size: 10px;
}
.atico-flag-icon svg { width: 12px; height: 12px; flex-shrink: 0; }
.atico-flag-icon:not(.is-static) { cursor: pointer; transition: color .1s, background .1s; }
.atico-flag-icon:not(.is-static):hover { background: var(--bg-hover); color: var(--text-2); }
.atico-flag-icon.is-active { color: var(--urgente-color); }
.atico-flag-icon.is-active:hover { color: var(--urgente-color); background: #fef2f2; }
.atico-flag-icon--pack  { color: #6366f1; }
.atico-flag-icon--check { color: var(--c-green-text); width: auto; padding: 0 4px; }
.atico-flag-icon--note  { color: var(--text-3); }
.atico-check-count { font-size: 10px; font-weight: 600; line-height: 1; }

/* Preview de descripción en fila */
.atico-row__preview {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* Menú "..." por fila */
.atico-row-menu { position: relative; }
.atico-row-menu__dropdown {
  display: none !important;
  position: absolute;
  right: 0; top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  z-index: 60;
  min-width: 150px;
  padding: .375rem;
  flex-direction: column;
  gap: 2px;
}
.atico-row-menu__dropdown.is-open { display: flex !important; }
.atico-row-menu__dropdown.opens-up { top: auto; bottom: calc(100% + 4px); }
.atico-row-menu__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .625rem;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
  width: 100%;
}
.atico-row-menu__item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-3); }
.atico-row-menu__item:hover { background: var(--bg-hover); text-decoration: none; }
.atico-row-menu__item--danger { color: #ef4444; }
.atico-row-menu__item--danger svg { color: #ef4444; }
.atico-row-menu__item--danger:hover { background: #fef2f2; }
.atico-row-menu__divider { height: 1px; background: var(--border); margin: .25rem 0; }

/* Flags antiguas (compatibilidad) */
.atico-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
}
.atico-flag svg { width: 12px; height: 12px; }
.atico-flag--urgente { color: var(--urgente-color); }
.atico-flag--acum    { color: #6366f1; }

/* ── Chips ──────────────────────────────────────────────── */
.atico-chip {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid;
}
.atico-chip--urgente { background: #fef2f2; color: var(--urgente-color); border-color: var(--urgente-border); }
.atico-chip--horas   { background: var(--bg-2); color: var(--text-3); border-color: var(--border); }
.atico-muted { color: var(--text-3); }

/* ── Detalle page ───────────────────────────────────────── */
.atico-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.atico-detail-meta__row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.atico-detail-meta__sep  { color: var(--text-3); }
.atico-detail-meta__client,
.atico-detail-meta__enc  { font-size: 13.5px; font-weight: 500; }
.atico-detail-meta__client { color: var(--text); }
.atico-detail-meta__enc    { color: var(--text-2); }
.atico-detail-meta__flags  { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.atico-estado-wrap { position: relative; }
.atico-estado-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  z-index: 50;
  min-width: 180px;
  padding: .375rem;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.atico-estado-dropdown.is-open { display: flex; }
.atico-estado-option {
  display: flex;
  align-items: center;
  padding: .375rem .625rem;
  border-radius: var(--r);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .1s;
}
.atico-estado-option:hover { background: var(--bg-hover); }

.atico-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .3rem .7rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.atico-flag-btn svg { width: 13px; height: 13px; }
.atico-flag-btn:hover { background: var(--bg-hover); border-color: var(--text-3); }
.atico-flag-btn.is-active { background: #fef2f2; border-color: var(--urgente-border); color: var(--urgente-color); }
.atico-flag-btn--pack.is-active { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.atico-pack-assign-wrap { position: relative; }
.atico-pack-assign-wrap .atico-estado-dropdown { top: calc(100% + 4px); left: 0; right: auto; }

.atico-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}
.atico-detail-main {}
.atico-detail-side {}

.atico-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.atico-info-item { display: flex; flex-direction: column; gap: .25rem; }
.atico-info-label { font-size: 11.5px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.atico-info-value { font-size: 14px; color: var(--text); }
.atico-info-value.is-overdue { color: #ef4444; }
.atico-overdue-badge {
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 600;
  background: #fef2f2;
  color: #ef4444;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: .25rem;
  vertical-align: middle;
}

.atico-section-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}

.atico-prose {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Checklist ──────────────────────────────────────────── */
.atico-checklist { display: flex; flex-direction: column; gap: 2px; }
.atico-checklist__item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .4rem .25rem;
  border-radius: var(--r-sm);
  transition: background .1s;
}
.atico-checklist__item:hover { background: var(--bg-hover); }
.atico-checklist__item:hover .atico-checklist__delete { opacity: 1; }

.atico-checklist__text {
  flex: 1;
  font-size: 13.5px;
  transition: color .15s;
}
.atico-checklist__item.is-done .atico-checklist__text {
  text-decoration: line-through;
  color: var(--text-3);
}

.atico-check-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-3);
  padding: 0;
}
.atico-check-toggle:hover { color: var(--brand-dark); }
.atico-check-icon { width: 16px; height: 16px; }
.atico-checklist__item.is-done .atico-check-toggle { color: var(--brand-dark); }

.atico-checklist__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
  opacity: 0;
  flex-shrink: 0;
  padding: 0;
  border-radius: 4px;
  transition: color .1s, background .1s;
}
.atico-checklist__delete:hover { color: #ef4444; background: #fee2e2; }
.atico-checklist__delete svg { width: 10px; height: 10px; }

.atico-check-static { color: var(--text-3); font-size: 12px; flex-shrink: 0; width: 20px; text-align: center; }

.atico-checklist-add {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.atico-checklist-add .atico-input--checklist { flex: 1; }

.atico-checklist-edit-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .375rem;
}

/* ── Historial ──────────────────────────────────────────── */
.atico-historial { display: flex; flex-direction: column; gap: 0; }
.atico-historial__item {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .5rem 0;
  position: relative;
}
.atico-historial__item + .atico-historial__item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  width: 1px;
  height: .5rem;
  background: var(--border);
}
.atico-historial__dot {
  width: 10px; height: 10px;
  border-radius: 99px;
  flex-shrink: 0;
  margin-top: .3rem;
  border: 2px solid;
}
.atico-historial__dot--blue   { background: var(--c-blue-bg);   border-color: var(--c-blue-text); }
.atico-historial__dot--purple { background: var(--c-purple-bg); border-color: var(--c-purple-text); }
.atico-historial__dot--green  { background: var(--c-green-bg);  border-color: var(--c-green-text); }
.atico-historial__dot--amber  { background: var(--c-amber-bg);  border-color: var(--c-amber-text); }
.atico-historial__dot--gray   { background: var(--c-gray-bg);   border-color: var(--c-gray-text); }
.atico-historial__dot--light  { background: var(--c-light-bg);  border-color: var(--c-light-text); }

.atico-historial__body { flex: 1; }
.atico-historial__action { display: block; font-size: 13px; font-weight: 500; }
.atico-historial__meta   { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* ── Formulario grid (create/edit) ──────────────────────── */
.atico-form-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}
.atico-form-actions { display: flex; flex-direction: column; gap: .5rem; }

/* ── Logo preview ───────────────────────────────────────── */
.atico-logo-preview {
  width: 100%;
  height: 100px;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  overflow: hidden;
  background: var(--bg-subtle);
}
.atico-logo-preview__img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.atico-logo-preview__placeholder { font-size: 12px; color: var(--text-3); }

/* ── Alertas ────────────────────────────────────────────── */
.atico-alert {
  padding: .75rem 1rem;
  border-radius: var(--r);
  font-size: 13.5px;
  margin-bottom: 1rem;
}
.atico-alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.atico-alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── Empty state ────────────────────────────────────────── */
.atico-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.atico-empty svg { width: 48px; height: 48px; opacity: .35; }
.atico-empty p { font-size: 14px; max-width: 300px; }

/* ── Facturación ────────────────────────────────────────── */
.atico-header-stats { display: flex; gap: 1.25rem; }
.atico-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.atico-stat__num { font-size: 22px; font-weight: 700; line-height: 1; }
.atico-stat__num--amber { color: var(--c-amber-text); }
.atico-stat__num--green { color: var(--c-green-text); }
.atico-stat__label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

.atico-section-heading {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .875rem;
  margin-top: 1.5rem;
}
.atico-section-dot {
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--c-amber-text);
}
.atico-section-dot--green { background: var(--c-green-text); }
.atico-section-dot--gray  { background: var(--text-3); }
.atico-section-heading--amber .atico-section-heading { color: var(--c-amber-text); }

.atico-section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.atico-text-muted { color: var(--text-3); font-size: 12px; }

/* ── Zona de purga de histórico (facturación) ── */
.atico-purge-zone {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  margin-top: 1.25rem;
  padding: .875rem 1rem;
  border-top: 1px dashed var(--border);
  background: #fff8f8;
  border-radius: 0 0 var(--r) var(--r);
}
.atico-purge-zone__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.atico-purge-zone__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.atico-purge-zone__desc { font-size: 13px; color: var(--text-2); }
.atico-input--sm { height: 30px; padding: 0 .5rem; font-size: 12.5px; max-width: 140px; }
html[data-theme="dark"] .atico-purge-zone { background: rgba(239,68,68,.06); }

.atico-fac-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .875rem;
  flex-wrap: wrap;
}
.atico-fac-toolbar .atico-input--sm { min-width: 160px; }

.atico-fac-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: .875rem;
  transition: border-color .15s;
}
.atico-fac-card:hover { border-color: #c7d2fe; }
.atico-fac-card--valorado { border-left: 3px solid var(--c-green-text); }
.atico-fac-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
  gap: 1rem;
}
.atico-fac-card__title-row { display: flex; align-items: center; gap: .625rem; }
.atico-fac-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none !important;
  transition: color .15s;
}
.atico-fac-card__title::after {
  content: ' →';
  font-size: 11px;
  font-weight: 400;
  opacity: 0;
  transition: opacity .15s;
}
.atico-fac-card__title:hover {
  color: var(--brand-dark);
  text-decoration: none !important;
}
.atico-fac-card__title:hover::after { opacity: 1; }
.atico-fac-card__client { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.atico-fac-precio { font-size: 16px; font-weight: 700; color: var(--c-green-text); }
.atico-fac-notas {
  margin: .625rem 1rem 1rem;
  padding: .625rem .875rem;
  background: rgba(0,199,252,.06);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.atico-fac-notas__label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand-dark);
  margin-bottom: .25rem;
}
.atico-fac-notas__text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

.atico-fac-fields { display: flex; gap: .75rem; align-items: stretch; flex-wrap: wrap; margin-bottom: .75rem; }
.atico-fac-side-col { display: flex; flex-direction: column; gap: .5rem; width: 170px; flex-shrink: 0; }

/* Textarea que se estira para igualar altura con la columna vecina */
.atico-field--grow { display: flex; flex-direction: column; }
.atico-textarea--stretch { flex: 1; min-height: 80px; resize: vertical; }

/* Sin cargo inline */
.atico-fac-check-row { display: flex; align-items: center; gap: .5rem; padding: .375rem 0; cursor: pointer; }
.atico-fac-check-row .atico-checkbox { margin: 0; }

/* Card sin valorar colapsable */
.atico-fac-card--details { overflow: visible; }
.atico-fac-card__header--summary {
  display: flex;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.atico-fac-card__header--summary::-webkit-details-marker { display: none; }
.atico-fac-card--details[open] .atico-details-arrow { transform: rotate(180deg); }
.atico-fac-card--details .atico-fac-form { padding: .875rem 1rem; border-top: 1px solid var(--border); }

/* Resumen valorados: concepto + post-it en fila */
.atico-fac-resumen {
  display: flex;
  gap: 1rem;
  padding: .875rem 1rem;
  align-items: flex-start;
}
.atico-fac-resumen__body { flex: 1; min-width: 0; }
.atico-fac-concepto { font-size: 13px; color: var(--text-2); font-style: italic; margin: 0; line-height: 1.5; }

/* Post-it verde */
.atico-fac-postit {
  flex-shrink: 0;
  width: 180px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-sm);
  padding: .5rem .75rem;
  position: relative;
}
.atico-fac-postit__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #15803d;
  margin-bottom: .25rem;
}
.atico-fac-postit__text {
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
  margin: 0;
}
.atico-fac-actions { display: flex; gap: .5rem; }
.atico-fac-inline {}

/* Historial card colapsable */
.atico-card--details { overflow: hidden; }
.atico-card__header--summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  border-bottom: none;
}
.atico-card--details[open] .atico-card__header--summary { border-bottom: 1px solid var(--border); }
.atico-card__header--summary::-webkit-details-marker { display: none; }
.atico-card__header--summary::marker { display: none; }
.atico-card__header--summary:hover { background: var(--bg-subtle); }
.atico-details-arrow { color: var(--text-3); transition: transform .2s; flex-shrink: 0; }
.atico-card--details[open] .atico-details-arrow { transform: rotate(180deg); }

/* Details summary */
.atico-details > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: .375rem;
  user-select: none;
}
.atico-details > summary::-webkit-details-marker { display: none; }
.atico-details > summary::before { content: '▸'; font-size: 10px; }
.atico-details[open] > summary::before { content: '▾'; }

/* ── Toasts ─────────────────────────────────────────────── */
#atico-toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.atico-toast {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .6rem 1rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: atico-slide-in .2s ease;
  max-width: 320px;
}
.atico-toast--error   { background: #991b1b; }
.atico-toast--success { background: #15803d; }
@keyframes atico-slide-in {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dashboard ──────────────────────────────────────────── */
.atico-page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin: .15rem 0 0;
  text-transform: capitalize;
}

/* Stat cards */
.atico-dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.atico-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  transition: box-shadow .15s, transform .15s;
}
.atico-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.atico-stat-card--alert {
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.04);
}
.atico-stat-card--warn {
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.04);
}
.atico-stat-card--fac {
  border-color: rgba(0,199,252,.35);
  background: rgba(0,199,252,.04);
}
.atico-stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.atico-stat-card__icon--blue  { background: rgba(59,130,246,.12); color: #3b82f6; }
.atico-stat-card__icon--red   { background: rgba(239,68,68,.12);  color: #ef4444; }
.atico-stat-card__icon--amber { background: rgba(245,158,11,.12); color: #f59e0b; }
.atico-stat-card__icon--brand { background: rgba(0,199,252,.15);  color: var(--brand-dark); }
.atico-stat-card__body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.atico-stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.03em;
}
.atico-stat-card__label {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.atico-stat-card__link {
  position: absolute;
  bottom: .75rem;
  right: 1rem;
  font-size: 11px;
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}
.atico-stat-card__link:hover { text-decoration: underline; }

/* Dashboard grid */
.atico-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Dashboard sections */
.atico-dash-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: visible;
}
.atico-dash-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.atico-dash-section__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.atico-dash-section__link {
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 500;
  text-decoration: none;
}
.atico-dash-section__link:hover { text-decoration: underline; }

/* Dashboard list items */
.atico-dash-list { display: flex; flex-direction: column; }
.atico-dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  gap: .75rem;
  transition: background .12s;
}
.atico-dash-item:last-child { border-bottom: none; }
.atico-dash-item:hover { background: var(--bg-hover); }
.atico-dash-item__left {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
.atico-dash-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.atico-dash-item__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.atico-dash-item__meta {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atico-dash-item__right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.atico-dash-item__date {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.atico-dash-item__date.is-overdue { color: #ef4444; font-weight: 600; }

/* Days badge */
.atico-dash-days {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--bg-subtle);
}
.atico-dash-days.is-overdue { background: rgba(239,68,68,.1); color: #dc2626; }
.atico-dash-days.is-soon    { background: rgba(245,158,11,.1); color: #d97706; }

/* Urgente dot */
.atico-urgente-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

/* Empty inline */
.atico-dash-empty-inline {
  font-size: 13px;
  color: var(--text-3);
  padding: 1.25rem 1.1rem;
  text-align: center;
}

/* Empty state in section */
.atico-empty--sm {
  padding: 1.5rem 1.1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.atico-empty--sm p {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* Activity feed */
.atico-activity-list {
  display: flex;
  flex-direction: column;
  padding: .5rem 0;
}
.atico-activity-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem 1.1rem;
}
.atico-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .35rem;
  flex-shrink: 0;
}
.atico-activity-dot--blue   { background: #3b82f6; }
.atico-activity-dot--purple { background: #8b5cf6; }
.atico-activity-dot--green  { background: #22c55e; }
.atico-activity-dot--amber  { background: #f59e0b; }
.atico-activity-dot--gray   { background: #94a3b8; }
.atico-activity-dot--light  { background: #cbd5e1; }
.atico-activity-body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.atico-activity-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.atico-activity-text strong { color: var(--text); font-weight: 600; }
.atico-activity-text a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.atico-activity-text a:hover { text-decoration: underline; }
.atico-activity-time {
  font-size: 11px;
  color: var(--text-3);
}

/* Compact list variant */
.atico-dash-list--compact .atico-dash-item { padding: .5rem 1.1rem; }

/* Logo xs */
.atico-logo--xs {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .atico-sidebar { width: 64px; }
  .atico-sidebar__brand span, .atico-nav__item span,
  .atico-user-info, .atico-logout-btn span { display: none; }
  .atico-nav__item { justify-content: center; padding: .625rem; }
  .atico-sidebar__brand { justify-content: center; padding: 1rem .5rem; }
  .atico-main { margin-left: 64px; padding: 1.5rem; }
  .atico-detail-grid,
  .atico-form-grid,
  .atico-dash-grid,
  .atico-detail-2col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .atico-main { padding: 1rem; }
  .atico-page-header { flex-wrap: wrap; }
  .atico-filters { flex-direction: column; align-items: stretch; }
  .atico-field-row { flex-direction: column; }
  .atico-fac-fields { flex-direction: column; }
  .atico-fac-side-col { width: 100%; }
  .atico-fac-resumen { flex-direction: column; }
  .atico-fac-postit { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   PESTAÑAS (tabs)
═══════════════════════════════════════════════════════════ */

.atico-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.atico-tab {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color .15s, border-color .15s;
}
.atico-tab:hover { color: var(--text-2); }
.atico-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.atico-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 .35rem;
  border-radius: 999px;
}
.atico-tab.is-active .atico-tab__count {
  background: rgba(0,199,252,.15);
  color: var(--brand-dark);
}

/* ═══════════════════════════════════════════════════════════
   CREDENCIALES
═══════════════════════════════════════════════════════════ */

.atico-cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

/* Tarjeta */
.atico-cred-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .15s;
}
.atico-cred-card:hover { box-shadow: var(--shadow); }

/* Cabecera de tarjeta */
.atico-cred-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.atico-cred-header__left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.atico-cred-header__actions {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.atico-cred-card:hover .atico-cred-header__actions { opacity: 1; }

/* Logo de plataforma */
.atico-cred-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-cred-platform-badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.atico-cred-platform-badge--generic { color: var(--text-3); }

.atico-cred-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atico-cred-meta {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: .1rem;
}

/* Filas de campos (email, clave, url) */
.atico-cred-fields {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.atico-cred-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 1rem;
  min-height: 32px;
}
.atico-cred-row__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  width: 44px;
  flex-shrink: 0;
}
.atico-cred-row__value {
  font-size: 12.5px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.atico-cred-url {
  color: var(--text-link);
  text-decoration: none;
  font-family: var(--font);
  font-size: 12px;
}
.atico-cred-url:hover { text-decoration: underline; }
.atico-cred-password { letter-spacing: .15em; }

/* Botón copiar */
.atico-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text-3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: color .12s, background .12s;
}
.atico-copy-btn:hover { color: var(--text-2); background: var(--bg-hover); }

/* Botón ojo inline (en tarjeta) */
.atico-eye-btn--inline {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text-3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .12s, background .12s;
}
.atico-eye-btn--inline:hover { color: var(--text-2); background: var(--bg-hover); }

/* Notas / info */
.atico-cred-info {
  padding: .65rem 1rem;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  border-left: 3px solid var(--border-focus);
  margin: .5rem .75rem;
  border-radius: 0 4px 4px 0;
  background: rgba(0,199,252,.04);
}

/* Botón ojo en formularios */
.atico-input-eye {
  position: relative;
  display: flex;
  align-items: center;
}
.atico-input-eye .atico-input {
  padding-right: 2.5rem;
  width: 100%;
}
.atico-input-eye .atico-eye-btn {
  position: absolute;
  right: .5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: .25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color .12s;
}
.atico-input-eye .atico-eye-btn:hover { color: var(--text-2); }

/* Botón xs */
.atico-btn--xs {
  padding: .25rem .5rem;
  font-size: 11px;
  gap: .25rem;
}

@media (max-width: 900px) {
  .atico-cred-grid { grid-template-columns: 1fr; }
}

/* ── Info expandible ── */
.atico-cred-info-wrap { padding: .5rem .75rem .65rem; }
.atico-cred-info--collapsed {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
}
.atico-cred-info--collapsed::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1.5em;
  background: linear-gradient(transparent, var(--bg));
}
.atico-cred-info-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-dark);
  padding: .2rem 0 0;
  display: block;
}
.atico-cred-info-toggle:hover { text-decoration: underline; }

/* ── Importación de credenciales ── */
.atico-import-result { display: flex; flex-direction: column; gap: .5rem; }
.atico-import-stat {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 13px;
  font-weight: 500;
  padding: .5rem .75rem;
  border-radius: var(--r);
}
.atico-import-stat--ok   { background: #dcfce7; color: #15803d; }
.atico-import-stat--warn { background: #fef3c7; color: #b45309; }
.atico-import-stat--info { background: #dbeafe; color: #1d4ed8; }
.atico-import-note { font-size: 12px; color: var(--text-3); margin: .5rem 0 0; }

/* ── Alert variante info ── */
.atico-alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.atico-alert--warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }

/* ═══════════════════════════════════════════════════════════
   MODO OSCURO
═══════════════════════════════════════════════════════════ */

/* ── Switch de tema en el nav ── */
.atico-nav__theme {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .75rem;
  border-radius: var(--r);
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.atico-nav__theme:hover { color: var(--text-2); background: var(--bg-hover); }
.atico-nav__theme svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .65; }
.atico-nav__theme > span:not(.atico-nav__theme-track) { flex: 1; }

/* Icono luna/sol */
.atico-theme-icon--sun  { display: none; }
html[data-theme="dark"] .atico-theme-icon--moon { display: none; }
html[data-theme="dark"] .atico-theme-icon--sun  { display: block; }

/* Track (fondo del switch) */
.atico-nav__theme-track {
  position: relative;
  width: 36px; height: 20px;
  background: var(--bg-active);
  border-radius: 99px;
  flex-shrink: 0;
  transition: background .2s;
}
/* Thumb (bolita del switch) */
.atico-nav__theme-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 99px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s;
}
/* Estado activo (modo oscuro ON) */
.atico-nav__theme[aria-checked="true"] .atico-nav__theme-track { background: var(--brand-dark); }
.atico-nav__theme[aria-checked="true"] .atico-nav__theme-thumb { transform: translateX(16px); }

html[data-theme="dark"] {
  /* ── Fondos ── */
  --bg:          #0f172a;
  --bg-subtle:   #1e293b;
  --bg-hover:    #293548;
  --bg-active:   #334155;

  /* ── Bordes ── */
  --border:      #2d3f55;
  --border-focus:#00C7FC;

  /* ── Textos ── */
  --text:        #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --text-link:   #38bdf8;

  /* ── Marca ── */
  --brand:       #00C7FC;
  --brand-dark:  #00d4ff;
  --brand-glow:  rgba(0, 199, 252, 0.18);

  /* ── Sidebar ── */
  --sidebar-bg:     #0a1628;
  --sidebar-border: #1e293b;

  /* ── Sombras (más profundas en oscuro) ── */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .5);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .6), 0 1px 2px -1px rgb(0 0 0 / .5);
  --shadow:    0 4px 6px -1px rgb(0 0 0 / .6), 0 2px 4px -2px rgb(0 0 0 / .5);
  --shadow-md: 0 8px 16px -4px rgb(0 0 0 / .7), 0 4px 6px -2px rgb(0 0 0 / .5);

  /* ── Amber ── */
  --amber: #fbbf24;

  /* ── Colores de estado (badges) ── */
  --c-blue-bg:   #1e3a5f; --c-blue-text:   #60a5fa;
  --c-purple-bg: #2d1b69; --c-purple-text: #a78bfa;
  --c-green-bg:  #14532d; --c-green-text:  #4ade80;
  --c-amber-bg:  #3d1f00; --c-amber-text:  #fbbf24;
  --c-gray-bg:   #1e293b; --c-gray-text:   #94a3b8;
  --c-light-bg:  #0f172a; --c-light-text:  #64748b;

  /* ── Urgente ── */
  --urgente-color:  #f87171;
  --urgente-bg:     #1f0a0a;
  --urgente-border: #7f1d1d;
}

/* ── Overrides de colores hardcodeados ─────────────────────── */

/* Nav activo */
html[data-theme="dark"] .atico-nav__item.is-active {
  background: rgba(0, 199, 252, 0.1);
  color: #7ae7ff;
  box-shadow: inset 3px 0 0 var(--brand);
}
html[data-theme="dark"] .atico-nav__item--trash.is-active {
  background: rgba(248,113,113,.12);
  color: #f87171;
}

/* Inputs — background-color (no background shorthand) para no resetear background-repeat/position */
html[data-theme="dark"] .atico-input,
html[data-theme="dark"] .atico-select,
html[data-theme="dark"] .atico-textarea {
  background-color: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
html[data-theme="dark"] .atico-input::placeholder,
html[data-theme="dark"] .atico-textarea::placeholder { color: var(--text-3); }

/* ── Contraste de tarjetas: fondo ligeramente más claro que la página ── */
html[data-theme="dark"] .atico-card,
html[data-theme="dark"] .atico-stat-card,
html[data-theme="dark"] .atico-fac-card,
html[data-theme="dark"] .atico-dash-section,
html[data-theme="dark"] .atico-table-wrap,
html[data-theme="dark"] .atico-cred-card { background: var(--bg-subtle); }

/* Table rows: misma tonalidad que la card que los contiene */
html[data-theme="dark"] .atico-row { background: var(--bg-subtle); }
html[data-theme="dark"] .atico-row:hover { background: var(--bg-hover); }
html[data-theme="dark"] .atico-table thead th { background: var(--bg-active); }

/* Cards hover */
html[data-theme="dark"] .atico-card:hover { border-color: #334155; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
html[data-theme="dark"] .atico-fac-card:hover { border-color: #334155; }
html[data-theme="dark"] .atico-btn--secondary:hover { border-color: #334155; }
html[data-theme="dark"] .atico-card--facturacion { border-color: #1e3a5f; background: #0c1a2e; }

/* Urgente rows */
html[data-theme="dark"] .atico-row--urgente { background: var(--urgente-bg); }
html[data-theme="dark"] .atico-row--urgente:hover { background: #2a0a0a; }

/* ── Títulos y textos con contraste suficiente ── */
html[data-theme="dark"] .atico-page-title   { color: var(--text); }
html[data-theme="dark"] .atico-card__title  { color: var(--text); }
html[data-theme="dark"] .atico-row__title   { color: var(--text); }
html[data-theme="dark"] .atico-dash-item__title { color: var(--text); }
html[data-theme="dark"] .atico-dash-section__title { color: var(--text); }
html[data-theme="dark"] .atico-fac-card__title { color: var(--text); }
html[data-theme="dark"] .atico-fac-card__title:hover { color: var(--brand); }
html[data-theme="dark"] .atico-info-value   { color: var(--text); }
html[data-theme="dark"] .atico-prose        { color: var(--text-2); }

/* Stat cards */
html[data-theme="dark"] .atico-stat-card--alert { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.06); }
html[data-theme="dark"] .atico-stat-card--warn  { border-color: rgba(251,191,36,.3);  background: rgba(251,191,36,.06); }
html[data-theme="dark"] .atico-stat-card--fac   { border-color: rgba(0,199,252,.2);   background: rgba(0,199,252,.05); }

/* Toasts */
html[data-theme="dark"] .atico-toast           { background: #e2e8f0; color: #0f172a; }
html[data-theme="dark"] .atico-toast--error    { background: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .atico-toast--success  { background: #14532d; color: #bbf7d0; }

/* Alertas */
html[data-theme="dark"] .atico-alert--error   { background: #300a0a; color: #fca5a5; border-color: #7f1d1d; }
html[data-theme="dark"] .atico-alert--success { background: #052e16; color: #86efac; border-color: #166534; }
html[data-theme="dark"] .atico-alert--info    { background: #0c1a2e; color: #93c5fd; border-color: #1e3a5f; }
html[data-theme="dark"] .atico-alert--warn    { background: #1c1300; color: #fde68a; border-color: #3d1f00; }

/* Post-it facturación */
html[data-theme="dark"] .atico-fac-postit            { background: #0d2318; border-color: #166534; }
html[data-theme="dark"] .atico-fac-postit__label     { color: #4ade80; }
html[data-theme="dark"] .atico-fac-postit__text      { color: #86efac; }
html[data-theme="dark"] .atico-fac-notas             { background: rgba(0,199,252,.05); }

/* Logo preview */
html[data-theme="dark"] .atico-logo-preview { background: var(--bg-subtle); border-color: var(--border); }

/* Credenciales info expandible */
html[data-theme="dark"] .atico-cred-info--collapsed::after {
  background: linear-gradient(transparent, var(--bg));
}

/* Importación stats */
html[data-theme="dark"] .atico-import-stat--ok   { background: #052e16; color: #4ade80; }
html[data-theme="dark"] .atico-import-stat--warn { background: #1c1300; color: #fbbf24; }
html[data-theme="dark"] .atico-import-stat--info { background: #0c1a2e; color: #60a5fa; }

/* Checklist input */
html[data-theme="dark"] .atico-input--checklist {
  border-bottom-color: var(--border);
  color: var(--text);
}

/* Sección dot */
html[data-theme="dark"] .atico-section-dot          { background: var(--c-amber-text); }
html[data-theme="dark"] .atico-section-dot--green   { background: var(--c-green-text); }

/* ═══════════════════════════════════════════════════════════
   PRIORITARIOS — Nav badge + Panel lateral
═══════════════════════════════════════════════════════════ */

/* ── Nav item y badge ── */
.atico-nav__item--prio {
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.atico-nav__badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 .35rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.atico-nav__badge--prio {
  background: var(--bg-active);
  color: var(--text-2);
}

/* ── Overlay oscuro ── */
.atico-prio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.atico-prio-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Panel ── */
.atico-prio-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.atico-prio-panel.is-open {
  transform: translateX(0);
  box-shadow: -8px 0 32px rgba(0, 0, 0, .12);
}

/* Cabecera */
.atico-prio-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-prio-panel__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.atico-prio-panel__title svg { color: var(--brand-dark); }
.atico-prio-panel__count {
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-active);
  color: var(--text-2);
  padding: .1rem .45rem;
  border-radius: 99px;
}
.atico-prio-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .1s, background .1s;
}
.atico-prio-close:hover { color: var(--text); background: var(--bg-hover); }
.atico-prio-close svg { width: 14px; height: 14px; }

/* Filtros Todos / Los míos */
.atico-prio-panel__filters {
  display: flex;
  gap: .375rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-prio-filter {
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.atico-prio-filter:hover { background: var(--bg-hover); }
.atico-prio-filter.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #003d50;
  font-weight: 600;
}

/* Lista de items */
.atico-prio-list {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0;
}

.atico-prio-item {
  display: block;
  padding: .75rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.atico-prio-item:last-child { border-bottom: none; }
.atico-prio-item:hover { background: var(--bg-hover); text-decoration: none; }

.atico-prio-item__top {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .2rem;
}
.atico-prio-item__titulo {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atico-prio-item__urgente {
  width: 10px; height: 10px;
  flex-shrink: 0;
  color: #ef4444;
}
.atico-prio-item__score {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--bg-active);
  padding: .1rem .4rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.atico-prio-item__meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: .25rem;
}
.atico-prio-item__razon {
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 500;
}

/* Estado vacío */
.atico-prio-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-3);
}
.atico-prio-empty svg { width: 40px; height: 40px; opacity: .3; }
.atico-prio-empty p   { font-size: 13px; line-height: 1.5; margin: 0; }

/* Pie del panel */
.atico-prio-panel__foot {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-prio-vermas {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-dark);
  text-decoration: none;
}
.atico-prio-vermas:hover { text-decoration: underline; }

/* Motivo en la lista principal (cuando se ordena por prioridad) */
.atico-row__razon {
  display: block;
  font-size: 11px;
  color: var(--brand-dark);
  margin-top: 1px;
  font-weight: 500;
}

@media (max-width: 640px) {
  .atico-prio-panel { width: 100vw; }
}

/* Dark mode overrides */
html[data-theme="dark"] .atico-prio-panel {
  background: var(--bg-subtle);
  border-left-color: var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .atico-prio-item:hover { background: var(--bg-hover); }
html[data-theme="dark"] .atico-prio-filter.is-active { color: #003d50; }

/* ── Importar ──────────────────────────────────────────────────────────────── */
.atico-import-wrap { display: flex; flex-direction: column; gap: 1.5rem; max-width: 680px; }
.atico-import-step { padding: 1.75rem; }
.atico-import-help { font-size: 13.5px; color: var(--text-2); margin: .5rem 0 1.25rem; line-height: 1.6; }
.atico-import-help code { background: var(--bg-active); padding: .1em .4em; border-radius: 4px; font-size: 12px; }

.atico-import-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--text-2);
}
.atico-import-dropzone:hover,
.atico-import-dropzone.is-over {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, transparent);
  color: var(--text);
}
.atico-import-dropzone p { margin: .5rem 0; font-size: 14px; }
.atico-import-dropzone svg { margin-bottom: .5rem; opacity: .5; }
.atico-import-browse { color: var(--brand); cursor: pointer; text-decoration: underline; }
.atico-import-hint { font-size: 12px; color: var(--text-3); margin-top: .25rem !important; }

.atico-import-error {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 8px;
  font-size: 13.5px;
}

.atico-import-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.atico-import-stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.atico-import-stat strong { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.atico-import-stat span  { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.atico-import-stat-pills { display: flex; flex-wrap: wrap; gap: .375rem; }
.atico-import-pill {
  font-size: 11.5px;
  padding: .2rem .6rem;
  background: var(--bg-active);
  border-radius: 99px;
  color: var(--text-2);
}

.atico-import-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 .75rem;
}
.atico-import-map { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.atico-import-map__row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--bg-subtle);
  border-radius: 8px;
}
.atico-import-map__name { font-weight: 600; font-size: 13.5px; min-width: 90px; color: var(--text); }
.atico-import-map__arrow { color: var(--text-3); }
.atico-import-map__select { flex: 1; }

.atico-import-options { margin-bottom: 1.5rem; }
.atico-import-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.atico-import-check input { accent-color: var(--brand); width: 15px; height: 15px; }

.atico-import-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.atico-import-result {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 10px;
}
.atico-import-result--ok { background: #f0fdf4; }
.atico-import-result--err { background: #fef2f2; }
.atico-import-result p { margin: .25rem 0; font-size: 14px; color: var(--text); }
.atico-import-warn { color: #92400e; }
.atico-import-err  { color: #dc2626; }

html[data-theme="dark"] .atico-import-result--ok { background: rgba(22,163,74,.12); }
html[data-theme="dark"] .atico-import-result--err { background: rgba(220,38,38,.12); }
html[data-theme="dark"] .atico-import-error { background: rgba(220,38,38,.12); }

/* ── Chat de notas ─────────────────────────────────────────────────────────── */
.atico-chat .atico-card__header { border-bottom: 1px solid var(--border); padding-bottom: .875rem; }

.atico-chat__messages {
  max-height: 340px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  scroll-behavior: smooth;
}
.atico-chat__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 2rem 0;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}
.atico-chat__empty svg { opacity: .4; }

.atico-chat__msg { display: flex; }
.atico-chat__msg--mine { justify-content: flex-end; }

.atico-chat__bubble {
  max-width: 78%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 2px;
  padding: .5rem .75rem;
}
.atico-chat__msg--mine .atico-chat__bubble {
  background: color-mix(in srgb, var(--brand) 10%, var(--bg));
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
  border-radius: 12px 12px 2px 12px;
}

.atico-chat__meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .25rem;
}
.atico-chat__autor { font-size: 11.5px; font-weight: 600; color: var(--brand-dark); }
.atico-chat__time  { font-size: 11px; color: var(--text-3); }
.atico-chat__del {
  margin-left: auto;
  opacity: 0;
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: var(--text-3);
  line-height: 1;
  transition: opacity .15s, color .15s;
}
.atico-chat__bubble:hover .atico-chat__del { opacity: 1; }
.atico-chat__del:hover { color: #ef4444; }

.atico-chat__text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.atico-chat__compose {
  display: flex;
  gap: .625rem;
  align-items: flex-end;
  padding: .75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.atico-chat__input { flex: 1; resize: none; min-height: 52px; font-size: 13.5px; }

/* 2 columnas: checklist + chat */
.atico-detail-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* ── Panel de mensajes (campanita) ─────────────────────────────────────────── */
.atico-nav__item--bell { color: var(--text-2); }

.atico-bell-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 199;
}
.atico-bell-overlay.is-open { display: block; }

.atico-bell-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 320px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.atico-bell-panel.is-open {
  transform: translateX(0);
  box-shadow: -6px 0 24px rgba(0,0,0,.12);
}

.atico-bell-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1rem .875rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-bell-panel__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.atico-bell-panel__count {
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: .1em .45em;
  border-radius: 99px;
  line-height: 1.4;
}
.atico-bell-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: .25rem;
  border-radius: 6px; transition: background .15s, color .15s;
}
.atico-bell-close:hover { background: var(--bg-hover); color: var(--text); }

.atico-bell-list { flex: 1; overflow-y: auto; padding: .5rem 0; }

.atico-bell-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem; padding: 3rem 1rem;
  color: var(--text-3); font-size: 13px; text-align: center;
}
.atico-bell-empty svg { opacity: .35; }

.atico-bell-item {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background .12s;
}
.atico-bell-item:hover { background: var(--bg-hover); }
.atico-bell-item__top {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: .5rem;
  margin-bottom: .2rem;
}
.atico-bell-item__titulo {
  font-size: 13.5px; font-weight: 500;
  color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atico-bell-item__new {
  font-size: 11px; font-weight: 700;
  color: var(--brand); white-space: nowrap;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: .15em .5em; border-radius: 99px;
}
.atico-bell-item__meta { font-size: 12px; color: var(--text-3); }

html[data-theme="dark"] .atico-bell-panel {
  background: var(--bg-subtle);
  border-left-color: var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,.45);
}
html[data-theme="dark"] .atico-bell-item:hover { background: var(--bg-hover); }
html[data-theme="dark"] .atico-chat__msg--mine .atico-chat__bubble {
  background: rgba(var(--brand-rgb, 0,185,212), .15);
}

/* ── Edición inline ──────────────────────────────────────────────────────── */

.atico-enc-editable {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background .15s;
  position: relative;
}
.atico-enc-editable:hover { background: var(--bg-2); }

.atico-enc-dropdown {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
  padding: .25rem;
  min-width: 160px;
  z-index: 9999;
  display: none;
}
.atico-enc-dropdown.is-open { display: block; }

.atico-enc-dropdown__item {
  display: block;
  width: 100%;
  padding: .45rem .65rem;
  border: none;
  background: none;
  border-radius: 5px;
  font: inherit;
  font-size: .875rem;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.atico-enc-dropdown__item:hover { background: var(--bg-2); }
.atico-enc-dropdown__item.is-active { color: var(--accent); font-weight: 500; }

.js-inline-edit {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 5px;
  margin: -1px -5px;
  transition: background .15s;
}
.js-inline-edit:hover,
.js-inline-edit:focus { background: var(--bg-2); outline: none; }
.js-inline-edit.is-editing { background: transparent; cursor: default; }

.atico-inline-input {
  font: inherit;
  font-size: inherit;
  color: var(--text-1);
  background: var(--bg-1);
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
}
input[type="date"].atico-inline-input  { max-width: 148px; }
input[type="number"].atico-inline-input { max-width: 76px; }



/* ══════════════════════════════════════════════════════════
   MODAL GENÉRICO
══════════════════════════════════════════════════════════ */

.atico-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

/* Cuando tienen [hidden], el display:flex no debe sobreescribir */
.atico-modal[hidden],
.atico-modal-overlay[hidden] { display: none; }

.atico-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}
.atico-modal--sm { width: min(420px, calc(100vw - 32px)); }

.atico-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem .9rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-modal__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.atico-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: var(--r);
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.atico-modal__close:hover { background: var(--bg-hover); color: var(--text); }

.atico-modal__body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}
.atico-modal__desc {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.atico-modal__foot {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding: 1rem 1.4rem 1.2rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Form layout dentro del modal de hostings ───────────────────── */

#hosting-form .atico-form-grid { display: flex; flex-direction: column; gap: .85rem; }

.atico-form-row {
  display: flex;
  gap: .75rem;
}
.atico-form-row--check { align-items: center; }

.atico-form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}
.atico-form-group--lg { flex: 2; }
.atico-form-group--full { flex: 1 0 100%; }

.atico-form-group label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: .01em;
}
.atico-form-group input,
.atico-form-group select,
.atico-form-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .45rem .65rem;
  font: inherit;
  font-size: .875rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.atico-form-group input:focus,
.atico-form-group select:focus,
.atico-form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.atico-form-group textarea { resize: vertical; }
.atico-form-hint {
  font-size: .75rem;
  color: var(--text-3);
}

.atico-check-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.atico-check-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
  cursor: pointer;
}

.atico-req { color: var(--urgente-color); font-size: .75rem; }

/* ── Icon buttons ────────────────────────────────────── */

.atico-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.atico-icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.atico-icon-btn--danger:hover { background: #fee2e2; color: var(--urgente-color); }

/* ── Link button (texto plano) ───────────────────────── */
.atico-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .8rem;
  color: var(--text-link);
  cursor: pointer;
  text-decoration: none;
}
.atico-link-btn:hover { text-decoration: underline; }


/* ══════════════════════════════════════════════════════════
   MÓDULO HOSTINGS
══════════════════════════════════════════════════════════ */

.hosting-grupos { display: flex; flex-direction: column; gap: 1.25rem; margin-top: .5rem; }

/* ── Grupo por cliente ───────────────────────────────── */

.hosting-grupo {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
}
.hosting-grupo--pronto  { border-color: #fcd34d; }
.hosting-grupo--urgente { border-color: #fca5a5; }
.hosting-grupo--vencida { border-color: var(--urgente-color); }

.hosting-grupo__head {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.hosting-grupo__head::-webkit-details-marker { display: none; }
.hosting-grupo--pronto  .hosting-grupo__head { background: #fffbeb; }
.hosting-grupo--urgente .hosting-grupo__head { background: #fff5f5; }
.hosting-grupo--vencida .hosting-grupo__head { background: #fff1f2; }
.hosting-grupo__arrow { margin-left: auto; flex-shrink: 0; color: var(--text-3); transition: transform .2s; }
.hosting-grupo[open] .hosting-grupo__arrow { transform: rotate(180deg); }
.hosting-grupo:not([open]) .hosting-grupo__head { border-bottom: none; border-radius: var(--r-lg); }

.hosting-grupo__cliente {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.hosting-grupo__nombre {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
.hosting-grupo__count {
  font-size: .73rem;
  color: var(--text-3);
  background: var(--bg-active);
  border-radius: 99px;
  padding: .1em .55em;
}

.hosting-grupo__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.hosting-grupo__precio {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.hosting-grupo__espacio {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-2);
}

.hosting-config-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.hosting-config-btn:hover { background: var(--bg-hover); color: var(--text); }
.hosting-config-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* ── Badges fecha ────────────────────────────────────── */

.hosting-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-active);
  border-radius: 99px;
  padding: .15em .6em;
}
.hosting-badge em { font-style: normal; font-weight: 400; color: var(--text-3); }
.hosting-badge--pronto  { background: #fef3c7; color: #92400e; }
.hosting-badge--urgente { background: #fee2e2; color: #991b1b; }
.hosting-badge--vencida { background: #fee2e2; color: #991b1b; font-weight: 700; }

/* ── Tabla ───────────────────────────────────────────── */

.hosting-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.hosting-tabla thead th {
  padding: .5rem .8rem;
  text-align: left;
  font-size: .73rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.hosting-tabla thead th small { font-size: .7rem; text-transform: none; }

.hosting-tabla tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.hosting-tabla tbody tr:last-child { border-bottom: none; }
.hosting-tabla tbody tr:hover { background: var(--bg-subtle); }
.hosting-tabla td {
  padding: .55rem .8rem;
  vertical-align: middle;
  color: var(--text);
}

.hosting-row--pronto  td:first-child { border-left: 3px solid #fcd34d; }
.hosting-row--urgente td:first-child { border-left: 3px solid #fca5a5; }
.hosting-row--vencida td:first-child { border-left: 3px solid var(--urgente-color); }

.hosting-dominio { font-weight: 500; }
.hosting-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 .3em;
  margin-left: .3em;
  vertical-align: middle;
  line-height: 1.6;
}

.hosting-fecha { font-variant-numeric: tabular-nums; }
.hosting-fecha--pronto  { color: #92400e; font-weight: 500; }
.hosting-fecha--urgente { color: #b91c1c; font-weight: 600; }
.hosting-fecha--vencida { color: var(--urgente-color); font-weight: 700; }

.hosting-espacio {
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  color: var(--text-2);
}
.hosting-coste  { color: var(--text-3); font-size: .82rem; }
.hosting-empty  { color: var(--text-3); }
.hosting-notas-cell { color: var(--text-2); font-size: .8rem; max-width: 180px; }

.hosting-actions {
  width: 64px;
  text-align: right;
  white-space: nowrap;
}

/* ── Pie de grupo (añadir servicio) ─────────────────── */

.hosting-grupo__foot {
  padding: .5rem 1rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

/* ── Empty state ─────────────────────────────────────── */

.atico-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-3);
}
.atico-empty-state svg { opacity: .4; }
.atico-empty-state p { font-size: .9rem; color: var(--text-2); }

.atico-field-hint {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .2rem;
  display: block;
}

.hosting-aviso-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 500;
  color: var(--brand-dark);
  background: #e0f7ff;
  border-radius: 99px;
  padding: .12em .5em;
}

/* ── Estado: de baja ─────────────────────────────────── */

.hosting-row--baja td { opacity: .55; }
.hosting-row--baja:hover td { opacity: .7; }
.hosting-row--baja td:first-child { border-left: 3px solid #d1d5db; }

.hosting-baja-tag {
  display: inline-block;
  font-size: .63rem;
  font-weight: 700;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 0 .3em;
  margin-left: .3em;
  vertical-align: middle;
  line-height: 1.6;
  letter-spacing: .03em;
}

/* ── Estado: archivado ───────────────────────────────── */

.hosting-row--archivado td { color: var(--text-3); }
.hosting-archivados-wrap { border-top: 1px solid var(--border); padding-top: 1rem; }
.hosting-archivados-toggle {
  font-size: .8rem;
  color: var(--text-3);
}
.hosting-archivados-toggle:hover { color: var(--text-2); }

/* ── Columna de acciones más ancha ───────────────────── */

.hosting-actions { width: auto; min-width: 100px; text-align: right; white-space: nowrap; }

/* ── Botones de acción extra ─────────────────────────── */

.atico-icon-btn--renew  { color: #059669; }
.atico-icon-btn--renew:hover  { background: #d1fae5; color: #065f46; }
.atico-icon-btn--warn   { color: #d97706; }
.atico-icon-btn--warn:hover   { background: #fef3c7; color: #92400e; }
.atico-icon-btn--ok     { color: #059669; }
.atico-icon-btn--ok:hover     { background: #d1fae5; color: #065f46; }
.atico-icon-btn--muted  { color: var(--text-3); }
.atico-icon-btn--muted:hover  { background: var(--bg-hover); color: var(--text); }

/* ══ Chat de facturación ══════════════════════════════════ */

.atico-fac-chat {
  border-top: 1px solid var(--border);
  padding: .75rem 1rem 1rem;
}
.atico-fac-chat__head {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
  color: #15803d;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.atico-fac-chat__messages {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 220px;
  overflow-y: auto;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r);
  padding: .6rem .75rem;
  margin-bottom: .5rem;
}
.atico-fac-chat__msg { display: flex; flex-direction: column; gap: .1rem; }
.atico-fac-chat__msg--mio { align-items: flex-end; }
.atico-fac-chat__autor { font-size: .68rem; font-weight: 600; color: var(--text-3); }
.atico-fac-chat__bubble {
  background: #fff;
  border: 1px solid #d1fae5;
  color: var(--text);
  padding: .35rem .65rem;
  border-radius: .85rem;
  font-size: .875rem;
  max-width: 82%;
  line-height: 1.45;
}
.atico-fac-chat__msg--mio .atico-fac-chat__bubble {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}
.atico-fac-chat__time { font-size: .66rem; color: var(--text-3); }
.atico-fac-chat__empty {
  font-size: .8rem;
  color: var(--text-3);
  text-align: center;
  padding: .5rem 0;
  margin: 0;
}
.atico-fac-chat__legacy {
  background: #fffde7;
  border: 1px solid #fde68a;
  border-radius: var(--r);
  padding: .45rem .65rem;
  font-size: .82rem;
  color: #78350f;
  line-height: 1.4;
}
.atico-fac-chat__legacy-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .2rem;
}
.atico-fac-chat__input-row { display: flex; gap: .5rem; align-items: flex-end; }
.atico-fac-chat__input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .45rem .65rem;
  font: inherit;
  font-size: .875rem;
  resize: none;
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.atico-fac-chat__input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}

.atico-fac-chat-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 99px;
  padding: .1rem .45rem;
}
/* Mensajes nuevos sin leer — verde vivo */
.atico-fac-chat-badge--unread {
  color: #fff;
  background: #16a34a;
  border-color: #15803d;
}
/* Mensajes leídos — gris discreto */
.atico-fac-chat-badge--read {
  color: var(--text-3);
  background: var(--bg-subtle);
  border-color: var(--border);
}

/* Etiqueta "Facturación" en el bell panel */
.atico-bell-item__fac-label {
  font-size: .68rem;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 99px;
  padding: .05rem .4rem;
  margin-left: .3rem;
}
.atico-bell-item--fac { border-left: 2px solid #16a34a; }

/* ══ Preview drawer del parte ════════════════════════════ */

.atico-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.atico-preview-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.atico-preview-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(500px, 100vw);
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 1051;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.atico-preview-drawer.is-open {
  transform: translateX(0);
  box-shadow: -4px 0 32px rgba(0,0,0,.14);
}
.atico-preview-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.atico-preview-drawer__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.atico-preview-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.atico-preview-loading {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
  color: var(--text-3);
}
.atico-preview__titulo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .5rem;
  line-height: 1.3;
}
.atico-preview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  align-items: center;
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.atico-preview__section { margin-bottom: 1rem; }
.atico-preview__section-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 .4rem;
}
.atico-preview__text {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}
.atico-preview__text--notas {
  background: var(--bg-alt);
  border-radius: var(--r);
  padding: .6rem .85rem;
  font-size: .85rem;
  color: var(--text-2);
}
.atico-preview__checklist {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.atico-preview__checklist li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text);
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.atico-preview__checklist li::before {
  content: '';
  width: 14px; height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
}
.atico-preview__checklist li.is-done { color: var(--text-3); text-decoration: line-through; }
.atico-preview__checklist li.is-done::before {
  background: var(--brand);
  border-color: var(--brand);
}
.atico-preview__footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════
   PESTAÑAS (TABS)
══════════════════════════════════════════════════════════ */

.atico-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  gap: 0;
}
.atico-tab {
  padding: .45rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.atico-tab:hover { color: var(--text); text-decoration: none; }
.atico-tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR COLAPSABLE
══════════════════════════════════════════════════════════ */

.atico-sidebar__toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .5rem .875rem;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}
.atico-sidebar__toggle:hover {
  color: var(--text-2);
  background: var(--bg-hover);
}
.atico-sidebar__toggle svg { flex-shrink: 0; }

/* ── Estado colapsado ─────────────────────────────────── */
html[data-sidebar="collapsed"] .atico-sidebar { width: 64px; }
html[data-sidebar="collapsed"] .atico-main { margin-left: 64px; }
html[data-sidebar="collapsed"] .atico-sidebar__brand { justify-content: center; padding: 1rem .5rem; }
html[data-sidebar="collapsed"] .atico-brand-name { display: none; }
html[data-sidebar="collapsed"] .atico-brand-logo { max-width: 36px; max-height: 28px; }
html[data-sidebar="collapsed"] .atico-nav__label { display: none; }
html[data-sidebar="collapsed"] .atico-nav__item { justify-content: center; padding: .625rem; position: relative; }
html[data-sidebar="collapsed"] .atico-nav__badge {
  position: absolute;
  top: 4px; right: 6px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
  padding: 0 3px;
}
html[data-sidebar="collapsed"] .atico-user-info { display: none; }
html[data-sidebar="collapsed"] .atico-nav__theme { justify-content: center; padding: .625rem; }
html[data-sidebar="collapsed"] .atico-nav__theme > span:not(.atico-nav__theme-track) { display: none; }
html[data-sidebar="collapsed"] .atico-nav__theme-track { display: none; }
html[data-sidebar="collapsed"] .atico-sidebar__toggle { justify-content: center; padding: .625rem; }
html[data-sidebar="collapsed"] .atico-sidebar__toggle svg { transform: rotate(180deg); }
html[data-sidebar="collapsed"] .atico-sidebar__footer { padding: .75rem .5rem; justify-content: center; }
html[data-sidebar="collapsed"] .atico-user-row { flex: 0; min-width: 0; }
html[data-sidebar="collapsed"] .atico-logout-btn { display: none; }

/* ═══════════════════════════════════════════════════════════
   VISTA MÓVIL  ≤ 768 px
═══════════════════════════════════════════════════════════ */

/* ── Código / contraseña visible ──────────────────────── */
.atico-code {
  display: inline-block;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: .875rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .2rem .6rem;
  color: var(--text);
  user-select: all;
  cursor: text;
}

/* ── Packs de horas ────────────────────────────────────── */
.atico-pack-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .875rem;
  background: var(--bg);
  transition: border-color .15s;
}
.atico-pack-card:last-child { margin-bottom: 0; }
.atico-pack-card--inactive { opacity: .6; }
.atico-pack-card__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.atico-pack-card__name {
  font-weight: 600;
  font-size: .9375rem;
  flex: 1;
  min-width: 0;
}
.atico-pack-card__actions {
  display: flex;
  gap: .25rem;
  flex-shrink: 0;
}
.atico-pack-card__desc {
  font-size: .8125rem;
  color: var(--muted);
  margin-bottom: .5rem;
}
.atico-pack-card__meta {
  font-size: .8125rem;
  color: var(--muted);
  margin-bottom: .625rem;
}
.atico-pack-progress {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.atico-pack-progress__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.atico-pack-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s ease;
}
.atico-pack-progress__fill--warn   { background: #d97706; }
.atico-pack-progress__fill--danger { background: #dc2626; }
.atico-pack-progress__label {
  font-size: .8125rem;
  color: var(--muted);
}

/* ── Topbar móvil ──────────────────────────────────────── */
.atico-mobile-topbar {
  display: none; /* oculto en escritorio */
}

@media (max-width: 768px) {

  /* Topbar fija */
  .atico-mobile-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 150;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: .625rem 1rem;
    margin: -1rem -1rem 1.25rem;
    min-height: 52px;
  }
  .atico-mobile-topbar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-1);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
  }
  .atico-mobile-topbar__btn:hover { background: var(--bg-hover); }
  .atico-mobile-topbar__title {
    flex: 1;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text-1);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .atico-mobile-topbar__bell { margin-left: auto; }
  .atico-mobile-topbar__badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
  }

  /* ── Sidebar como overlay ──────────────────────────────── */
  .atico-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w) !important;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    /* neutralizar regla 900px que lo colapsa a 64px */
    overflow-y: auto;
  }
  .atico-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }

  /* Restaurar labels y estilos de nav que la 900px ocultó */
  .atico-sidebar__brand span,
  .atico-nav__item span,
  .atico-user-info,
  .atico-logout-btn span { display: revert !important; }
  .atico-nav__item { justify-content: flex-start !important; padding: .625rem 1rem !important; }
  .atico-sidebar__brand { justify-content: flex-start !important; padding: 1rem 1.25rem !important; }

  /* Ocultar el botón colapsar sidebar */
  .atico-sidebar__toggle { display: none !important; }

  /* Neutralizar html[data-sidebar="collapsed"] en móvil */
  html[data-sidebar="collapsed"] .atico-sidebar { width: var(--sidebar-w) !important; }
  html[data-sidebar="collapsed"] .atico-main { margin-left: 0 !important; }
  html[data-sidebar="collapsed"] .atico-sidebar__brand { justify-content: flex-start !important; padding: 1rem 1.25rem !important; }
  html[data-sidebar="collapsed"] .atico-brand-name { display: revert !important; }
  html[data-sidebar="collapsed"] .atico-brand-logo { max-width: none !important; max-height: none !important; }
  html[data-sidebar="collapsed"] .atico-nav__label { display: revert !important; }
  html[data-sidebar="collapsed"] .atico-nav__item { justify-content: flex-start !important; padding: .625rem 1rem !important; position: static !important; }
  html[data-sidebar="collapsed"] .atico-nav__badge {
    position: static !important;
    margin-left: auto !important;
    min-width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
    padding: 0 5px !important;
  }
  html[data-sidebar="collapsed"] .atico-user-info { display: revert !important; }
  html[data-sidebar="collapsed"] .atico-nav__theme { justify-content: flex-start !important; padding: .625rem 1rem !important; }
  html[data-sidebar="collapsed"] .atico-nav__theme > span:not(.atico-nav__theme-track) { display: revert !important; }
  html[data-sidebar="collapsed"] .atico-nav__theme-track { display: revert !important; }
  html[data-sidebar="collapsed"] .atico-sidebar__toggle { display: none !important; }
  html[data-sidebar="collapsed"] .atico-sidebar__footer { padding: .75rem 1rem !important; justify-content: flex-start !important; }
  html[data-sidebar="collapsed"] .atico-user-row { flex: 1 !important; min-width: 0 !important; }
  html[data-sidebar="collapsed"] .atico-logout-btn { display: revert !important; }

  /* ── Overlay oscuro detrás del sidebar ─────────────────── */
  .atico-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,.45);
  }
  .atico-sidebar-overlay.is-open { display: block; }

  /* ── Área de contenido principal ───────────────────────── */
  .atico-main {
    margin-left: 0 !important;
    padding: 1rem !important;
  }

  /* ── Detalle: checklist + chat en una columna ─────────────── */
  .atico-detail-2col {
    grid-template-columns: 1fr !important;
  }

  /* ── Tabla de partes: ocultar columnas no esenciales ────── */
  .col-encargado,
  .col-entrega,
  .col-horas,
  .col-flags,
  .col-menu { display: none !important; }

  /* ── Paneles bell y prio: ancho completo en móvil ────────── */
  .atico-bell-panel,
  .atico-prio-panel {
    width: 100vw !important;
    right: 0 !important;
    border-radius: 0 !important;
  }

}

/* ── Vista Packs ─────────────────────────────────────────────────────────── */
.atico-packs-group { margin-bottom: 2rem; }
.atico-packs-group__header {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: .5rem;
  padding-bottom: .375rem;
  border-bottom: 2px solid var(--border);
}
.atico-packs-group__client {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  text-decoration: none;
}
.atico-packs-group__client:hover { color: var(--brand); }
.atico-packs-group__count { font-size: .75rem; color: var(--text-3); }

.atico-pack-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .375rem;
  overflow: hidden;
}
.atico-pack-row__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .625rem .875rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.atico-pack-row__summary::-webkit-details-marker { display: none; }
.atico-pack-row__summary:hover { background: var(--bg-hover); }
.atico-pack-row__left { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.atico-pack-row__arrow { flex-shrink: 0; color: var(--text-3); transition: transform .15s; }
details.atico-pack-row[open] .atico-pack-row__arrow { transform: rotate(180deg); }
.atico-pack-row__name { font-weight: 500; font-size: .875rem; }
.atico-pack-row__desc { font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.atico-pack-row__right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  font-size: .8125rem;
  color: var(--text-2);
}
.atico-pack-row__horas { white-space: nowrap; font-size: .8125rem; }
.atico-pack-row__horas--warn  { color: var(--c-yellow-text); }
.atico-pack-row__horas--danger { color: var(--urgente-color); font-weight: 600; }
.atico-pack-row__dates { font-size: .75rem; color: var(--text-3); white-space: nowrap; }
.atico-pack-progress__bar--sm { width: 80px; height: 5px; }

.atico-pack-row__body {
  padding: .5rem .875rem .75rem 2.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.atico-pack-parte + .atico-pack-parte { border-top: 1px solid var(--border); padding-top: .3rem; }
.atico-pack-parte__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .3rem 0;
}
.atico-pack-parte__row--child { padding-left: 1.25rem; }
.atico-pack-parte__title {
  font-size: .8125rem;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atico-pack-parte__title:hover { color: var(--brand); }
.atico-pack-parte__meta { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; }
.atico-pack-parte__details { list-style: none; }
.atico-pack-parte__details > summary { cursor: pointer; list-style: none; }
.atico-pack-parte__details > summary::-webkit-details-marker { display: none; }
.atico-pack-parte__ver-mas {
  font-size: .7rem;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1rem .4rem;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.atico-pack-parte__details[open] .atico-pack-parte__ver-mas {
  color: var(--brand);
  border-color: var(--brand);
}
.atico-pack-parte__notas {
  font-size: .8rem;
  color: var(--text-2);
  line-height: 1.55;
  padding: .4rem 0 .5rem .25rem;
  white-space: pre-wrap;
}
.atico-pack-parte__notas--child { padding-left: 1.25rem; }
.atico-pack-row__footer {
  margin-top: .625rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
}
.atico-link { color: var(--brand); text-decoration: none; }
.atico-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  /* Pack summary: apilar nombre y stats verticalmente */
  .atico-pack-row__summary {
    flex-direction: column;
    align-items: flex-start;
    gap: .375rem;
  }
  .atico-pack-row__left { width: 100%; }
  .atico-pack-row__right {
    flex-wrap: wrap;
    gap: .375rem;
    padding-left: 1.375rem; /* alinear con el nombre (tras la flecha) */
  }
  .atico-pack-progress__bar--sm { width: 56px; }

  /* Pack parte rows: título en su propia línea, meta debajo */
  .atico-pack-parte__row {
    flex-wrap: wrap;
    gap: .25rem .5rem;
  }
  .atico-pack-parte__title {
    flex: 0 0 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .atico-pack-parte__details > summary { flex-wrap: wrap; gap: .25rem .5rem; }
  .atico-pack-parte__details > summary .atico-pack-parte__title {
    flex: 0 0 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ── Solicitudes admin ───────────────────────────────────────────────────── */

.atico-sol-admin { display: flex; flex-direction: column; gap: 1.25rem; }

.atico-sol-grupo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 1.125rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.atico-sol-grupo__nombre {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.atico-sol-tabla .atico-sol-titulo {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}

.atico-sol-tabla .atico-sol-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: .15rem;
}

.atico-sol-acciones { text-align: right; white-space: nowrap; }
