:root {
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --border-color: #e4e4e7;
    --btn-dark: #18181b;
    --btn-dark-hover: #27272a;
    --badge-bg: #f4f4f5;
    --wa-bg: #eafaf1;
    --wa-color: #128c7e;
    --wa-hover: #d2f4e1;
}

/* Ocultar publicidad y widget flotante de Netlify */
[data-netlify-deploy-id],
#netlify-drawer,
div[class*="netlify"],
iframe[title*="Netlify"] {    
    display: none !important;    
    visibility: hidden !important;   
    opacity: 0 !important;    
    pointer-events: none !important;            
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px 40px;
}

.container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    flex: 1;
}

/* HEADER */
header {
    text-align: center;
    margin-bottom: 20px;
}

/* BARRA SUPERIOR */
.top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.city-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #52525b;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.dot-green {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
}

.top-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* BOTÓN INSTALAR PWA */
.btn-install-pwa {
    display: none;
    align-items: center;
    gap: 5px;
    background-color: #18181b;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: all 0.15s;
}

.btn-install-pwa:hover {
    background-color: #27272a;
    transform: translateY(-1px);
}

.btn-install-pwa svg {
    width: 13px;
    height: 13px;
    stroke: #34d399;
}

.top-company-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 3px 10px 3px 6px;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    cursor: pointer;
}

.top-company-badge:hover {
    border-color: #18181b;
    background-color: #fafafa;
}

.top-company-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    display: block;
}

.top-company-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.banner-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background-color: #0a0a0c;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #27272a;
    margin-bottom: 10px;
}

.banner-logo svg {
    width: 38px;
    height: 44px;
    flex-shrink: 0;
}

.banner-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center;
}

.banner-title {
    font-size: 20px;
    color: #ffffff;
    line-height: 1.15;
    font-family: "Brush Script MT", "Caveat", "Palatino", "Georgia", cursive, serif;
    font-style: italic;
}

.banner-address {
    font-size: 10px;
    color: #d4d4d8;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 3px;
}

