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

        body {
            font-family: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
            background: #f5f7fa;
            color: #1f1f23;
        }

        header {
            position: relative;
            background: linear-gradient(135deg, #111113 0%, #2e2e33 100%);
            color: white;
            /* Encabezado delgado: el protagonista es el organigrama, no el titulo */
            padding: 12px 20px 14px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        /* Titulo y pestanas de vista comparten renglon para ahorrar altura */
        .header-top {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
            /* Espacio a la derecha para que la tuerca no encime las pestanas */
            padding-right: 52px;
            margin-bottom: 10px;
        }

        .settings-gear-btn {
            position: absolute;
            top: 10px;
            right: 12px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: rgba(255,255,255,0.12);
            border: 1px solid rgba(255,255,255,0.2);
            color: rgba(255,255,255,0.65);
            font-size: 1.05rem;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .settings-gear-btn:hover {
            background: rgba(255,255,255,0.25);
            color: white;
        }

        .settings-menu {
            position: absolute;
            top: 50px;
            right: 12px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.2);
            padding: 6px;
            display: flex;
            flex-direction: column;
            gap: 2px;
            z-index: 50;
            min-width: 220px;
        }

        .settings-menu-item {
            background: none;
            border: none;
            text-align: left;
            padding: 8px 10px;
            border-radius: 5px;
            font-size: 0.8rem;
            color: #1f1f23;
            cursor: pointer;
        }

        .settings-menu-item:hover {
            background: #f0f0f2;
        }

        .settings-menu-item.reset-item {
            color: #b91c1c;
            border-top: 1px solid #eee;
            margin-top: 2px;
            padding-top: 8px;
        }

        .container {
            width: 100%;
            max-width: 1900px;
            margin: 0 auto;
            padding: 0 24px;
        }

        h1 {
            font-size: 1.35rem;
            margin: 0;
            font-weight: 700;
            letter-spacing: -0.01em;
            white-space: nowrap;
        }

        .filters {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 20px;
        }

        .filter-btn {
            background: rgba(255,255,255,0.2);
            color: white;
            border: 2px solid rgba(255,255,255,0.3);
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
        }

        .filter-btn:hover,
        .filter-btn.active {
            background: rgba(255,255,255,0.3);
            border-color: white;
        }

        main {
            padding: 16px 0;
        }

        .org-structure {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
        }

        .department-section {
            border-bottom: 1px solid #e8e8ea;
        }

        .department-section:last-child {
            border-bottom: none;
        }

        .dept-header {
            background: linear-gradient(135deg, #111113 0%, #2e2e33 100%);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            user-select: none;
        }

        .dept-title {
            font-size: 1.2rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .dept-icon {
            font-size: 1.5rem;
        }

        .toggle-icon {
            font-size: 1.5rem;
            transition: transform 0.3s ease;
        }

        .toggle-icon.collapsed {
            transform: rotate(-90deg);
        }

        .dept-content {
            max-height: 1000px;
            overflow: hidden;
            transition: max-height 0.4s ease;
        }

        .dept-content.collapsed {
            max-height: 0;
            border: none;
        }

        .hierarchy {
            padding: 30px;
        }

        .org-position {
            margin-bottom: 20px;
            background: #f8f9fa;
            border-radius: 8px;
            overflow: hidden;
            border-left: 4px solid var(--row-accent, #2e2e33);
            transition: all 0.3s ease;
        }

        .org-position:hover {
            box-shadow: 0 4px 12px rgba(46, 46, 51, 0.15);
            transform: translateX(4px);
        }

        .org-position.staff-row {
            border-left-style: dashed;
            background: #f4f5f8;
        }

        .org-position.has-recognition.badge-ai {
            border-left-color: #6d28d9;
            box-shadow: 0 0 0 1px rgba(109, 40, 217, 0.35);
        }

        .org-position.has-recognition.badge-month {
            border-left-color: #d4a017;
            box-shadow: 0 0 0 1px rgba(212, 160, 23, 0.4);
        }

        .list-count-badge {
            display: inline-block;
            background: var(--row-accent, #2e2e33);
            color: white;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 2px 9px;
            border-radius: 10px;
            margin-top: 6px;
        }

        .reports-to {
            font-size: 0.75rem;
            color: #a8a8ae;
            margin-top: 2px;
            margin-bottom: 2px;
        }

        .list-children {
            max-height: 10000px;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .list-children.collapsed {
            max-height: 0;
        }

        .position-header {
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            background: white;
        }

        .position-info {
            flex: 1;
        }

        .person-name {
            font-size: 1.05rem;
            font-weight: 600;
            color: #111113;
            margin-bottom: 4px;
        }

        .person-role {
            font-size: 0.95rem;
            color: #7f8c8d;
            margin-bottom: 0;
        }

        .position-expand {
            font-size: 1.5rem;
            color: #2e2e33;
            transition: transform 0.3s ease;
            cursor: pointer;
        }

        .position-expand.expanded {
            transform: rotate(180deg);
        }

        .team-members {
            background: #f0f4f8;
            padding: 15px;
            margin-top: 10px;
            border-radius: 6px;
        }

        .team-label {
            font-size: 0.85rem;
            font-weight: 600;
            color: #7f8c8d;
            text-transform: uppercase;
            margin-bottom: 10px;
            display: block;
        }

        .member-tag {
            display: inline-block;
            background: #2e2e33;
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.85rem;
            margin-right: 8px;
            margin-bottom: 8px;
        }

        .team-header {
            padding: 15px 30px;
            background: #ecf0f7;
            font-weight: 600;
            color: #111113;
            margin-top: 30px;
        }

        .team-list {
            padding: 15px 30px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 15px;
        }

        .team-member-card {
            background: white;
            padding: 15px;
            border-radius: 6px;
            border-left: 3px solid #27ae60;
            font-size: 0.9rem;
        }

        .member-name {
            font-weight: 600;
            color: #111113;
            margin-bottom: 4px;
        }

        .member-role {
            color: #7f8c8d;
            font-size: 0.85rem;
        }





        .view-toggle {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .view-toggle-btn {
            background: rgba(255,255,255,0.15);
            color: white;
            border: 2px solid rgba(255,255,255,0.3);
            padding: 5px 14px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        /* Sin contrasena solo existe el organigrama: las demas vistas
           aparecen al entrar en modo edicion. */
        body:not(.edit-mode) .view-toggle-btn[data-view="list"],
        body:not(.edit-mode) .view-toggle-btn[data-view="about"] {
            display: none;
        }

        .view-toggle-btn:hover,
        .view-toggle-btn.active {
            background: white;
            color: #111113;
            border-color: white;
        }

        /* Vista de organigrama (árbol) */
        .chart-view-wrapper {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow-x: auto;
            padding: 30px;
            min-height: 72vh;   /* aprovecha la altura de la pantalla */
            /* El lienzo se mueve arrastrando con la manita, no con la barra */
            cursor: grab;
            scrollbar-width: none;        /* Firefox */
            -ms-overflow-style: none;     /* Edge antiguo */
        }

        .chart-view-wrapper::-webkit-scrollbar {
            display: none;                /* Chrome, Safari */
        }

        .chart-view-wrapper.arrastrando {
            cursor: grabbing;
            /* Evita que el navegador seleccione texto mientras se mueve el lienzo */
            user-select: none;
        }

        /* Sobre una tarjeta el cursor indica que se puede pulsar, no arrastrar */
        .chart-view-wrapper .org-card {
            cursor: pointer;
        }

        .chart-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .zoom-label {
            min-width: 52px;
            text-align: center;
            font-size: 0.85rem;
            font-weight: 700;
            color: #2e2e33;
            background: white;
            border: 1px solid #e8e8ea;
            border-radius: 6px;
            padding: 8px 6px;
        }

        .tree-minimap {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 170px;
            height: 120px;
            background: rgba(255,255,255,0.97);
            border: 1px solid #d8d8dc;
            border-radius: 8px;
            box-shadow: 0 4px 14px rgba(0,0,0,0.18);
            overflow: hidden;
            z-index: 40;
            padding: 5px;
            box-sizing: content-box;
        }

        .minimap-content {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .minimap-dot {
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 1px;
            transform: translate(-50%, -50%);
        }

        .minimap-viewport {
            position: absolute;
            top: 0;
            left: 0;
            border: 2px solid #2e2e33;
            background: rgba(46, 46, 51, 0.15);
            pointer-events: none;
            border-radius: 2px;
        }

        .org-tree,
        .org-tree ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
        }

        .org-tree {
            min-width: max-content;
        }

        .org-tree li {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            padding: 40px 16px 0 16px;
        }

        .org-tree li::before,
        .org-tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            width: 50%;
            height: 40px;
            border-top: 2px solid #d0d0d4;
        }

        .org-tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid #d0d0d4;
        }

        .org-tree li:only-child {
            padding-top: 0;
        }

        .org-tree li:only-child::before,
        .org-tree li:only-child::after {
            display: none;
        }

        .org-tree li:first-child::before {
            border: none;
        }

        .org-tree li:last-child::after {
            border: none;
        }

        .org-tree li:last-child::before {
            border-right: 2px solid #d0d0d4;
            border-radius: 0 6px 0 0;
        }

        .org-tree li:first-child::after {
            border-radius: 6px 0 0 0;
        }

        .org-tree > li {
            padding-top: 0;
        }

        .org-tree > li::before,
        .org-tree > li::after {
            display: none;
        }

        .org-tree ul {
            position: relative;
            padding-top: 40px;
        }

        .org-tree ul::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            width: 0;
            height: 40px;
            border-left: 2px solid #d0d0d4;
        }

        .org-card {
            --accent: #2e2e33;
            position: relative;
            background: white;
            border: 1px solid #e8e8ea;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            width: 190px;
            text-align: left;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .org-card.has-children {
            cursor: pointer;
        }

        .org-card-bar {
            border-radius: 10px 10px 0 0;
        }

        .org-count-badge {
            display: inline-block;
            background: var(--accent);
            color: white;
            border-radius: 12px;
            font-size: 0.68rem;
            font-weight: 700;
            padding: 3px 9px;
            white-space: nowrap;
            margin-top: 8px;
        }

        /* Asistente: staff del CEO, visualmente distinto a los Chiefs */
        li.assistant-branch > .org-card {
            width: 165px;
            border: 2px dashed var(--accent);
            background: #f9f9fa;
            margin-top: 30px;
        }

        li.assistant-branch > .org-card .org-card-bar {
            display: none;
        }

        /* Reconocimiento: dos tipos distintos, no deben verse iguales.
           "AI Champion" (badge-ai, morado) = impulsa adopción de IA.
           "Colaborador Destacado" (badge-month, dorado) = premio mensual rotativo. */
        .org-card.has-recognition.badge-ai {
            box-shadow: 0 0 0 2px #6d28d9, 0 2px 8px rgba(0,0,0,0.06);
        }

        .org-card.has-recognition.badge-month {
            box-shadow: 0 0 0 2px #d4a017, 0 2px 8px rgba(0,0,0,0.06);
        }

        .org-recognition-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.68rem;
            font-weight: 700;
            padding: 3px 9px;
            border-radius: 12px;
            margin-bottom: 6px;
        }

        .org-recognition-badge.badge-ai {
            background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
            color: white;
        }

        .org-recognition-badge.badge-month {
            background: linear-gradient(135deg, #f5c542 0%, #d4a017 100%);
            color: #4a3400;
        }

        .badge-period {
            font-weight: 600;
            opacity: 0.85;
        }

        .org-recognition-reason {
            font-size: 0.7rem;
            font-style: italic;
            margin-top: 4px;
            line-height: 1.3;
        }

        .org-recognition-reason.badge-ai {
            color: #5b21b6;
        }

        .org-recognition-reason.badge-month {
            color: #8a6d00;
        }

        .list-recognition-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 10px;
            margin-left: 8px;
        }

        .list-recognition-badge.badge-ai {
            background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
            color: white;
        }

        .list-recognition-badge.badge-month {
            background: linear-gradient(135deg, #f5c542 0%, #d4a017 100%);
            color: #4a3400;
        }

        .org-staff-label {
            display: inline-block;
            background: #f0f0f2;
            color: #64748b;
            font-size: 0.6rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 2px 6px;
            border-radius: 4px;
            margin-bottom: 6px;
        }

        /* Posición vacante: aún no hay persona asignada. Siempre gris, sin importar el departamento. */
        .org-card.vacant-card {
            background: #f5f5f6;
            border: 1px solid #d8d8dc;
        }

        .org-card.vacant-card .org-card-bar {
            background: #b7c0cf;
        }

        .org-position.vacant-row {
            border-left-color: #b7c0cf;
            background: #f5f5f6;
        }

        .org-photo.vacant-photo {
            background: #e3e6eb;
            border: 1px solid #d8d8dc;
        }

        .vacant-name {
            color: #7c8797 !important;
            font-style: italic;
        }

        .vacant-tag {
            display: inline-block;
            background: #e3e6eb;
            color: #64748b;
            font-size: 0.6rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 2px 7px;
            border-radius: 4px;
            margin-bottom: 6px;
        }

        .org-toggle-hint {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px dashed #e8e8ea;
            color: var(--accent);
            font-size: 0.72rem;
            font-weight: 700;
        }

        li.node-collapsed > ul {
            display: none;
        }

        .org-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        }

        .org-card-bar {
            height: 4px;
            background: var(--accent);
        }

        .org-card-body {
            padding: 14px;
        }

        .org-photo {
            width: 42px;
            height: 42px;
            min-width: 42px;
            border-radius: 50%;
            background: #eef1f6;
            border: 1px solid #dde3ec;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .org-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .org-photo.list-photo {
            width: 40px;
            height: 40px;
            min-width: 40px;
        }

        .org-card-head {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 4px;
        }

        .org-card-headtext {
            min-width: 0;
        }

        .org-card-headtext .org-card-name {
            margin-bottom: 2px;
        }

        .list-head {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .org-card-name {
            font-weight: 700;
            font-size: 0.92rem;
            color: #111113;
            margin-bottom: 8px;
            line-height: 1.2;
        }

        .org-card-tag {
            display: flex;
            align-items: baseline;
            gap: 6px;
            margin-bottom: 4px;
        }

        .org-tag-label {
            background: #f0f0f2;
            color: #7f8c8d;
            font-weight: 700;
            padding: 1px 6px;
            border-radius: 4px;
            letter-spacing: 0.3px;
            text-transform: uppercase;
            font-size: 0.6rem;
            flex-shrink: 0;
        }

        .org-tag-value {
            color: #1f1f23;
            font-size: 0.78rem;
            line-height: 1.3;
        }

        #aboutView {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            padding: 40px;
        }

        .about-section {
            margin-bottom: 40px;
        }

        .about-section h2 {
            font-size: 1.8rem;
            color: #111113;
            margin-bottom: 20px;
            font-weight: 700;
        }

        .about-section p {
            font-size: 1rem;
            line-height: 1.8;
            color: #555;
            margin-bottom: 15px;
        }

        .values-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .value-card {
            background: #f8f9fa;
            padding: 25px;
            border-radius: 8px;
            border-left: 4px solid #2e2e33;
        }

        .value-card h3 {
            color: #111113;
            margin-bottom: 10px;
            font-weight: 600;
        }

        .value-card p {
            font-size: 0.95rem;
            color: #666;
            margin: 0;
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 1.8rem;
            }

            .dept-header {
                padding: 15px;
            }

            .hierarchy {
                padding: 15px;
            }

            .team-list {
                grid-template-columns: 1fr;
            }

            #aboutView {
                padding: 20px;
            }

            .about-section h2 {
                font-size: 1.5rem;
            }
        }

        .search-bar {
            background: white;
            padding: 8px 10px;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            margin-bottom: 0;
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .search-input {
            flex: 1;
            min-width: 220px;
            padding: 6px 12px;
            border: 2px solid #e8e8ea;
            border-radius: 6px;
            font-size: 0.95rem;
        }

        .search-input:focus {
            outline: none;
            border-color: #2e2e33;
            box-shadow: 0 0 0 3px rgba(46, 46, 51, 0.1);
        }

        .control-btns {
            display: flex;
            gap: 10px;
        }

        .control-btn {
            background: #2e2e33;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .control-btn:hover {
            background: #111113;
            transform: translateY(-2px);
        }

        .custom-data-notice {
            background: #fff8e1;
            color: #7a5c00;
            border: 1px solid #f0d98c;
            border-radius: 8px;
            padding: 10px 16px;
            font-size: 0.85rem;
            margin-bottom: 20px;
        }

        .photo-edit-notice {
            background: #e8f0fe;
            color: #111113;
            border-color: #b7cdfb;
        }

        /* Modal propio: reemplaza prompt()/alert()/confirm() nativos, que algunos
           navegadores integrados (WebViews de apps de redes sociales, etc.) bloquean en silencio. */
        .app-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(20, 25, 40, 0.55);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 300;
            padding: 20px;
        }

        .app-modal {
            background: white;
            border-radius: 12px;
            padding: 22px;
            width: 100%;
            max-width: 380px;
            box-shadow: 0 12px 40px rgba(0,0,0,0.3);
        }

        .app-modal-title {
            font-weight: 700;
            font-size: 1.05rem;
            color: #111113;
            margin-bottom: 12px;
        }

        .app-modal-message {
            font-size: 0.9rem;
            color: #1f1f23;
            margin-bottom: 14px;
            line-height: 1.4;
        }

        .app-modal-field {
            margin-bottom: 12px;
        }

        .app-modal-field label {
            display: block;
            font-size: 0.78rem;
            color: #64748b;
            margin-bottom: 4px;
            font-weight: 600;
        }

        .app-modal-field input,
        .app-modal-field textarea {
            width: 100%;
            padding: 9px 11px;
            border: 2px solid #e8e8ea;
            border-radius: 6px;
            font-size: 0.9rem;
            font-family: inherit;
            resize: vertical;
        }

        .app-modal-field input:focus,
        .app-modal-field textarea:focus {
            outline: none;
            border-color: #2e2e33;
        }

        .app-modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 6px;
        }

        .app-modal-btn {
            padding: 9px 18px;
            border-radius: 6px;
            border: none;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
        }

        .app-modal-btn.cancel {
            background: #f0f0f2;
            color: #64748b;
        }

        .app-modal-btn.confirm {
            background: #2e2e33;
            color: white;
        }

        body.edit-mode .org-photo[data-person] {
            cursor: pointer;
            transition: box-shadow 0.15s ease;
        }

        body.edit-mode .org-photo[data-person]:hover {
            box-shadow: 0 0 0 3px rgba(46, 46, 51, 0.45);
        }

        .give-recognition-btn,
        .upload-photo-btn,
        .edit-person-btn {
            display: none;
            background: #f0f0f2;
            color: #2e2e33;
            border: 1px dashed #c8c8ce;
            border-radius: 10px;
            padding: 2px 8px;
            font-size: 0.68rem;
            font-weight: 700;
            cursor: pointer;
            margin-top: 6px;
            margin-right: 4px;
        }

        .give-recognition-btn:hover,
        .upload-photo-btn:hover,
        .edit-person-btn:hover {
            background: #e4e4e8;
        }

        body.edit-mode .give-recognition-btn,
        body.edit-mode .upload-photo-btn,
        body.edit-mode .edit-person-btn {
            display: inline-block;
        }

        /* Antigüedad, resumen de funciones y género */
        /* Botón de "más información" — mantiene la tarjeta compacta */
        .more-info-btn {
            background: none;
            border: 1px solid #dfe4ec;
            color: #64748b;
            border-radius: 10px;
            padding: 1px 8px;
            font-size: 0.66rem;
            font-weight: 700;
            cursor: pointer;
            margin-top: 6px;
        }

        .more-info-btn:hover {
            background: #f0f0f2;
            color: #2e2e33;
            border-color: #c8c8ce;
        }

        /* Panel de detalle de la persona */
        .detail-modal {
            max-width: 440px;
        }

        .detail-head {
            display: flex;
            gap: 14px;
            align-items: flex-start;
            margin-bottom: 16px;
        }

        .detail-head .org-photo {
            width: 58px;
            height: 58px;
            min-width: 58px;
        }

        .detail-name {
            font-size: 1.15rem;
            font-weight: 700;
            color: #111113;
            line-height: 1.2;
        }

        .detail-role {
            font-size: 0.9rem;
            color: #64748b;
            margin-top: 2px;
        }

        .detail-rows {
            border-top: 1px solid #f0f0f2;
            padding-top: 12px;
        }

        .detail-row {
            display: flex;
            gap: 10px;
            padding: 6px 0;
            font-size: 0.85rem;
            align-items: flex-start;
        }

        .detail-row dt {
            min-width: 105px;
            color: #94a3b8;
            font-weight: 600;
            flex-shrink: 0;
        }

        .detail-row dd {
            margin: 0;
            color: #1f1f23;
            line-height: 1.4;
        }

        .detail-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid #f0f0f2;
        }

        /* Menú contextual (clic derecho sobre una tarjeta, en modo edición) */
        /* Opciones al soltar una tarjeta sobre otra */
        .move-option {
            display: block;
            width: 100%;
            text-align: left;
            background: #f9f9fa;
            border: 2px solid #e8e8ea;
            border-radius: 8px;
            padding: 12px 14px;
            margin-bottom: 10px;
            cursor: pointer;
            font-family: inherit;
        }

        .move-option:hover {
            border-color: #2e2e33;
            background: #eef3fb;
        }

        .move-option-title {
            display: block;
            font-size: 0.92rem;
            font-weight: 700;
            color: #111113;
            margin-bottom: 4px;
        }

        .move-option-detail {
            display: block;
            font-size: 0.78rem;
            color: #64748b;
            line-height: 1.4;
        }

        .card-context-menu {
            position: fixed;
            top: 0;
            left: 0;
            right: auto;          /* anula el anclaje a la derecha que trae .settings-menu */
            min-width: 210px;
            width: max-content;
            max-width: 260px;
            z-index: 400;
        }

        .context-menu-header {
            font-size: 0.7rem;
            font-weight: 700;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            padding: 4px 10px 6px;
            border-bottom: 1px solid #f0f0f2;
            margin-bottom: 2px;
        }

        /* Arrastrar y soltar para reasignar jefe */
        body.edit-mode .org-card,
        body.edit-mode .list-head {
            cursor: grab;
        }

        .drag-source {
            opacity: 0.4;
        }

        .drop-target-ok {
            outline: 3px solid #27ae60 !important;
            outline-offset: 2px;
            border-radius: 10px;
        }

        .drop-target-bad {
            outline: 3px solid #c0392b !important;
            outline-offset: 2px;
            border-radius: 10px;
        }

        .drag-hint {
            background: #eef7f0;
            color: #2f6b47;
            border-color: #bfe0ca;
        }

        .recognitions-list {

            margin-top: 6px;
        }

        .recognition-item {
            font-size: 0.72rem;
            color: #4a4a4a;
            background: #f6f8fb;
            border-left: 2px solid #a8a8ae;
            padding: 3px 7px;
            margin-top: 3px;
            border-radius: 0 4px 4px 0;
        }

        .recognition-item strong {
            color: #111113;
        }

        .hidden-item {
            display: none;
        }

        /* Resaltado temporal al saltar a un resultado de búsqueda */
        .search-hit-flash {
            animation: search-hit-pulse 2.2s ease-out;
            position: relative;
            z-index: 5;
            border-radius: 8px;
        }

        @keyframes search-hit-pulse {
            0%, 55% {
                box-shadow: 0 0 0 3px #e74c3c;
            }
            100% {
                box-shadow: 0 0 0 3px rgba(231, 76, 60, 0);
            }
        }

        .dept-content.collapsed {
            max-height: 0;
            border: none;
        }

        .dept-content {
            max-height: 10000px;
            overflow: hidden;
            transition: max-height 0.4s ease;
        }

/* ---- Barra de sesión (entrada con Microsoft) ---- */
.sesion-barra { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-left: auto; margin-right: 56px; }
.sesion-usuario { opacity: .85; }
.sesion-salir { color: inherit; text-decoration: underline; }
.almacen-aviso { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #111113; color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,.25); }

/* ---- Perfiles ---- */
.solo-people-oculto { display: none !important; }

/* ---- Asistente de IA ---- */
.ia-boton { position: fixed; left: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; gap: 8px;
  background: #111113; color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: 600 14px/1 inherit;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; }
.ia-boton:hover, .ia-boton.activo { background: #2b2b33; }
.ia-panel { position: fixed; left: 20px; bottom: 76px; z-index: 900; width: min(420px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #fff; color: #1c1c22;
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; font-size: 14px; }
.ia-panel[hidden] { display: none; }
.ia-cabeza { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #111113; color: #fff; }
.ia-cabeza small { display: block; opacity: .75; font-size: 12px; margin-top: 2px; }
.ia-cerrar { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.ia-mensajes { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ia-msg { padding: 9px 12px; border-radius: 10px; max-width: 92%; }
.ia-msg p { margin: 0 0 6px; } .ia-msg p:last-child { margin: 0; }
.ia-msg h4 { margin: 8px 0 4px; font-size: 14px; }
.ia-msg ul { margin: 4px 0 6px 18px; padding: 0; }
.ia-yo { align-self: flex-end; background: #111113; color: #fff; }
.ia-bot { align-self: flex-start; background: #f2f3f5; }
.ia-error { background: #fdecec; color: #8a1c1c; }
.ia-pensando { opacity: .7; font-style: italic; }
.ia-tabla { overflow-x: auto; margin: 6px 0; }
.ia-tabla table { border-collapse: collapse; font-size: 12px; }
.ia-tabla th, .ia-tabla td { border: 1px solid #d9dbe0; padding: 4px 6px; text-align: left; vertical-align: top; }
.ia-tabla th { background: #e8e9ec; }
.ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ia-chips button, .ia-sugerencias button { border: 1px solid #c9ccd3; background: #fff; border-radius: 999px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; }
.ia-chips button:hover, .ia-sugerencias button:hover { background: #f2f3f5; }
.ia-sugerencias { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.ia-diagnostico { margin: 0 12px 8px; padding: 9px; border-radius: 8px; border: 1px dashed #111113; background: #fafafa;
  font-weight: 600; cursor: pointer; }
.ia-forma { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eceef1; }
.ia-forma input { flex: 1; padding: 9px 10px; border: 1px solid #c9ccd3; border-radius: 8px; font: inherit; }
.ia-forma button { padding: 9px 14px; border: 0; border-radius: 8px; background: #111113; color: #fff; font-weight: 600; cursor: pointer; }
.ia-nota { margin: 0; padding: 0 12px 10px; font-size: 11px; color: #6b6f78; }
@media (max-width: 600px) { .ia-boton span { display: none; } .ia-panel { left: 16px; bottom: 72px; } }
