/* ================================================================
   SHELL.CSS — Elementos persistentes del SPA Shell
   Identity Bar + Pulse + Search Universal
   ================================================================ */

/* --- IDENTITY BAR --- */
.identity-bar {
    background: var(--bg-dark, #2C2C2C);
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    padding: 0 1.5rem;
    height: 48px;
    display: flex;
    align-items: center;
    z-index: 100;
}
.identity-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.identity-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary, #C1694F); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.5px; flex-shrink: 0;
}
.identity-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.identity-name {
    color: #fff; font-size: 0.85rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.identity-role {
    color: var(--text-muted, #999); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.identity-company { margin-left: auto; flex-shrink: 0; }
.company-select {
    background: var(--bg-card, #363636); color: #fff;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px; padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: 0.8rem; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.5rem center;
    max-width: 240px; transition: border-color 0.2s;
}
.company-select:hover, .company-select:focus {
    border-color: var(--primary, #C1694F); outline: none;
}
.company-single { color: var(--accent, #3D9A8B); font-size: 0.8rem; font-weight: 500; }

/* --- PULSE BAR --- */
.pulse-bar {
    position: fixed; top: 8px; right: 80px;
    display: flex; align-items: center; gap: 1rem; z-index: 200;
    padding: 0.3rem 0.75rem;
    background: rgba(44,44,44,0.9); backdrop-filter: blur(8px);
    border-radius: 20px; border: 1px solid var(--border-color, #3a3a3a);
}
.pulse-inner { display: flex; align-items: center; gap: 1rem; }
.pulse-item {
    display: flex; align-items: center; gap: 0.35rem;
    cursor: default; position: relative;
}
.pulse-item[data-clickable] { cursor: pointer; }
.pulse-label {
    font-size: 0.65rem; color: var(--text-muted, #999);
    text-transform: uppercase; letter-spacing: 0.3px; display: none;
}
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}
.pulse-dot--loading {
    background: var(--text-muted, #999);
    animation: pulse-blink 1.2s ease-in-out infinite;
}
.pulse-dot--ok { background: #4CAF50; box-shadow: 0 0 4px rgba(76,175,80,0.5); }
.pulse-dot--warning { background: #FF9800; box-shadow: 0 0 4px rgba(255,152,0,0.5); }
.pulse-dot--error {
    background: #f44336; box-shadow: 0 0 4px rgba(244,67,54,0.5);
    animation: pulse-blink 1s ease-in-out infinite;
}
@keyframes pulse-blink { 0%,100%{opacity:1} 50%{opacity:0.4} }
.pulse-badge {
    font-size: 0.7rem; font-weight: 600;
    min-width: 18px; height: 18px; line-height: 18px; text-align: center;
    border-radius: 9px; padding: 0 5px; color: #fff;
    background: var(--primary, #C1694F);
}
.pulse-badge--info { background: var(--accent, #3D9A8B); }
.pulse-badge--warning { background: #FF9800; }
.pulse-badge--zero { background: var(--bg-card, #363636); color: var(--text-muted, #999); }
.pulse-item:hover .pulse-label { display: inline; }

/* --- SEARCH UNIVERSAL --- */
.search-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 1000; display: flex;
    align-items: flex-start; justify-content: center;
    padding-top: 12vh; opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease;
}
.search-overlay.search-open { opacity: 1; pointer-events: auto; }
.search-modal {
    background: var(--bg-dark, #2C2C2C);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 12px; width: 90%; max-width: 560px;
    max-height: 60vh; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: translateY(-10px); transition: transform 0.15s ease;
}
.search-open .search-modal { transform: translateY(0); }
.search-input-wrap {
    display: flex; align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a); gap: 0.6rem;
}
.search-icon { color: var(--text-muted, #999); flex-shrink: 0; }
.search-input {
    flex: 1; background: none; border: none; color: #fff;
    font-size: 1rem; outline: none; padding: 0.25rem 0;
}
.search-input::placeholder { color: var(--text-muted, #666); }
.search-kbd {
    background: var(--bg-card, #363636); color: var(--text-muted, #999);
    padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.7rem;
    font-family: inherit; border: 1px solid var(--border-color, #3a3a3a); flex-shrink: 0;
}
.search-results { overflow-y: auto; max-height: calc(60vh - 60px); padding: 0.5rem; }
.search-hint {
    text-align: center; color: var(--text-muted, #999);
    font-size: 0.85rem; padding: 2rem 1rem;
}
.search-section { margin-bottom: 0.5rem; }
.search-section-title {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted, #999); padding: 0.5rem 0.75rem 0.25rem;
}
.search-result-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.75rem; border-radius: 6px; cursor: pointer;
    text-decoration: none; color: inherit; transition: background 0.1s;
}
.search-result-item:hover, .search-result-item:focus,
.search-result-item.search-result--selected { background: var(--bg-card, #363636); }
.search-result-name { color: #fff; font-size: 0.9rem; }
.search-result-name mark {
    background: rgba(193,105,79,0.3); color: var(--primary, #C1694F);
    border-radius: 2px; padding: 0 1px;
}
.search-result-sub {
    color: var(--text-muted, #999); font-size: 0.75rem;
    flex-shrink: 0; margin-left: 1rem;
}
.search-trigger {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-card, #363636);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px; cursor: pointer;
    color: var(--text-muted, #999); font-size: 0.8rem;
    transition: border-color 0.2s; margin-left: 1rem;
}
.search-trigger:hover { border-color: var(--primary, #C1694F); color: #fff; }
.search-trigger kbd {
    background: var(--bg-dark, #2C2C2C); padding: 0.1rem 0.35rem;
    border-radius: 3px; font-size: 0.65rem; font-family: inherit;
    border: 1px solid var(--border-color, #3a3a3a);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .identity-bar { padding: 0 0.75rem; height: 44px; }
    .identity-info { display: none; }
    .company-select { max-width: 160px; font-size: 0.75rem; }
    .pulse-bar { right: 60px; gap: 0.5rem; padding: 0.2rem 0.5rem; }
    .pulse-label { display: none !important; }
    .search-modal { width: 95%; max-height: 70vh; }
    .search-trigger { display: none; }
}
@media (max-width: 480px) {
    .pulse-bar { right: 10px; top: 6px; }
    .company-select { max-width: 120px; }
}
