:root {
  --bg: #f5efe8;
  --bg-strong: #efe0d3;
  --card: rgba(255, 250, 245, 0.88);
  --card-strong: rgba(255, 248, 242, 0.96);
  --text: #1d2230;
  --muted: #5f6373;
  --line: rgba(65, 72, 94, 0.12);
  --brand: #185a4d;
  --brand-dark: #103d35;
  --brand-soft: #d9efe8;
  --accent: #ca6d3f;
  --accent-soft: #f7e3d7;
  --danger: #b43f3f;
  --danger-soft: rgba(180, 63, 63, 0.1);
  --shadow: 0 24px 55px rgba(40, 32, 52, 0.14);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(24, 90, 77, 0.14), transparent 18%),
    radial-gradient(circle at bottom right, rgba(202, 109, 63, 0.14), transparent 20%),
    linear-gradient(145deg, #fbf7f2 0%, var(--bg) 52%, var(--bg-strong) 100%);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

h1,
h2,
h3,
strong {
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.94;
  max-width: 10ch;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.9rem;
}

.hero {
  margin-bottom: 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.hero-copy {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.session-card,
.form-card,
.result-card,
.history-card,
.auth-card,
.auth-side-card,
.profile-card,
.admin-card {
  padding: 24px;
}

.session-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
}

.session-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.badge {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-soft {
  background: rgba(24, 90, 77, 0.08);
}

.pill {
  background: rgba(29, 34, 48, 0.06);
  color: var(--text);
}

.status-banner {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 90, 77, 0.14);
  background: rgba(24, 90, 77, 0.08);
  color: var(--brand-dark);
  font-weight: 700;
}

.status-banner.is-error {
  border-color: rgba(180, 63, 63, 0.18);
  background: rgba(180, 63, 63, 0.08);
  color: #8e2929;
}

.status-banner.is-success {
  border-color: rgba(24, 90, 77, 0.18);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 22px;
}

.auth-side-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(24, 90, 77, 0.12), transparent 24%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(243, 234, 225, 0.92));
}

.feature-list {
  margin: 18px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.app-shell {
  display: grid;
  gap: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-tile {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(24, 90, 77, 0.08);
  background: var(--card-strong);
  display: grid;
  gap: 6px;
}

.mini-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 22px;
}

form {
  display: grid;
  gap: 12px;
}

.form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-split > div {
  display: grid;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  font-weight: 700;
}

input,
select,
button,
textarea {
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select,
textarea {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(24, 90, 77, 0.18);
  border-color: rgba(24, 90, 77, 0.34);
}

button {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 800;
  color: #f8f3ef;
  background: linear-gradient(135deg, var(--brand) 0%, #247564 100%);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(24, 90, 77, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.8);
  color: var(--brand);
}

.danger-button {
  background: rgba(180, 63, 63, 0.12);
  color: #922d2d;
  box-shadow: none;
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(24, 90, 77, 0.22);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
}

.hidden {
  display: none !important;
}

.result-panel {
  display: grid;
  gap: 20px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.result-label,
.metric-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-head h3 {
  margin: 0;
  font-size: 2rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(227, 242, 236, 0.76));
  border: 1px solid rgba(24, 90, 77, 0.08);
}

.metric-card strong {
  font-size: 1.48rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.history-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-box {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid rgba(24, 90, 77, 0.08);
}

.summary-box span {
  font-size: 0.85rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.users-wrap table {
  min-width: 640px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.44);
}

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

.editable-row td {
  vertical-align: top;
}

.edited-row {
  background: rgba(180, 63, 63, 0.08);
}

.edited-row:hover {
  background: rgba(180, 63, 63, 0.12);
}

.table-input {
  width: 100%;
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 90, 77, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.table-input.table-number {
  min-width: 76px;
}

.table-select {
  width: 100%;
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 90, 77, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.amount-editor {
  display: grid;
  grid-template-columns: minmax(76px, 92px) minmax(120px, 1fr);
  gap: 8px;
}

.amount-meta {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.edited-row .table-input,
.edited-row .table-select {
  background: rgba(255, 236, 236, 0.92);
  border-color: rgba(180, 63, 63, 0.28);
}

.edited-row .amount-meta {
  color: #9b2f2f;
}

.table-input:focus,
.table-select:focus {
  outline: 2px solid rgba(180, 63, 63, 0.16);
  border-color: rgba(180, 63, 63, 0.32);
}

.status-cell {
  min-width: 180px;
}

.status-stack {
  display: grid;
  gap: 10px;
}

.status-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(24, 90, 77, 0.1);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
}

.edited-row .status-note {
  background: rgba(180, 63, 63, 0.14);
  color: #9b2f2f;
}

.row-action {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(202, 109, 63, 0.12);
  color: var(--accent);
  box-shadow: none;
  width: fit-content;
  white-space: nowrap;
}

.row-action.is-confirming {
  background: rgba(180, 63, 63, 0.16);
  color: #992d2d;
}

.placeholder-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

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

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 24px, 1200px);
    padding-top: 24px;
  }

  .history-header,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .metric-grid,
  .profile-summary,
  .form-split {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
  }
}
