:root {
  --navy: #0A100E;
  --navy-mid: #131B18;
  --green: #A9BB52;
  --green-dark: #7d8a3a;
  --blue: #1B6EF3;
  --page: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --sidebar-w: 272px;
  --sidebar-offset: 272px;
  --header-h: 56px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --nuevo: #059669;
  --mejora: #d97706;
  --bug: #dc2626;
  --resuelto: #6b7280;
  --alta: #dc2626;
  --media: #d97706;
  --baja: #16a34a;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
}
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--text);
  line-height: 1.45;
  min-height: 100%;
  overflow: hidden;
}
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Login —— */
.login-page {
  min-height: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #1a2838 100%);
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.25);
  padding: 2rem 2rem 1.75rem;
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand img { height: 48px; margin-bottom: 0.75rem; }
.login-brand h1 { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.login-brand p { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 110, 243, 0.15);
}
.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -0.35rem 0 0.85rem;
}
.field input[readonly],
.field select:disabled,
.field textarea[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}
.field input[readonly]:focus {
  border-color: var(--border);
  box-shadow: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, background 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-green { background: var(--green); color: var(--navy); }
.btn-green:hover { filter: brightness(1.05); }
.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.login-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

/* —— App shell (Zoho-like) —— */
.app {
  display: flex;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow: hidden;
  transform: translateX(0);
  transition: transform 0.22s ease;
}
.sidebar-brand {
  padding: 1rem 0.75rem 1rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--header-h);
}
.sidebar-brand img { height: 28px; width: auto; max-width: 140px; object-fit: contain; flex-shrink: 0; }
.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand-text strong { display: block; font-size: 0.9375rem; color: #fff; }
.sidebar-brand div small { font-size: 0.65rem; color: var(--green); text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar-toggle {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { background: #f8fafc; border-color: #cbd5e1; }
.sidebar .sidebar-toggle {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}
.sidebar .sidebar-toggle:hover { background: rgba(255,255,255,0.12); }
.sidebar-toggle-open { margin-right: 0.25rem; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 45;
}
/* Colapsado: mantener ancho real para que translateX(-100%) saque todo el panel */
.app.sidebar-collapsed {
  --sidebar-offset: 0px;
}
.app.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  pointer-events: none;
  visibility: hidden;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0.5rem; }
.nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0.5rem 0.75rem 0.35rem;
}
.project-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  margin: 0.1rem 0.25rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #cbd5e1;
  width: calc(100% - 0.5rem);
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
}
.project-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.project-nav-item.active { background: rgba(169, 187, 82, 0.18); color: #fff; }
.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-nav-meta { flex: 1; min-width: 0; }
.project-nav-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-nav-meta small { font-size: 0.7rem; color: #94a3b8; }
.project-badge {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
}
.sidebar-footer { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-offset);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: margin-left 0.22s ease;
}
.topbar {
  height: var(--header-h);
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1rem 0 0.85rem;
  gap: 0.65rem;
  position: relative;
  z-index: 40;
  box-shadow: var(--shadow);
}
.topbar h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-box {
  flex: 1;
  max-width: 320px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  background: #f8fafc;
}
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.875rem;
}

.search-box input.has-value {
  border-color: var(--blue);
  background: #eff6ff;
}

/* Barra compacta: indicadores + filtros en modales */
.tools-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 1.25rem;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tools-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.tools-trigger.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.tools-trigger .filter-active-badge {
  margin-left: 0.15rem;
}
.tools-bar-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-left: auto;
}
.tools-bar-meta .page-indicator {
  min-width: auto;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 1.5rem;
  overflow: auto;
}
.sheet-overlay[hidden] { display: none !important; }
.sheet-panel {
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheet-in 0.18s ease;
}
.sheet-panel-wide { width: min(720px, 100%); }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-panel { animation: none; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.sheet-head h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy);
}
.sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sheet-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.sheet-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.filters-grid {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  padding: 0;
}
.stat-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.stat-card .val { font-size: 1.35rem; font-weight: 700; color: var(--blue); }
.stat-card .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card.stat-highlight { border-color: rgba(27, 110, 243, 0.35); background: #f8fbff; }
.stat-card.stat-highlight .val { color: var(--blue); }
.stat-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  margin-top: 0.45rem;
  overflow: hidden;
}
.stat-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #16a34a);
  border-radius: 99px;
  transition: width 0.25s;
}

