:root {
  --ink: #272229;
  --ink-soft: #514b55;
  --muted: #817987;
  --line: rgba(39, 34, 41, .10);
  --canvas: #f8f6f8;
  --surface: #ffffff;
  --lavender: #efc9ff;
  --lavender-2: #dba2f5;
  --lilac: #e9d8ff;
  --peach: #ffd9aa;
  --rose: #ffb7c8;
  --coral: #ff8162;
  --mint: #bdebd4;
  --shadow: 0 24px 70px rgba(53, 38, 60, .12);
  --shadow-soft: 0 10px 30px rgba(53, 38, 60, .08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(239, 201, 255, .55), transparent 32rem),
    linear-gradient(135deg, #faf9fa 0%, #f6f2f8 100%);
  font-family: "Montserrat", system-ui, sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--lavender);
  background: var(--ink);
  font-weight: 800;
  letter-spacing: -.08em;
  box-shadow: inset -7px -7px 14px rgba(255,255,255,.04);
}
.brand-mark--large { width: 64px; height: 64px; border-radius: 20px; font-size: 1.4rem; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 46%) 1fr;
  padding: 20px;
}
.login-card {
  z-index: 2;
  display: grid;
  align-content: center;
  width: min(100%, 610px);
  padding: clamp(34px, 7vw, 92px);
  background: rgba(255,255,255,.91);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 72px; }
