:root {
  --blue: #2145b6;
  --milk: #f5f3ec;
  --ink: #19223b;
  --coral: #ef795f;
  --lav: #e8eaff;
  --muted: #5e6679;
  --line: #e5e2da;
  --white: #fff;
  --shadow: 0 10px 28px rgba(25, 34, 59, .09);
  --radius: 22px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--milk); color: var(--ink); font: 14px/1.5 Manrope, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin: 0 0 12px; }
h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; letter-spacing: -.04em; }
h2 { font-size: 23px; line-height: 1.15; letter-spacing: -.025em; }
h3 { font-size: 17px; line-height: 1.25; }
.muted { color: var(--muted); }
.eyebrow, .nav-label { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand { display: inline-flex; }
.brand img { display: block; object-fit: cover; object-position: center 49%; border-radius: 6px; }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; }
.shell > aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 16px 18px;
  background: var(--white);
  border-right: 1px solid var(--line);
}
.sidebar-top { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; padding-inline: 12px; }
nav { display: grid; align-content: start; gap: 20px; overflow: auto; }
.nav-label { margin: 0 12px 6px; color: var(--muted); }
nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 14px; color: var(--ink); font-size: 13px; }
nav a:hover { background: var(--milk); }
nav a.active { background: var(--lav); color: var(--blue); font-weight: 800; }
nav a span { min-width: 18px; color: var(--blue); text-align: center; font-size: 16px; }
.aside-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.aside-bottom button { margin-left: auto; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lav); color: var(--blue); font-weight: 800; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 clamp(16px, 4vw, 52px); border-bottom: 1px solid var(--line); color: var(--muted); }
header > div { display: flex; align-items: center; gap: 10px; }
.page { max-width: 1520px; margin-inline: auto; padding: 30px clamp(16px, 4vw, 52px) 48px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 26px; }
.page-heading p:last-child { margin-bottom: 0; }
.primary, .secondary, .danger, .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.primary { background: var(--blue); color: var(--white); }
.secondary { background: var(--white); color: var(--blue); border-color: var(--line); }
.danger { background: #ffece6; color: #8f351f; }
.icon { width: 42px; padding: 0; flex: 0 0 auto; background: var(--lav); color: var(--blue); font-size: 22px; }
.primary:hover, .secondary:hover, .danger:hover { filter: brightness(.96); }
.week-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 25px; margin-bottom: 18px; border-radius: var(--radius); background: var(--lav); }
.week-card h2 { margin: 5px 0 8px; }
.week-card p { margin: 0; color: var(--muted); }
.hero-actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions { flex-shrink: 0; }
.actions { margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat, .panel, .empty, .table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat { min-width: 0; padding: 18px; }
.stat:first-child { background: var(--blue); border-color: var(--blue); color: var(--white); }
.stat-label { font-size: 12px; font-weight: 700; }
.stat-value { margin-top: 6px; font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.stat small { display: block; margin-top: 8px; }
.panel { padding: 20px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.pill { display: inline-block; padding: 4px 9px; border-radius: 999px; background: var(--lav); color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill.approved, .pill.sent, .pill.completed, .pill.active { background: #e0f2e8; color: #235f43; }
.pill.pending, .pill.new, .pill.in_progress { background: #fff0d1; color: #775212; }
.pill.changes, .pill.failed, .pill.blocked { background: #ffece6; color: #8f351f; }
.grid, .split, .cards { display: grid; gap: 14px; }
.grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.stack > * + * { margin-top: 14px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.toolbar input, .toolbar select { width: auto; max-width: 100%; }
.toolbar input[type="search"] { flex: 1 1 220px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.toolbar label input { margin: 0; }
.column-picker { margin: 12px 0; }
.column-picker summary { display: inline-flex; gap: 6px; cursor: pointer; list-style: none; }
.column-picker summary::-webkit-details-marker { display: none; }
.column-picker[open] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.column-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 8px 12px; margin: 12px 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 11px 14px; }
th { color: var(--muted); background: #f8f8ff; font-size: 12px; }
td { border-top: 1px solid var(--line); max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
td small { display: block; margin-top: 3px; color: var(--muted); }
tbody tr:hover { background: #fafaff; }
.table-foot { padding-top: 10px; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 0; background: none; color: var(--blue); font-weight: 800; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; margin-bottom: 6px; color: var(--ink); font-size: 17px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
legend { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; margin: 0; accent-color: var(--blue); }
.bar-row { display: grid; grid-template-columns: minmax(100px, 1fr) 1fr 26px; align-items: center; gap: 8px; margin: 10px 0; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--lav); }
.bar-fill { height: 100%; border-radius: 999px; background: var(--blue); }
.dictionary-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.profile-top { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.profile-photo, .placeholder { width: 90px; height: 100px; flex: 0 0 auto; border-radius: 16px; background: var(--lav); object-fit: cover; }
.placeholder { display: grid; place-items: center; color: var(--blue); font-size: 32px; }
.profile-gallery { display: flex; gap: 8px; overflow: auto; margin: 12px 0; }
.profile-gallery img { width: 88px; height: 96px; object-fit: cover; border-radius: 12px; background: var(--lav); }
.photo-thumb { flex: none; display: block; padding: 0; border: 0; border-radius: 12px; background: none; cursor: zoom-in; }
.photo-thumb img { display: block; }
#photo-full { display: block; max-width: 100%; max-height: 72dvh; margin: 0 auto; object-fit: contain; }
.profile-video { display: block; width: min(100%, 320px); max-height: 250px; margin: 12px 0; border-radius: 18px; background: var(--ink); }
.profile-bio, .message, .preview { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-panel { padding: 16px; border: 1px solid var(--line); border-radius: 18px; }
.review-status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.detail-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-section h3:not(:first-child) { margin-top: 14px; }
.details { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); gap: 6px 10px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.message, .warning, .change, .preview, .error { padding: 12px; margin-bottom: 8px; border-radius: 14px; background: var(--lav); }
.message small { display: block; margin-bottom: 4px; color: var(--muted); }
.message.admin { margin-left: 20px; }
.warning, .change { background: #fff0d1; color: #775212; }
.error { background: #ffece6; color: #8f351f; }
dialog { width: min(760px, 94vw); max-height: 90dvh; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(25, 34, 59, .54); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
#toast { position: fixed; z-index: 10; right: 14px; bottom: 14px; max-width: min(410px, calc(100vw - 28px)); padding: 13px 16px; border-radius: 15px; background: var(--ink); color: var(--white); box-shadow: var(--shadow); }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; min-height: 100dvh; padding: clamp(14px, 4vw, 48px); }
.login-art { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 25px; overflow: hidden; padding: clamp(24px, 5vw, 65px); border-radius: 30px; background: var(--lav); }
.login-art p { margin: 0; color: var(--blue); font-size: clamp(36px, 6vw, 86px); font-weight: 900; line-height: .98; letter-spacing: -.07em; }
.login-art small { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.orb { position: absolute; z-index: -1; right: -80px; bottom: 7%; width: min(70%, 380px); aspect-ratio: 1; border-radius: 50%; background: #f4b4a6; }
.login form { align-self: center; width: min(100%, 440px); margin: auto; padding: clamp(20px, 4vw, 34px); background: var(--white); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.login button { width: 100%; }
#login-error { color: #8f351f; margin: 10px 0 0; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .shell > aside { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-top { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 0; gap: 8px; }
  .sidebar-top .brand img { width: 106px; height: 31px; }
  nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 3px; }
  .nav-group { display: flex; gap: 3px; }
  .shell[data-mode="waitlist"] nav { flex-wrap: wrap; overflow: visible; }
  .shell[data-mode="waitlist"] .nav-group { display: contents; }
  .nav-label, .aside-bottom > span, header .eyebrow { display: none; }
  nav a { padding-inline: 8px; white-space: nowrap; }
  .aside-bottom { padding: 0; margin: 0; border: 0; }
  header { min-height: 40px; font-size: 12px; }
  .page { padding-top: 18px; }
  .page-heading { margin-bottom: 18px; }
  .week-card { display: block; padding: 17px; }
  .hero-actions { margin-top: 12px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .login { display: flex; flex-direction: column; gap: 12px; min-height: 100dvh; }
  .login-art { gap: 14px; padding: 22px; }
  .login-art p br { display: none; }
  .login form { margin: 0 auto; }
}