.filter-active-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.12rem 0.4rem;
  border-radius: 99px;
  min-width: 1.25rem;
  text-align: center;
}
.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 1.25rem 0.45rem;
  flex-shrink: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.filter-chip:hover { background: #dbeafe; }
.filter-chip span { font-size: 0.875rem; line-height: 1; opacity: 0.7; }

.results-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.page-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.filter-field label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.filter-field select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  background: var(--surface);
  font-family: inherit;
  width: 100%;
}
.filter-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(27, 110, 243, 0.12);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0 0.15rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--page);
  border-top: 1px solid transparent;
}
.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.page-num {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}
.page-num:hover { background: #f8fafc; border-color: #cbd5e1; }
.page-num.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.page-ellipsis {
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.req-table .time-cell { white-space: nowrap; font-weight: 500; color: var(--muted); }

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.toolbar-row select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  background: var(--surface);
}

.content-area {
  padding: 0 1.25rem 0.65rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.resumen-panel {
  background: linear-gradient(90deg, rgba(27,110,243,0.06), rgba(169,187,82,0.08));
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.resumen-panel h3 { font-size: 0.8125rem; color: var(--navy); margin-bottom: 0.5rem; }
.resumen-panel ul { padding-left: 1.1rem; font-size: 0.8125rem; color: var(--muted); }

/* Zoho-style table */
.req-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  flex: 1;
  min-height: 0;
}
.req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.req-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.req-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.req-table tr:hover td { background: #fafbfc; }
.req-table tr { cursor: pointer; }
.req-table .num { color: var(--blue); font-weight: 600; width: 48px; }
.req-table .title { font-weight: 500; max-width: 280px; }
.req-table .title small { display: block; color: var(--muted); font-weight: 400; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }

.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.tag-nuevo { background: #d1fae5; color: var(--nuevo); }
.tag-mejora { background: #fef3c7; color: var(--mejora); }
.tag-bug { background: #fee2e2; color: var(--bug); }
.tag-resuelto { background: #f3f4f6; color: var(--resuelto); }
.tag-alta { background: #fee2e2; color: var(--alta); }
.tag-media { background: #fef3c7; color: var(--media); }
.tag-baja { background: #dcfce7; color: var(--baja); }
.tag-estado-pendiente { background: #f1f5f9; color: #475569; }
.tag-estado-en_analisis { background: #fef3c7; color: #b45309; }
.tag-estado-en_desarrollo { background: #dbeafe; color: #1d4ed8; }
.tag-estado-en_progreso { background: #dbeafe; color: #1d4ed8; }
.tag-estado-completado { background: #d1fae5; color: #047857; }
.tag-estado-bloqueado { background: #fee2e2; color: #b91c1c; }
.drawer-locked { font-size: 0.8125rem; color: #b45309; background: #fffbeb; padding: 0.5rem 0.65rem; border-radius: 6px; margin-bottom: 0.75rem; }
.user-role { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.1rem; }
.user-role-admin { color: var(--green); }
.user-role-editor { color: #94a3b8; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-state h3 { color: var(--text); margin-bottom: 0.35rem; }

/* Drawer / panel detalle */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.drawer-header h3 { font-size: 1rem; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.drawer-section { margin-bottom: 1.25rem; }
.drawer-section label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.drawer-desc {
  font-size: 0.875rem;
  white-space: normal;
  color: var(--text);
  text-align: justify;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.drawer-desc .text-link,
.avance-text .text-link,
.drawer-link-item {
  word-break: break-all;
}
.inline-media {
  display: block;
  margin: 0.85rem auto;
  max-width: 100%;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.65rem 0.5rem;
  box-shadow: var(--shadow);
}
.inline-media-link {
  display: block;
  text-decoration: none;
}
.inline-media-img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.inline-media-caption {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  line-height: 1.35;
}
.inline-media-caption a { color: var(--muted); }
.inline-media.is-broken .inline-media-img { display: none; }
.inline-media.is-broken::before {
  content: "No se pudo cargar la imagen";
  display: block;
  padding: 1rem;
  color: #b91c1c;
  font-size: 0.8125rem;
}
.drawer-links .inline-media { margin-top: 0.65rem; }
.drawer-links .drawer-link-item { display: block; margin: 0.35rem 0; font-size: 0.8125rem; }
.drawer-links .inline-media-caption a { display: inline; }
.avance-text { margin-top: 0.25rem; }
.muted-empty { color: var(--muted); font-size: 0.8125rem; }
.drawer-links a { display: block; font-size: 0.8125rem; word-break: break-all; margin: 0.25rem 0; }
.avance-list { margin-top: 0.5rem; }
.avance-item {
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
}
.avance-item time { display: block; font-size: 0.65rem; color: var(--muted); }
.add-row { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.add-row input { flex: 1; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 1rem; font-size: 1.0625rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: min(300px, 86vw);
    min-width: min(300px, 86vw);
    transform: translateX(-105%);
    visibility: hidden;
    box-shadow: 8px 0 28px rgba(0,0,0,0.25);
  }
  .app:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .app:not(.sidebar-collapsed) .sidebar-backdrop {
    display: block;
  }
  .app.sidebar-collapsed {
    --sidebar-offset: 0px;
  }
  .main-wrap { margin-left: 0; }
  .req-table .title small { max-width: 180px; }
  #btnCollapseSidebar { display: none; }
}
