:root {
  --bg: #f5f0e8;
  --surface: #fffdf9;
  --surface-2: #eee6da;
  --ink: #1d211d;
  --muted: #6c726d;
  --line: #ddd4c7;
  --brand: #d2482f;
  --brand-dark: #a93220;
  --success: #18794e;
  --warning: #a15c00;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(40, 31, 19, .12);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(210,72,47,.09), transparent 34rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245,240,232,.88); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(221,212,199,.8);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--brand); color: white; box-shadow: 0 9px 20px rgba(210,72,47,.25); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); font-size: 13px; font-weight: 750; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(210,72,47,.22); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-success { background: #d9f2e5; color: var(--success); }
.btn-sm { padding: 8px 11px; border-radius: 10px; font-size: 13px; }
.card { background: var(--surface); border: 1px solid rgba(221,212,199,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 12px 13px; border-radius: 13px; outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(210,72,47,.1); }
.textarea { resize: vertical; min-height: 90px; }
.label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-full { grid-column: 1 / -1; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; }
.toast { max-width: min(390px, calc(100vw - 36px)); padding: 13px 15px; border-radius: 14px; background: #1d211d; color: white; box-shadow: var(--shadow); animation: toastIn .2s ease; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; background: rgba(19,22,19,.54); backdrop-filter: blur(5px); }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; }
.icon-btn { border: 0; background: var(--surface-2); width: 38px; height: 38px; border-radius: 12px; font-size: 20px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(440px, 100%); padding: 30px; }
.login-card h1 { margin: 10px 0 8px; font-size: clamp(34px, 7vw, 54px); letter-spacing: -.06em; }
.error-text { color: var(--danger); font-size: 14px; font-weight: 700; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }
@media (max-width: 680px) {
  .container { width: min(100% - 20px, 1180px); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar-inner { min-height: 64px; }
}
