:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #412a30;
  background: #fff7ef;
  --paper: #fffdf9;
  --ink: #412a30;
  --berry: #8b3453;
  --berry-dark: #6d2540;
  --muted: #6e545b;
  --line: #ead8d2;
  --field-line: #ac8f93;
  --rose: #fae7ec;
  --shadow: 0 8px 28px #5d2e3910;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #ffefe7, transparent 40rem);
  line-height: 1.5;
}

.site-header {
  padding: 16px 0;
  color: #fffaf6;
  background: linear-gradient(105deg, #432731, #612e46);
  border-bottom: 3px solid #e6a8ba;
}

.wrap { width: min(100%, 800px); margin-inline: auto; padding-inline: 20px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #ffebdf;
  font-size: 23px;
}
.brand strong { font: 700 1.25rem/1.2 Georgia, serif; }
.top .account { font-size: .875rem; color: #f7dce6; overflow-wrap: anywhere; }
main.wrap { padding-block: 24px 56px; }

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 26px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
nav form { margin-inline-start: auto; }
nav a, nav .link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--berry-dark);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}
nav a:hover, nav .link:hover { background: var(--rose); }
a { color: var(--berry-dark); text-underline-offset: .18em; }

h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { margin: 0 0 16px; font-size: clamp(1.75rem, 5vw, 2.3rem); }
h2 { margin: 24px 0 12px; font-size: 1.38rem; }
h3 { margin: 0 0 10px; font-size: 1.05rem; }

.card {
  margin: 12px 0;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.auth {
  max-width: 440px;
  margin: clamp(12px, 5vw, 40px) auto;
  padding: clamp(20px, 5vw, 32px);
  border-top: 4px solid #cb7796;
}

label { display: block; margin: 14px 0; font-size: .9rem; font-weight: 650; }
input:not([type="hidden"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}
button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: #fff4ee;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: #f9e4dd; }
.primary { width: 100%; border-color: var(--berry); background: var(--berry); color: #fff; }
.primary:hover { border-color: var(--berry-dark); background: var(--berry-dark); }
.danger { margin-top: 10px; border-color: #b67080; background: #fff2f2; color: #8b233a; }
.danger:hover { background: #fbe0e4; }
:is(a, button, input, select):focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; }

.muted, small { color: var(--muted); }
.error, .success { padding: 10px 12px; border-radius: 10px; }
.error { background: #fae4e8; color: #8b233a; }
.success { background: #e9f4e8; color: #286345; }
.green { color: #286345; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats .card { margin: 0; }
.stats h2 { margin: 6px 0 0; font-size: clamp(1.125rem, 4vw, 1.6rem); }
.stats .total { grid-column: 1 / -1; border-color: #e4bac8; background: var(--rose); }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: .9rem; }
.line b { text-align: right; }
.strong { border-top: 1px solid var(--line); font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .primary { width: auto; }
.actions .danger { margin-top: 0; }

@media (max-width: 460px) {
  .wrap { padding-inline: 12px; }
  .site-header { padding-block: 12px; }
  .top .account { font-size: .8rem; }
  nav form { margin-inline-start: 0; }
}
