/* ---- LIFE — Unified Typography & Design System ---- */
.life-v6,
#life-assessment-wizard-modal,
#life-careplan-modal,
.modal-life-wizard,
.modal-life-careplan {
    font-family: 'Inter', 'Noto Sans JP', 'Meiryo', 'Yu Gothic', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.life-v6 input,
.life-v6 select,
.life-v6 textarea,
.life-v6 button,
.life-v6 table,
.life-v6 th,
.life-v6 td,
#life-assessment-wizard-modal input,
#life-assessment-wizard-modal select,
#life-assessment-wizard-modal textarea,
#life-assessment-wizard-modal button,
#life-assessment-wizard-modal table,
#life-careplan-modal input,
#life-careplan-modal select,
#life-careplan-modal textarea,
#life-careplan-modal button,
#life-careplan-modal table {
    font-family: 'Inter', 'Noto Sans JP', 'Meiryo', 'Yu Gothic', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.life-v6-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--ov6-surface);
    border: 1px solid var(--ov6-border-soft);
    border-radius: var(--ov6-radius);
    box-shadow: var(--ov6-shadow);
}

.life-v6-sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ov6-text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.life-v6-sub-btn:hover {
    background: var(--ov6-bg);
    color: var(--ov6-text);
}

.life-v6-sub-btn.active {
    background: var(--ov6-success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.life-v6-sub-btn i { font-size: 10px; }

.life-v6 .life-subpanel.hidden {
    display: none !important;
}

.life-v6 .life-subpanel:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.life-v6 .life-subpanel > .grid > div,
.life-v6 .life-subpanel .bg-white.p-5.rounded-2xl,
.life-v6 .life-subpanel .bg-white.p-6.rounded-2xl,
.life-v6 .life-subpanel .bg-white.rounded-2xl.border {
    background: var(--ov6-surface) !important;
    border-color: var(--ov6-border-soft) !important;
    border-radius: var(--ov6-radius) !important;
    box-shadow: var(--ov6-shadow) !important;
}

.life-v6 .life-subpanel h3,
.life-v6 .life-subpanel h4 {
    color: var(--ov6-text) !important;
}

.life-v6 .life-subpanel .bg-slate-50 {
    background: var(--ov6-bg) !important;
}

.life-v6 .life-subpanel table thead {
    background: var(--ov6-bg) !important;
}

.life-v6 .life-subpanel .border-slate-200 {
    border-color: var(--ov6-border-soft) !important;
}

.life-v6 .life-subpanel button.bg-blue-600,
.life-v6 .life-subpanel button.bg-indigo-600,
.life-v6 .life-subpanel button.bg-emerald-600 {
    border-radius: 10px !important;
    font-weight: 800 !important;
}

@media (max-width: 767px) {
    .life-v6-subnav { gap: 6px; }
    .life-v6-sub-btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
    .att-v6-btn-orange { width: 100%; }
}

/* ---- LIFE Floor Map (compact) ---- */
.life-floor-panel {
    padding: 12px 14px !important;
}

.life-floor-map-wrap {
    overflow-x: auto;
    padding: 0;
}

.life-floor-map {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px;
    background: #eef2f6;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.life-floor-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.life-floor-corridor {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 0;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.45);
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.life-room-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    padding: 8px 10px;
    background: #ffffff;
    border: 1.5px solid #e8edf2;
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.life-room-card:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.life-room-card--selected {
    border-color: #22c55e;
    background: #f0fdf4;
}

.life-room-card--online:not(.life-room-card--selected) {
    border-color: #bbf7d0;
}

.life-room-card--alert {
    border-color: #f59e0b;
    background: #fffbeb;
}

.life-room-card--alert-high {
    border-color: #ef4444;
    background: #fef2f2;
}

.life-room-title {
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    line-height: 1.1;
}

.life-room-sensors {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.life-sensor-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    min-width: 0;
}

.life-sensor-pill > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.life-sensor-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #64748b;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.life-sensor-dot--muted { background: #cbd5e1; }
.life-sensor-dot--offline { background: #cbd5e1; }
.life-sensor-dot--empty { background: #94a3b8; }
.life-sensor-dot--online { background: #64748b; }
.life-sensor-dot--active { background: #10b981; }
.life-sensor-dot--sitting { background: #3b82f6; }
.life-sensor-dot--alert { background: #f59e0b; }
.life-sensor-dot--alert-high { background: #ef4444; }

@media (max-width: 900px) {
    .life-floor-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .life-sensor-pill > span:last-child {
        max-width: 42px;
    }
}

/* Ensure tables inside LIFE tab scroll horizontally and don't overflow the viewport */
.life-v6,
.life-v6 .grid,
.life-v6 .life-subpanel,
.life-v6 .bg-white,
.life-v6 .xl\:col-span-2 {
    min-width: 0 !important;
}

.life-v6 .overflow-x-auto {
    overflow-x: auto !important;
    max-width: 100% !important;
    display: block !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

