/* =====================================================================
   HUANOMI - Estilos (v2 - look & feel Neuro-Vía)
   =====================================================================
   Sidebar lateral navy + topbar blanca + cards redondeadas.
   Conserva 100% las clases hn-* existentes para no romper PHP actual.
   ===================================================================== */

:root {
    --hn-primary:        #1A3A6B;
    --hn-primary-dark:   #142d54;
    --hn-primary-soft:   #e8eef7;
    --hn-accent:         #d4af37;
    --hn-bg:             #f0f4fa;
    --hn-surface:        #ffffff;
    --hn-text:           #222;
    --hn-text-muted:     #888;
    --hn-text-soft:      #555;
    --hn-border:         #e0e0e0;
    --hn-border-soft:    #f0f0f0;
    --hn-error:          #c0392b;
    --hn-success:        #2e7d32;
    --hn-warning:        #e67e22;

    /* Dimensiones */
    --sidebar-width:     210px;
    --topbar-height:     56px;
    --card-radius:       10px;
    --btn-radius:        6px;
}

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

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    background: var(--hn-bg);
    color: var(--hn-text);
    line-height: 1.5;
    min-height: 100vh;
}

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

h1 { font-size: 20px; font-weight: 700; color: var(--hn-primary); margin-bottom: 12px; }
h2 { font-size: 16px; font-weight: 700; color: var(--hn-primary); margin-bottom: 10px; }
h3 { font-size: 14px; font-weight: 700; color: var(--hn-primary); margin-bottom: 8px; }

/* ===================================================================
   LAYOUT GENERAL: sidebar + main
   =================================================================== */

#hn-app {
    display: flex;
    min-height: 100vh;
}

#hn-sidebar {
    width: var(--sidebar-width);
    background: var(--hn-primary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

#hn-sidebar-logo {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
#hn-sidebar-logo h1 {
    color: #fff;
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
}
#hn-sidebar-logo p {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    margin-top: 4px;
}

.hn-nav-section {
    padding: 12px 16px 4px;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 6px;
}

.hn-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-size: 13px;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.hn-nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}
.hn-nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #fff;
    font-weight: 700;
}

#hn-main {
    flex: 1;
    overflow-x: hidden;
    min-width: 0;
}

#hn-topbar {
    background: var(--hn-surface);
    padding: 12px 24px;
    border-bottom: 1px solid var(--hn-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--topbar-height);
}
#hn-topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--hn-primary);
}
#hn-topbar-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--hn-text-muted);
}
#hn-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--hn-text);
}
#hn-topbar-user strong { color: var(--hn-primary); }
#hn-topbar-user small { color: var(--hn-text-muted); }

#hn-content {
    padding: 20px;
}

/* ===================================================================
   COMPATIBILIDAD: clases viejas mapean a layout nuevo
   =================================================================== */

/* hn-header / hn-header-inner: ocultar (reemplazado por sidebar) */
.hn-header { display: none; }
.hn-header-inner { display: none; }

/* hn-main: ya está usado como wrapper en layout viejo */
/* En el layout nuevo es #hn-main, pero si por algo aparece .hn-main, le damos algo razonable */
.hn-main {
    padding: 20px;
}

/* hn-logo, hn-nav, hn-user: solo aplican si vienen del header viejo (ya ocultado) */

/* ===================================================================
   FOOTER
   =================================================================== */

.hn-footer {
    background: var(--hn-surface);
    border-top: 1px solid var(--hn-border);
    padding: 12px 24px;
    margin-top: 20px;
}
.hn-footer-inner {
    display: flex;
    justify-content: space-between;
    color: var(--hn-text-muted);
    font-size: 12px;
}

/* ===================================================================
   PANELES Y CARDS
   =================================================================== */

.hn-panel {
    background: var(--hn-surface);
    border-radius: var(--card-radius);
    border: 1px solid var(--hn-border);
    padding: 18px;
    margin-bottom: 14px;
}

.hn-card {
    background: var(--hn-surface);
    border-radius: var(--card-radius);
    border: 1px solid var(--hn-border);
    padding: 18px;
    margin-bottom: 14px;
}

