:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --teal-900: #084f49;
  --teal-700: #0b776c;
  --teal-100: #e4f4f1;
  --red-700: #d70015;
  --red-100: #fff0f1;
  --blue-700: #0071e3;
  --blue-100: #edf5ff;
  --amber-700: #9a6700;
  --amber-100: #fff7df;
  --shadow: 0 8px 30px rgba(0, 0, 0, .06);
}

html { background: var(--canvas); }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
h1, h2, h3, strong { color: var(--ink); }
h1 { font-size: 2.1rem; font-weight: 760; }
h2 { font-size: 1.35rem; font-weight: 720; }
button, input, select, textarea { border-radius: 8px; }

.app-header {
  min-height: 64px;
  color: #f5f5f7;
  background: rgba(29, 29, 31, .96);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(20px);
}
.brand-logo { width: 52px; height: 44px; border-radius: 7px; }
.active-role-button {
  color: #f5f5f7;
  background: rgba(255,255,255,.12);
}
.active-role-button:hover, .header-icon:hover, .compact-button:hover { background: rgba(255,255,255,.2); }
.header-icon, .compact-button { color: #f5f5f7; }
.compact-button { background: rgba(255,255,255,.12); }
.badge { color: #fff; background: var(--red-700); }

.app-layout { grid-template-columns: 246px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.side-nav {
  top: 64px;
  height: calc(100vh - 64px);
  padding: 25px 14px 34px;
  border-right: 1px solid #dedee3;
  background: rgba(245,245,247,.94);
  backdrop-filter: saturate(170%) blur(18px);
}
.nav-section + .nav-section { margin-top: 19px; }
.nav-section-label {
  padding: 0 12px 7px;
  color: #86868b;
  font-size: .67rem;
  font-weight: 720;
}
.nav-button {
  min-height: 44px;
  padding: 10px 12px;
  color: #424245;
  font-weight: 650;
}
.nav-button:hover { color: #1d1d1f; background: rgba(255,255,255,.72); }
.nav-button.active {
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 3px 16px rgba(0,0,0,.07), inset 0 0 0 1px rgba(0,0,0,.04);
}
.nav-button.active svg { color: var(--teal-700); }

.view-root { width: 100%; max-width: 1500px; margin: 0 auto; padding: 44px 48px 88px; }
.page-head {
  margin-bottom: 34px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { margin-bottom: 7px; }
.page-head p { max-width: 720px; color: var(--muted); font-size: .96rem; }

.summary-grid { gap: 16px; margin-bottom: 38px; }
.summary-tile {
  position: relative;
  min-height: 138px;
  padding: 25px 21px 20px;
  overflow: hidden;
  border: 0;
  border-left: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.035);
}
.summary-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--teal-700);
}
.summary-tile.blue::before { background: var(--blue-700); }
.summary-tile.amber::before { background: #d49a00; }
.summary-tile.red::before { background: var(--red-700); }
.summary-tile span { color: var(--muted); font-size: .76rem; font-weight: 720; text-transform: uppercase; }
.summary-tile strong { font-size: 2.2rem; font-weight: 740; }

.section-band {
  margin: 0 0 36px;
  padding: 29px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.section-head { margin-bottom: 19px; }
.section-head p { color: var(--muted); }
.result-list, .member-list, .group-list, .notification-list, .timeline { gap: 12px; }
.list-row, .dashboard-link, .timeline-card, .member-card, .group-card, .notification-card {
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 22px rgba(0,0,0,.05), inset 0 0 0 1px rgba(0,0,0,.045);
}
.list-row { padding: 19px 20px; transition: transform .18s ease, box-shadow .18s ease; }
.list-row:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0,0,0,.08), inset 0 0 0 1px rgba(0,0,0,.045); }
.timeline-card { border-left: 4px solid var(--teal-700); }
.dashboard-link { transition: transform .18s ease, box-shadow .18s ease; }
.dashboard-link:hover { transform: translateY(-1px); box-shadow: 0 9px 26px rgba(0,0,0,.08); }

.primary-button { color: #fff; background: var(--blue-700); }
.primary-button:hover { background: #0077ed; }
.secondary-button { color: #1d1d1f; background: #e8e8ed; }
.secondary-button:hover { background: #dedee3; }
.danger-button { color: #b40012; background: var(--red-100); }
.callout { border-radius: 8px; }
.status-pill { border-radius: 999px; }
input, select, textarea { border-color: #c7c7cc; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(0,113,227,.14); }

.modal, .mobile-nav-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
}
.option-button { border-color: #dedee3; background: #fff; }
.option-button:hover { background: #f5f5f7; }
.mobile-nav-section + .mobile-nav-section { border-top-color: #dedee3; }

.login-shell { background: #f5f5f7; }
.login-panel {
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.12);
  backdrop-filter: blur(24px);
}
.login-panel .primary-button { background: #1d1d1f; }
.login-panel .primary-button:hover { background: #353537; }

@media (max-width: 720px) {
  h1 { font-size: 1.78rem; }
  .app-header { min-height: calc(66px + env(safe-area-inset-top)); }
  .view-root { padding: 28px 15px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { gap: 14px; margin-bottom: 25px; padding-bottom: 20px; }
  .summary-grid { gap: 10px; margin-bottom: 29px; }
  .summary-tile { min-height: 112px; padding: 20px 14px 15px; }
  .summary-tile span { font-size: .7rem; }
  .summary-tile strong { font-size: 1.78rem; }
  .section-band { padding-top: 23px; }
  .list-row { padding: 16px; }
  button.mobile-menu-button {
    color: #fff;
    background: rgba(29,29,31,.96);
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
    backdrop-filter: blur(18px);
  }
  .mobile-nav-dialog { background: rgba(255,255,255,.98); backdrop-filter: blur(24px); }
}

@media print {
  .section-band { border-top: 0; }
  .summary-tile, .list-row { box-shadow: none; }
}
