/* =========================================================================
   CIVILTOOLS - ESTILOS MINIMALISTAS (BY NUBIK 2026)
   ========================================================================= */
:root {
  --bg-main: #0a0e17;
  --bg-card: #121826;
  --bg-card-hover: #182235;
  --border-color: #1f2a3f;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #38bdf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Minimalista */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-logo {
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-text h1 span {
  color: #60a5fa;
  font-weight: 400;
}

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

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-score { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-success { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-muted { background-color: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid var(--border-subtle); }
.badge-accent { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* =========================================================================
   PORTADA DE INICIO (HERO MINIMALISTA)
   ========================================================================= */
.hero-container {
  max-width: 1100px;
  margin: 4.5rem auto 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-title span {
  color: #60a5fa;
  font-weight: 400;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 3rem auto;
}

/* Grilla de Módulos */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  text-align: left;
}

.module-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.module-card.card-active {
  cursor: pointer;
}

.module-card.card-active:hover {
  border-color: #3b82f6;
  background-color: var(--bg-card-hover);
  transform: translateY(-3px);
}

.module-card.card-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  border-color: var(--border-subtle);
}

.module-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* Iconos SVG Monocromáticos */
.module-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.module-card.card-active .module-icon {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.module-card-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.module-card-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.module-card-footer {
  margin-top: auto;
}

.btn-block {
  width: 100%;
}

.disabled-btn {
  background-color: #121826;
  color: #64748b;
  border: 1px solid var(--border-subtle);
  cursor: not-allowed;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1e293b;
  border: 1px solid var(--border-color);
  color: #f1f5f9;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: transform 0.25s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

/* =========================================================================
   NAVEGACION Y PESTAÑAS DEL ESPACIO DE TRABAJO
   ========================================================================= */
.app-nav {
  background-color: #0f1422;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.nav-back-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav-back-btn:hover {
  color: #ffffff;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
  margin: 0 4px;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: #60a5fa;
  border-bottom-color: var(--primary);
  background-color: rgba(37, 99, 235, 0.06);
}

/* Contenido Principal */
.app-main {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.module-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.actions-group {
  display: flex;
  gap: 8px;
}

/* Botones con iconos monocromáticos */
.btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn svg {
  stroke: currentColor;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary {
  background-color: #182235;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background-color: #202d44; }

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

/* Tarjetas y Rejillas */
.grid-2col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-header {
  padding: 0.9rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

/* Formularios */
.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: #3b82f6;
}

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

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

/* Checklist Items */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
}

.check-info { flex: 1; }

.check-title {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.check-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Banner de Veredicto */
.verdict-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  background-color: #182235;
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.verdict-banner.aprobado {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}
.verdict-banner.observado {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}
.verdict-banner.rechazado {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.verdict-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #27354f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.verdict-banner.aprobado .verdict-icon { background-color: var(--success); color: white; }
.verdict-banner.observado .verdict-icon { background-color: var(--warning); color: white; }
.verdict-banner.rechazado .verdict-icon { background-color: var(--danger); color: white; }

.verdict-details h4 { font-size: 1rem; font-weight: 600; }
.verdict-details p { font-size: 0.78rem; color: var(--text-muted); }

.warning-list { list-style: none; margin-top: 8px; }

.warning-list li {
  font-size: 0.78rem;
  color: #fca5a5;
  background-color: rgba(239, 68, 68, 0.06);
  padding: 6px 8px;
  border-left: 2px solid var(--danger);
  margin-bottom: 6px;
  border-radius: 2px;
}

.warning-list li.empty-msg {
  color: var(--text-muted);
  background: none;
  border-left: none;
  padding: 0;
}

/* Tablas */
.table-responsive { overflow-x: auto; }

.table-data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table-data th {
  background-color: #0a0e17;
  color: var(--text-muted);
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

.table-data td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.table-data input {
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 3px 6px;
  border-radius: 4px;
  width: 75px;
  font-size: 0.8rem;
}

/* Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card {
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.metric-label { font-size: 0.72rem; color: var(--text-muted); }

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 3px 0;
}

.metric-value.text-primary { color: #60a5fa; }
.metric-value.text-accent { color: #38bdf8; }

.metric-sub { font-size: 0.7rem; color: #64748b; }

.canvas-strata {
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto;
}

/* TdR */
.scope-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background-color: #0a0e17;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.scope-stat { display: flex; flex-direction: column; }
.scope-stat .label { font-size: 0.7rem; color: var(--text-muted); }
.scope-stat strong { font-size: 0.95rem; color: var(--text-main); }

.tdr-output {
  background-color: #0a0e17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  max-height: 480px;
  overflow-y: auto;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.space-y-4 > * + * { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Footer Minimalista */
.app-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}