/* ===================================================================
   FORMULARIOS
   =================================================================== */

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: var(--btn-radius);
    font-size: 13px;
    font-family: Arial, sans-serif;
    background: #fff;
    color: var(--hn-text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--hn-primary);
}
textarea { resize: vertical; min-height: 70px; }

.hn-form-group {
    margin-bottom: 12px;
}
.hn-form-group label {
    display: block;
    font-size: 11px;
    color: var(--hn-text-soft);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.hn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

/* ===================================================================
   BOTONES
   =================================================================== */

button, .hn-btn {
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    border-radius: var(--btn-radius);
    padding: 8px 16px;
    border: 1px solid transparent;
    background: var(--hn-surface);
    color: var(--hn-text);
    display: inline-block;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.hn-btn:hover { background: #f5f5f5; text-decoration: none; }

.hn-btn-primary {
    background: var(--hn-primary);
    color: #fff;
    font-weight: 700;
    border-color: var(--hn-primary);
}
.hn-btn-primary:hover {
    background: var(--hn-primary-dark);
    color: #fff;
}

.hn-btn-secondary {
    background: #fff;
    color: var(--hn-primary);
    border: 1px solid var(--hn-primary);
}
.hn-btn-secondary:hover {
    background: var(--hn-primary-soft);
}

.hn-btn-block { display: block; width: 100%; }

.hn-btn-link {
    background: rgba(0,0,0,0.05);
    color: var(--hn-primary);
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
}
.hn-btn-link:hover {
    background: rgba(0,0,0,0.1);
    color: var(--hn-primary);
    text-decoration: none;
}

/* ===================================================================
   ALERTAS
   =================================================================== */

.hn-alert {
    padding: 12px 16px;
    border-radius: var(--btn-radius);
    margin: 12px 0;
    font-size: 13px;
    border-left: 4px solid;
}
.hn-alert-success {
    background: #d4edda;
    color: #155724;
    border-color: var(--hn-success);
}
.hn-alert-info {
    background: var(--hn-primary-soft);
    color: var(--hn-primary);
    border-color: var(--hn-primary);
}
.hn-alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: var(--hn-warning);
}
.hn-alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: var(--hn-error);
}

/* ===================================================================
   TABLAS
   =================================================================== */

.hn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.hn-table th {
    text-align: left;
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--hn-text-soft);
    border-bottom: 2px solid var(--hn-border);
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--hn-primary-soft);
}
.hn-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--hn-border-soft);
    vertical-align: middle;
}
.hn-table tr:hover td {
    background: #f7f9fd;
}

/* ===================================================================
   STAT CARDS (dashboards)
   =================================================================== */

.hn-stat-card {
    background: var(--hn-primary-soft);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: var(--hn-primary);
}
.hn-stat-valor {
    font-size: 32px;
    font-weight: 700;
    color: var(--hn-primary);
    margin-bottom: 4px;
}
.hn-stat-label {
    font-size: 12px;
    color: var(--hn-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.hn-subtitle {
    font-size: 13px;
    color: var(--hn-text-muted);
    margin-bottom: 12px;
}

/* ===================================================================
   LOGIN (página fuera del layout principal)
   =================================================================== */

.hn-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hn-primary);
    background: linear-gradient(135deg, var(--hn-primary) 0%, var(--hn-primary-dark) 100%);
    padding: 20px;
}
.hn-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}
.hn-login-card h1 {
    font-size: 28px;
    color: var(--hn-primary);
    margin-bottom: 4px;
}
.hn-login-card .hn-subtitle {
    color: var(--hn-text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.hn-login-card .hn-form-group { text-align: left; }
.hn-login-card .hn-btn { margin-top: 8px; }

/* ===================================================================
   RESPONSIVO (básico)
   =================================================================== */

@media (max-width: 768px) {
    :root { --sidebar-width: 60px; }
    #hn-sidebar { width: 60px; }
    #hn-sidebar-logo h1 { font-size: 0; }
    #hn-sidebar-logo h1::before { content: 'H'; font-size: 22px; }
    #hn-sidebar-logo p { display: none; }
    .hn-nav-section { display: none; }
    .hn-nav-item { padding: 12px; justify-content: center; font-size: 0; }
    .hn-nav-item::before { content: '•'; font-size: 16px; }
}
