/* ============================================================
   Barangay Gas Leakage Monitoring System — Complete Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #F4F5F7; color: #111827; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── App shell ─────────────────────────────────────────────── */
.app-body      { display: flex; height: 100vh; overflow: hidden; }
.main-content  { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.page-body     { flex: 1; overflow-y: auto; padding: 24px; background: #F4F5F7; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: 215px; flex-shrink: 0;
    background: #6B1010;
    color: #fff;
    display: flex; flex-direction: column;
    height: 100vh; position: sticky; top: 0;
    z-index: 200; transition: transform 0.25s;
}
.sidebar-header {
    padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-wrap {
    width: 44px; height: 44px; background: rgba(255,255,255,0.15);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 700; line-height: 1.45; }
.sidebar-nav   { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    color: rgba(255,255,255,0.68); font-size: 13px;
    text-decoration: none; margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.nav-item:hover              { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active             { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }
.nav-item.active::before     { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:#fff; border-radius:0 3px 3px 0; }
.nav-item svg                { flex-shrink: 0; }
.nav-badge { background:#DC2626; color:#fff; font-size:9px; font-weight:700; padding:1px 5px; border-radius:10px; min-width:17px; text-align:center; }
.sidebar-footer { padding:16px; border-top:1px solid rgba(255,255,255,0.1); text-align:center; }
.sidebar-footer p { font-size:11px; opacity:0.62; line-height:1.65; margin-top:8px; }

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
    background: #fff; border-bottom: 1px solid #E5E7EB;
    height: 60px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.topbar-left   { display: flex; align-items: center; gap: 12px; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn { background:none; border:none; cursor:pointer; padding:6px; border-radius:6px; color:#6B7280; display:none; }
.topbar-title  { font-size: 18px; font-weight: 700; color: #CC0000; margin: 0; }
.topbar-notif-btn { position:relative; background:none; border:none; cursor:pointer; padding:6px; border-radius:8px; color:#374151; display:flex; align-items:center; }
.notif-badge   { position:absolute; top:0; right:0; background:#DC2626; color:#fff; font-size:9px; font-weight:700; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.btn-logout    { display:flex; align-items:center; gap:6px; background:#DC2626; color:#fff; border:none; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; text-decoration:none; cursor:pointer; transition:filter 0.15s; }
.btn-logout:hover { filter:brightness(0.9); }

/* ── Footer ────────────────────────────────────────────────── */
.app-footer { background:#fff; border-top:1px solid #E5E7EB; padding:10px 24px; display:flex; justify-content:space-between; align-items:center; font-size:11.5px; color:#6B7280; flex-shrink:0; }

/* ── Dashboard stat cards ──────────────────────────────────── */
.stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:20px; }
.stat-card { border-radius:14px; padding:22px; display:flex; align-items:center; gap:16px; position:relative; overflow:hidden; }
.stat-danger  { background:#DC2626; }
.stat-warning { background:#F59E0B; }
.stat-safe    { background:#16A34A; }
.stat-icon-circle { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon-danger  { background:rgba(255,255,255,0.22); }
.stat-icon-warning { background:rgba(255,255,255,0.22); }
.stat-icon-safe    { background:rgba(255,255,255,0.22); }
.stat-info { flex:1; min-width:0; }
.stat-label  { font-size:13px; font-weight:600; color:rgba(255,255,255,0.9); margin-bottom:2px; }
.stat-number { font-size:40px; font-weight:800; color:#fff; line-height:1.1; }
.stat-sub    { font-size:11.5px; color:rgba(255,255,255,0.75); margin-top:2px; }
.stat-bg-icon { position:absolute; right:-8px; bottom:-8px; pointer-events:none; }

/* ── House cards ───────────────────────────────────────────── */
.house-grid  { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:20px; }
.house-card  { border-radius:12px; overflow:hidden; background:#fff; transition:box-shadow 0.2s, transform 0.2s; }
.house-card:hover { box-shadow:0 4px 20px rgba(0,0,0,0.10); transform:translateY(-2px); }
.house-card-top   { padding:18px 18px 10px; display:flex; justify-content:space-between; align-items:flex-start; }
.house-card-name  { font-size:16px; font-weight:700; color:#111827; margin-bottom:5px; }
.house-card-addr  { font-size:12px; color:#6B7280; display:flex; align-items:center; gap:4px; }
.house-card-badge { padding:0 18px 12px; }
.house-card-footer{ padding:11px 18px; display:flex; justify-content:flex-end; }
.view-link { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; text-decoration:none; }
.view-link:hover { opacity:0.75; }

/* ── Status badges ─────────────────────────────────────────── */
.hbadge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; letter-spacing:0.3px; }
.hbadge-danger  { background:#FEE2E2; color:#DC2626; }
.hbadge-warning { background:#FEF3C7; color:#D97706; }
.hbadge-safe    { background:#DCFCE7; color:#16A34A; }

/* ── Analytics card ────────────────────────────────────────── */
.analytics-card   { background:#fff; border:1px solid #E5E7EB; border-radius:14px; padding:20px; }
.analytics-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.analytics-title  { font-size:16px; font-weight:700; color:#DC2626; }
.analytics-date-pill { display:flex; align-items:center; gap:6px; font-size:12px; color:#6B7280; background:#F9FAFB; padding:6px 12px; border-radius:8px; border:1px solid #E5E7EB; }
.analytics-charts-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.chart-panel      { background:#FAFAFA; border-radius:10px; border:1px solid #E5E7EB; padding:14px; }
.chart-panel-title{ font-size:12.5px; font-weight:700; color:#111827; margin-bottom:2px; }
.chart-canvas-wrap{ position:relative; }
.chart-legend     { display:flex; flex-direction:column; gap:4px; margin-top:8px; }
.legend-row       { display:flex; align-items:center; gap:6px; font-size:11px; color:#6B7280; }
.legend-dot       { width:8px; height:8px; border-radius:2px; display:inline-block; flex-shrink:0; }
.area-summary     { display:flex; flex-direction:column; margin-top:8px; }
.area-sum-row     { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid #F3F4F6; font-size:12.5px; color:#6B7280; }
.area-sum-row strong { font-size:18px; font-weight:800; color:#111827; }
.area-sum-left    { display:flex; align-items:center; gap:8px; }
.area-sum-icon    { width:26px; height:26px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* ── Gas bar ───────────────────────────────────────────────── */
.gas-bar-track { height:7px; background:#F3F4F6; border-radius:4px; overflow:hidden; width:100%; }
.gas-bar-fill  { height:100%; border-radius:4px; transition:width 0.4s; }

/* ── Page section header ───────────────────────────────────── */
.page-header   { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
.section-title { font-size:18px; font-weight:700; color:#111827; }

/* ── House alerts list ─────────────────────────────────────── */
.list-stack    { display:flex; flex-direction:column; gap:10px; }
.alert-row     { background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:16px 20px; display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.alert-row-left{ display:flex; align-items:center; gap:14px; flex:1; min-width:180px; }
.alert-avatar  { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; flex-shrink:0; }
.alert-avatar-danger  { background:#FEE2E2; color:#DC2626; }
.alert-avatar-warning { background:#FEF3C7; color:#D97706; }
.alert-avatar-safe    { background:#DCFCE7; color:#16A34A; }
.alert-name    { font-weight:700; font-size:14px; color:#111827; margin-bottom:2px; }
.alert-addr    { font-size:12px; color:#6B7280; }
.alert-meta    { font-size:12px; color:#9CA3AF; margin-top:2px; }
.alert-row-right { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.alert-gas-display { text-align:center; }
.alert-gas-label { font-size:11px; color:#6B7280; margin-bottom:2px; }
.alert-gas-num { font-size:22px; font-weight:800; }
.alert-bar-wrap{ width:100%; padding-top:4px; }
.eta-badge { background:#EFF6FF; color:#1D4ED8; font-size:11px; font-weight:600; padding:3px 8px; border-radius:6px; }
.btn-view-sm { font-size:12px; font-weight:600; color:#DC2626; text-decoration:none; border:1px solid #E5E7EB; padding:6px 12px; border-radius:6px; white-space:nowrap; transition:background 0.15s; }
.btn-view-sm:hover { background:#FEF2F2; }
.filter-tabs   { display:flex; gap:6px; }
.filter-tab    { padding:6px 14px; border-radius:8px; font-size:12px; font-weight:600; text-decoration:none; border:1px solid; transition:all 0.15s; }

/* ── Map ───────────────────────────────────────────────────── */
.map-layout      { display:grid; grid-template-columns:1fr 285px; gap:16px; }
.map-panel       { background:#fff; border:1px solid #E5E7EB; border-radius:14px; padding:16px; }
.map-legend      { display:flex; gap:16px; margin-top:12px; }
.map-leg         { display:flex; align-items:center; gap:5px; font-size:12px; color:#374151; }
.map-dot         { width:10px; height:10px; border-radius:50%; display:inline-block; }
.map-side-panel  { background:#fff; border:1px solid #E5E7EB; border-radius:14px; padding:14px; display:flex; flex-direction:column; }
.map-side-title  { font-size:13px; font-weight:700; color:#111827; margin-bottom:10px; }
.map-side-scroll { display:flex; flex-direction:column; gap:8px; overflow-y:auto; flex:1; max-height:460px; }
.map-list-card   { display:block; padding:10px 12px; background:#FAFAFA; border:1px solid #E5E7EB; border-radius:10px; transition:box-shadow 0.15s; }
.map-list-card:hover { box-shadow:0 2px 8px rgba(0,0,0,0.08); }
.map-list-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.map-list-name   { font-weight:600; font-size:13px; color:#111827; }
.map-list-addr   { font-size:11px; color:#6B7280; margin-bottom:4px; }

/* ── Reports ───────────────────────────────────────────────── */
.sum-row { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid #F3F4F6; }
.sum-row:last-child { border-bottom:none; }

/* ── Residents ─────────────────────────────────────────────── */
.res-grid    { display:grid; grid-template-columns:repeat(auto-fill,minmax(235px,1fr)); gap:16px; }
.res-card    { background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:16px; transition:box-shadow 0.2s, transform 0.2s; }
.res-card:hover { box-shadow:0 4px 14px rgba(0,0,0,0.08); transform:translateY(-1px); }
.res-card-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.res-avatar  { width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; flex-shrink:0; }
.res-name    { font-weight:700; font-size:14px; color:#111827; margin-bottom:4px; }
.res-details { margin-bottom:8px; }
.res-detail-row { font-size:12px; color:#6B7280; margin-bottom:3px; }
.res-view-btn { display:block; text-align:center; background:#FEF2F2; color:#DC2626; font-size:13px; font-weight:600; padding:8px; border-radius:8px; transition:background 0.15s; }
.res-view-btn:hover { background:#FEE2E2; }

/* ── Devices ───────────────────────────────────────────────── */
.mini-stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px; }
.mini-stat      { background:#fff; border:1px solid #E5E7EB; border-radius:10px; padding:14px 16px; display:flex; align-items:center; gap:12px; }
.mini-stat-icon { font-size:22px; }
.mini-stat-label{ font-size:11px; color:#6B7280; }
.mini-stat-num  { font-size:22px; font-weight:800; }
.type-badge     { background:#F3F4F6; color:#374151; font-size:11px; font-weight:600; padding:2px 8px; border-radius:6px; }

/* ── Notifications ─────────────────────────────────────────── */
.notif-row     { display:flex; align-items:flex-start; gap:14px; background:#fff; border:1px solid #E5E7EB; border-radius:12px; padding:14px 18px; }
.notif-unread  { border-color:#FECACA; background:#FFF8F8; }
.notif-icon    { width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.notif-body    { flex:1; min-width:0; }
.notif-text    { font-size:13.5px; color:#111827; line-height:1.5; }
.notif-time    { font-size:11px; color:#9CA3AF; margin-top:3px; }
.unread-dot    { width:8px; height:8px; border-radius:50%; background:#DC2626; flex-shrink:0; margin-top:4px; }

/* ── Settings ──────────────────────────────────────────────── */
.settings-heading { font-size:14px; font-weight:700; color:#111827; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid #E5E7EB; }
.form-group  { margin-bottom:14px; }
.form-label  { display:block; font-size:13px; font-weight:600; color:#111827; margin-bottom:5px; }
.form-input  { width:100%; padding:9px 12px; border:1.5px solid #E5E7EB; border-radius:8px; font-size:13px; color:#111827; background:#FAFAFA; transition:border-color 0.15s; font-family:inherit; }
.form-input:focus { outline:none; border-color:#DC2626; }
.toggle-row  { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; font-size:13px; color:#111827; }
.toggle      { width:44px; height:24px; border-radius:12px; background:#D1D5DB; cursor:pointer; position:relative; transition:background 0.2s; flex-shrink:0; }
.toggle.toggle-on { background:#DC2626; }
.toggle-knob { width:20px; height:20px; border-radius:50%; background:#fff; position:absolute; top:2px; left:2px; transition:left 0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.25); }
.toggle.toggle-on .toggle-knob { left:22px; }

/* ── Shared components ─────────────────────────────────────── */
.card-plain     { background:#fff; border:1px solid #E5E7EB; border-radius:12px; overflow:hidden; }
.data-table     { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th  { padding:10px 14px; text-align:left; font-size:12px; font-weight:600; color:#6B7280; background:#F9FAFB; border-bottom:1px solid #E5E7EB; white-space:nowrap; }
.data-table td  { padding:12px 14px; border-bottom:1px solid #F3F4F6; color:#111827; }
.data-table tbody tr:last-child td { border-bottom:none; }
.data-table tbody tr:hover td { background:#FAFAFA; }
.btn-primary-sm { background:#DC2626; color:#fff; border:none; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; transition:filter 0.15s; }
.btn-primary-sm:hover { filter:brightness(0.9); }
.btn-ghost      { background:transparent; color:#6B7280; border:1px solid #E5E7EB; padding:8px 16px; border-radius:8px; font-size:13px; cursor:pointer; }
.btn-ghost:hover { background:#F9FAFB; }
.search-input   { padding:8px 14px; border:1.5px solid #E5E7EB; border-radius:8px; font-size:13px; min-width:250px; font-family:inherit; }
.search-input:focus { outline:none; border-color:#DC2626; }

/* ════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════ */
.login-page     { background:#fff; }
.login-wrapper  { display:flex; min-height:100vh; }
.login-left     { flex:0 0 420px; background:linear-gradient(160deg,#8B1010 0%,#4A0808 100%); padding:48px 40px; display:flex; flex-direction:column; color:#fff; position:relative; overflow:hidden; }
.login-left::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 30% 20%,rgba(255,255,255,0.07) 1px,transparent 1px); background-size:28px 28px; }
.login-left-inner { position:relative; z-index:1; flex:1; }
.login-logo     { width:80px; height:80px; border-radius:50%; background:rgba(255,255,255,0.13); border:2px solid rgba(255,255,255,0.22); display:flex; align-items:center; justify-content:center; font-size:34px; margin-bottom:24px; }
.login-title    { display:flex; flex-direction:column; margin-bottom:6px; }
.title-white    { font-size:28px; font-weight:800; line-height:1.2; }
.title-accent   { font-size:28px; font-weight:800; color:#FF8C8C; line-height:1.2; }
.login-sub      { font-size:13px; opacity:0.8; margin-bottom:8px; }
.login-divider  { width:40px; height:3px; background:#FF6B6B; border-radius:2px; margin-bottom:20px; }
.login-desc     { font-size:13px; opacity:0.75; line-height:1.7; margin-bottom:32px; }
.login-features { list-style:none; display:flex; flex-direction:column; gap:16px; }
.login-features li { display:flex; gap:14px; align-items:flex-start; }
.feat-icon      { width:36px; height:36px; background:rgba(255,255,255,0.15); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.login-features strong { display:block; font-size:14px; font-weight:600; margin-bottom:2px; }
.login-features p { font-size:12px; opacity:0.7; line-height:1.5; }
.login-left-footer { position:relative; z-index:1; font-size:12px; opacity:0.5; margin-top:32px; }
.login-right    { flex:1; display:flex; align-items:center; justify-content:center; background:#fff; padding:40px; }
.login-form-box { width:100%; max-width:400px; }
.login-flame    { width:56px; height:56px; background:#FEE2E2; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:28px; margin:0 auto 16px; }
.login-heading  { font-size:22px; font-weight:700; color:#111827; text-align:center; margin-bottom:6px; }
.login-subhead  { font-size:14px; color:#6B7280; text-align:center; margin-bottom:28px; }
.alert-error    { background:#FEE2E2; color:#DC2626; border:1px solid #FECACA; padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:16px; }
.input-group    { position:relative; }
.input-prefix   { position:absolute; left:12px; top:50%; transform:translateY(-50%); font-size:16px; color:#9CA3AF; pointer-events:none; }
.input-toggle   { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; font-size:16px; color:#9CA3AF; cursor:pointer; }
.form-inp       { width:100%; padding:11px 12px 11px 40px; border:1.5px solid #E5E7EB; border-radius:8px; font-size:14px; color:#111827; background:#FAFAFA; transition:border-color 0.15s; font-family:inherit; }
.form-inp:focus { outline:none; border-color:#DC2626; background:#fff; }
.form-row-mid   { display:flex; justify-content:space-between; align-items:center; margin:4px 0 20px; }
.checkbox-lbl   { display:flex; align-items:center; gap:8px; font-size:13px; color:#6B7280; cursor:pointer; }
.checkbox-lbl input { accent-color:#DC2626; }
.forgot-link    { font-size:13px; font-weight:600; color:#DC2626; }
.btn-login      { width:100%; background:#DC2626; color:#fff; border:none; padding:12px; border-radius:8px; font-size:15px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:filter 0.15s; font-family:inherit; }
.btn-login:hover { filter:brightness(0.9); }
.btn-user-login { width:100%; background:#fff; color:#111827; border:1.5px solid #E5E7EB; padding:11px; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:background 0.15s; font-family:inherit; }
.btn-user-login:hover { background:#F9FAFB; }
.or-sep         { text-align:center; position:relative; margin:16px 0; font-size:13px; color:#9CA3AF; }
.or-sep::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background:#E5E7EB; }
.or-sep span    { position:relative; background:#fff; padding:0 12px; }
.login-info-box { margin-top:16px; background:#F9FAFB; border-radius:8px; padding:10px 14px; border:1px solid #E5E7EB; display:flex; align-items:flex-start; gap:10px; font-size:12px; color:#6B7280; line-height:1.5; }
.login-copy     { text-align:center; font-size:12px; color:#9CA3AF; margin-top:24px; line-height:1.7; }

/* ── House detail ──────────────────────────────────────────── */
.detail-layout  { display:grid; grid-template-columns:1fr 1.35fr; gap:24px; }
.detail-info    { display:flex; flex-direction:column; gap:0; }
.detail-header  { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px; }
.detail-name    { font-size:26px; font-weight:800; color:#111827; }
.detail-timestamp { font-size:12px; color:#6B7280; text-align:right; line-height:1.7; }
.detail-info-item { display:flex; gap:14px; align-items:flex-start; padding:10px 0; border-bottom:1px solid #F9FAFB; }
.detail-info-item:last-child { border-bottom:none; }
.detail-icon-box { width:34px; height:34px; background:#F9FAFB; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.detail-item-label { font-size:11px; color:#9CA3AF; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:2px; }
.detail-item-value { font-size:14px; color:#111827; font-weight:500; }
.detail-item-sub   { font-size:12px; color:#6B7280; margin-top:2px; }
.detail-map     { border-radius:12px; overflow:hidden; border:1px solid #E5E7EB; min-height:300px; }
.detail-map iframe { width:100%; height:100%; min-height:300px; display:block; }
.map-no-coords  { height:300px; display:flex; align-items:center; justify-content:center; background:#E8F4FD; color:#6B7280; font-size:14px; }
.map-legend-overlay { display:flex; gap:12px; margin-top:10px; font-size:11px; }
.back-btn       { display:inline-flex; align-items:center; gap:6px; font-size:14px; color:#6B7280; margin-bottom:20px; padding:6px 10px; border-radius:6px; transition:background 0.15s; }
.back-btn:hover { background:#E5E7EB; color:#111827; }
.detail-footer-bar { display:flex; justify-content:space-between; align-items:center; background:#fff; border-radius:10px; border:1px solid #E5E7EB; padding:12px 20px; margin-top:16px; }
.detail-footer-note { font-size:13px; color:#6B7280; }
.btn-outline-red { background:transparent; color:#DC2626; border:1.5px solid #DC2626; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; transition:background 0.15s; }
.btn-outline-red:hover { background:#FEF2F2; }
.gauge-svg      { display:block; }
.risk-label     { font-weight:800; font-size:14px; text-align:center; margin-top:4px; }
.risk-desc      { font-size:10.5px; color:#6B7280; text-align:center; margin-top:5px; line-height:1.5; }
.info-box-warn  { background:#FEF3C7; border-radius:8px; padding:8px 10px; font-size:11px; color:#92400E; text-align:center; margin-top:8px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width:1100px) { .analytics-charts-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width:900px)  { .house-grid{grid-template-columns:repeat(2,1fr);} .stat-grid{grid-template-columns:repeat(3,1fr);} .map-layout{grid-template-columns:1fr;} .detail-layout{grid-template-columns:1fr;} }
@media (max-width:768px)  {
    .sidebar{position:fixed;left:0;top:0;bottom:0;transform:translateX(-100%);box-shadow:4px 0 20px rgba(0,0,0,0.3);}
    .sidebar.open{transform:translateX(0);}
    .topbar-menu-btn{display:flex;}
    .stat-grid,.house-grid{grid-template-columns:1fr;}
    .analytics-charts-grid,.mini-stats-row{grid-template-columns:1fr 1fr;}
    .login-wrapper{flex-direction:column;}
    .login-left{flex:none;padding:32px 24px;}
    .login-features{display:none;}
    .login-right{padding:24px;}
}
@media print { .sidebar,.topbar,.app-footer,.back-btn,.detail-footer-bar{display:none!important;} .main-content{display:block;} .page-body{padding:0;} }

/* ── Sidebar user panel ────────────────────────────────────── */
.sidebar-user { padding:12px 14px; margin:4px 8px; background:rgba(255,255,255,0.08); border-radius:10px; display:flex; align-items:center; gap:10px; }
.sidebar-user-avatar { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,0.2); border:1.5px solid rgba(255,255,255,0.3); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:#fff; flex-shrink:0; }
.sidebar-user-info { min-width:0; }
.sidebar-user-name { font-size:12px; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role { font-size:10px; color:rgba(255,255,255,0.6); margin-top:1px; }

/* ── Alert error with icon ─────────────────────────────────── */
.alert-error { background:#FEE2E2; color:#DC2626; border:1px solid #FECACA; padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:16px; display:flex; align-items:flex-start; gap:8px; line-height:1.5; }
