/* ============================================================
   Intranet PURO TRAIL OSORNO — estilos
   Diseño: sidebar + tarjetas blancas sobre fondo mint claro
   (inspirado en dashboards HR modernos)
   ============================================================ */
:root {
    --bg:         #e9efec;   /* fondo general mint-gris */
    --card:       #ffffff;
    --line:       #e3e9e6;
    --texto:      #1f2933;
    --texto-sec:  #7b8794;
    --verde:      #177e5b;   /* acento principal */
    --verde-suave:#e7f3ee;
    --naranja:    #f0662d;   /* acento CTA / logo */
    --ok-bg:      #e3f4ec;  --ok-tx:   #147a52;
    --pend-bg:    #fdf3d8;  --pend-tx: #8a6100;
    --err-bg:     #fdeaea;  --err-tx:  #b62222;
    --info-bg:    #e4eef7;  --info-tx: #1f5f8f;
    --radio:      14px;
    --radio-sm:   10px;
    --sombra:     0 2px 10px rgba(16, 42, 34, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--texto);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--verde); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT: sidebar + main
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px; flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}

.logo-area {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 20px 18px;
}
.logo-icono { font-size: 24px; }
.logo-texto { font-size: 19px; font-weight: 800; letter-spacing: .2px; color: var(--texto); }
.logo-dot { color: var(--naranja); }

.nav-lateral { flex: 1; padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radio-sm);
    color: var(--texto-sec); font-weight: 600; font-size: 14px;
    position: relative; transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #f2f6f4; color: var(--texto); text-decoration: none; }
.nav-item.activo { background: var(--verde-suave); color: var(--verde); }
.nav-item.activo::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
    width: 4px; border-radius: 0 4px 4px 0; background: var(--verde);
}

.sidebar-pie { padding: 12px; border-top: 1px solid var(--line); }
.nav-salir:hover { background: var(--err-bg); color: var(--err-tx); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 12px 28px;
}
.org small { display: block; color: var(--texto-sec); font-size: 12px; }
.org strong { font-size: 15px; }
.user-area { display: flex; align-items: center; gap: 12px; }
a.user-area { color: inherit; padding: 4px 10px; border-radius: var(--radio-sm); }
a.user-area:hover { text-decoration: none; background: #f2f6f4; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--verde), #2aa578);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; letter-spacing: .5px;
}
.user-nombre strong { display: block; font-size: 14px; }
.user-nombre small { color: var(--texto-sec); font-size: 12px; }

.contenido { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px; }
.pie { text-align: center; color: var(--texto-sec); font-size: 12px; padding: 18px; }

/* ============================================================
   TIPOGRAFÍA / SECCIONES
   ============================================================ */
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 16px; margin: 24px 0 12px; font-weight: 700; }
.subtitulo { color: var(--texto-sec); margin: 0 0 20px; font-size: 13px; }
.cabecera-seccion { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   TARJETAS Y PANELES
   ============================================================ */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tarjeta {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radio);
    padding: 20px; box-shadow: var(--sombra);
}
.tarjeta .num { font-size: 28px; font-weight: 800; color: var(--verde); }
.tarjeta .etq { color: var(--texto-sec); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-top: 2px; }

.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radio);
    padding: 22px; box-shadow: var(--sombra); margin-bottom: 20px;
}

/* ---------- Cabecera de perfil (ficha de socio) ---------- */
.perfil-card { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.perfil-avatar {
    width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--naranja), #f5924d);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 800; letter-spacing: 1px;
}
.perfil-info h1 { margin: 0; }
.perfil-rol { color: var(--verde); font-weight: 600; font-size: 13px; margin-top: 2px; }
.perfil-datos {
    margin-left: auto; display: grid; grid-template-columns: repeat(2, minmax(140px, auto));
    gap: 10px 36px; padding-left: 24px; border-left: 1px solid var(--line);
}
.dato-etq { display: block; color: var(--texto-sec); font-size: 12px; }
.dato-val { font-weight: 600; font-size: 14px; }

/* ============================================================
   TABLAS
   ============================================================ */