.login-brand strong { display: block; font-size: 1rem; letter-spacing: .12em; }
.login-brand span { color: var(--muted); font-size: .74rem; }
.login-card h1 { max-width: 430px; margin: 0 0 14px; font-size: clamp(2.15rem, 4.6vw, 4rem); line-height: .98; letter-spacing: -.06em; }
.login-card h1 em { color: #aa61ca; font-family: "Caveat", cursive; font-size: 1.08em; font-style: normal; font-weight: 600; }
.login-lede { max-width: 430px; margin: 0 0 34px; color: var(--muted); }
.login-form { display: grid; gap: 18px; max-width: 430px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .82rem; font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: .2s border-color, .2s box-shadow, .2s background;
}
.input, .select { min-height: 50px; padding: 0 15px; }
.textarea { min-height: 110px; resize: vertical; padding: 14px 15px; }
.input:focus, .select:focus, .textarea:focus { border-color: #bd80db; box-shadow: 0 0 0 4px rgba(219,162,245,.2); }
.login-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.microcopy { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.setup-card > .button { width: fit-content; }
.setup-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(380px, .8fr); gap: 20px; padding: 20px; }
.setup-panel { display: grid; align-content: center; padding: clamp(28px, 6vw, 82px); border: 1px solid rgba(255,255,255,.8); border-radius: 32px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.setup-panel .login-brand { margin-bottom: 48px; }
.setup-panel h1 { max-width: 700px; margin: 10px 0 16px; font-size: clamp(2rem, 4.6vw, 4rem); line-height: 1; letter-spacing: -.06em; }
.setup-panel h1 em { color: #aa61ca; font-family: "Caveat", cursive; font-size: 1.08em; font-style: normal; font-weight: 600; }
.setup-lede { max-width: 680px; margin: 0 0 28px; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.setup-form { display: grid; gap: 20px; max-width: 720px; }
.setup-error, .setup-help { max-width: 720px; margin-bottom: 20px; padding: 14px 16px; border-radius: 14px; font-size: .72rem; line-height: 1.6; }
.setup-error { color: #8d3425; background: #ffe3dc; }
.setup-help { margin: 22px 0 0; color: #6d6172; background: #f1ebf3; }
.setup-success { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 22px; color: #18683f; background: var(--mint); font-size: 1.8rem; font-weight: 800; }
.setup-aside { position: relative; overflow: hidden; display: grid; align-content: center; padding: clamp(34px, 5vw, 76px); border-radius: 32px; color: white; background: linear-gradient(145deg, #2c282f, #53385b); }
.setup-aside::before { content: ""; position: absolute; width: 440px; height: 440px; right: -180px; top: -160px; border-radius: 50%; background: linear-gradient(145deg, var(--lavender), var(--rose)); opacity: .86; }
.setup-aside > * { position: relative; z-index: 1; }
.setup-aside .script { color: var(--peach); font-family: "Caveat", cursive; font-size: clamp(2rem, 4vw, 3.5rem); }
.setup-aside h2 { margin: 10px 0 22px; font-size: clamp(3rem, 6vw, 6rem); line-height: .86; letter-spacing: -.07em; }
.setup-aside p { max-width: 480px; margin: 0; color: rgba(255,255,255,.68); font-size: 1rem; line-height: 1.7; }
.login-art {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: clamp(40px, 7vw, 110px);
  border-radius: 32px;
  background:
    linear-gradient(140deg, rgba(255,255,255,.1), transparent 45%),
    linear-gradient(135deg, #2d2930 0%, #403045 55%, #503758 100%);
}
.login-art::before, .login-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}
.login-art::before { width: 460px; height: 460px; right: -130px; top: -120px; background: radial-gradient(circle at 35% 38%, #f7d4ff, #d69bf1 70%); opacity: .8; }
.login-art::after { width: 260px; height: 260px; left: -80px; bottom: -90px; background: radial-gradient(circle at 30% 30%, #ffe7c7, #ffb8c6 72%); opacity: .85; }
.art-copy { position: relative; z-index: 1; max-width: 600px; color: white; }
.art-copy .script { display: block; margin-bottom: 6px; color: var(--peach); font-family: "Caveat", cursive; font-size: clamp(2rem, 4vw, 3.5rem); }
.art-copy h2 { margin: 0 0 20px; font-size: clamp(2.5rem, 6vw, 6.4rem); line-height: .87; letter-spacing: -.07em; }
.art-copy p { max-width: 430px; margin: 0; color: rgba(255,255,255,.66); font-size: 1.05rem; }
.floating-week {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: min(100%, 570px);
  margin-top: 62px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  background: rgba(22,18,24,.34);
  backdrop-filter: blur(12px);
}
.floating-day { display: grid; place-items: center; min-height: 72px; border-radius: 16px; color: rgba(255,255,255,.7); font-size: .68rem; }
.floating-day b { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; color: white; font-size: .8rem; }
.floating-day.is-active { color: var(--ink); background: var(--lavender); }
.floating-day.is-active b { background: var(--ink); }

.app-shell { min-height: 100vh; padding-left: var(--sidebar); }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 26px 18px 20px;
  color: white;
  background: linear-gradient(180deg, #29252b, #211e23);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.sidebar-brand strong { display: block; letter-spacing: .14em; font-size: .95rem; }
.sidebar-brand small { color: rgba(255,255,255,.48); font-size: .68rem; }
.nav-label { padding: 0 13px 10px; color: rgba(255,255,255,.34); font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav { display: grid; gap: 5px; }
.nav-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  border-radius: 14px;
  color: rgba(255,255,255,.62);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: .84rem;
  font-weight: 600;
}
.nav-button:hover { color: white; background: rgba(255,255,255,.06); }
.nav-button.is-active { color: var(--ink); background: var(--lavender); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; font-size: 1rem; }
.nav-badge { margin-left: auto; min-width: 23px; padding: 3px 7px; border-radius: 999px; color: white; background: rgba(255,255,255,.12); font-size: .65rem; text-align: center; }
.nav-button.is-active .nav-badge { color: white; background: var(--ink); }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; }
.client-pill { padding: 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: rgba(255,255,255,.05); }
.client-pill small { display: block; margin-bottom: 4px; color: rgba(255,255,255,.42); font-size: .63rem; text-transform: uppercase; letter-spacing: .1em; }
.client-pill strong { font-size: .85rem; }
.logout-button { width: 100%; margin-top: 10px; border: 0; color: rgba(255,255,255,.52); background: transparent; cursor: pointer; font-size: .76rem; text-align: left; padding: 9px 7px; }

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(22px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(248,246,248,.76);
  backdrop-filter: blur(18px);
}
.topbar-title p { margin: 0 0 2px; color: var(--muted); font-size: .72rem; }
.topbar-title h1 { margin: 0; font-size: 1.15rem; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.profile-button { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 0; background: transparent; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: var(--ink); background: linear-gradient(135deg, var(--lavender), var(--peach)); font-size: .78rem; font-weight: 800; }
.profile-copy { text-align: left; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: .76rem; }
.profile-copy small { color: var(--muted); font-size: .64rem; }

.main { padding: clamp(22px, 4vw, 48px); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.page-head h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; letter-spacing: -.055em; }
.page-head p { max-width: 620px; margin: 9px 0 0; color: var(--muted); font-size: .86rem; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.month-nav { display: flex; align-items: center; gap: 8px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.month-label { min-width: 145px; text-align: center; font-size: .82rem; font-weight: 700; text-transform: capitalize; }
.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}
.icon-button:hover { background: rgba(39,34,41,.06); }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  transition: .18s transform, .18s box-shadow, .18s background;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.button--dark { color: white; background: var(--ink); box-shadow: 0 9px 22px rgba(39,34,41,.18); }
.button--lavender { color: var(--ink); background: var(--lavender); }
.button--ghost { border: 1px solid var(--line); background: white; }
.button--danger { color: #9e341d; background: #ffddd4; }
.button--small { min-height: 38px; padding: 0 13px; border-radius: 12px; font-size: .72rem; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; }
.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.92); box-shadow: var(--shadow-soft); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday { padding: 17px 10px 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.calendar-day { position: relative; min-height: 136px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; cursor: default; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day.is-outside { background: #faf9fa; }
.calendar-day.is-outside .day-number { opacity: .28; }
.calendar-day.is-today { background: linear-gradient(145deg, rgba(239,201,255,.24), white 70%); }
.calendar-day.is-today::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(186,112,219,.4); border-radius: 16px; pointer-events: none; }
.day-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.day-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; font-size: .72rem; font-weight: 700; }
.is-today .day-number { color: white; background: var(--ink); }
.day-load { color: var(--muted); font-size: .59rem; }
.delivery-stack { position: relative; z-index: 2; display: grid; gap: 6px; }
.delivery-chip { width: 100%; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; padding: 8px; border: 0; border-radius: 11px; background: #f4eff6; cursor: pointer; text-align: left; }
.delivery-chip:hover { filter: brightness(.98); transform: translateY(-1px); }
.delivery-chip--video { background: #ffe6c8; }
.delivery-chip--flyer { background: #eadcff; }
.delivery-chip--social { background: #ffdce5; }
.delivery-chip--pdf { background: #dff3e9; }
.delivery-chip--editable { background: #e4edf9; }
.delivery-dot { width: 7px; height: 7px; border: 2px solid transparent; border-radius: 50%; background: #ad70c8; }
.status-delivered .delivery-dot { background: #249d65; }
.status-review .delivery-dot { background: #df8b2e; }
.status-correction .delivery-dot { background: #e05d43; }
.delivery-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; font-weight: 700; }
.delivery-chip small { color: rgba(39,34,41,.52); font-size: .54rem; font-weight: 600; }
.more-count { padding: 4px 7px; color: var(--muted); font-size: .6rem; font-weight: 700; }
.empty-drop { width: 100%; min-height: 54px; display: grid; place-items: center; border: 1px dashed rgba(39,34,41,.12); border-radius: 12px; color: rgba(39,34,41,.35); font-size: .62rem; opacity: 0; transition: opacity .15s; }
.calendar-day:hover .empty-drop { opacity: 1; }

.side-stack { display: grid; align-content: start; gap: 16px; }
.panel { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.88); box-shadow: var(--shadow-soft); }
.panel--dark { color: white; background: linear-gradient(145deg, #2d2930, #3a303d); border-color: rgba(255,255,255,.06); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: .88rem; letter-spacing: -.02em; }
.panel-head span { color: var(--muted); font-size: .66rem; }
.panel--dark .panel-head span { color: rgba(255,255,255,.47); }
.capacity-wrap { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 20px; }
.capacity-ring { --p: 62; position: relative; width: 112px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--lavender) calc(var(--p) * 1%), rgba(255,255,255,.09) 0); }
.capacity-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #302b33; }
.capacity-value { position: relative; z-index: 1; text-align: center; }
.capacity-value strong { display: block; font-size: 1.45rem; line-height: 1; }
.capacity-value small { color: rgba(255,255,255,.46); font-size: .58rem; }
.capacity-copy strong { display: block; margin-bottom: 5px; font-size: 1.2rem; }
.capacity-copy span { display: block; color: rgba(255,255,255,.52); font-size: .66rem; line-height: 1.5; }
.buffer-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 13px; color: rgba(255,255,255,.68); background: rgba(255,255,255,.06); font-size: .64rem; line-height: 1.45; }
.buffer-note b { color: var(--peach); }
.upcoming-list { display: grid; gap: 12px; }
.upcoming-item { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; }
.date-tile { width: 42px; height: 44px; display: grid; place-content: center; border-radius: 13px; background: var(--canvas); text-align: center; }
.date-tile strong { font-size: .86rem; line-height: 1; }
.date-tile small { color: var(--muted); font-size: .56rem; text-transform: uppercase; }
.upcoming-copy { min-width: 0; }
.upcoming-copy strong, .upcoming-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy strong { font-size: .7rem; }
.upcoming-copy small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: #f2edf4; font-size: .56rem; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9d74ad; }
.status-pill--delivered { color: #18683f; background: #dff4e8; }
.status-pill--delivered::before { background: #249d65; }
.status-pill--review { color: #8d551b; background: #fff0d8; }
.status-pill--review::before { background: #df8b2e; }
.status-pill--correction { color: #963c2c; background: #ffe1d9; }
.status-pill--correction::before { background: #e05d43; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; background: #f7f4f8; color: var(--muted); font-size: .59rem; font-weight: 600; }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-soft); }
.metric-card small { display: block; margin-bottom: 16px; color: var(--muted); font-size: .67rem; font-weight: 600; }
.metric-card strong { font-size: 1.8rem; letter-spacing: -.05em; }
.metric-card span { margin-left: 7px; color: var(--muted); font-size: .64rem; }
.content-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-soft); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar h3 { margin: 0; font-size: .9rem; }
.filter-group { display: flex; gap: 7px; }
.filter-chip { padding: 7px 11px; border: 0; border-radius: 999px; color: var(--muted); background: #f6f3f7; cursor: pointer; font-size: .62rem; font-weight: 700; }
.filter-chip.is-active { color: white; background: var(--ink); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.data-table td { font-size: .72rem; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fbf9fc; }
.table-title strong, .table-title small { display: block; }
.table-title strong { font-size: .72rem; }
.table-title small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.empty-state { display: grid; place-items: center; min-height: 280px; padding: 40px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }

.bar-chart { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 36px 1fr 42px; align-items: center; gap: 10px; font-size: .65rem; }
.bar-track { height: 11px; overflow: hidden; border-radius: 999px; background: #f0ebf2; }
.bar-fill { width: var(--width); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lavender-2), var(--peach)); }
.settings-form { display: grid; gap: 17px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .74rem; }
.switch { position: relative; width: 42px; height: 25px; border: 0; border-radius: 999px; background: #ddd6df; cursor: pointer; }
.switch::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: transform .2s; }
.switch.is-on { background: var(--lavender-2); }
.switch.is-on::after { transform: translateX(17px); }

.dialog {
  width: min(92vw, 700px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: white;
  box-shadow: 0 34px 100px rgba(20, 12, 24, .32);
}
.dialog--detail { width: min(94vw, 860px); }
.dialog::backdrop { background: rgba(24,18,27,.58); backdrop-filter: blur(8px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.dialog-head h2 { margin: 4px 0 0; font-size: 1.35rem; letter-spacing: -.04em; }
.eyebrow { margin: 0; color: #a15fc1; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; padding: 24px 26px; }
.field--full { grid-column: 1 / -1; }
.field-hint { color: var(--muted); font-size: .62rem; }
.dialog-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 17px 26px 23px; border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.detail-hero { position: relative; min-height: 205px; display: grid; align-content: end; padding: 28px; overflow: hidden; color: white; background: linear-gradient(135deg, #302a33, #5e3d66); }
.detail-hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -55px; top: -90px; border-radius: 50%; background: radial-gradient(circle at 32% 32%, #f7d4ff, #c77de8 67%, transparent 69%); opacity: .9; }
.detail-hero::after { content: ""; position: absolute; width: 150px; height: 150px; right: 115px; bottom: -96px; border-radius: 50%; background: var(--peach); opacity: .85; }
.detail-close { position: absolute; z-index: 3; right: 18px; top: 18px; color: white; background: rgba(0,0,0,.16); }
.detail-hero-copy { position: relative; z-index: 1; max-width: 610px; }
.detail-hero-copy h2 { margin: 8px 0 0; font-size: clamp(1.6rem, 4vw, 2.7rem); line-height: 1; letter-spacing: -.055em; }
.detail-body { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; padding: 26px; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { margin: 0 0 11px; font-size: .73rem; text-transform: uppercase; letter-spacing: .09em; }
.detail-section p { margin: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.7; }
.meta-list { display: grid; gap: 10px; }
.meta-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .69rem; }
.meta-item span { color: var(--muted); }
.file-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #faf8fb; font-size: .68rem; }
.file-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--lilac); font-weight: 800; }
.comment-list { display: grid; gap: 12px; max-height: 240px; overflow-y: auto; }
.comment { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.comment-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #f0e8f3; font-size: .62rem; font-weight: 800; }
.comment-bubble { padding: 11px 13px; border-radius: 4px 14px 14px 14px; background: #f7f4f8; }
.comment-bubble strong { display: block; margin-bottom: 4px; font-size: .64rem; }
.comment-bubble p { font-size: .68rem; line-height: 1.5; }
.comment-bubble time { display: block; margin-top: 5px; color: var(--muted); font-size: .55rem; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form .input { min-height: 42px; }
.detail-aside { align-self: start; padding: 18px; border-radius: 18px; background: #f7f3f8; }
.correction-note { padding: 13px; margin-top: 14px; border-radius: 13px; color: #82501c; background: #fff0d5; font-size: .63rem; line-height: 1.5; }

.brand-hero {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
  padding: clamp(26px, 5vw, 48px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: white;
  background: linear-gradient(135deg, #2d2930, #5a3b62);
  box-shadow: var(--shadow-soft);
}
.brand-hero::before { content: ""; position: absolute; width: 330px; height: 330px; right: -80px; top: -150px; border-radius: 50%; background: linear-gradient(145deg, var(--lavender), var(--rose)); opacity: .92; }
.brand-hero > * { position: relative; z-index: 1; }
.script-label { display: block; margin-bottom: 4px; color: var(--peach); font-family: "Caveat", cursive; font-size: 1.75rem; }
.brand-hero h3 { margin: 0; font-size: clamp(2rem, 5vw, 4.5rem); line-height: .95; letter-spacing: -.06em; }
.brand-hero p { max-width: 620px; margin: 14px 0 0; color: rgba(255,255,255,.68); font-size: .82rem; line-height: 1.65; }
.brand-selector { width: min(100%, 260px); padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(22,18,24,.35); backdrop-filter: blur(14px); }
.brand-selector label { display: block; margin-bottom: 7px; color: rgba(255,255,255,.62); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 20px; align-items: start; }
.brand-upload-panel { position: sticky; top: 22px; }
.textarea--tall { min-height: 170px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.color-swatches i { width: 26px; height: 26px; border: 3px solid white; border-radius: 9px; background: var(--swatch); box-shadow: 0 0 0 1px var(--line), 0 4px 10px rgba(39,34,41,.1); }
.brand-links { display: flex; flex-wrap: wrap; gap: 7px; }
.brand-links a { padding: 7px 10px; border-radius: 999px; color: #713d88; background: #f2e5f7; font-size: .62rem; font-weight: 700; }
.brand-library, .brand-manuals { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.9); box-shadow: var(--shadow-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h3 { margin: 5px 0 0; font-size: 1.3rem; letter-spacing: -.035em; }
.brand-assets-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.brand-asset-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.brand-asset-preview { height: 150px; display: grid; place-items: center; color: #724588; background: linear-gradient(145deg, #f7eefb, #f4f0f5); font-size: 1.25rem; font-weight: 800; }
.brand-asset-preview.is-image { background: #eee9ef; }
.brand-asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.brand-asset-copy { min-width: 0; display: grid; gap: 3px; padding: 13px 42px 14px 14px; }
.brand-asset-copy small { color: #9f61bb; font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.brand-asset-copy strong, .brand-asset-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-asset-copy strong { font-size: .72rem; }
.brand-asset-copy span { color: var(--muted); font-size: .58rem; }
.brand-remove { position: absolute; right: 10px; bottom: 12px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #9e341d; background: #ffebe6; cursor: pointer; font-size: 1rem; }
.brand-remove:hover { background: #ffddd4; }
.brand-manual { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.brand-manual + .brand-manual { margin-top: 16px; }
.brand-manual > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .7rem; }
.brand-manual a { color: #8b4aa7; font-weight: 700; }
.brand-manual iframe { width: 100%; height: min(72vh, 760px); border: 0; background: #eee9ef; }
.plan-overview { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.9); box-shadow: var(--shadow-soft); }
.plan-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.plan-card { position: relative; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: #faf8fb; }
.plan-card.is-current { border-color: #c17ade; background: linear-gradient(145deg, #f4dcff, #fff4e8); box-shadow: 0 8px 20px rgba(157,94,184,.12); }
.plan-card small { color: #8e579f; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.plan-card strong { display: block; margin-top: 9px; font-size: 1.02rem; letter-spacing: -.03em; }
.plan-card strong span { color: var(--muted); font-size: .52rem; font-weight: 600; }
.plan-card p { margin: 5px 0 0; color: var(--muted); font-size: .62rem; }
.plan-card em { display: inline-block; margin-top: 13px; padding: 4px 7px; border-radius: 999px; color: white; background: var(--ink); font-size: .53rem; font-style: normal; font-weight: 700; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; padding: 14px 17px; border-radius: 14px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: .72rem; animation: toast-in .25s ease-out; }
.toast--error { background: #923e31; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.mobile-top { display: none; }
.mobile-nav { display: none; }
.mobile-logout { border: 0; cursor: pointer; }

@media (max-width: 1180px) {
  :root { --sidebar: 205px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(3, 1fr); }
  .panel--dark { grid-column: span 1; }
  .calendar-day { min-height: 124px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 76px; }
  .sidebar { align-items: center; width: 76px; padding-inline: 10px; }
  .sidebar-brand { padding-inline: 0; }
  .sidebar-brand div, .nav-label, .nav-button > span:not(.nav-icon), .nav-badge, .sidebar-foot { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .topbar { padding-inline: 24px; }
  .content-grid { grid-template-columns: 1fr; }
  .brand-layout { grid-template-columns: 1fr; }
  .brand-upload-panel { position: static; }
  .brand-assets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .setup-shell { grid-template-columns: 1fr; }
  .setup-aside { display: none; }
  .login-card { width: 100%; max-width: none; }
  .login-art { display: none; }
}

@media (max-width: 700px) {
  :root { --sidebar: 0px; }
  .app-shell { padding: 0 0 74px; }
  .sidebar, .topbar { display: none; }
  .mobile-top { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(248,246,248,.88); backdrop-filter: blur(14px); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: .76rem; font-weight: 800; letter-spacing: .08em; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 10px 10px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; color: rgba(255,255,255,.5); background: rgba(34,30,36,.95); box-shadow: 0 18px 45px rgba(20,14,22,.24); backdrop-filter: blur(16px); }
  .mobile-nav button { height: 48px; display: grid; place-items: center; border: 0; border-radius: 12px; color: inherit; background: transparent; font-size: 1rem; }
  .mobile-nav button.is-active { color: var(--ink); background: var(--lavender); }
  .main { padding: 20px 14px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { flex-wrap: wrap; }
  .month-nav { flex: 1; }
  .month-label { min-width: 112px; }
  .calendar-card { overflow-x: auto; border-radius: 20px; }
  .weekday-row, .calendar-grid { min-width: 760px; }
  .side-stack { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 1.4rem; }
  .table-card { overflow-x: auto; }
  .data-table { min-width: 680px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .detail-body { grid-template-columns: 1fr; }
  .brand-hero { align-items: stretch; flex-direction: column; }
  .brand-selector { width: 100%; }
  .brand-assets-grid { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog { width: calc(100vw - 20px); max-height: 94vh; border-radius: 22px; }
  .login-shell { padding: 0; }
  .login-card { min-height: 100vh; border-radius: 0; padding: 34px 24px; }
  .setup-shell { padding: 0; }
  .setup-panel { min-height: 100vh; padding: 34px 24px; border-radius: 0; }
  .setup-panel .login-brand { margin-bottom: 40px; }
  .login-brand { margin-bottom: 54px; }
  .login-actions { align-items: stretch; flex-direction: column-reverse; }
  .login-actions .button { width: 100%; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
  .profile-copy { display: none; }
  .page-actions > .button { flex: 1 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
