/* Estilos compartidos del modo offline */

.offline-banner {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 14px;
}

.offline-banner strong { color: #664d03; }

.catalog-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
}

.search-box {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.search-box:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.conn-indicator { cursor: pointer; user-select: none; }
.conn-indicator:hover { filter: brightness(0.95); }

.sync-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sync-panel-backdrop.open { display: flex; }

.sync-panel {
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sync-panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sync-panel-header h3 { margin: 0; font-size: 1.05rem; }

.sync-panel-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.sync-panel-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
}

.sync-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    border-left: 4px solid #1a73e8;
}

.sync-item.register { border-left-color: #6c3fc5; }
.sync-item .sync-type { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; color: #555; }
.sync-item .sync-detail { margin-top: 4px; color: #333; }
.sync-item .sync-time { margin-top: 4px; font-size: 0.75rem; color: #888; }

.sync-panel-footer {
    padding: 12px 18px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.sync-btn.secondary { background: #6c757d; }

.offline-person-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.offline-person-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #ddd;
}

.offline-person-card .info { flex: 1; min-width: 0; }
.offline-person-card .info strong { display: block; font-size: 0.95rem; }
.offline-person-card .info span { font-size: 0.8rem; color: #666; }

.queued-msg {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #174ea6;
}

/* --- Chip de operador (brigadista) en la barra de navegación --- */
.operator-chip {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operator-chip:hover { background: rgba(255, 255, 255, 0.3); }
.operator-chip.unset { background: #ffc107; color: #333; border-color: #ffc107; }

/* --- Modal de identidad del operador --- */
.operator-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.operator-backdrop.open { display: flex; }

.operator-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 720px);
    overflow: hidden;
}

.op-modal-handle {
    display: none;
}

.op-modal-scroll {
    overflow-y: auto;
    padding: 24px;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.op-modal-header { margin-bottom: 4px; }

.operator-modal h3 { margin: 0 0 6px; font-size: 1.15rem; color: #1a1a1a; }
.operator-modal .op-sub { font-size: 0.85rem; color: #666; margin: 0 0 16px; line-height: 1.45; }
.operator-modal .op-section-title {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5f6368;
}
.operator-modal .op-geo-section,
.operator-modal .op-offline-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e8eaed;
}
.operator-modal .op-offline-section { padding-bottom: 8px; }
.operator-modal .op-label { display: block; font-weight: 600; font-size: 0.85rem; color: #555; margin: 10px 0 6px; }
.operator-modal input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
}
.operator-modal input[type="text"]:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
.operator-modal .op-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 14px;
    font-size: 0.95rem;
    color: #202124;
    cursor: pointer;
    line-height: 1.4;
}
.operator-modal .op-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: #1a73e8;
}
.operator-modal .op-geo-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
}
.operator-modal .op-geo-status__device {
    font-weight: 700;
    color: #1a73e8;
    font-size: 0.9rem;
}
.operator-modal .op-geo-status__detail { color: #3c4043; }
.operator-modal .op-geo-status__place {
    color: #137333;
    font-weight: 600;
    font-size: 0.85rem;
    word-break: break-word;
}
.operator-modal .op-geo-help,
.operator-modal .op-session-details {
    margin: 0 0 12px;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #fafafa;
    overflow: hidden;
}
.operator-modal .op-geo-help summary,
.operator-modal .op-session-details summary {
    padding: 12px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a73e8;
    cursor: pointer;
    list-style: none;
}
.operator-modal .op-geo-help summary::-webkit-details-marker,
.operator-modal .op-session-details summary::-webkit-details-marker { display: none; }
.operator-modal .op-geo-help summary::before,
.operator-modal .op-session-details summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s ease;
}
.operator-modal .op-geo-help[open] summary::before,
.operator-modal .op-session-details[open] summary::before { transform: rotate(90deg); }
.operator-modal .op-geo-help .op-geo-hint,
.operator-modal .op-session-details p {
    margin: 0;
    padding: 0 14px 12px;
    font-size: 0.82rem;
    color: #5f6368;
    line-height: 1.45;
}
.operator-modal .op-warn {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fce8e6;
    color: #b3261e;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}
.operator-modal .op-geo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.operator-modal .op-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.operator-modal .op-btn:active { transform: scale(0.98); }
.operator-modal .op-btn--anchor { background: #e6f4ea; color: #137333; }
.operator-modal .op-btn--test { background: #e8f0fe; color: #1a73e8; }
.operator-modal .op-btn--map { background: #f3e8ff; color: #6c3fc5; }
.operator-modal .op-geo-hint { font-size: 0.82rem; color: #5f6368; line-height: 1.45; }
.operator-modal .op-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px 16px;
    border-top: 1px solid #e8eaed;
    background: #fff;
    flex-shrink: 0;
}
.operator-modal .op-actions button {
    flex: 1;
    min-height: 48px;
    padding: 14px 12px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.operator-modal .op-cancel { background: #f1f3f4; color: #3c4043; }
.operator-modal .op-save { background: #1a73e8; color: #fff; }
.operator-modal .op-session-note {
    background: #e8f0fe; border-left: 4px solid #1a73e8; border-radius: 8px;
    padding: 10px 12px; margin-bottom: 14px; font-size: 0.8rem; color: #174ea6; line-height: 1.45;
}
.operator-modal .op-readonly-hint { font-size: 0.76rem; color: #888; margin-top: 6px; line-height: 1.4; }
.operator-modal input[type="text"][readonly] { background: #f1f3f4; color: #555; cursor: not-allowed; }
.operator-modal input[type="text"][readonly]:focus { border-color: #dadce0; box-shadow: none; }