.meta-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.badge-count {
    background-color: var(--badge-bg);
    color: #3f3f46;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

/* BUSCADOR */
.search-box {
    position: relative;
    margin-bottom: 14px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #a1a1aa;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    font-size: 14.5px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.search-input:focus {
    border-color: #18181b;
    box-shadow: 0 0 0 1px #18181b;
}

/* FILTROS */
.filter-status-row {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 2px 4px;
}

.filter-status-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-reset-btn {
    background: none;
    border: none;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

.filter-reset-btn:hover {
    background-color: #fee2e2;
}

/* CUADRÍCULA 2X2 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.dash-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    user-select: none;
}

.dash-card:hover {
    border-color: #a1a1aa;
    transform: translateY(-1px);
}

.dash-card.active {
    background-color: #18181b;
    border-color: #18181b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dash-card.active .dash-title {
    color: #ffffff !important;
}

.dash-card.active .dash-count {
    background-color: #27272a !important;
    color: #ffffff !important;
}

.dash-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dash-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.dash-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-count {
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--badge-bg);
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* CARDS */
.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-count {
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 500;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: #a1a1aa;
}

.card.is-emergency {
    border-left: 4px solid #18181b;
    background: linear-gradient(to right, rgba(254, 242, 242, 0.4), #ffffff);
}

.contact-info {
    flex: 1;
    padding-right: 12px;
    min-width: 0;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.badge-urgente {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 2px 6px;
    border-radius: 4px;
}

.number-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-number {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
}

.btn-copy {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-copy:hover {
    color: #18181b;
    background-color: #f4f4f5;
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

.contact-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.3;
}

/* ACCIONES */
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--wa-bg);
    color: var(--wa-color);
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #cbf0db;
    transition: all 0.15s;
}

.btn-wa:hover {
    background-color: var(--wa-hover);
    transform: scale(1.03);
}

.btn-wa svg {
    width: 22px;
    height: 22px;
    fill: #25D366;
}

.btn-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: var(--btn-dark);
    color: #ffffff;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    padding: 11px 16px;
    min-height: 44px;
    min-width: 98px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-call:hover {
    background-color: var(--btn-dark-hover);
}

.btn-call:active {
    transform: scale(0.97);
}

.btn-call svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.empty-state {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* FOOTER */
footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.sync-footer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.sync-footer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    flex-shrink: 0;
}

.sync-btn-footer {
    background: none;
    border: none;
    color: #18181b;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.sync-btn-footer:hover {
    color: #065f46;
}

.footer-title {
    font-weight: 700;
    color: var(--text-primary);
}

/* CONTACTO 3D FAMILY */
.company-card {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.company-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #a1a1aa;
    margin-bottom: 8px;
}

.company-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 16px;
    max-width: 360px;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    text-align: center;
}

.company-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

.company-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.company-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.company-pill:hover {
    background-color: #18181b;
    color: #ffffff;
    border-color: #18181b;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #18181b;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -6px);
}

/* MODAL GUÍA IOS */
.modal-ios {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-ios.show {
    display: flex;
}

.modal-ios-content {
    background: #ffffff;
    max-width: 360px;
    width: 100%;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    text-align: left;
}

.modal-ios-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-ios-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.ios-step-num {
    width: 22px;
    height: 22px;
    background: #18181b;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.btn-modal-close {
    width: 100%;
    background: #18181b;
    color: #ffffff;
    border: none;
    padding: 11px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* ========================================================
   ACCESO RESIDENTES (CERO FRICCIÓN) - PM2026
   ======================================================== */
.resident-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(circle at top, #18181b 0%, #09090b 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    overflow-y: auto;
}

.resident-gate-container {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.gate-card {
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid rgba(63, 63, 70, 0.6);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gate-card::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 160px;
    height: 160px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.gate-logo-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.gate-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    border: 1px solid rgba(82, 82, 91, 0.5);
    background: #09090b;
    padding: 4px;
    object-fit: contain;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.gate-key-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: #09090b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-size: 13px;
}

.gate-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.gate-subtitle {
    font-size: 13.5px;
    color: #a1a1aa;
    line-height: 1.45;
    margin-bottom: 22px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.gate-input-group {
    position: relative;
    text-align: left;
    margin-bottom: 14px;
}

.gate-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d8;
    margin-bottom: 6px;
    margin-left: 4px;
}

.gate-input-wrap {
    position: relative;
}

.gate-input {
    width: 100%;
    background: rgba(9, 9, 11, 0.9);
    border: 1.5px solid #3f3f46;
    border-radius: 16px;
    padding: 14px 44px 14px 44px;
    color: #ffffff;
    font-size: 16px;
    font-family: monospace;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.gate-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.gate-input.error {
    border-color: #ef4444 !important;
    background: rgba(69, 10, 10, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.gate-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #71717a;
    pointer-events: none;
    font-size: 16px;
}

.gate-toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
}

.gate-remember {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    font-size: 12px;
    color: #a1a1aa;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
    padding: 0 4px;
}

.gate-remember input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #10b981;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.gate-btn-submit {
    width: 100%;
    background: #10b981;
    color: #09090b;
    border: none;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.gate-btn-submit:hover {
    background: #34d399;
    transform: translateY(-1px);
}

.gate-error-box {
    display: none;
    margin-top: 10px;
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid rgba(220, 38, 38, 0.6);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    color: #fca5a5;
    text-align: left;
    gap: 8px;
}

.gate-error-box.show {
    display: flex;
}

.gate-help {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(63, 63, 70, 0.6);
    font-size: 11.5px;
    color: #71717a;
}

.gate-emergency-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(136, 19, 55, 0.35);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #fda4af;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.15s;
}

.gate-emergency-btn:hover {
    background: rgba(136, 19, 55, 0.6);
    color: #ffffff;
}

.emergency-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.emergency-modal-overlay.active {
    display: flex;
}

.emergency-modal-box {
    background: #18181b;
    border: 1px solid #7f1d1d;
    border-radius: 24px;
    max-width: 380px;
    width: 100%;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: #ffffff;
}

.emg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(39, 39, 42, 0.8);
    border: 1px solid #3f3f46;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #ffffff;
    margin-bottom: 10px;
    transition: all 0.15s;
}

.emg-item:hover {
    border-color: #ef4444;
    background: rgba(69, 10, 10, 0.4);
}

.emg-item-left {
    text-align: left;
}

.emg-item-title {
    font-size: 13.5px;
    font-weight: 700;
}

.emg-item-sub {
    font-size: 11px;
    color: #a1a1aa;
}

.emg-item-badge {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
}

@keyframes gateShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.animate-gate-shake {
    animation: gateShake 0.4s ease-in-out;
}

/* ========================================================
   ESTILOS BOTÓN DE PÁNICO Y AUXILIO RESIDENCIAL
   ======================================================== */
.floating-panic-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.5);
    padding: 12px 18px;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: panicPulse 2.5s infinite;
}

.floating-panic-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 28px -5px rgba(239, 68, 68, 0.6);
}

.panic-icon {
    font-size: 18px;
}

@keyframes panicPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.panic-box {
    border: 1px solid #7f1d1d !important;
    background: #18181b !important;
}

.panic-header {
    margin-bottom: 16px;
    text-align: center;
}

.panic-icon-pulse {
    font-size: 38px;
    margin-bottom: 6px;
}

.panic-title {
    font-size: 19px;
    font-weight: 800;
    color: #f87171;
    margin: 0;
}

.panic-subtitle {
    font-size: 12px;
    color: #a1a1aa;
    margin-top: 4px;
}

.apt-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #27272a;
    border: 1px solid #3f3f46;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.apt-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
}

