:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --ink: #0a0a0a;
  --ink-soft: #4a4a4a;
  --muted: #8a8a8a;
  --line: #e8e8e6;
  --accent: #ff6a3d;
  --accent-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Nav */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 30%, var(--accent) 31% 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
nav ul { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; }
nav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: #fff; padding: 9px 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600;
  text-decoration: none;
}
.nav-cta:hover { background: #1f1f1f; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease;
  font-family: inherit;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1f1f1f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #ff5524; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 9px 14px; font-size: 14px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
  outline: none; transition: border-color .12s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,10,10,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px; padding: 32px;
  max-width: 520px; width: 100%; box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.modal .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; background: none; border: 0;
  font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1;
}

/* Notice */
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice-error { background: #fde9e3; color: #a82a00; }
.notice-success { background: #e2f7e8; color: #115e2a; }
.notice-info { background: #eef0f3; color: var(--ink-soft); }

/* Calendar */
.calendar { display: grid; gap: 8px; }
.cal-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cal-day {
  flex: 0 0 auto; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; min-width: 64px;
  text-align: center; font-size: 13px; line-height: 1.2;
}
.cal-day .dow { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; }
.cal-day .num { font-size: 18px; font-weight: 700; }
.cal-day.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-day.active .dow { color: rgba(255,255,255,0.7); }
.cal-slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; margin-top: 4px;
}
.cal-slot {
  padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 14px; text-align: center;
}
.cal-slot:hover { background: var(--bg-soft); }
.cal-slot.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 36px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 24px; padding: 4px; background: var(--bg-soft); border-radius: 10px; }
.auth-tab {
  flex: 1; padding: 8px 12px; border: 0; background: transparent;
  cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--ink-soft); border-radius: 8px;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Dashboard */
.dash { padding: 40px 0; }
.dash h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -0.02em; }
.dash .sub { color: var(--ink-soft); margin: 0 0 32px; }
.dash-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.dash-tab {
  background: transparent; border: 0; padding: 12px 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.dash-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.audit-list { display: grid; gap: 12px; }
.audit-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.audit-row .asin { font-weight: 700; font-size: 15px; }
.audit-row .meta { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-pending { background: #fff3e0; color: #b54708; }
.badge-delivered { background: #e2f7e8; color: #115e2a; }
.badge-paid { background: #eef0f3; color: var(--ink-soft); }
.badge-free { background: #eef6ff; color: #1849a9; }
.empty {
  border: 2px dashed var(--line); border-radius: 14px; padding: 40px;
  text-align: center; color: var(--muted);
}
.empty h3 { color: var(--ink); margin: 0 0 8px; font-size: 18px; }

@media (max-width: 700px) {
  .audit-row { grid-template-columns: 1fr; }
  nav ul { display: none; }
}
