/* ==========================================================================
   CUADERNO DE CAMPO LCIF PARA MANDOS - UME
   Estilos Optimizados para Operaciones de Campo y Móvil
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Modo Táctico Nocturno / Estándar (Dark OLED) */
  --bg-main: #0c1017;
  --bg-card: #151c27;
  --bg-card-sub: #1b2432;
  --bg-header: #0f151f;
  --border-color: #273549;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-accent: #fbbf24;

  --color-primary: #3b82f6;
  --color-primary-dark: #1d4ed8;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-bg: #451212;
  --color-success: #10b981;
  --color-success-bg: #064e3b;
  --color-info: #06b6d4;

  --nav-height: 64px;
  --header-height: 58px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Modo Solar / Luz Diurna Intensa */
body.theme-solar {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-header: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-accent: #b45309;

  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-success: #059669;
  --color-success-bg: #d1fae5;
  --color-info: #0891b2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* HEADER SUPERIOR */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title span {
  font-size: 11px;
  color: var(--text-accent);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header:active {
  transform: scale(0.96);
}

/* BARRA DE NAVEGACIÓN INFERIOR (MÓVIL) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  padding: 4px 0;
}

.nav-btn .nav-icon {
  font-size: 19px;
  margin-bottom: 2px;
}

.nav-btn.active {
  color: var(--text-accent);
  border-top: 3px solid var(--text-accent);
  background: rgba(245, 158, 11, 0.08);
}

/* CONTENEDOR PRINCIPAL Y PESTAÑAS */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.15s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS GENERALES */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.card-title-lg {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* HERO DASHBOARD */
.hero-banner {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

body.theme-solar .hero-banner {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  border: 1px solid #cbd5e1;
}

.hero-banner h1 {
  font-size: 19px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.hero-banner p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ACCESOS RÁPIDOS (GRID) */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 600px) {
  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.quick-card:active {
  transform: scale(0.97);
  background: var(--bg-card-sub);
}

.quick-card-icon {
  font-size: 24px;
}

.quick-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.quick-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ALERTA CRÍTICA BANNER */
.alert-box {
  background-color: var(--color-danger-bg);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.alert-box strong {
  color: var(--color-danger);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.alert-box.info {
  background-color: rgba(6, 182, 212, 0.12);
  border-left-color: var(--color-info);
}

.alert-box.info strong {
  color: var(--color-info);
}

.alert-box.warning {
  background-color: rgba(245, 158, 11, 0.12);
  border-left-color: var(--color-warning);
}

.alert-box.warning strong {
  color: var(--color-warning);
}

/* CALCULADORAS TÁCTICAS */
.calc-nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.calc-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.calc-nav-btn.active {
  background: var(--text-accent);
  color: #000;
  border-color: var(--text-accent);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}

.form-group .form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-control {
  width: 100%;
  height: 44px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--text-accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-results-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.calc-res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 13px;
}

.calc-res-item:last-child {
  border-bottom: none;
}

.calc-res-val {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-accent);
  font-family: var(--font-mono);
}

.calc-badge {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.4px;
}

.badge-success {
  background: var(--color-success-bg);
  color: #34d399;
  border: 1px solid var(--color-success);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: #f87171;
  border: 1px solid var(--color-danger);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid var(--color-warning);
}

/* TABLAS RESPONSIVAS */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

table.data-table th {
  background: var(--bg-card-sub);
  color: var(--text-accent);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  font-weight: 700;
}

table.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table.data-table tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.badge-indicativo {
  background: #334155;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.tel-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
}

/* ACORDEONES DEL CUADERNO */
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  background-color: var(--bg-card);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  user-select: none;
}

.accordion-header:active {
  background-color: var(--bg-card-sub);
}

.accordion-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 800;
  color: #fff;
}

.accordion-content {
  padding: 14px 16px;
  background-color: var(--bg-main);
  border-top: 1px solid var(--border-color);
  display: none;
  font-size: 14px;
}

.accordion-item.active .accordion-content {
  display: block;
}

.accordion-item.active .accordion-header .acc-icon {
  transform: rotate(180deg);
}

.acc-icon {
  transition: transform 0.2s ease;
  font-size: 12px;
}

/* CHECKLISTS */
.checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.checklist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.checklist-card-title {
  font-size: 16px;
  font-weight: 700;
}

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

.progress-bar-container {
  height: 8px;
  background: var(--bg-card-sub);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.25s ease;
}

.checklist-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.checklist-items-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.chk-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.chk-item.checked {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  text-decoration: line-through;
  color: var(--text-muted);
}

.btn-action-small {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* RADIO AIR-TO-GROUND BUBBLES */
.radio-step-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
}

.radio-step-header {
  font-size: 13px;
  color: var(--text-accent);
  margin-bottom: 8px;
}

.radio-bubble {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 13.5px;
  line-height: 1.4;
}

.radio-tierra {
  background: #1e3a5f;
  border-left: 4px solid #3b82f6;
}

.radio-aire {
  background: #2d3748;
  border-left: 4px solid #e2e8f0;
}

body.theme-solar .radio-tierra {
  background: #dbeafe;
  border-left-color: #2563eb;
}

body.theme-solar .radio-aire {
  background: #e2e8f0;
  border-left-color: #475569;
}

.bubble-author {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  color: var(--text-accent);
}

.radio-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

.btn-abort {
  background: #dc2626;
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-abort:active {
  transform: scale(0.98);
}

/* BUSCADOR MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.search-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin-top: 30px;
}

.search-modal-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-field {
  width: 100%;
  height: 44px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-item {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.search-item:hover, .search-item:active {
  border-color: var(--text-accent);
  background: rgba(245, 158, 11, 0.05);
}

.search-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.search-item-badge {
  background: #334155;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-item-title {
  font-size: 14px;
  color: var(--text-main);
}

.search-item-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.search-empty-hint, .search-no-results {
  text-align: center;
  padding: 30px 14px;
  color: var(--text-muted);
  font-size: 13px;
}

/* BOTÓN COPIAR */
.btn-copy {
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-copy:active {
  background: var(--color-primary-dark);
}

/* PULSE HIGHLIGHT */
.highlight-pulse {
  animation: pulseGlow 1.8s ease-in-out;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