.apt-label {
    font-size: 11px;
    color: #a1a1aa;
    font-weight: 500;
    text-transform: uppercase;
}

.apt-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 700;
}

.btn-edit-apt {
    background: transparent;
    border: 1px solid #52525b;
    color: #d4d4d8;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    cursor: pointer;
    font-weight: 600;
}

/* CAJAS ESTANDARIZADAS PARA TORRE Y APTO */
.apt-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.apt-field-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: #09090b;
    border: 1.5px solid #3f3f46;
    border-radius: 10px;
    padding: 2px 8px;
    transition: border-color 0.2s;
}

.apt-field-group:focus-within {
    border-color: #ef4444;
}

.apt-prefix {
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 700;
    margin-right: 6px;
    user-select: none;
}

.apt-field-group input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.btn-save-apt {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-save-apt:hover {
    background: #dc2626;
}

.panic-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.btn-panic-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #15803d;
    color: #ffffff;
    border: none;
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
}

.btn-panic-wa:hover {
    background: #16a34a;
}

.btn-panic-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #27272a;
    color: #ffffff;
    border: 1px solid #3f3f46;
    padding: 11px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.btn-panic-123 {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #a1a1aa;
    border: 1px dashed #3f3f46;
    padding: 9px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.btn-panic-close {
    width: 100%;
    background: transparent;
    color: #71717a;
    border: none;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
}

/* Diseño del directorio para pantallas táctiles */
:root {
    --bg-body: #f1f5fa;
    --text-primary: #17263b;
    --text-secondary: #34465e;
    --text-muted: #526277;
    --border-color: #d7e1ed;
    --btn-dark: #174e85;
    --btn-dark-hover: #123f6d;
    --wa-color: #14633d;
}

body {
    padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
    line-height: 1.5;
}

button, input, a {
    font: inherit;
}

button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid #2872b8;
    outline-offset: 3px;
}

.banner-logo {
    background: #173c60;
    border-color: #173c60;
}

.banner-title { font-size: 24px; }
.banner-address { font-size: 12px; }
.meta-info, .city-badge, .top-company-name { font-size: 14px; }
.btn-install-pwa { min-height: 48px; font-size: 15px; }

.quick-access {
    margin: 20px 0 24px;
}

.section-intro h1 {
    font-size: 24px;
    line-height: 1.2;
    color: #173c60;
}

.section-intro p {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 16px;
}

.directory-label {
    display: block;
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #173c60;
}
.all-contacts-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 54px;
    padding: 10px 16px;
    border: 1px solid #c9ddec;
    border-radius: 16px;
    background: #ffffff;
    color: #173c60;
    font-size: 20px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.all-contacts-toggle[hidden] { display: none; }
