/* ============================================================
   GN-BASE.CSS — Estilos base compartidos para Good Neighbors
   Showcase Soft One Spa — 2026
   ============================================================ */

/* --- Variables de diseño --- */
:root {
    --gn-green: #009640;
    --gn-lightgreen: #E5F4EB;
    --gn-orange: #F37021;
    --gn-lightorange: #FEF1EA;
    --gn-dark: #1E293B;
    --gn-gray: #F8FAFC;
    --gn-border: #E2E8F0;
    --gn-text: #334155;
    --gn-text-light: #64748B;
    --sidebar-width: 260px;
    --header-height: 56px;
}

/* --- Reset y base --- */
body.gn-app {
    background-color: var(--gn-gray);
    font-family: 'Inter', sans-serif;
    color: var(--gn-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar limpio --- */
.gn-app ::-webkit-scrollbar { width: 6px; height: 6px; }
.gn-app ::-webkit-scrollbar-track { background: #f1f5f9; }
.gn-app ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.gn-app ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   HEADER DE SISTEMA (barra superior verde)
   ============================================================ */
.gn-header {
    background-color: var(--gn-green);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.gn-header__logo {
    height: 32px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.gn-header__divider {
    width: 1px;
    height: 28px;
    background-color: rgba(255,255,255,0.3);
    margin: 0 14px;
    flex-shrink: 0;
}

.gn-header__title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gn-header__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.gn-header__subtitle {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    line-height: 1.2;
}

.gn-header__left {
    display: flex;
    align-items: center;
}

.gn-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gn-header__user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid rgba(255,255,255,0.3);
}

.gn-header__user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.gn-header__user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.gn-header__notification {
    position: relative;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 4px;
}

.gn-header__notification:hover { color: #fff; }

.gn-header__notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--gn-green);
}

/* ============================================================
   SIDEBAR DE NAVEGACIÓN (visual, no funcional en vistas)
   ============================================================ */
.gn-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.gn-sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--gn-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
}

.gn-sidebar__section {
    padding: 16px 14px 8px;
}

.gn-sidebar__section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gn-text-light);
    padding: 0 10px;
    margin-bottom: 6px;
}

.gn-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gn-text);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.gn-sidebar__item:hover {
    background-color: var(--gn-lightgreen);
    color: var(--gn-green);
}

.gn-sidebar__item--active {
    background-color: var(--gn-green);
    color: #fff;
    font-weight: 600;
}

.gn-sidebar__item--active:hover {
    background-color: var(--gn-green);
    color: #fff;
}

.gn-sidebar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.gn-sidebar__item--active .gn-sidebar__icon {
    opacity: 1;
}

/* Badge de sección (Nivel) */
.gn-sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gn-sidebar__badge--green {
    background: var(--gn-lightgreen);
    color: var(--gn-green);
}

.gn-sidebar__badge--orange {
    background: var(--gn-lightorange);
    color: var(--gn-orange);
}

/* Soft One branding discreto en sidebar */
.gn-sidebar__footer {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--gn-border);
    text-align: center;
}

.gn-sidebar__footer-text {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.gn-sidebar__footer-logo {
    height: 18px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.gn-sidebar__footer-logo:hover {
    opacity: 0.7;
}

.gn-sidebar__footer-link {
    font-size: 9px;
    color: #94a3b8;
    text-decoration: none;
}

.gn-sidebar__footer-link:hover {
    color: var(--gn-green);
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.gn-main {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    padding: 0;
    position: relative;
}

/* ============================================================
   RESPONSIVE: Ocultar sidebar en < 1024px
   ============================================================ */
@media (max-width: 1023px) {
    .gn-sidebar {
        display: none;
    }
    .gn-main {
        width: 100%;
    }
}

/* ============================================================
   UTILIDADES COMUNES
   ============================================================ */
.gn-fade-in {
    animation: gnFadeIn 0.35s ease-out;
}

@keyframes gnFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjeta genérica */
.gn-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gn-border);
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Select estándar */
.gn-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

/* ============================================================
   PROTECCIÓN ANTI-COPIA (complementa JS)
   ============================================================ */
.gn-protected {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
