:root {
  /* Restore brand, matched to Campaign Studio (values from restore.com):
     navy #042e43, blue #2b86b8 / #308cbf, Poppins headings, Open Sans body. */
  --ink: #1d2b35;
  --ink-2: #414042;
  --muted: #66757f;
  --line: #dbe3e8;
  --line-2: #e8eef2;
  --paper: #f4f7f9;
  --card: #ffffff;
  --panel: #eaf3f8;
  --brand: #042e43;
  --brand-2: #2b86b8;
  --brand-dark: #1f6f9c;
  --accent: #308cbf;
  /* studio tiers */
  --t-H: #1f5fa8;  --t-H-bg: #e3edf9;
  --t-P: #2f7d4f;  --t-P-bg: #e2f2e7;
  --t-N: #9a6b00;  --t-N-bg: #fbf0cf;
  --t-LR: #b2541f; --t-LR-bg: #fbe5d8;
  --t-U: #9b2c2c;  --t-U-bg: #f6e1e1;
  /* day levels */
  --d-P: #2f7d4f;  --d-P-bg: #d9efe0;
  --d-N: #55656f;  --d-N-bg: #eef2f5;
  --d-A: #8a6300;  --d-A-bg: #fbedc4;
  --d-U: #9b2c2c;  --d-U-bg: #f4d9d9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(4,46,67,.06), 0 8px 24px rgba(4,46,67,.06);
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: Poppins, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); }
h1, h2, h3 { font-family: var(--font-head); color: var(--brand); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.65rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---- layout ---- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.wide { max-width: none; padding: 20px 16px 64px; }
.narrow { max-width: 440px; margin: 8vh auto; padding: 0 16px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 18px;
  background: var(--brand); color: #ffffff; }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-weight: 650; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #ffffff; color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { color: #c4d6e1; text-decoration: none; padding: 7px 11px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.who { position: relative; }
.who summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.08); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.who summary::-webkit-details-marker { display: none; }
.who .menu { position: absolute; right: 0; top: 110%; background: var(--card); color: var(--ink); border-radius: 10px; box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 10px; min-width: 220px; display: grid; gap: 4px; }
.who .menu a { padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.who .menu a:hover { background: var(--paper); }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand .app-name { display: none; }
  .who { margin-left: auto; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 0; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.stat { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* ---- forms ---- */
label { font-weight: 550; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #c9d5dd; border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 14px; }
.help { font-size: .85rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; text-decoration: none; background: var(--brand-2); color: #fff; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: var(--brand-2); color: var(--brand-2); }
.btn.ghost:hover { background: #fff; }
.btn.warm { background: var(--brand); }
.btn.warm:hover { background: #0a4361; }
.btn.danger { background: transparent; color: var(--t-U); border-color: #e5c3c3; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.error { background: var(--t-U-bg); color: var(--t-U); padding: 10px 12px; border-radius: 9px; margin-bottom: 14px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; background: #e3f0ea; color: #1f5a3a; border: 1px solid #c7e1d3; overflow-wrap: anywhere; }
.flash.warn { background: #fdf1d8; color: #7a5600; border-color: #f0dca8; }

/* ---- chips ---- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.t-H { color: var(--t-H); background: var(--t-H-bg); }
.t-P { color: var(--t-P); background: var(--t-P-bg); }
.t-N { color: var(--t-N); background: var(--t-N-bg); }
.t-LR { color: var(--t-LR); background: var(--t-LR-bg); }
.t-U { color: var(--t-U); background: var(--t-U-bg); }
.d-P { color: var(--d-P); background: var(--d-P-bg); }
.d-N { color: var(--d-N); background: var(--d-N-bg); }
.d-A { color: var(--d-A); background: var(--d-A-bg); }
.d-U { color: var(--d-U); background: var(--d-U-bg); }
.chip.status-pending { background: #fdf1d8; color: #7a5600; }
.chip.status-approved, .chip.status-published { background: #e2f2e7; color: #2f7d4f; }
.chip.status-denied { background: var(--t-U-bg); color: var(--t-U); }
.chip.status-cancelled, .chip.status-draft { background: #eee; color: #666; }

/* ---- segmented choice (tiers / levels) ---- */
.choice-list { display: grid; gap: 10px; }
.choice-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.choice-row .name { font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; cursor: pointer; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); font-weight: 550; font-size: .85rem; color: var(--ink-2); background: #fff; user-select: none; }
.seg input:focus-visible + label { outline: 2px solid var(--brand-2); }
.seg input:checked + label.t-H, .seg input:checked + label.d-x { border-color: currentColor; }
.seg input:checked + label { box-shadow: inset 0 0 0 1.5px currentColor; }
.seg label.o-H { --c: var(--t-H); --b: var(--t-H-bg); }
.seg label.o-P { --c: var(--t-P); --b: var(--t-P-bg); }
.seg label.o-N { --c: var(--t-N); --b: var(--t-N-bg); }
.seg label.o-LR { --c: var(--t-LR); --b: var(--t-LR-bg); }
.seg label.o-U { --c: var(--t-U); --b: var(--t-U-bg); }
.seg label.l-P { --c: var(--d-P); --b: var(--d-P-bg); }
.seg label.l-N { --c: var(--d-N); --b: var(--d-N-bg); }
.seg label.l-A { --c: var(--d-A); --b: var(--d-A-bg); }
.seg label.l-U { --c: var(--d-U); --b: var(--d-U-bg); }
.seg input:checked + label { color: var(--c); background: var(--b); border-color: var(--c); box-shadow: none; }
@media (max-width: 560px) { .choice-row { grid-template-columns: 1fr; } }

/* ---- wizard ---- */
.steps { display: flex; gap: 6px; margin: 0 0 18px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--brand-2); }

/* ---- month calendar (preferences) ---- */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal .day { position: relative; min-height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px 7px; cursor: pointer; user-select: none;
  display: flex; flex-direction: column; justify-content: space-between; transition: transform .06s; }
.cal .day:active { transform: scale(.97); }
.cal .day.out { visibility: hidden; }
.cal .day .num { font-weight: 650; font-size: .95rem; }
.cal .day .lvl { font-size: .72rem; font-weight: 600; }
.cal .day.ov::after { content: ""; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.cal .day.lv-P { background: var(--d-P-bg); color: var(--d-P); border-color: #b9dcc5; }
.cal .day.lv-N { background: #fff; color: var(--d-N); }
.cal .day.lv-A { background: var(--d-A-bg); color: var(--d-A); border-color: #efd590; }
.cal .day.lv-U { background: var(--d-U-bg); color: var(--d-U); border-color: #e7bcbc; }
.cal .day.locked { cursor: default; }
.cal .day select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cal .day .shift { font-size: .72rem; font-weight: 650; color: var(--ink); background: #fff; border-radius: 6px; padding: 1px 5px; margin-top: 2px; border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal.view .day { cursor: default; min-height: 74px; }
.today-ring { box-shadow: 0 0 0 2px var(--brand-2) inset; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav strong { min-width: 150px; text-align: center; font-size: 1.05rem; }

/* ---- tables & boards ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.board-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.board { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.board th, .board td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; }
.board thead th { position: sticky; top: 0; z-index: 3; background: #f7fafc; padding: 6px 4px; font-weight: 600; text-align: center; min-width: 74px; }
.board thead th .dw { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.board thead th.we { background: #edf3f7; }
.board th.rowh { position: sticky; left: 0; z-index: 2; background: #f7fafc; text-align: left; padding: 6px 10px; white-space: nowrap; min-width: 140px; font-weight: 600; }
.board thead th.rowh { z-index: 4; }
.board td.closed { background: repeating-linear-gradient(45deg, #f1f4f7, #f1f4f7 6px, #e6ecf1 6px, #e6ecf1 12px); }
.slot { display: block; padding: 6px 6px; min-height: 40px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.slot:hover { background: #f1f6f9; }
.slot.open { color: var(--t-U); font-weight: 650; background: #fbeeee; }
.slot.sv-H { border-left-color: var(--t-H); }
.slot.sv-P { border-left-color: var(--t-P); }
.slot.sv-N { border-left-color: var(--t-N); }
.slot.sv-LR { border-left-color: var(--t-LR); background: #fdf3ed; }
.slot.bad { background: #fde7e7; }
.slot .nm { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.slot .tm { color: var(--muted); font-size: .7rem; }
.slot .lk { font-size: .7rem; }
.cell-lvl { display: block; text-align: center; padding: 8px 2px; font-weight: 600; font-size: .75rem; min-height: 34px; }
.cell-lvl.has-shift { color: var(--ink); background: #fff; box-shadow: inset 0 0 0 2px var(--brand-2); border-radius: 4px; }
.board td.tot { text-align: center; padding: 6px; font-weight: 600; background: #f7fafc; }
.av-btn { display: block; width: 100%; border: 0; font: inherit; font-weight: 650; font-size: .78rem; padding: 9px 0; cursor: pointer; background: transparent; color: inherit; }
.av-btn.ov { text-decoration: underline dotted; text-underline-offset: 3px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .v { font-size: 1.5rem; font-weight: 700; }
.kpi .l { font-size: .8rem; color: var(--muted); }
.tabs { display: inline-flex; background: #e3ebf0; border-radius: 10px; padding: 3px; gap: 2px; }
.tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 550; }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.shift-card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.datebox { text-align: center; border-radius: 10px; background: var(--paper); padding: 6px 0; border: 1px solid var(--line); }
.datebox .m { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.datebox .d { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.issues { margin: 0; padding-left: 18px; color: var(--t-U); }
.notes { margin: 0; padding-left: 18px; color: var(--d-A); }
.copybox { display: flex; gap: 8px; }
.copybox input { font-family: "JetBrains Mono", monospace; font-size: .8rem; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
details.box summary { cursor: pointer; font-weight: 600; }
.hours-table input[type=time] { padding: 6px; min-width: 96px; }
.hours-table input[type=number] { padding: 6px; width: 56px; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 650; }
.auth-logo .mark { background: var(--brand); color: #ffffff; }

/* ---- narrow-screen fixes ---- */
.cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .day .lvl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .cal { gap: 4px; }
  .cal .day { min-height: 54px; padding: 5px; border-radius: 8px; }
  .cal .day .lvl { font-size: .62rem; }
  .seg label { padding: 6px 8px; font-size: .8rem; }
  .page-head h1 { font-size: 1.45rem; }
}

/* ---- show / hide password ---- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); border: 0; background: transparent;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--brand-2); padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.pw-toggle:hover { background: var(--paper); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand-2); }

/* ---- Restore wordmark (same as the Campaign Studio landing pages) ---- */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; color: inherit; }
.wordmark .name { font-family: var(--font-head); font-weight: 700; font-size: 23px; letter-spacing: -.02em; text-transform: lowercase; }
.wordmark .sub { font-size: 7.5px; letter-spacing: .32em; text-transform: uppercase; margin-top: 3px; opacity: .8; }
.brand .app-name { font-family: var(--font-head); font-weight: 500; font-size: .9rem; padding-left: 12px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.25); color: #c4d6e1; }
.auth-logo { color: var(--brand); }
.auth-logo .app-name { font-family: var(--font-head); font-weight: 500; font-size: .9rem; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); }
.page-head h1, .card h2, .kpi .v, .stat { font-family: var(--font-head); }
.eyebrow { color: #187db4; font-family: var(--font-head); }
.tabs a, .nav a, .btn { font-family: var(--font-head); font-weight: 500; }
@media (max-width: 760px) { .brand .app-name { display: none; } }
