:root {
  --chili: #9F1D20;
  --chili-dark: #7F171A;
  --chili-deep: #651216;
  --chili-soft: #F7E9EA;
  --chili-glow: rgba(159, 29, 32, .08);
  --ink: #17202A;
  --muted: #6B7280;
  --surface: rgba(255,255,255,.94);
  --line: #E5E1E0;
  --bg: #F5F5F6;
  --green: #2F7D66;
  --green-soft: #EDF6F2;
  --blue: #4666A8;
  --blue-soft: #EEF2FA;
  --amber: #B97A20;
  --amber-soft: #FBF3E5;
  --purple: #7258A3;
  --purple-soft: #F3EFF8;
  --burgundy: #98495A;
  --burgundy-soft: #F8EEF1;
  --shadow-sm: 0 2px 8px rgba(31, 41, 55, .035);
  --shadow-md: 0 4px 14px rgba(31, 41, 55, .05);
  --radius: 20px;
}

html { background: var(--bg); }
body {
  color: var(--ink) !important;
  background: #F5F5F6 !important;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--chili-dark);
  z-index: 9999;
  pointer-events: none;
}

/* App identity */
.brand h1,
.top h1,
.app > h1 {
  letter-spacing: -.025em;
  color: #111827;
}
.brand h1::before,
.top h1::before,
.app > h1::before {
  content: "";
  display: inline-block;
  width: 42px;
  height: 42px;
  margin-right: 10px;
  vertical-align: -12px;
  background: url('/icon-192.png') center/contain no-repeat;
  filter: none;
}

