:root {
  --bg: #f7f2e8;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdf8;
  --stroke: rgba(71, 52, 30, 0.12);
  --text: #25190f;
  --muted: #6a5644;
  --green: #2f7d4e;
  --red: #b53a2d;
  --shadow: 0 22px 60px rgba(66, 45, 21, 0.12);
  --radius-xl: 24px;
  --radius-md: 14px;
  --left-panel-width: 31%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(241, 203, 167, 0.8), transparent 34%),
    linear-gradient(135deg, #f6efe1 0%, #f1e2ce 48%, #efe7d8 100%);
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, var(--left-panel-width)) 12px minmax(0, 1fr);
}

.left-panel,
.right-panel {
  padding: 24px;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.right-panel {
  border-left: 1px solid rgba(71, 52, 30, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 249, 241, 0.72), rgba(255, 255, 255, 0.82)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 34px,
      rgba(184, 92, 56, 0.03) 34px,
      rgba(184, 92, 56, 0.03) 35px
    );
}

.panel-resizer {
  position: relative;
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(71, 52, 30, 0.02), rgba(71, 52, 30, 0.08));
}

.panel-resizer::before {
  content: "";
  position: absolute;
  inset: 24px 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(184, 92, 56, 0.18), rgba(71, 52, 30, 0.12));
}

.card,
.hero-strip {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.brand-card,
.card,
.hero-strip {
  padding: 22px;
}

.brand-card {
  border-radius: 28px;
  color: #fff7f1;
  background: linear-gradient(135deg, rgba(95, 41, 20, 0.92), rgba(184, 92, 56, 0.9));
  box-shadow: 0 26px 50px rgba(95, 41, 20, 0.28);
}

.brand-card h1,
.hero-strip h2,
.auth-title,
.admin-card h3 {
  margin: 6px 0;
}

.auth-brand {
  min-height: 100%;
}

.brand-note {
  color: #f4dfcf;
  line-height: 1.6;
}

.workspace-stack,
.entry-form,
.stack {
  display: grid;
  gap: 14px;
}

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

.compact {
  margin: 4px 0 0;
}

.eyebrow,
.tiny-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.93rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(71, 52, 30, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

.primary-button,
.secondary-button,
.danger-button,
.auth-tab,
.page-tab,
.chart-period-btn,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, #9d4325, #c46d48);
  color: #fff8f3;
}

.secondary-button,
.button-link,
.chart-period-btn {
  background: rgba(71, 52, 30, 0.08);
  color: var(--text);
}

.danger-button {
  background: rgba(181, 58, 45, 0.12);
  color: var(--red);
}

.auth-tabs,
.page-tabs,
.chart-period-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(71, 52, 30, 0.1);
}

.auth-tab.active,
.page-tab.active,
.chart-period-btn.active {
  background: linear-gradient(135deg, #9d4325, #c46d48);
  color: #fff8f3;
}

.helper-box,
.message-box,
.date-badge,
.pill,
.stat-pill {
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(71, 52, 30, 0.1);
}

.helper-box {
  background: rgba(184, 92, 56, 0.08);
}

.message-box {
  font-weight: 700;
}

.hero-strip,
.section-head,
.user-bar,
.rules-head,
.history-head,
.board-day,
.section-title-row,
.chart-row,
.history-filter-card,
.inline-fields,
.sound-grid,
.rule-row,
.toolbar-actions,
.entry-item-top,
.user-card {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.78);
}

.stat-pill span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-pill strong {
  font-size: 1.45rem;
}

.board-content,
.history-list {
  display: grid;
  gap: 18px;
}

.summary-grid,
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.mini-card,
.history-card,
.chart-card,
.history-date-block,
.history-filter-card,
.user-card {
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(71, 52, 30, 0.1);
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(66, 45, 21, 0.08);
  padding: 18px;
}

.mini-card strong {
  display: block;
  font-size: 1.8rem;
}

.history-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
}

.history-entry-grid,
.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.board-column {
  background: var(--panel-strong);
  border: 1px solid rgba(71, 52, 30, 0.1);
  border-radius: 20px;
  overflow: hidden;
}

.column-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(71, 52, 30, 0.08);
  background: linear-gradient(135deg, rgba(184, 92, 56, 0.14), rgba(184, 92, 56, 0.04));
}

.entry-list {
  max-height: 65vh;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.entry-item,
.history-entry-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(247, 242, 232, 0.72);
  border: 1px solid rgba(71, 52, 30, 0.08);
}

.entry-item strong,
.history-entry-item strong {
  display: block;
}

.entry-meta,
.history-entry-item span,
.history-entry-item small {
  color: var(--muted);
}

.rule-form {
  flex: 1;
  display: grid;
  gap: 12px;
}

.user-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-card {
  display: grid;
  gap: 14px;
}

.chart-label {
  width: 180px;
  display: grid;
  gap: 4px;
}

.chart-bar-wrap {
  flex: 1;
  height: 16px;
  border-radius: 999px;
  background: rgba(71, 52, 30, 0.08);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  min-width: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b85c38, #e3a27d);
}

.chart-bar.alternate {
  background: linear-gradient(90deg, #4d7a5a, #9bc28e);
}

.column-chart {
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 14px;
  align-items: end;
}

.column-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: end;
  text-align: center;
}

.column-bar-wrap {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(71, 52, 30, 0.02), rgba(71, 52, 30, 0.08));
}

.column-bar {
  width: 100%;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #e3a27d, #b85c38);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 18px;
  color: white;
  box-shadow: var(--shadow);
}

.toast-success {
  background: #2f7d4e;
}

.toast-error {
  background: #b53a2d;
}

.empty-box {
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .auth-layout,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel-resizer {
    display: none;
  }

  .hero-strip,
  .section-head,
  .user-bar,
  .rules-head,
  .history-head,
  .board-day,
  .section-title-row,
  .chart-row,
  .history-filter-card,
  .inline-fields,
  .sound-grid,
  .rule-row,
  .toolbar-actions,
  .entry-item-top,
  .user-card {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-label {
    width: auto;
  }

  .entry-list {
    max-height: none;
  }
}
