/* CANDIDATO_NEUROFACTORY_UI
   NeuroGest One — AppShell, sidebar, topbar, cards, tables, badges.
   Stack: CSS plano. Sin framework de interfaz. */

:root {
    --ink: #1c2430;
    --muted: #5c6b7a;
    --line: #d9e0e7;
    --paper: #f4f6f8;
    --panel: #ffffff;
    --side: #1b2836;
    --side-text: #d5dee8;
    --accent: #0f6e6b;
    --accent-2: #e7f3f2;
    --warn: #8a5a00;
    --warn-bg: #fff4d6;
    --alert: #8d2d2d;
    --alert-bg: #fde8e6;
    --ok: #1d6b3a;
    --ok-bg: #e5f6eb;
    --info: #1d4e89;
    --info-bg: #e7f0fa;
    --neutral-bg: #eef1f4;
    --shadow: 0 1px 2px rgba(20, 32, 44, 0.06);
    --sidebar: 232px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.ng-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.ng-app { min-height: 100vh; }

.ng-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    background: var(--side);
    color: var(--side-text);
    overflow: auto;
    z-index: 20;
    padding: 16px 12px 28px;
}

.ng-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 10px 16px;
    color: #fff;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.ng-brand-mark {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    color: #fff;
}

.ng-brand-mark--img {
    background: #fff;
    overflow: hidden;
}

.ng-brand-mark--img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ng-brand-text { min-width: 0; }

.ng-brand-product {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.ng-brand-product small,
.ng-brand small {
    color: #8fb8b6;
    font-weight: 600;
    margin-left: 5px;
}

.ng-brand-org {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    align-items: baseline;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #9aafc2;
}

.ng-brand-org-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.ng-brand-org-name {
    color: #c5d4e2;
    font-weight: 600;
}

.ng-nav-close { display: none; }

.ng-nav-label {
    margin: 14px 10px 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8ea0b3;
}

.ng-sidebar nav a {
    display: block;
    color: var(--side-text);
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 2px 0;
}

.ng-sidebar nav a:hover,
.ng-sidebar nav a.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.ng-sidebar nav a.is-active { box-shadow: inset 3px 0 0 var(--accent); }

.ng-main { margin-left: var(--sidebar); min-height: 100vh; }

.ng-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.ng-burger {
    display: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
}

.ng-top-title { font-weight: 650; flex: 1; }

.ng-top-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.ng-role {
    background: var(--accent-2);
    color: var(--accent);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 650;
}

.ng-content { padding: 18px; max-width: 1180px; }

.ng-card, .ng-stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.ng-card { padding: 16px 16px 18px; margin: 0 0 14px; }
.ng-card h2 { margin: 0 0 12px; font-size: 16px; }

.ng-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.ng-stat { padding: 14px; }
.ng-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.ng-stat-label { color: var(--muted); font-size: 13px; }

.ng-grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
}

.ng-form { display: grid; gap: 10px; }
.ng-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ng-form input, .ng-form select, .ng-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
.ng-form textarea { min-height: 96px; resize: vertical; }
.ng-check { display: flex; align-items: center; gap: 8px; color: var(--ink); }

.ng-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ng-btn, button.ng-btn {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: 9px 14px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.ng-btn:hover { text-decoration: none; filter: brightness(1.05); }
.ng-btn.secondary { background: #314155; }
.ng-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.ng-table-wrap { overflow: auto; }
.ng-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ng-table th, .ng-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.ng-table th { color: var(--muted); font-size: 12px; font-weight: 650; }

.ng-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 650;
    background: var(--neutral-bg);
}
.ng-tone-warn { background: var(--warn-bg); color: var(--warn); }
.ng-tone-alert { background: var(--alert-bg); color: var(--alert); }
.ng-tone-ok { background: var(--ok-bg); color: var(--ok); }
.ng-tone-info { background: var(--info-bg); color: var(--info); }
.ng-tone-neutral { background: var(--neutral-bg); color: var(--muted); }

.ng-alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.ng-empty {
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 16px;
    color: var(--muted);
    background: #fbfcfd;
}

.ng-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.ng-tabs a {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    font-size: 13px;
}
.ng-tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.ng-crumb { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.ng-crumb-sep { margin: 0 6px; }

.ng-kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 14px; }
.ng-kv dt { color: var(--muted); }

.ng-jobs { display: grid; gap: 10px; }
.ng-job {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}
.ng-job h3 { margin: 0 0 6px; font-size: 16px; }
.ng-job p { margin: 4px 0; }
.ng-meta { color: var(--muted); font-size: 13px; }

.ng-search-results { display: grid; gap: 6px; margin-top: 8px; }
.ng-hit {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
}
.ng-hit strong { display: block; }
.ng-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.ng-timeline { list-style: none; margin: 0; padding: 0; }
.ng-timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); }

