/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; background: #f5f6fa; color: #1a1a2e; line-height: 1.5; }
a { color: #003366; text-decoration: none; }

/* === Navbar === */
.navbar { background: #003366; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; display: flex; align-items: center; gap: 1.5rem; height: 56px; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { background: white; color: #003366; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; letter-spacing: 0.05em; }
.nav-title { color: white; font-size: 13px; font-weight: 500; }
.nav-sub { color: rgba(255,255,255,0.6); font-size: 11px; }
.nav-links { margin-left: auto; display: flex; gap: 4px; }
.nav-links a { color: rgba(255,255,255,0.8); padding: 6px 12px; border-radius: 4px; font-size: 13px; transition: all 0.15s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.15); color: white; }

/* === Main wrap === */
.main-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem; }

/* === Footer === */
.footer { background: #003366; color: rgba(255,255,255,0.5); text-align: center; font-size: 11px; padding: 10px; margin-top: 3rem; }

/* === Page header === */
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 20px; font-weight: 500; color: #1a1a2e; }
.page-sub { font-size: 12px; color: #666; margin-top: 2px; }
.ev-meta { font-size: 12px; color: #666; margin-top: 4px; }
.back-link { font-size: 12px; color: #003366; display: inline-block; margin-bottom: 8px; }

/* === Cards === */
.card { background: white; border: 0.5px solid #dde1ea; border-radius: 10px; margin-bottom: 1rem; overflow: hidden; }
.card-hd { background: #003366; padding: 0.65rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.card-hd h2 { color: white; font-size: 13px; font-weight: 500; }
.card-tag { color: rgba(255,255,255,0.7); font-size: 11px; background: rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 3px; }
.hd-sts { background: #003366; }
.card-body { padding: 1rem; }
.card-body.p0 { padding: 0; }
.mt1 { margin-top: 1rem; }

/* === Stats grid === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.stat-card { background: white; border: 0.5px solid #dde1ea; border-radius: 8px; padding: 1rem; text-align: center; }
.stat-card.green .stat-val { color: #1a7a4a; }
.stat-card.red .stat-val { color: #c0392b; }
.stat-card.amber .stat-val { color: #b45309; }
.stat-val { font-size: 28px; font-weight: 500; }
.stat-lbl { font-size: 11px; color: #666; margin-top: 3px; }

/* === Action cards === */
.action-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.action-card { background: white; border: 0.5px solid #dde1ea; border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; gap: 6px; transition: all 0.15s; }
.action-card:hover { border-color: #003366; transform: translateY(-1px); }
.ac-badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 700; color: white; align-self: flex-start; }
.ac-badge.sts01 { background: #003366; }
.ac-badge.sts02 { background: #7b1fa2; }
.ac-badge.conv { background: #b45309; }
.action-card h3 { font-size: 13px; font-weight: 500; color: #1a1a2e; }
.action-card p { font-size: 11px; color: #666; }

/* === Data table === */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: #f8f9fb; }
.data-table th { padding: 8px 12px; text-align: left; font-weight: 500; color: #555; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 0.5px solid #dde1ea; }
.data-table td { padding: 8px 12px; border-bottom: 0.5px solid #f0f0f5; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbff; }

/* === Badges === */
.badge-mod { font-size: 11px; padding: 2px 7px; border-radius: 3px; background: #e8eef8; color: #003366; }
.verdict-badge { font-size: 11px; padding: 3px 9px; border-radius: 4px; font-weight: 500; }
.verdict-badge.apto { background: #eaf5ee; color: #1a7a4a; }
.verdict-badge.noapto { background: #fdf0ee; color: #c0392b; }
.verdict-badge.pend { background: #fef9e7; color: #b45309; }
.verdict-badge.big { font-size: 14px; padding: 5px 14px; }

/* === Buttons === */
.btn-primary { background: #003366; color: white; border: none; border-radius: 6px; padding: 9px 18px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.btn-primary:hover { background: #002244; }
.btn-sec { background: white; color: #003366; border: 0.5px solid #aab6cc; border-radius: 6px; padding: 9px 18px; font-size: 13px; cursor: pointer; transition: all 0.15s; display: inline-block; }
.btn-sec:hover { background: #f0f4f8; }
.btn-sm { font-size: 11px; padding: 4px 10px; background: white; border: 0.5px solid #aab6cc; border-radius: 4px; color: #003366; cursor: pointer; white-space: nowrap; }
.btn-sm:hover { background: #f0f4f8; }
.btn-cerrar { background: #1a7a4a; }
.btn-cerrar:hover { background: #145e38; }

/* === Tabs === */
.tabs-wrap { display: flex; background: white; border: 0.5px solid #dde1ea; border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.tab { flex: 1; padding: 10px 6px; border: none; border-right: 0.5px solid #dde1ea; background: white; font-size: 11px; color: #666; cursor: pointer; transition: all 0.15s; text-align: center; }
.tab:last-child { border-right: none; }
.tab:hover { background: #f8f9fb; color: #003366; }
.tab.active { background: #003366; color: white; font-weight: 500; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-nav { display: flex; gap: 10px; margin-top: 0.75rem; justify-content: flex-end; }
.tab-nav .btn-sec { margin-right: auto; }

/* === Eval table === */
.eval-table { width: 100%; border-collapse: collapse; }
.eval-table thead { background: #f8f9fb; }
.eval-table th { padding: 8px 12px; font-size: 11px; font-weight: 500; color: #555; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 0.5px solid #dde1ea; }
.eval-table th.col-desc { text-align: left; }
.eval-table td { padding: 8px 10px; border-bottom: 0.5px solid #f0f0f5; vertical-align: middle; }
.eval-table tr:last-child td { border-bottom: none; }
.col-desc { font-size: 12.5px; }
.col-opt { text-align: center; width: 70px; }
.col-nota { width: 220px; }
.nota-field { width: 100%; border: 0.5px solid #dde1ea; border-radius: 5px; padding: 4px 7px; font-size: 11px; background: #fafbff; color: #1a1a2e; }
.nota-field:focus { outline: none; border-color: #003366; }

/* === Opt buttons === */
.opt-btn { display: block; width: 100%; padding: 4px 0; border: 0.5px solid #dde1ea; border-radius: 5px; font-size: 11px; cursor: pointer; background: #f8f9fb; color: #666; transition: all 0.1s; margin: 2px 0; }
.opt-btn:hover { border-color: #aab6cc; background: #f0f4f8; }
.opt-btn.active-apto { background: #eaf5ee; border-color: #1a7a4a; color: #1a7a4a; font-weight: 500; }
.opt-btn.active-noapto { background: #fdf0ee; border-color: #c0392b; color: #c0392b; font-weight: 500; }
.opt-btn.active-si { background: #e8eef8; border-color: #003366; color: #003366; font-weight: 500; }
.opt-btn.active-no { background: #fdf0ee; border-color: #c0392b; color: #c0392b; font-weight: 500; }
.opt-btn.active-na { background: #f5f5f5; border-color: #999; color: #666; font-weight: 500; }

/* === Maniobras === */
.maniobra-block { border-bottom: 1px solid #e8ecf2; padding: 1rem 0; }
.maniobra-block:last-child { border-bottom: none; }
.maniobra-block.anomala .man-letter { background: #7b1fa2; }
.maniobra-hdr { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.man-letter { width: 28px; height: 28px; border-radius: 50%; background: #003366; color: white; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.man-title { font-size: 13px; font-weight: 500; color: #1a1a2e; line-height: 1.4; }
.maniobra-content { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; }
.man-svg-wrap { flex-shrink: 0; }
.man-svg-wrap svg { width: 100%; height: auto; border-radius: 6px; }
.man-eval-wrap { display: flex; flex-direction: column; gap: 8px; }
.man-desc { font-size: 11.5px; color: #555; line-height: 1.55; font-style: italic; background: #f8f9fb; padding: 8px 10px; border-radius: 5px; border-left: 3px solid #003366; }
.man-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.man-col { display: flex; flex-direction: column; gap: 4px; min-width: 100px; }
.man-col-lbl { font-size: 10px; color: #888; text-align: center; font-weight: 500; }
.man-col-btns { display: flex; gap: 4px; }
.eval-btn { flex: 1; padding: 5px 6px; border: 0.5px solid #dde1ea; border-radius: 5px; font-size: 11px; cursor: pointer; background: #f8f9fb; color: #666; transition: all 0.1s; text-align: center; }
.eval-btn:hover { border-color: #aab6cc; }
.eval-btn.active-apto { background: #eaf5ee; border-color: #1a7a4a; color: #1a7a4a; font-weight: 500; }
.eval-btn.active-noapto { background: #fdf0ee; border-color: #c0392b; color: #c0392b; font-weight: 500; }
.nota-row { display: flex; align-items: center; gap: 6px; }
.nota-row label { font-size: 11px; color: #888; white-space: nowrap; }
.nota-man-field { flex: 1; border: 0.5px solid #dde1ea; border-radius: 5px; padding: 4px 7px; font-size: 11px; background: #fafbff; color: #1a1a2e; }
.nota-man-field:focus { outline: none; border-color: #003366; }

/* === Obs textarea === */
.obs-textarea { width: 100%; border: 0.5px solid #dde1ea; border-radius: 6px; padding: 8px 10px; font-size: 13px; background: #fafbff; color: #1a1a2e; resize: vertical; }
.obs-textarea:focus { outline: none; border-color: #003366; }

/* === Save toast === */
.save-toast { position: fixed; bottom: 24px; right: 24px; background: #1a7a4a; color: white; padding: 8px 16px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999; }
.save-toast.visible { opacity: 1; }

/* === Form nueva === */
.form-nueva .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.g2 { grid-column: 1 / -1; }
.form-group label { font-size: 11px; color: #555; font-weight: 500; }
.form-group input, .form-group select { height: 36px; border: 0.5px solid #dde1ea; border-radius: 6px; padding: 0 10px; font-size: 13px; background: white; color: #1a1a2e; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #003366; }
.form-actions { margin-top: 1rem; display: flex; justify-content: flex-end; }

/* === Filter bar === */
.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-input { height: 36px; border: 0.5px solid #dde1ea; border-radius: 6px; padding: 0 10px; font-size: 13px; min-width: 220px; }
.filter-input:focus { outline: none; border-color: #003366; }
.filter-select { height: 36px; border: 0.5px solid #dde1ea; border-radius: 6px; padding: 0 10px; font-size: 13px; background: white; }
.actions-cell { white-space: nowrap; }

/* === ACTA (informe) === */
.print-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.acta-wrap { background: white; border: 0.5px solid #dde1ea; border-radius: 10px; padding: 2rem; max-width: 820px; margin: 0 auto; }
.acta-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #e8ecf2; }
.acta-logo-wrap { display: flex; align-items: center; gap: 12px; }
.acta-logo { background: #003366; color: white; font-size: 16px; font-weight: 700; padding: 8px 12px; border-radius: 6px; letter-spacing: 0.05em; }
.acta-logo-title { font-size: 14px; font-weight: 500; }
.acta-logo-sub { font-size: 11px; color: #666; }
.acta-ref { text-align: right; font-size: 11px; color: #666; line-height: 1.8; }
.acta-title-box { padding: 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; text-align: center; }
.acta-title-box.apto { background: #eaf5ee; }
.acta-title-box.noapto { background: #fdf0ee; }
.acta-title-box.pend { background: #fef9e7; }
.acta-doctype { font-size: 11px; font-weight: 500; color: #666; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.acta-scenario { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.acta-verdict-big { font-size: 32px; font-weight: 700; }
.acta-verdict-big.apto { color: #1a7a4a; }
.acta-verdict-big.noapto { color: #c0392b; }
.acta-verdict-big.pend { color: #b45309; }
.acta-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.acta-section { margin-bottom: 1rem; }
.acta-section-hd { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #003366; background: #edf2f8; padding: 6px 10px; border-radius: 4px; margin-bottom: 6px; }
.acta-section-hd.red { background: #fdf0ee; color: #c0392b; }
.acta-info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.acta-info-table th { width: 42%; padding: 5px 8px; color: #555; font-weight: 500; border-bottom: 0.5px solid #e8ecf2; text-align: left; }
.acta-info-table td { padding: 5px 8px; border-bottom: 0.5px solid #e8ecf2; font-weight: 500; }
.deficiencias-list { display: flex; flex-direction: column; gap: 6px; }
.deficiencia-item { background: #fdf0ee; border-radius: 5px; padding: 7px 10px; }
.def-fase { font-size: 10px; font-weight: 600; color: #c0392b; text-transform: uppercase; display: block; }
.def-texto { font-size: 12px; color: #4a1a1a; display: block; margin-top: 2px; }
.def-nota { font-size: 11px; color: #8b4513; display: block; margin-top: 2px; font-style: italic; }
.acta-notas { background: #f8f9fb; border-radius: 5px; padding: 10px; font-size: 12.5px; line-height: 1.6; min-height: 60px; }
.acta-cert-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.acta-cert-table th { padding: 6px 10px; background: #f8f9fb; font-weight: 500; font-size: 11px; text-transform: uppercase; color: #555; border: 0.5px solid #dde1ea; }
.acta-cert-table td { padding: 8px 10px; border: 0.5px solid #e8ecf2; }
.acta-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; }
.sig-box { text-align: center; padding-top: 2.5rem; border-top: 1px solid #b0b8cc; }
.sig-name { font-size: 13px; font-weight: 500; }
.sig-role { font-size: 11px; color: #888; margin-top: 3px; }

/* === Print === */
@media print {
  .navbar, .footer, .print-bar, .no-print { display: none !important; }
  body { background: white; }
  .main-wrap { padding: 0; max-width: 100%; }
  .acta-wrap { border: none; padding: 0; box-shadow: none; }
  @page { margin: 1.5cm; }
}

/* === Responsive === */
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .action-cards { grid-template-columns: 1fr; }
  .maniobra-content { grid-template-columns: 1fr; }
  .man-svg-wrap svg { max-width: 280px; }
  .acta-section-grid { grid-template-columns: 1fr; }
  .acta-signatures { grid-template-columns: 1fr; }
  .tabs-wrap { flex-wrap: wrap; }
  .tab { flex-basis: 50%; }
  .form-nueva .form-grid { grid-template-columns: 1fr; }
}