/* Login */
.wrap { padding-top: 54px !important; }
.wrap .brand { margin-bottom: 24px !important; }
.wrap .brand h1::before {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  vertical-align: initial;
  filter: none;
}
.wrap .brand h1 { font-size: 34px !important; }
.wrap .brand p { color: #74676A !important; font-weight: 600; }
.wrap .card {
  border: 1px solid rgba(159,29,32,.12) !important;
  border-radius: 24px !important;
  box-shadow: none !important;
  background: #FFFFFF !important;
  position: relative;
  overflow: hidden;
}
.wrap .card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--chili-dark);
}
.wrap .foot { color: #817477 !important; }

/* Form controls */
select,
input[type="text"],
input[type="password"],
input[type="time"],
input[type="date"] {
  border-color: #D9D4D5 !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
select:focus,
input:focus {
  outline: none !important;
  border-color: var(--chili) !important;
  box-shadow: none !important;
}
button,
.action {
  background: var(--chili) !important;
  color: white !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
button:active,
.action:active { transform: translateY(1px) scale(.995); }
.action.secondary {
  background: white !important;
  color: var(--chili-dark) !important;
  border: 1px solid rgba(159,29,32,.20) !important;
  box-shadow: none !important;
}
.message {
  background: #FBF4F4 !important;
  color: var(--chili-dark) !important;
  border: 1px solid rgba(159,29,32,.14);
}

/* Dashboard header */
.topbar {
  padding: 12px 4px 2px;
  align-items: center !important;
}
.brand p { color: #74676A !important; font-weight: 600; }
.logout {
  color: var(--chili-dark) !important;
  background: rgba(255,255,255,.92) !important;
  border-color: rgba(159,29,32,.20) !important;
  box-shadow: none;
  font-weight: 700;
}
.welcome {
  background: #FFFFFF !important;
  border: 1px solid rgba(159,29,32,.10) !important;
  border-radius: var(--radius) !important;
  box-shadow: none;
  padding: 16px 18px !important;
  position: relative;
  overflow: hidden;
}
.welcome::after { display: none; }

/* KPI cards */
.summary { gap: 12px !important; }
.summary-card {
  border: 0 !important;
  border-radius: 19px !important;
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 15px 14px !important;
  background: #fff !important;
}
.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent, var(--chili));
}
.summary-card::after { display: none !important; }
.summary-card:nth-child(1) { --accent: var(--green); background: #FFFFFF !important; }
.summary-card:nth-child(2) { --accent: var(--blue); background: #FFFFFF !important; }
.summary-card:nth-child(3) { --accent: var(--amber); background: #FFFFFF !important; }
.summary-card:nth-child(4) { --accent: var(--purple); background: #FFFFFF !important; }
.summary-card:nth-child(5) { --accent: var(--burgundy); background: #FFFFFF !important; }
.summary-card strong { font-size: 28px !important; color: var(--accent, var(--ink)); }
.summary-card span { font-weight: 650; }

.section-title {
  font-size: 20px !important;
  letter-spacing: -.015em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 24px;
  border-radius: 999px;
  background: var(--chili);
}
.member-card,
.item,
.card,
.empty {
  border: 1px solid rgba(31,41,55,.09) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  background: var(--surface) !important;
}
.member-card {
  padding: 16px !important;
  position: relative;
  overflow: hidden;
}
.member-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #E5E7EB;
}
.member-card:has(.status-office)::before { background: var(--green); }
.member-card:has(.status-meeting)::before { background: var(--blue); }
.member-card:has(.status-outside)::before { background: var(--amber); }
.member-card:has(.status-program)::before { background: var(--purple); }
.member-card:has(.status-leave)::before { background: var(--burgundy); }
.member-name { font-size: 15px; }
.member-position { color: #7D7275 !important; }
.member-info { color: #4B5563; }
.updated-time { color: #8A7C80 !important; border-top-color: #ECE7E8 !important; }
.you-pill {
  background: var(--chili) !important;
  box-shadow: none;
}
.status-office { background: var(--green-soft) !important; color: #0E6847 !important; }
.status-meeting { background: var(--blue-soft) !important; color: #1F55B5 !important; }
.status-outside { background: var(--amber-soft) !important; color: #9A6000 !important; }
.status-program { background: var(--purple-soft) !important; color: #6930C3 !important; }
.status-leave { background: var(--burgundy-soft) !important; color: #9E243A !important; }
.status-unknown { background: #F2F1F0 !important; color: #756B68 !important; }

/* Status page */
.back { color: var(--chili-dark) !important; }
.status-option label {
  border-radius: 18px !important;
  border-color: #DED8D5 !important;
  box-shadow: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.status-option:nth-child(1) label { border-left: 5px solid var(--green) !important; }
.status-option:nth-child(2) label { border-left: 5px solid var(--blue) !important; }
.status-option:nth-child(3) label { border-left: 5px solid var(--amber) !important; }
.status-option:nth-child(4) label { border-left: 5px solid var(--purple) !important; }
.status-option:nth-child(5) label { border-left: 5px solid var(--burgundy) !important; }
.status-option input:checked + label {
  border-color: var(--chili) !important;
  background: #FBF4F4 !important;
  color: var(--chili-dark) !important;
  box-shadow: none !important;
  transform: none;
}

/* Upcoming */
.item { position: relative; overflow: hidden; }
.item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--amber);
}
.date { color: var(--chili-dark) !important; }
.ongoing-pill {
  background: var(--green) !important;
  color: #fff !important;
  box-shadow: none;
}

/* Activity */
.activity-page .item,
.app .item { transition: transform .15s ease, box-shadow .15s ease; }
.status { color: var(--chili-dark); }
.time { color: var(--chili-dark) !important; }

/* Bottom navigation */
.bottom-nav {
  border: 1px solid rgba(31,41,55,.09) !important;
  border-bottom: 0 !important;
  border-radius: 22px 22px 0 0;
  box-shadow: none;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom)) !important;
  background: rgba(255,255,255,.96) !important;
  backdrop-filter: blur(16px);
}
.bottom-nav a {
  border-radius: 14px;
  font-weight: 650;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.bottom-nav a.active {
  color: var(--chili-dark) !important;
  background: var(--chili-soft);
  font-weight: 800 !important;
}

/* Headings and page shell */
.app { padding-top: 26px !important; }
.subtitle { color: #776B6E !important; }
.card { padding: 18px !important; }

@media (hover:hover) {
  .member-card:hover,
  .item:hover,
  .summary-card:hover { transform: none; box-shadow: none !important; }
  button:hover,
  .action:hover { filter: brightness(.98); box-shadow: none !important; }
}

@media (max-width: 599px) {
  body::before { height: 5px; }
  .app { padding-left: 16px !important; padding-right: 16px !important; }
  .brand h1 { font-size: 28px !important; }
  .brand h1::before { width: 28px; height: 28px; }
  .summary { gap: 10px !important; }
  .summary-card { min-height: 100px; padding: 16px !important; }
  .summary-card strong { font-size: 30px !important; }
  .quick-actions { gap: 10px !important; }
  .action { min-height: 52px; display: flex !important; align-items: center; justify-content: center; }
  .member-card { padding: 17px 16px !important; }
  .member-name { font-size: 16px; }
  .bottom-nav { width: calc(100% - 18px) !important; bottom: 0; }
  .bottom-nav a { font-size: 11px !important; flex-direction: column; gap: 1px; padding: 6px 3px !important; }
  .wrap { padding-left: 18px !important; padding-right: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}


/* V1.1.2 Premium Visual Refinement */
.brand h1,
.top h1,
.app > h1 { line-height: 1.08; }
.brand h1::before,
.top h1::before,
.app > h1::before { background-color: transparent; }

.member-card:has(.status-unknown) {
  background: #FFFFFF !important;
}
.member-card:has(.status-unknown)::before { background: #C9C7C5 !important; }
.updated-time {
  font-size: 12px !important;
  line-height: 1.35;
  color: #786C6F !important;
  letter-spacing: .005em;
}

/* Premium empty states */
.empty-state {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px 20px !important;
  background: #FFFFFF !important;
  border: 1px dashed rgba(159,29,32,.18) !important;
}
.empty-state img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  opacity: .88;
  filter: none;
}
.empty-state strong {
  font-size: 15px;
  color: #2B2526;
}
.empty-state span {
  max-width: 310px;
  font-size: 13px;
  line-height: 1.45;
  color: #7A7072;
}

/* Refined navigation */
.bottom-nav {
  box-shadow: none !important;
  border-color: rgba(31,41,55,.07) !important;
}
.bottom-nav a {
  position: relative;
  color: #62666D !important;
}
.bottom-nav a.active {
  color: var(--chili-dark) !important;
  background: #FBF3F3 !important;
  box-shadow: none;
}

/* Calm page cards */
.card,
.item,
.member-card,
.empty,
.welcome {
  box-shadow: none !important;
}

@media (max-width: 599px) {
  .brand h1::before,
  .top h1::before,
  .app > h1::before { width: 36px; height: 36px; vertical-align: -10px; }
  .brand h1 { font-size: 29px !important; }
  .updated-time { font-size: 12px !important; }
  .empty-state { min-height: 142px; padding: 22px 18px !important; }
  .empty-state img { width: 54px; height: 54px; }
}


/* V1.1.3 Clean Flat Refinement — approved cleanup */
.summary-card::after { display: none !important; content: none !important; }
.welcome::after { display: none !important; content: none !important; }
.bottom-nav a::before, .bottom-nav a::after { display: none !important; content: none !important; }
.welcome, .summary-card, .member-card, .card, .item, .empty, .status-option label, .bottom-nav, button, .action, .logout, .you-pill, .ongoing-pill {
  box-shadow: none !important;
}
.welcome, .summary-card, .member-card, .card, .item, .empty { background-image: none !important; }
.summary-card { background: #FFFFFF !important; }
button, .action { background-image: none !important; }


/* V1.3.2 Action Colour Hierarchy — semantic, flat, no shadow */
:root {
  --urbi-live: #9F1D20;
  --urbi-live-soft: #F7E9EA;
  --urbi-status: #1F7665;
  --urbi-status-soft: #EAF4F1;
  --urbi-upcoming: #9A6418;
  --urbi-upcoming-soft: #FAF0E1;
  --urbi-activity: #6B4FA1;
  --urbi-activity-soft: #F0ECF7;
  --urbi-notify: #315A9A;
}

.action.action-status {
  background: var(--urbi-status) !important;
  border-color: var(--urbi-status) !important;
  color: #fff !important;
}
.action.action-status:active { background: #18594D !important; }

.action.action-upcoming {
  background: var(--urbi-upcoming) !important;
  border-color: var(--urbi-upcoming) !important;
  color: #fff !important;
}
.action.action-upcoming:active { background: #7D500F !important; }

.action.action-discuss {
  background: var(--urbi-live) !important;
  border-color: var(--urbi-live) !important;
  color: #fff !important;
}
.action.action-discuss:active { background: #7F171A !important; }

button.notification-button {
  background: var(--urbi-notify) !important;
  border: 1px solid var(--urbi-notify) !important;
  color: #fff !important;
}
button.notification-button:active {
  background: #264879 !important;
  border-color: #264879 !important;
}
button.notification-button.active {
  background: var(--urbi-status) !important;
  border-color: var(--urbi-status) !important;
  color: #fff !important;
}

.bottom-nav {
  gap: 6px !important;
}
.bottom-nav a {
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
}
.bottom-nav a.nav-live {
  background: var(--urbi-live-soft) !important;
  color: #8C1A1D !important;
}
.bottom-nav a.nav-status {
  background: var(--urbi-status-soft) !important;
  color: #176052 !important;
}
.bottom-nav a.nav-upcoming {
  background: var(--urbi-upcoming-soft) !important;
  color: #825311 !important;
}
.bottom-nav a.nav-activity {
  background: var(--urbi-activity-soft) !important;
  color: #5D468D !important;
}
.bottom-nav a.nav-live.active {
  background: var(--urbi-live) !important;
  color: #fff !important;
  border-color: var(--urbi-live) !important;
}
.bottom-nav a.nav-status.active {
  background: var(--urbi-status) !important;
  color: #fff !important;
  border-color: var(--urbi-status) !important;
}
.bottom-nav a.nav-upcoming.active {
  background: var(--urbi-upcoming) !important;
  color: #fff !important;
  border-color: var(--urbi-upcoming) !important;
}
.bottom-nav a.nav-activity.active {
  background: var(--urbi-activity) !important;
  color: #fff !important;
  border-color: var(--urbi-activity) !important;
}

/* V1.4.0 Interactive Activity Calendar */
.view-tab,
.today-button,
.add-button,
.filter-button,
.day-cell,
.submit-button {
  box-shadow: none !important;
  background-image: none !important;
}
.day-cell:focus-visible,
.view-tab:focus-visible,
.today-button:focus-visible,
.add-button:focus-visible,
.filter-button:focus-visible {
  outline: 3px solid rgba(154,100,24,.22) !important;
  outline-offset: 2px;
}
.calendar-event,
.calendar-card,
.form-card,
.list-panel {
  box-shadow: none !important;
}