@media (max-width: 900px) {
    .ng-sidebar {
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }
    .ng-nav-toggle:checked ~ .ng-sidebar { transform: none; }
    .ng-nav-close {
        display: inline-block;
        margin: 0 10px 8px;
        color: #fff;
        font-size: 13px;
    }
    .ng-main { margin-left: 0; }
    .ng-burger { display: inline-block; }
    .ng-grid-2 { grid-template-columns: 1fr; }
    .ng-kv { grid-template-columns: 1fr; }
    .ng-top-user span:first-child { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}

/* Auth gate styles: assets/ui/neurogest-enterprise-auth.css (Dynamic Enterprise UI) */

.ng-content .ng-btn-primary {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

/* --- Sprint 104: Dynamic Enterprise density + collapse + hubs --- */
.ng-ent-app {
    --sidebar: 220px;
    --sidebar-collapsed: 64px;
}

.ng-side-collapse { position: absolute; opacity: 0; pointer-events: none; }

.ng-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink);
    user-select: none;
}

.ng-collapse-btn:hover { background: var(--accent-2); }

.ng-side-collapse:checked ~ .ng-sidebar {
    width: var(--sidebar-collapsed);
}
.ng-side-collapse:checked ~ .ng-sidebar .ng-brand-text,
.ng-side-collapse:checked ~ .ng-sidebar .ng-nav-label,
.ng-side-collapse:checked ~ .ng-sidebar .ng-nav-text,
.ng-side-collapse:checked ~ .ng-sidebar .ng-nav-close {
    display: none;
}
.ng-side-collapse:checked ~ .ng-sidebar .ng-brand { justify-content: center; padding-left: 8px; padding-right: 8px; }
.ng-side-collapse:checked ~ .ng-sidebar nav a { text-align: center; padding-left: 8px; padding-right: 8px; }
.ng-side-collapse:checked ~ .ng-sidebar nav a::before {
    content: "•";
    color: #8fb8b6;
}
.ng-side-collapse:checked ~ .ng-main { margin-left: var(--sidebar-collapsed); }
.ng-side-collapse:checked ~ .ng-main .ng-collapse-btn { transform: rotate(180deg); }

.ng-org-chip {
    background: #eef2f6;
    color: #163a5f;
    border: 1px solid #cfd8e3;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 650;
}

.ng-content--dense { padding: 14px 16px; max-width: 1280px; }
.ng-content--dense .ng-card {
    border-radius: 4px;
    padding: 12px 14px 14px;
    margin-bottom: 10px;
}
.ng-content--dense .ng-card h2 { font-size: 15px; margin-bottom: 10px; }

.ng-content--dense .ng-table {
    font-size: 13px;
    border-collapse: collapse;
    width: 100%;
}
.ng-content--dense .ng-table th,
.ng-content--dense .ng-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.ng-content--dense .ng-table thead th {
    position: sticky;
    top: 0;
    background: #f0f4f8;
    color: #0a2540;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 1;
}
.ng-content--dense .ng-table tbody tr:nth-child(even) { background: #fafbfc; }
.ng-content--dense .ng-table tbody tr:hover { background: #eef5fb; }

.ng-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.ng-form {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.ng-form label { font-size: 12px; font-weight: 600; color: #0a2540; }
.ng-form input, .ng-form select, .ng-form textarea {
    padding: 7px 9px;
    border-radius: 4px;
    font-size: 13px;
}

.ng-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.ng-hub-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 14px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ng-hub-tile:hover {
    border-color: #0b5cab;
    box-shadow: 0 2px 10px rgba(11, 92, 171, 0.12);
    text-decoration: none;
}
.ng-hub-tile strong { color: #0a2540; font-size: 14px; }
.ng-hub-tile span { color: var(--muted); font-size: 12px; }

.ng-panel-context {
    border-left: 3px solid #0b5cab;
    background: #f7fafc;
}

@media (max-width: 900px) {
    .ng-collapse-btn { display: none; }
    .ng-side-collapse:checked ~ .ng-sidebar { width: var(--sidebar); }
    .ng-side-collapse:checked ~ .ng-main { margin-left: 0; }
    .ng-org-chip { display: none; }
}