.tabla-wrap {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radio); box-shadow: var(--sombra);
    overflow-x: auto; margin-bottom: 20px;
}
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th {
    background: #fafcfb; color: var(--texto-sec); font-weight: 600;
    text-transform: uppercase; font-size: 11.5px; letter-spacing: .5px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fbfa; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-block; background: var(--verde); color: #fff !important;
    padding: 9px 16px; border-radius: var(--radio-sm); border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; text-decoration: none; transition: filter .15s;
    font-family: inherit;
}
.btn:hover { filter: brightness(.92); text-decoration: none; }
.btn-naranja { background: var(--naranja); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-gris { background: #f1f4f3; color: var(--texto) !important; border: 1px solid var(--line); }
.btn-gris:hover { filter: none; background: #e7ecea; }
.btn-peligro { background: #fff; color: var(--err-tx) !important; border: 1px solid #f0c9c9; }
.btn-peligro:hover { filter: none; background: var(--err-bg); }
.btn-salir { background: #f1f4f3; color: var(--texto) !important; border: 1px solid var(--line); }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo.ancho { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: var(--texto-sec); }
input, select, textarea {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radio-sm);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(23, 126, 91, .3); outline-offset: 0; border-color: var(--verde);
}
textarea { resize: vertical; min-height: 90px; }
.form-acciones { margin-top: 20px; display: flex; gap: 10px; }
.barra-filtros { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.barra-filtros input, .barra-filtros select { min-width: 180px; }

/* Vistas de solo lectura: etiqueta gris arriba, valor en negrita */
.form-grid > div > label { display: block; margin-bottom: 2px; }
.form-grid > div > div { font-weight: 600; }

/* ============================================================
   BADGES Y ALERTAS
   ============================================================ */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ok   { background: var(--ok-bg);   color: var(--ok-tx); }
.badge-pend { background: var(--pend-bg); color: var(--pend-tx); }
.badge-off  { background: #eef1f0;        color: #67757e; }
.badge-info { background: var(--info-bg); color: var(--info-tx); }

.alerta { padding: 12px 16px; border-radius: var(--radio-sm); margin-bottom: 16px; font-size: 14px; }
.alerta-ok    { background: var(--ok-bg);  color: var(--ok-tx);  border: 1px solid #bfe5d3; }
.alerta-error { background: var(--err-bg); color: var(--err-tx); border: 1px solid #f2c2c2; }

/* ============================================================
   LISTA DE AVISOS
   ============================================================ */
.lista-avisos .aviso { border-bottom: 1px solid var(--line); padding: 16px 0; }
.lista-avisos .aviso:last-child { border-bottom: none; }
.lista-avisos .aviso h3 { margin: 0 0 4px; font-size: 15px; }
.lista-avisos .meta { color: var(--texto-sec); font-size: 12px; margin-bottom: 8px; }

/* ============================================================
   LOGIN / INSTALADOR
   ============================================================ */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1000px 600px at 20% 0%, #d9ebe3, var(--bg));
    padding: 20px;
}
.login-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px;
    padding: 36px; width: 100%; max-width: 380px;
    box-shadow: 0 16px 50px rgba(16, 42, 34, .12);
}
.login-card .logo-grande { font-size: 44px; text-align: center; }
.login-card h1 { text-align: center; font-size: 20px; margin: 8px 0 2px; }
.login-card p.sub { text-align: center; color: var(--texto-sec); font-size: 13px; margin: 0 0 24px; }
.login-card .campo { margin-bottom: 14px; }
.login-card .btn { width: 100%; text-align: center; padding: 11px; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-sec { color: var(--texto-sec); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.vacio { text-align: center; padding: 40px; color: var(--texto-sec); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
    .nav-lateral { flex-direction: row; overflow-x: auto; padding: 4px 12px 10px; }
    .nav-item { padding: 9px 12px; white-space: nowrap; }
    .nav-item.activo::before { display: none; }
    .sidebar-pie { border-top: none; position: absolute; top: 14px; right: 12px; padding: 0; }
    .sidebar { position: relative; }
    .logo-area { padding: 16px 20px 8px; }
    .contenido { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .perfil-datos { margin-left: 0; padding-left: 0; border-left: none; }
}
