/* ============================================================
   overrides.css — Polish and modern UI (legacy-safe)
   Loaded AFTER main styles. No logic or structure changes.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Variables modernas (override suave) --- */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --focus-ring: 0 0 0 3px rgba(255, 215, 0, 0.35);
  --transition-ui: 0.2s ease-out;
}

/* --- Tipografía global --- */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(165deg, #f2f4f6 0%, #e8eaee 45%, #e2e6eb 100%);
  -webkit-font-smoothing: antialiased;
}

/* --- Header más limpio --- */
header {
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 50%, #2a2a2a 100%);
  box-shadow: var(--shadow-md);
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

header .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- Navegación tipo pill --- */
.navbar {
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: none;
}

.nav-link.active {
  background: #FFD700;
  color: #1a1a1a;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

#navLogout:hover {
  background: rgba(220, 53, 69, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

/* --- Contenedor principal --- */
.wrap {
  padding: 1.25rem 1.5rem;
  margin: 1.5rem auto;
}

@media (min-width: 768px) {
  .wrap {
    padding: 1.5rem 2rem;
  }
}

/* --- Cards modernas --- */
.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card::before {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  width: 4px;
}

/* --- Títulos --- */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2::after {
  height: 2px;
  border-radius: 2px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.25rem;
}

/* --- Formularios: inputs y focus --- */
input[type="text"],
input[type="date"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid #d1d5db;
  padding: 0.65rem 0.9rem;
  font-size: 0.9375rem;
  transition: border-color var(--transition-ui), box-shadow var(--transition-ui);
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9ca3af;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* --- Botones --- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: translateY(0);
}

.btn.small {
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.btn.secondary {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn.secondary:hover {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.4);
}

/* --- Tabs / sub-nav (pestañas internas) --- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nav-link.sub-nav {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  background: #f1f3f5;
  border: 1px solid #e9ecef;
}

.nav-link.sub-nav:hover {
  background: #e9ecef;
  color: #212529;
}

.nav-link.sub-nav.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* --- Menú técnico (tech options) --- */
.tech-menu {
  gap: 1rem;
}

.tech-option {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.tech-option:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(255, 215, 0, 0.35);
}

/* --- Listas de seguimiento / registros --- */
.tracking-list {
  list-style: none;
  padding-left: 0;
}

.tracking-list li {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 3px solid rgba(255, 215, 0, 0.5);
  background: #fafbfc;
  transition: background var(--transition-ui), border-left-color var(--transition-ui);
}

.tracking-list li:hover {
  background: #f1f3f5;
  border-left-color: rgba(255, 215, 0, 0.85);
}

/* --- Tablas --- */
.cotizacion-table,
table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cotizacion-table th,
table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.cotizacion-table td,
table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.9375rem;
}

.cotizacion-table tr:last-child td,
table tr:last-child td {
  border-bottom: none;
}

/* --- Búsqueda --- */
.search-container {
  margin-bottom: 1.25rem;
}

.search-input {
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  font-size: 0.9375rem;
  transition: border-color var(--transition-ui), box-shadow var(--transition-ui);
}

.search-input::placeholder {
  color: #9ca3af;
}

/* --- Login (mantener y afinar) --- */
#loginView {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  padding: 2rem 1rem;
}

#loginView .card {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  text-align: left;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

#loginView h2 {
  margin-bottom: 0.5rem;
  text-align: center;
}

#loginView .muted {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: #6b7280;
}

#loginView label {
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

#loginView label:first-of-type {
  margin-top: 0;
}

#loginView input[type="text"],
#loginView input[type="password"] {
  margin-top: 0;
  padding: 0.7rem 0.9rem;
}

#loginView .center {
  margin-top: 1.75rem;
}

#loginView .btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* --- Texto secundario --- */
.muted {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* --- Save status / mensajes --- */
.save-status {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  min-height: 1.5em;
}

/* --- Form grid (espaciado) --- */
.form-grid {
  gap: 1rem;
}

/* --- Centrado de bloques --- */
.center {
  gap: 0.75rem;
  margin: 1.25rem 0;
}
