:root {
  color-scheme: light dark;
  --teal: #3a8f8a;
  --rust: #c17850;
  --yellow: #e8d97a;
  --ink: light-dark(#172023, #f4fbfa);
  --muted: light-dark(#5d686b, #a9b7b7);
  --line: light-dark(rgb(20 30 32 / 14%), rgb(255 255 255 / 16%));
  --glass: light-dark(rgb(255 255 255 / 48%), rgb(255 255 255 / 8%));
  --glass-strong: light-dark(rgb(255 255 255 / 68%), rgb(255 255 255 / 12%));
  --bg-a: light-dark(#edf9f7, #090f10);
  --bg-b: light-dark(#fff5df, #132324);
  --bg-c: light-dark(#f4e9dc, #2a1e17);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-a), var(--bg-b), var(--bg-c));
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
}

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.login-card,
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: 0 22px 50px rgb(0 0 0 / 14%);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.login-card {
  width: min(440px, 100%);
  padding: 24px;
}

.logo {
  display: block;
  width: min(310px, 100%);
  margin: 0 auto 24px;
}

.card {
  padding: 16px;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.header {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 8vw, 42px);
}

h2 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.field,
.select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--glass-strong);
  padding: 13px 14px;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  color: white;
  font-weight: 700;
}

.primary {
  background: linear-gradient(135deg, var(--teal), var(--rust));
  box-shadow: 0 14px 28px rgb(58 143 138 / 22%);
}

.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--glass-strong);
}

.danger {
  background: #b94444;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.between {
  justify-content: space-between;
}

.tabs {
  position: fixed;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 14px;
  z-index: 20;
  display: grid;
  max-width: 720px;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: 0 18px 40px rgb(0 0 0 / 18%);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

.tab {
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 700;
}

.tab.active {
  color: white;
  background: var(--teal);
}

.metric {
  display: grid;
  gap: 4px;
}

.metric strong {
  font-size: 28px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.item:last-child {
  border-bottom: 0;
}

.calendar-head,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-name {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.day {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink);
  background: transparent;
  padding: 6px;
  text-align: center;
}

.day.today {
  border-color: var(--teal);
}

.day.selected {
  background: rgb(58 143 138 / 18%);
}

.day.out {
  opacity: 0.45;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-height: 6px;
  margin-top: 5px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  background: rgb(232 217 122 / 26%);
  color: var(--rust);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.avatar {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--teal);
  object-fit: cover;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
}

.announcement-image {
  width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 18px;
  object-fit: cover;
}

a {
  color: var(--teal);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.notice {
  color: var(--rust);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (display-mode: standalone) {
  .install-hint {
    display: none;
  }
}
