/* ============================================================
   styles.css — Estilos globales ObraDocs
   ============================================================ */

/* Variables de color y diseño */
:root {
  --azul: #2563eb;
  --azul-oscuro: #1d4ed8;
  --azul-claro: #eff6ff;
  --verde: #16a34a;
  --verde-claro: #f0fdf4;
  --rojo: #dc2626;
  --rojo-claro: #fef2f2;
  --amarillo: #d97706;
  --amarillo-claro: #fffbeb;
  --gris-texto: #1a1a2e;
  --gris-secundario: #6b7280;
  --gris-borde: #e5e7eb;
  --gris-fondo: #f9fafb;
  --blanco: #ffffff;
  --radio: 12px;
  --sombra: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--gris-texto);
  background: var(--gris-fondo);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN
   ============================================================ */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: #06B6D4;  /* cyan en vez de azul */
  margin: 8px 0 4px;
}

.login-logo p {
  color: #94a3b8;  /* gris claro */
  font-size: 14px;
}

/* ============================================================
  CARD
   ============================================================ */
.card {
  background: #1e293b;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.12);
  color: #f1f5f9;
}

/* ============================================================
  TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--gris-fondo);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gris-secundario);
  transition: all 0.2s;
}

.tab-btn.activo {
  background: var(--blanco);
  color: var(--azul);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.tab-content { display: none; }
.tab-content.activo { display: block; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-grupo {
  margin-bottom: 16px;
}

.form-grupo label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gris-secundario);
  margin-bottom: 6px;
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gris-texto);
  background: var(--blanco);
  transition: border-color 0.2s;
  outline: none;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-primario {
  width: 100%;
  padding: 12px;
  background: var(--azul);
  color: var(--blanco);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-primario:hover { background: var(--azul-oscuro); }
.btn-primario:active { transform: scale(0.98); }
.btn-primario:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secundario {
  padding: 10px 20px;
  background: var(--blanco);
  color: var(--gris-texto);
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secundario:hover { background: var(--gris-fondo); }

.btn-peligro {
  padding: 10px 20px;
  background: var(--rojo-claro);
  color: var(--rojo);
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ============================================================
   MENSAJES
   ============================================================ */
.mensaje-error {
  background: var(--rojo-claro);
  color: var(--rojo);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

.mensaje-exito {
  background: var(--verde-claro);
  color: var(--verde);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

.mensaje-advertencia {
  background: var(--amarillo-claro);
  color: var(--amarillo);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

/* ============================================================
   BADGE OFFLINE
   ============================================================ */
.badge-offline {
  background: #1f2937;
  color: #f9fafb;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 16px;
}

/* ============================================================
   NAVEGACIÓN SUPERIOR
   ============================================================ */
.navbar {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-marca {
  font-size: 17px;
  font-weight: 700;
  color: var(--azul);
  text-decoration: none;
}

.navbar-acciones {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-usuario {
  font-size: 13px;
  color: var(--gris-secundario);
}

.navbar-offline {
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  display: none;
}

.navbar-offline.visible { display: inline-block; }

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.contenido {
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================================
   LISTA DE DOCUMENTOS
   ============================================================ */
.lista-docs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-item {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.doc-item:hover { box-shadow: var(--sombra); }

.doc-item-info { flex: 1; }

.doc-item-nombre {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.doc-item-desc {
  font-size: 13px;
  color: var(--gris-secundario);
}

.badge-estado {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pendiente {
  background: var(--amarillo-claro);
  color: var(--amarillo);
}

.badge-firmado {
  background: var(--verde-claro);
  color: var(--verde);
}

/* ============================================================
   ESTADO DE PROGRESO
   ============================================================ */
.progreso-barra {
  background: var(--gris-borde);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.progreso-relleno {
  height: 100%;
  background: var(--azul);
  border-radius: 20px;
  transition: width 0.5s ease;
}

/* ============================================================
   OBRA CARD
   ============================================================ */
.obra-card {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.obra-card:hover { box-shadow: var(--sombra); }

.obra-card h3 { font-size: 17px; margin-bottom: 6px; }

.obra-card p { font-size: 13px; color: var(--gris-secundario); }

/* ============================================================
   VISOR DE DOCUMENTO
   ============================================================ */
.doc-preview {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  padding: 32px;
  min-height: 400px;
  font-size: 14px;
  line-height: 1.8;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .contenido { padding: 16px; }
  .card { padding: 20px; }
  .doc-item { flex-direction: column; align-items: flex-start; gap: 10px; }
}
