/* ═══════════════════════════════════════════════════
   SISTEMA 911 — Chile Roleplay Community
   Glassmorphism dark theme · Emergency UI
   ═══════════════════════════════════════════════════ */

/* ── Hero ── */
.e911-hero {
    text-align: center;
    padding: 2rem 0 0.5rem;
}
.e911-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: 999px; font-size: 0.72rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    background: rgba(239, 68, 68, 0.15); color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.e911-hero h1 {
    font-family: 'Inter', 'Inter', sans-serif;
    font-size: 2rem; font-weight: 800; margin: 0.6rem 0 0.3rem;
    background: linear-gradient(135deg, #f87171, #fb923c, #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.e911-hero p {
    color: #94a3b8; font-size: 0.88rem; max-width: 600px; margin: 0 auto;
}

/* ── Tabs ── */
.e911-tabs {
    display: flex; gap: 4px; padding: 5px;
    background: rgba(15, 23, 42, 0.7); border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.15);
    width: fit-content; margin: 1.5rem auto 0;
}
.e911-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    color: #94a3b8; background: transparent; border: none;
    transition: all 0.2s ease;
}
.e911-tab:hover { color: #e2e8f0; background: rgba(255,255,255,0.04); }
.e911-tab.active {
    background: rgba(239, 68, 68, 0.2); color: #f87171;
    box-shadow: inset 0 0 12px rgba(239, 68, 68, 0.12);
}
.e911-tab .tab-count {
    padding: 1px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700;
    background: rgba(239, 68, 68, 0.25); color: #f87171;
}

/* ── Section Panels ── */
.e911-panel { display: none; margin-top: 1.5rem; }
.e911-panel.active { display: block; }

/* ── Glass Card ── */
.e911-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 14px; padding: 1.25rem;
    backdrop-filter: blur(16px);
}
.e911-card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding-bottom: 0.75rem; margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148,163,184,0.1);
}
.e911-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.92rem; font-weight: 700; color: #e2e8f0;
}
.e911-card-title i { font-size: 1.15rem; color: #f87171; }
.e911-card-sub { font-size: 0.76rem; color: #64748b; margin-top: 2px; }

/* ── Form ── */
.e911-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.e911-field { display: flex; flex-direction: column; gap: 5px; }
.e911-field.full { grid-column: 1 / -1; }
.e911-label {
    font-size: 0.78rem; font-weight: 600; color: #cbd5e1;
    display: flex; align-items: center; gap: 6px;
}
.e911-label i { font-size: 0.88rem; color: #64748b; }
.e911-hint { font-size: 0.7rem; color: #64748b; }
.e911-input, .e911-textarea {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 8px; padding: 10px 12px;
    font-size: 0.82rem; color: #e2e8f0;
    font-family: inherit; outline: none;
    transition: border-color 0.2s;
}
.e911-input:focus, .e911-textarea:focus {
    border-color: rgba(239, 68, 68, 0.4);
}
.e911-input::placeholder, .e911-textarea::placeholder { color: #475569; }
.e911-textarea { min-height: 100px; resize: vertical; }

/* ── Equipos ── */
.e911-equipos { display: flex; flex-wrap: wrap; gap: 6px; }
.e911-equipo-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 600;
    cursor: pointer; border: 1px solid rgba(148,163,184,0.2);
    background: rgba(15, 23, 42, 0.8); color: #94a3b8;
    transition: all 0.2s ease; user-select: none;
}
.e911-equipo-pill:hover { border-color: rgba(148,163,184,0.35); color: #cbd5e1; }
.e911-equipo-pill.selected {
    background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.e911-equipo-pill i { font-size: 1rem; }

/* ── Upload ── */
.e911-upload {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 24px; border: 2px dashed rgba(148,163,184,0.15);
    border-radius: 10px; color: #64748b; font-size: 0.78rem;
    cursor: pointer; transition: border-color 0.2s;
    position: relative; overflow: hidden;
}
.e911-upload:hover { border-color: rgba(239, 68, 68, 0.3); }
.e911-upload input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.e911-upload-preview {
    display: none; width: 100%; max-height: 140px;
    object-fit: cover; border-radius: 8px;
}
.e911-upload.has-image { padding: 8px; }
.e911-upload.has-image .e911-upload-placeholder { display: none; }
.e911-upload.has-image .e911-upload-preview { display: block; }

/* ── Buttons ── */
.e911-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; font-size: 0.82rem;
    font-weight: 600; cursor: pointer; border: none;
    transition: all 0.2s ease; font-family: inherit;
}
.e911-btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff; box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}
.e911-btn-primary:hover { box-shadow: 0 6px 24px rgba(239, 68, 68, 0.35); transform: translateY(-1px); }
.e911-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.e911-btn-ghost {
    background: rgba(15, 23, 42, 0.6); color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.15);
}
.e911-btn-ghost:hover { color: #e2e8f0; border-color: rgba(148,163,184,0.3); }

/* ── Llamadas Recientes ── */
.e911-calls-list { display: flex; flex-direction: column; gap: 8px; }
.e911-call-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: 10px;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(148,163,184,0.08);
    transition: border-color 0.2s; cursor: pointer;
}
.e911-call-item:hover { border-color: rgba(148,163,184,0.2); }
.e911-call-main { display: flex; flex-direction: column; gap: 2px; }
.e911-call-title { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }
.e911-call-meta { font-size: 0.72rem; color: #64748b; }
.e911-call-actions { display: flex; align-items: center; gap: 6px; }

/* ── Badges ── */
.e911-badge {
    padding: 3px 10px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}
.e911-badge-activa { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.e911-badge-atendida { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.e911-badge-cerrada { background: rgba(148,163,184,0.12); color: #64748b; }
.e911-badge-equipo {
    padding: 2px 8px; border-radius: 999px; font-size: 0.66rem; font-weight: 600;
    background: rgba(251, 146, 60, 0.15); color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

/* ── Chat ── */
.e911-chat-container {
    display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem;
    margin-top: 1.5rem;
}
.e911-chat-panel { display: flex; flex-direction: column; gap: 0; height: 420px; }
.e911-chat-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: 14px 14px 0 0;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148,163,184,0.1);
    border-bottom: none;
}
.e911-chat-topbar-left {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; font-weight: 600; color: #e2e8f0;
}
.e911-chat-topbar-left i { color: #f87171; }
.e911-chat-timer {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 0.76rem; font-weight: 700;
    font-family: 'Inter', sans-serif;
}
.e911-chat-timer.ok { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.e911-chat-timer.warn { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.e911-chat-timer.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.e911-chat-messages {
    flex: 1; overflow-y: auto; padding: 12px;
    background: rgba(2, 6, 23, 0.6);
    border-left: 1px solid rgba(148,163,184,0.1);
    border-right: 1px solid rgba(148,163,184,0.1);
    display: flex; flex-direction: column; gap: 8px;
}
.e911-chat-messages::-webkit-scrollbar { width: 4px; }
.e911-chat-messages::-webkit-scrollbar-track { background: transparent; }
.e911-chat-messages::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 4px; }

.e911-msg {
    display: flex; gap: 8px; align-items: flex-start;
    max-width: 85%;
}
.e911-msg.self { margin-left: auto; flex-direction: row-reverse; }
.e911-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid rgba(148,163,184,0.15);
}
.e911-msg-bubble {
    padding: 8px 12px; border-radius: 12px;
    font-size: 0.8rem; line-height: 1.45; color: #e2e8f0;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148,163,184,0.08);
}
.e911-msg.self .e911-msg-bubble {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.2);
}
.e911-msg.equipo .e911-msg-bubble {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}
.e911-msg-name {
    font-size: 0.7rem; font-weight: 700; color: #94a3b8;
    margin-bottom: 2px;
}
.e911-msg-name .equipo-tag {
    font-size: 0.62rem; padding: 1px 5px; border-radius: 4px;
    background: rgba(59, 130, 246, 0.2); color: #60a5fa;
    margin-left: 4px; font-weight: 600;
}
.e911-msg-time { font-size: 0.64rem; color: #475569; margin-top: 3px; }

.e911-msg-sistema {
    text-align: center; padding: 6px; font-size: 0.72rem;
    color: #64748b; font-style: italic;
}

.e911-chat-input-row {
    display: flex; gap: 8px; padding: 10px 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148,163,184,0.1);
    border-top: none; border-radius: 0 0 14px 14px;
}
.e911-chat-input {
    flex: 1; background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 8px; padding: 8px 12px;
    font-size: 0.8rem; color: #e2e8f0;
    font-family: inherit; outline: none;
}
.e911-chat-input:focus { border-color: rgba(239, 68, 68, 0.3); }
.e911-chat-input::placeholder { color: #475569; }
.e911-chat-send {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff; border: none; font-size: 0.78rem;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.e911-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Chat Sidebar (info de llamada) ── */
.e911-chat-sidebar {
    display: flex; flex-direction: column; gap: 12px;
}
.e911-info-row {
    display: flex; flex-direction: column; gap: 3px;
}
.e911-info-label { font-size: 0.68rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; }
.e911-info-value { font-size: 0.82rem; color: #e2e8f0; }
.e911-info-img {
    width: 100%; max-height: 120px; object-fit: cover;
    border-radius: 8px; border: 1px solid rgba(148,163,184,0.1);
}
.e911-equipos-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── Empty State ── */
.e911-empty {
    text-align: center; padding: 3rem 1rem;
    color: #475569;
}
.e911-empty i { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; color: #334155; }
.e911-empty p { font-size: 0.84rem; }

/* ── Toast ── */
.e911-toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 12px 20px; border-radius: 10px;
    font-size: 0.82rem; font-weight: 600; z-index: 9999;
    transform: translateY(100px); opacity: 0;
    transition: all 0.3s ease;
}
.e911-toast.show { transform: translateY(0); opacity: 1; }
.e911-toast.success { background: rgba(34, 197, 94, 0.9); color: #fff; }
.e911-toast.error { background: rgba(239, 68, 68, 0.9); color: #fff; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .e911-form-grid { grid-template-columns: 1fr; }
    .e911-chat-container { grid-template-columns: 1fr; }
    .e911-chat-sidebar { order: -1; }
    .e911-tabs { flex-wrap: wrap; width: 100%; justify-content: center; }
}
@media (max-width: 600px) {
    .e911-hero h1 { font-size: 1.5rem; }
    .e911-chat-panel { height: 360px; }
}

