
:root {
  color-scheme: light;
  --bg: #f7f4f0;
  --panel: #ffffff;
  --text: #241f1c;
  --muted: #746b64;
  --line: #e4ddd5;
  --accent: #9e2f45;
  --accent-dark: #7e2638;
  --ok: #247a53;
  --warn: #a96510;
  --shadow: 0 10px 24px rgba(36, 31, 28, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 750; font-size: 18px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.btn.primary, .nav a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { border-color: #c74747; color: #9b2424; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 0 0 14px; }
p { color: var(--muted); margin: 0; line-height: 1.45; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two { grid-template-columns: 1.35fr .85fr; align-items: start; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.stat .value { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.stat .label { color: var(--muted); font-size: 14px; }
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
td { font-size: 14px; }
.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1e8e1;
  color: #5b4034;
  font-size: 13px;
  font-weight: 700;
}
.pill.ok { background: #e4f3eb; color: var(--ok); }
.pill.warn { background: #fff0d9; color: var(--warn); }
.muted { color: var(--muted); }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .card { width: min(420px, 100%); }
.notice {
  padding: 12px 14px;
  border: 1px solid #f0c36d;
  background: #fff8e9;
  border-radius: 8px;
  color: #6c4a10;
  margin-bottom: 16px;
}
.order-items {
  display: grid;
  gap: 12px;
}
.order-item {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr .45fr .7fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf6;
}
.order-item .remove-item {
  min-width: 38px;
  padding: 0 10px;
}
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .wrap { padding: 16px; }
  .stats, .two, .form-grid { grid-template-columns: 1fr; }
  .order-item { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border: 0; padding: 6px 0; }
  td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
  .birthdays-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: baseline;
  }
  .birthdays-table td { padding: 0; }
  .birthdays-table td::before { display: none; }
  .birthdays-table .birthday-phone { display: none; }
  .birthdays-table .birthday-date {
    order: 1;
    color: var(--muted);
    font-weight: 700;
  }
  .birthdays-table .birthday-client {
    order: 2;
    font-weight: 700;
  }
  .birthdays-table .birthday-client a { color: var(--accent); }
}