.all-contacts-toggle:hover { background: #eaf4fb; }
.all-contacts-toggle svg { width: 24px; height: 24px; flex-shrink: 0; }
.all-contacts-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.search-box { margin-bottom: 22px; }
.search-input { min-height: 54px; padding-right: 56px; font-size: 16px; border-color: #b7c8d8; }
.search-icon { width: 20px; height: 20px; color: #526277; }
.search-clear {
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #34465e;
    cursor: pointer;
}
.search-clear[hidden] { display: none; }
.search-clear:hover { background: #e8f0f7; }
.search-clear svg { width: 20px; height: 20px; }
.filter-status-text, .filter-reset-btn { font-size: 16px; }
.filter-reset-btn { min-height: 48px; padding: 8px 12px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.dash-card {
    min-width: 0;
    min-height: 170px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid #c9ddec;
    border-radius: 22px;
    background: linear-gradient(145deg, #ffffff, #eaf4fb);
    box-shadow: 0 5px 16px rgba(23, 60, 96, 0.08);
    text-align: center;
    color: #173c60;
}
.dash-card.active { background: #174e85; border-color: #174e85; }
.dash-card.active .dash-count { background: #123f6d !important; }
.dash-left { flex-direction: column; gap: 4px; max-width: 100%; }
.dash-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dceefa;
    font-size: 30px;
}
.dash-title { font-size: 24px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
.dash-count { margin-left: 0; font-size: 18px; background: #e3edf6; }

.section-header { align-items: baseline; gap: 10px; }
.section-title { font-size: 21px; letter-spacing: 0; text-transform: none; color: #173c60; }
.section-count { font-size: 16px; color: var(--text-secondary); text-align: right; }
.card-list { gap: 12px; }
.card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px;
    border-color: transparent;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(23, 60, 96, 0.07);
}
.card.is-emergency { border-left-color: #b91c1c; }
.contact-info { padding-right: 0; }
.contact-name { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.badge-urgente { font-size: 14px; }
.number-row { justify-content: space-between; }
.contact-number { font-size: 21px; overflow-wrap: anywhere; }
.contact-desc { font-size: 18px; line-height: 1.4; color: var(--text-secondary); }
.btn-copy { min-width: 48px; min-height: 48px; justify-content: center; color: #34465e; }
.btn-copy svg { width: 20px; height: 20px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-wa, .btn-call {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    height: auto;
    padding: 10px 8px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 999px;
}
.btn-wa { gap: 6px; background: #e4f6e9; border-color: #a7d7b6; }
.btn-call { grid-column: 2; }
.btn-wa svg { width: 20px; height: 20px; fill: currentColor; }
.btn-call svg { width: 20px; height: 20px; }
.empty-state { font-size: 16px; }
.empty-reset-btn {
    margin-top: 16px;
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px;
    background: #174e85;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

footer { font-size: 14px; }
.sync-footer { display: flex; flex-wrap: wrap; justify-content: center; border-radius: 16px; font-size: 15px; }
.sync-btn-footer { min-height: 48px; font-size: 15px; }
.company-label, .company-name, .company-pill { font-size: 14px; }
.company-pill { min-height: 48px; }
.toast { max-width: calc(100% - 32px); width: max-content; bottom: calc(82px + env(safe-area-inset-bottom)); font-size: 16px; text-align: center; }

.resident-gate-overlay { background: linear-gradient(160deg, #123450, #10243a); }
.gate-card { background: #17354f; border-color: #57758e; }
.gate-title { font-size: 26px; }
.gate-subtitle, .gate-input-label, .gate-remember, .gate-help { font-size: 16px; color: #e5eef7; }
.gate-input { min-height: 56px; padding-right: 56px; font-family: inherit; letter-spacing: normal; }
.gate-input::placeholder { color: #b7c7d6; }
.gate-toggle-eye {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    right: 4px;
    color: #e5eef7;
}
.gate-toggle-eye svg { width: 24px; height: 24px; }
.gate-toggle-eye svg[hidden] { display: none; }
.gate-remember input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; }
.gate-btn-submit { min-height: 54px; font-size: 18px; }
.gate-btn-submit:disabled {
    background: #586d7d;
    color: #ffffff;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.gate-error-box { font-size: 16px; }
.gate-emergency-btn { min-height: 52px; font-size: 16px; color: #ffffff; }

.emergency-modal-overlay { overflow-y: auto; align-items: safe center; }
.emergency-modal-box { max-height: calc(100dvh - 32px); overflow-y: auto; }
.emg-item { min-height: 64px; gap: 10px; }
.emg-item-title, .emg-item-sub, .emg-item-badge { font-size: 16px; }
.emg-item-sub { color: #d4d4d8; }
.emergency-modal-box > p { font-size: 16px !important; }
.emergency-modal-box > button { min-height: 48px; font-size: 16px !important; }
.floating-panic-btn {
    position: fixed;
    left: auto;
    right: 16px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    justify-content: center;
    width: 68px;
    height: 68px;
    min-height: 68px;
    padding: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 22%, #ff8a80 0%, #ef4444 38%, #b91c1c 78%, #851313 100%);
    border: 2px solid #ffc0b8;
    box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.55), inset 0 -5px 8px rgba(100, 0, 0, 0.4), 0 5px 0 #8e1616, 0 9px 16px rgba(82, 16, 16, 0.35);
    font-size: 18px;
    letter-spacing: 0.03em;
    animation: none;
}
.floating-panic-btn:hover {
    transform: translateY(calc(-50% - 2px));
    box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.55), inset 0 -5px 8px rgba(100, 0, 0, 0.4), 0 7px 0 #8e1616, 0 11px 18px rgba(82, 16, 16, 0.35);
}
.floating-panic-btn:active {
    transform: translateY(calc(-50% + 3px));
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.45), inset 0 -3px 6px rgba(100, 0, 0, 0.4), 0 2px 0 #8e1616, 0 5px 8px rgba(82, 16, 16, 0.3);
}
.panic-title { color: #fca5a5; font-size: 22px; }
.panic-subtitle, .apt-label, .apt-value, .apt-prefix { font-size: 16px; color: #e4e4e7; }
.panic-wa-note { color: #e4e4e7; font-size: 15px; line-height: 1.4; }
.btn-edit-apt, .btn-save-apt, .btn-panic-wa, .btn-panic-call, .btn-panic-123, .btn-panic-close {
    min-height: 48px;
    font-size: 16px;
}
.btn-panic-123, .btn-panic-close { color: #e4e4e7; }
.apt-input-box { flex-wrap: wrap; }
.apt-field-group { min-width: 100px; min-height: 48px; }
.apt-field-group input { font-size: 16px; }
.modal-ios-desc, .ios-step, .btn-modal-close { font-size: 16px; }
.btn-modal-close { min-height: 48px; }

@media (max-width: 350px) {
    .dash-card { padding-left: 4px; padding-right: 4px; }
    .dash-title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Rediseño del directorio aprobado en pruebas */
:root {
    --bg-body: #f7f9fc;
    --bg-card: #ffffff;
    --text-primary: #173f67;
    --text-secondary: #52677d;
    --text-muted: #52677d;
    --border-color: #d5e1ed;
    --btn-dark: #245a8d;
    --btn-dark-hover: #173f67;
    --wa-color: #21683d;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    padding: 24px 16px calc(100px + env(safe-area-inset-bottom));
    line-height: 1.5;
}

.container {
    max-width: 900px;
}

header {
    margin-bottom: 28px;
    text-align: left;
}

.top-nav-bar {
    gap: 8px;
    margin-bottom: 12px;
    padding: 0;
}

.top-nav-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.city-badge {
    min-height: 40px;
    border-color: var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}

.btn-install-pwa {
    display: inline-flex;
    min-height: 40px;
    background: var(--btn-dark);
    padding: 8px 14px;
    font-size: 13px;
}

.btn-install-pwa svg {
    stroke: #ffffff;
}

.top-company-badge {
    min-height: 44px;
    min-width: 44px;
    padding: 3px 12px 3px 5px;
}

.top-company-logo {
    width: 36px;
    height: 36px;
}

.top-company-name {
    color: var(--text-primary);
}

.banner-logo {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 106px;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(115deg, #173f67, #245a8d);
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.12);
}

.banner-logo::after {
    position: absolute;
    top: -54px;
    right: -24px;
    width: 180px;
    height: 180px;
    border: 24px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.banner-logo svg {
    position: relative;
    z-index: 1;
    width: 62px;
    height: 68px;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 12px;
    filter: invert(1);
}

.banner-text {
    position: relative;
    z-index: 1;
    min-width: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    padding-left: 14px;
}

.banner-title {
    color: #ffffff;
    font-family: inherit;
    font-size: 22px;
    font-style: normal;
    font-weight: 800;
}

.banner-address {
    color: #eaf3fb;
    font-size: 11px;
    letter-spacing: 0.7px;
}

.meta-info {
    justify-content: space-between;
    gap: 12px;
    color: var(--text-primary);
    font-size: 13px;
    text-align: left;
}

.meta-title {
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.badge-count {
    display: flex;
    min-width: 100px;
    min-height: 46px;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--btn-dark);
    color: #ffffff;
    text-align: center;
}

.badge-count-number {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.badge-count-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.1;
    text-transform: uppercase;
}

.quick-access {
    margin: 24px 0 20px;
}

.section-intro h1 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-intro p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 16px;
}

.directory-label {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.search-box {
    margin-bottom: 20px;
}

.search-input {
    min-height: 56px;
    padding: 12px 56px 12px 48px;
    border: 2px solid var(--btn-dark);
    border-radius: 16px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.06);
}

.search-input:focus {
    border-color: var(--btn-dark);
    box-shadow: 0 0 0 2px rgba(36, 90, 141, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.search-icon {
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--btn-dark);
}

.search-clear {
    right: 4px;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
}

.category-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.category-heading h2 {
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--text-primary);
    padding: 8px 16px;
    color: #ffffff;
    font-size: 16px;
    font-style: italic;
    font-weight: 700;
}

.category-heading > span {
    height: 1px;
    flex: 1;
    background: var(--border-color);
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.dash-card {
    min-width: 0;
    min-height: 84px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--category-border, var(--border-color));
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.06);
    text-align: left;
    color: var(--text-primary);
}

.dash-card:hover {
    border-color: var(--category-color, var(--btn-dark));
    transform: translateY(-2px);
}

.dash-card.active {
    border-color: var(--btn-dark);
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--btn-dark);
}

.dash-card.active .dash-title {
    color: var(--text-primary) !important;
}

.dash-card.active .dash-subtitle {
    color: var(--text-secondary);
}

.dash-left {
    min-width: 0;
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.dash-icon {
    display: flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--category-background, #eaf3fb);
    color: var(--category-color, var(--btn-dark));
}

.dash-icon svg {
    width: 23px;
    height: 23px;
}

.dash-content {
    display: block;
    min-width: 0;
    overflow: hidden;
}

.dash-title {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

.dash-arrow {
    display: flex;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--category-color, var(--btn-dark));
    color: #ffffff;
}

.dash-arrow svg {
    width: 16px;
    height: 16px;
}

.all-contacts-toggle {
    min-height: 48px;
    gap: 10px;
    padding: 8px 14px;
    border-color: var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.06);
    font-size: 16px;
}

.all-contacts-toggle[hidden] {
    display: none;
}

.all-contacts-toggle:hover {
    background: #ffffff;
    border-color: var(--btn-dark);
}

.all-contacts-count {
    margin-left: auto;
    border-radius: 999px;
    background: var(--color-primary-light, #eaf3fb);
    padding: 2px 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.all-contacts-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.all-contacts-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.section {
    margin-bottom: 32px;
}

.section-header {
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.section-title {
    gap: 10px;
    color: var(--text-primary);
    font-size: 20px;
    letter-spacing: 0;
    text-transform: none;
}

.section-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.section-icon svg {
    width: 20px;
    height: 20px;
}

.section-count {
    flex-shrink: 0;
    border-radius: 999px;
    background: #eaf3fb;
    padding: 4px 12px;
    color: var(--text-primary);
    font-size: 13px;
    text-align: center;
}

.card-list {
    gap: 10px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.06);
}

.card.is-emergency {
    border-left: 4px solid #a51f1f;
    background: linear-gradient(to right, rgba(253, 231, 231, 0.6), #ffffff);
}

.contact-info {
    min-width: 0;
    padding-right: 0;
}

.contact-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.contact-name {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.badge-urgente {
    border-radius: 4px;
    background: #fde7e7;
    padding: 2px 6px;
    color: #a51f1f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.number-row {
    min-height: 40px;
    justify-content: space-between;
    gap: 8px;
}

.contact-number {
    min-width: 0;
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.btn-copy {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-primary);
}

.btn-copy svg {
    width: 20px;
    height: 20px;
}

.contact-desc {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.45;
}

.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.btn-wa,
.btn-call {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    height: auto;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
}

.btn-wa {
    border: 1px solid #a7d7b6;
    background: #e4f6e9;
    color: #166534;
}

.btn-wa:hover {
    background: #d4f0dc;
}

.btn-call {
    grid-column: 2;
    background: var(--btn-dark);
    color: #ffffff;
}

.btn-call:hover {
    background: var(--btn-dark-hover);
}

.btn-wa svg,
.btn-call svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-wa svg {
    fill: currentColor;
}

.empty-state {
    margin: 24px 0;
    padding: 32px 20px;
    border-color: var(--border-color);
    border-radius: 20px;
    background: #ffffff;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(23, 63, 103, 0.06);
}

.empty-state-icon {
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--color-primary-light, #eaf3fb);
    color: var(--btn-dark);
}

.empty-state-icon svg {
    width: 24px;
    height: 24px;
}

.empty-state h2 {
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 18px;
}

.empty-state p {
    line-height: 1.5;
}

.empty-reset-btn {
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--btn-dark);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

footer {
    position: relative;
    overflow: hidden;
    margin-top: 32px;
    padding: 56px 0 0;
    border: 0;
    font-size: 14px;
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    pointer-events: none;
}

.footer-content {
    position: relative;
    border-top: 1px solid var(--border-color);
    padding: 20px 8px 24px;
}

.footer-community {
    color: var(--text-primary);
    font-family: cursive;
    font-size: 24px;
    font-style: italic;
    font-weight: 700;
}

.footer-title {
    margin-top: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.sync-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    font-size: 14px;
}

.sync-btn-footer {
    min-height: 40px;
    color: var(--btn-dark);
    font-size: 14px;
}

.company-card {
    border-color: var(--border-color);
}

.company-label,
.company-name,
.company-pill {
    font-size: 14px;
}

.company-pill {
    min-height: 44px;
}

.toast {
    max-width: calc(100% - 32px);
    width: max-content;
    bottom: calc(82px + env(safe-area-inset-bottom));
    font-size: 15px;
    text-align: center;
}

@media (max-width: 480px) {
    body {
        padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
    }

    .top-nav-left {
        gap: 6px;
    }

    .city-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-install-pwa {
        padding: 8px 10px;
        font-size: 12px;
    }

    .top-company-badge {
        padding: 3px;
    }

    .top-company-name {
        display: none;
    }

    .banner-logo {
        min-height: 96px;
        gap: 10px;
        padding: 12px;
    }

    .banner-logo svg {
        width: 54px;
        height: 62px;
    }

    .banner-title {
        font-size: 20px;
    }

    .banner-address {
        font-size: 10px;
        letter-spacing: 0.3px;
    }

    .section-intro h1 {
        font-size: 26px;
    }

    .dashboard-grid {
        gap: 8px;
    }

    .dash-card {
        min-height: 76px;
        gap: 4px;
        padding: 6px;
    }

    .dash-left {
        gap: 4px;
    }

    .dash-icon {
        width: 36px;
        height: 36px;
    }

    .dash-icon svg {
        width: 20px;
        height: 20px;
    }

    .dash-title {
        font-size: 15px;
    }

    .dash-subtitle {
        font-size: 12px;
    }

    .dash-arrow {
        width: 20px;
        height: 20px;
    }

    .dash-arrow svg {
        width: 13px;
        height: 13px;
    }

    .section-count {
        padding: 4px 8px;
        font-size: 12px;
    }

    .contact-name {
        font-size: 19px;
    }

    .contact-number {
        font-size: 17px;
    }

    .btn-wa,
    .btn-call {
        font-size: 15px;
    }

    .floating-panic-btn {
        right: 12px;
    }
}

@media (max-width: 350px) {
    .dash-card {
        gap: 5px;
        padding: 8px 6px;
    }

    .dash-icon {
        width: 34px;
        height: 34px;
    }

    .dash-title {
        font-size: 14px;
    }

    .dash-arrow {
        width: 20px;
        height: 20px;
    }

    .btn-wa,
    .btn-call {
        gap: 4px;
        padding: 6px 4px;
        font-size: 13px;
    }
}
