:root {
  --bg: #f6f9fc;
  --text: #0d1b2a;
  --muted: #5b6b7c;
  --line: #d8e3f0;
  --accent: #1167d8;
  --accent-dark: #0b3f91;
  --sos-navy: #08265a;
  --sos-teal: #18b7b5;
}

.app-sidebar { border-right-color: var(--line); }
.app-brand { display: flex; flex-direction: row; align-items: center; gap: 10px; padding-bottom: 24px; }
.app-brand .brand-logo { width: 38px; height: 38px; object-fit: contain; }
.app-brand strong { color: var(--sos-navy); font-size: 22px; }
.app-brand small { color: #45617e; font-size: 11px; }
.sidebar-institution { margin-top: auto; padding: 18px 10px 13px; border-top: 1px solid #edf0f5; }
.sidebar-institution small { display: block; margin-bottom: 7px; color: #718096; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.sidebar-institution img { display: block; width: 118px; max-width: 100%; height: auto; }
.sidebar-institution + .sidebar-foot { margin-top: 0; }
.side-link.active { color: var(--sos-navy); background: #e8f3fb; box-shadow: inset 3px 0 0 var(--sos-teal); }
.app-topbar { border-top: 3px solid var(--sos-navy); }
.topbar-title small { color: var(--accent-dark); }
.primary-action { background: var(--accent); }
.feature-card:hover { border-color: var(--sos-teal); }

.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 300px); gap: 34px; align-items: center; padding: clamp(28px, 4vw, 48px); margin-bottom: 32px; border-radius: 18px; color: #fff; background: linear-gradient(125deg, #08265a 0%, #0b3f91 56%, #147f9e 100%); overflow: hidden; }
.home-kicker { display: block; margin-bottom: 14px; color: #9aede7; font-size: 11px; font-weight: 750; letter-spacing: .15em; }
.home-hero h1 { max-width: 720px; margin: 0 0 12px; font-size: clamp(30px, 4.2vw, 51px); font-weight: 750; line-height: 1.08; letter-spacing: -.045em; }
.home-hero p { max-width: 610px; margin: 0 0 26px; color: #e5f4fc; font-size: clamp(14px, 1.5vw, 17px); }
.home-hero-action { display: inline-flex; align-items: center; gap: 15px; min-height: 44px; padding: 10px 17px; border-radius: 8px; background: #fff; color: var(--sos-navy); font-weight: 700; text-decoration: none; }
.home-hero-action:hover { background: #e8f9f7; color: var(--sos-navy); }
.home-hero-brand { min-width: 0; padding: 24px; border: 1px solid #ffffff4d; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px #001b4070; text-align: center; }
.home-hero-brand img { display: block; width: 100%; height: auto; }
.home-hero-brand span { display: block; margin-top: 12px; color: #45617e; font-size: 12px; font-weight: 650; }

.health-section { margin-bottom: 32px; }
.health-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.health-heading h2, .health-preview h2 { margin: 0 0 3px; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.health-heading p, .health-preview p { margin: 0; color: var(--muted); }
.health-heading > a { flex: none; font-weight: 650; text-decoration: none; }
.health-summary { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; border: 1px solid; border-radius: 12px; background: #fff; }
.health-summary strong { display: block; margin-bottom: 3px; font-size: 18px; line-height: 1.3; }
.health-summary p { margin: 0 0 5px; color: #45586b; }
.health-summary small { color: #5b6b7c; }
.health-indicator { flex: none; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; background: #718096; box-shadow: 0 0 0 5px #71809621; }
.health-good { border-color: #9ad9c5; background: #f4fcf9; }
.health-good .health-indicator { background: #15805f; box-shadow: 0 0 0 5px #15805f20; }
.health-attention { border-color: #f2ce8a; background: #fffbf2; }
.health-attention .health-indicator { background: #aa6900; box-shadow: 0 0 0 5px #aa690020; }
.health-unavailable { border-color: #cbd5e1; background: #f8fafc; }
.health-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.health-service { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.service-indicator { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.service-active { background: #15805f; }
.service-problem { background: #b45309; }
.health-service-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.health-service-state { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.health-preview { margin-bottom: 32px; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

.resource-section { margin-bottom: 32px; }
.resource-live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.resource-live i { width: 8px; height: 8px; border-radius: 50%; background: #19a974; box-shadow: 0 0 0 4px #19a97418; }
.resource-chart-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.resource-chart-card { display: flex; align-items: center; gap: 18px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 3px 14px #08265a0a; }
.resource-chart-card > div:last-child { min-width: 0; }
.resource-chart-card > div > small { color: #64748b; font-size: 10px; font-weight: 750; letter-spacing: .11em; }
.resource-chart-card h3 { margin: 4px 0 3px; color: var(--text); font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.resource-chart-card p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-ring { --ring-color:#1766d5; position: relative; display: grid; place-items: center; width: 92px; height: 92px; flex: 0 0 92px; border-radius: 50%; background: conic-gradient(var(--ring-color) calc(var(--usage) * 1%),#e6edf5 0); }
.resource-ring::before { content:""; position:absolute; inset:10px; border-radius:50%; background:#fff; }
.resource-ring span { position:relative; color:#17324d; font-size:20px; font-weight:750; letter-spacing:-.03em; }
.resource-ring span small { font-size:11px; margin-left:1px; }
.resource-ring-warning { --ring-color:#d17a00; }

.login-card { border-top: 4px solid var(--sos-navy); }
.login-brand { display: block; width: 150px; max-width: 100%; height: auto; margin-bottom: 25px; object-fit: contain; object-position: left center; }

@media (max-width: 1050px) {
  .home-hero { grid-template-columns: 1fr; gap: 22px; }
  .home-hero-brand { width: min(100%, 270px); }
  .health-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero-brand { width: min(100%, 270px); }
  .health-heading { align-items: flex-start; flex-direction: column; }
  .health-service-grid { grid-template-columns: 1fr; }
  .health-summary { padding: 18px; }
  .resource-chart-card { padding: 18px; }
  .resource-ring { width: 78px; height: 78px; flex-basis: 78px; }
}
