.app-shell { display: flex; min-height: 100vh; }
.app-shell[hidden], .login-screen[hidden] { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20;
  flex: 0 0 260px;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; text-decoration: none; padding: 0 8px; }
.brand-logo { display: block; width: min(190px, 100%); height: auto; }
.unit-name { margin: 20px 8px 8px; padding: 12px; background: var(--red-soft); border-radius: 10px; color: var(--red); font-weight: 800; font-size: 14px; }
.unit-name small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--ink-2); }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #9aa0ab; font-weight: 700; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav a .ico { width: 20px; text-align: center; color: #9aa0ab; }
.nav a:hover { background: #f3f4f6; color: var(--red); }
.nav a.active { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(155, 34, 38, .25); }
.nav a.active .ico { color: #fff; }

.main { margin-left: 260px; min-width: 0; min-height: 100vh; display: flex; flex: 1; flex-direction: column; }
.hero {
  background: radial-gradient(900px 300px at 85% -20%, rgba(255, 255, 255, .14), transparent 60%),
              linear-gradient(120deg, #6e1519 0%, #9b2226 55%, #b5302f 100%);
  color: #fff; padding: 30px 36px 34px;
}
.hero-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.hero p { opacity: .85; font-size: 14px; }

.view { padding: 28px 36px 40px; flex: 1; width: 100%; }
.footer { padding: 18px 36px; font-size: 12px; color: #d9dbe0; background: #26272c; }

.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); position: relative; padding-bottom: 6px; }
.section-head h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 2px; background: var(--red); }
.section-head small { color: var(--muted); font-size: 12.5px; }
.section-action { margin-left: auto; }

.grid { display: grid; gap: 16px; }
.g-6 { grid-template-columns: repeat(6, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-c4 { grid-template-columns: repeat(4, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-21 { grid-template-columns: 2fr 1fr; }

@media (max-width: 1280px) {
  .g-6 { grid-template-columns: repeat(3, 1fr); }
  .g-3, .g-c4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .unit-name { display: none; }
  .nav { flex-direction: row; overflow-x: auto; margin-top: 10px; flex: none; }
  .nav-group { display: none; }
  .nav a { white-space: nowrap; }
  .app-shell { flex-direction: column; }
  .main { margin-left: 0; }
  .hero, .view, .footer { padding-left: 18px; padding-right: 18px; }
  .g-6, .g-4, .g-3, .g-c4, .g-2, .g-21 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .g-6, .g-4, .g-3, .g-c4, .g-2, .g-21 { grid-template-columns: 1fr; }
}
