:root {
  --bg: #1c1d1a;
  --bg-card: #252722;
  --bg-elev: #2f322b;
  --border: #3a3e35;
  --text: #e6e2d8;
  --muted: #a39f93;
  --accent: #b86b43;
  --accent-hover: #c97a50;
  --olive: #56734a;
  --gold: #bfa065;
  --danger: #a85448;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3, .oswald {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(28, 29, 26, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-elev);
  border: 1px solid rgba(184, 107, 67, 0.55);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--text);
}

.brand-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.header-user {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-root {
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
}

.page-title {
  font-size: 23px;
  margin-bottom: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-done {
  background: rgba(86, 115, 74, 0.22);
  color: #a8c69b;
  border: 1px solid rgba(116, 150, 102, 0.45);
}

.badge-planned {
  background: rgba(191, 160, 101, 0.16);
  color: #d4bc8b;
  border: 1px solid rgba(191, 160, 101, 0.38);
}

.badge-active {
  background: rgba(184, 107, 67, 0.20);
  color: #dfa07e;
  border: 1px solid rgba(184, 107, 67, 0.45);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f4ee;
}

.btn-olive {
  background: var(--olive);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f4ee;
}

.btn-danger {
  background: rgba(168, 84, 72, 0.16);
  border-color: rgba(168, 84, 72, 0.45);
  color: #e09f96;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 13px;
  width: auto;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.input, .select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  background: #1f211d;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--gold);
}

input[type="date"].input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  margin-top: 10px;
}

.set-row {
  display: grid;
  grid-template-columns: 34px 1fr 1fr 48px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.set-num {
  font-family: 'Oswald', sans-serif;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.set-check {
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #1f211d;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.set-check.done {
  background: var(--olive);
  border-color: #6d8f5f;
  color: #f7f4ee;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
}

.stat-lbl {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.cal-cell {
  min-height: 42px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.cal-cell.selected {
  border-color: var(--accent);
  background: var(--bg-elev);
}

.cal-cell.has-done {
  border-color: rgba(116, 150, 102, 0.65);
  background: rgba(86, 115, 74, 0.24);
}

.cal-cell.has-planned {
  border-color: rgba(191, 160, 101, 0.65);
  background: rgba(191, 160, 101, 0.10);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(30, 32, 28, 0.96);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  backdrop-filter: blur(10px);
}

.nav-btn {
  min-height: 58px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-btn.active {
  color: var(--gold);
  border-top: 2px solid var(--accent);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 13, 11, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 16px;
}

.hidden {
  display: none !important;
}

.toast-root {
  position: fixed;
  top: 68px;
  left: 16px;
  right: 16px;
  z-index: 60;
  background: var(--bg-elev);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
