/* Lioh CRM — app shell, journal and pages */

.wordmark { display: block; width: auto; flex: none; }

/* ---------- shell ---------- */
.shell { display: flex; height: 100vh; }
.side {
  width: 228px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 12px 16px;
}
.logo { display: flex; align-items: center; padding: 0 12px 26px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
  border-radius: 11px; color: var(--muted); font-weight: 560;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.on { background: var(--sage-100); color: var(--brand); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav svg { width: 20px; height: 20px; flex: none; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; }
.side-foot .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { min-height: 66px; flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page { flex: 1; overflow-y: auto; padding: 24px; }
.page-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

@media (max-width: 1000px) {
  .side { width: 70px; padding: 18px 10px; }
  .logo { justify-content: center; padding: 0 0 22px; }
  .logo .monogram { height: 44px !important; }
  .nav a span, .side-foot .who { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .nav a.on::before { left: -10px; }
  .side-foot { justify-content: center; padding: 12px 0 0; }
}
@media (max-width: 680px) {
  .shell { flex-direction: column-reverse; }
  .side { width: 100%; height: 64px; flex-direction: row; padding: 0 4px env(safe-area-inset-bottom); border-right: none; border-top: 1px solid var(--line); }
  .side .logo, .side-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; height: 54px; width: 54px; font-size: 10px; }
  .nav a span { display: block; }
  .nav a.on::before { left: 14px; right: 14px; top: -5px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .topbar { padding: 8px 14px; }
  .page { padding: 14px; }
}

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--cream); }
.auth-hero {
  position: relative; background: var(--cream); color: var(--ink); border-right: 1px solid var(--line);
  padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-hero .wordmark, .auth-hero .monogram { align-self: flex-start; }
.monogram { display: block; width: auto; flex: none; }
.auth-hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 4vw, 56px);
  line-height: 1.04; letter-spacing: -0.025em; color: var(--brand); max-width: 560px; text-wrap: balance;
}
.auth-hero h1 em { font-style: normal; font-weight: 400; }
.auth-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 14px; align-items: center; color: var(--muted); }
.auth-hero li::before { content: ""; width: 18px; height: 2px; background: var(--brand); flex: none; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-size: 34px; color: var(--brand); }
.tabs { display: flex; background: var(--cream); border-radius: 11px; padding: 4px; }
.tabs button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; } .auth-hero { padding: 30px 24px; gap: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-hero h1 { font-size: 36px; } .auth-hero ul { display: none; } .auth-mark { height: 92px !important; }
}

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
select.compact { height: 36px; width: auto; max-width: 200px; }

/* ---------- journal ---------- */
.journal { flex: 1; display: flex; min-height: 0; }
.jside { width: 252px; flex: none; border-right: 1px solid var(--line); background: var(--surface); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.jmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jtitle { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#jsum { white-space: nowrap; }
@media (min-width: 1181px) { #jpick { display: none; } }
@media (max-width: 1180px) { .jside { display: none; } #jsum { display: none; } }
@media (max-width: 680px) { .jtitle, #jnew span, #jblock span { display: none; } }

.mcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 650; }
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mcal .wd { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.mcal button { height: 30px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.mcal button:hover { background: var(--sage-100); }
.mcal button.other { color: #BDBBB3; }
.mcal button.inweek { background: var(--sage-100); border-radius: 0; }
.mcal button.today { color: var(--brand); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.mcal button.sel { background: var(--brand); color: #fff; font-weight: 650; border-radius: 8px; }
.side-section h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; }
.legend { display: grid; gap: 6px; font-size: 13px; }

.jscroll { flex: 1; overflow: auto; position: relative; background: var(--surface); }
.jrow { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(var(--colw, 170px), 1fr)); min-width: min-content; }
.jhead { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.jhead > div { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--line); min-width: 0; }
.jhead > div:first-child { border-left: none; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.jhead .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jhead .hrs { font-size: 12px; color: var(--muted); white-space: nowrap; }
.jhead .daynum { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; background: var(--bg); flex: none; }
.jhead .is-today .daynum { background: var(--brand); color: var(--cream); }
.jhead .clickable { cursor: pointer; }
.jhead .clickable:hover { background: var(--bg); }
.jtimes { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); }
.jtimes div { position: absolute; right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.jcol {
  position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) / 2 - 1px), #F2F3EF calc(var(--hour) / 2 - 1px), #F2F3EF calc(var(--hour) / 2));
}
.jcol.today-col { background-color: #FCFAFB; }
.jcol .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, #F4F4F0, #F4F4F0 6px, #ECECE6 6px, #ECECE6 12px); pointer-events: none; }
.jcol .hover-slot { position: absolute; left: 4px; right: 4px; border-radius: 7px; background: rgba(42, 85, 53, .07); border: 1px dashed var(--brand-400); pointer-events: none; font-size: 11px; color: var(--brand); padding: 2px 6px; display: none; }
.jcol:hover .hover-slot { display: block; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); z-index: 3; pointer-events: none; }
.now-line.first::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

.appt {
  position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 5px 8px 5px 10px;
  background: color-mix(in srgb, var(--c) 12%, #fff); border-left: 4px solid var(--c);
  color: var(--text); overflow: hidden; cursor: pointer; z-index: 2; font-size: 12px; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(46, 44, 37, .08); user-select: none; touch-action: none;
  transition: box-shadow .12s;
}
.appt:hover { box-shadow: 0 4px 14px rgba(46, 44, 37, .16); z-index: 3; }
.appt .t { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .c { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.st-cancelled, .appt.st-no_show { opacity: .6; }
.appt.st-cancelled .c { text-decoration: line-through; }
.appt.st-done { background: #F3F3F0; }
.appt.block { background: repeating-linear-gradient(-45deg, #EFEEE9, #EFEEE9 7px, #E6E4DD 7px, #E6E4DD 14px); border-left-color: var(--st-block); }
.appt.block .t, .appt.block .c { color: var(--taupe); }
.appt.dragging { opacity: .88; box-shadow: var(--shadow-lg); z-index: 10; cursor: grabbing; transition: none; }
.appt .src { position: absolute; top: 5px; right: 6px; font-size: 9px; font-weight: 800; letter-spacing: .04em; color: var(--brand); background: var(--sage-100); border-radius: 4px; padding: 1px 4px; }
.appt .who { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

/* ---------- appointment modal ---------- */
.statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.statuses button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.statuses button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.picker { position: relative; }
.picker-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; }
.picker-list div { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.picker-list div:hover { background: var(--bg); }
.chosen { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; }
.meta-line { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---------- pages ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kpi { padding: 16px; position: relative; overflow: hidden; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.kpi.accent .l, .kpi.accent .sub { color: var(--sage); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 10px; }
.bars > div { flex: 1; display: flex; flex-direction: column-reverse; min-height: 2px; height: 100%; justify-content: flex-start; position: relative; }
.bars > div i { display: block; border-radius: 3px 3px 0 0; }
.bars > div:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.bar-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.hbar { height: 8px; background: var(--sage-100); border-radius: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand-400); border-radius: 4px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg); }
.list-row.static { cursor: default; }
.list-row.static:hover { background: none; }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.staff-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .12s; }
.staff-card:hover { box-shadow: var(--shadow-lg); }
.days { display: flex; gap: 4px; }
.days span { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; background: #F2F2EE; color: #BDBBB3; }
.days span.on { background: var(--sage-100); color: var(--brand); }
.sched-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px; align-items: center; }
.svc-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; max-height: 220px; overflow-y: auto; }
.client-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .client-layout { grid-template-columns: 1fr; } }
.info-list { display: grid; gap: 12px; margin-top: 16px; }
.info-list div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { background: var(--bg); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--sage-100); color: var(--brand); font-weight: 600; font-size: 13px; }
.tag button { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.tag button:hover { background: rgba(0, 0, 0, .06); }
.override-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.override-row:last-child { border-bottom: none; }
.settings-nav { display: flex; gap: 4px; flex-wrap: wrap; position: sticky; top: -24px; z-index: 3; background: var(--bg); padding: 6px 0 10px; }
.settings-nav a { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--muted); font-weight: 600; }
.settings-nav a:hover { background: var(--surface); color: var(--text); }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.tpl h4 { margin: 0; font-size: 14px; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 4px; }
.placeholder-list code { font-size: 11px; background: var(--sage-100); color: var(--brand); padding: 2px 6px; border-radius: 5px; cursor: pointer; }
.notice { background: var(--cream-deep); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.notice.ok { background: var(--sage-100); color: var(--brand); }
.page-inner > .card { scroll-margin-top: 64px; }

/* payments */
.paybar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--bg); }
.paybar.ok { background: var(--sage-100); border-color: transparent; color: var(--brand); }
.paybar.due { background: #FBF3E2; border-color: #F0DDB5; }
.appt .src.paid { color: var(--brand); background: var(--sage-100); }
.appt .src.due { color: #8A5A00; background: #FBF0D9; }

/* iPhone status bar / notch (in the Lioh app and full-screen Safari): keep content clear of it */
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); min-height: calc(66px + env(safe-area-inset-top)); }
.side { padding-top: calc(22px + env(safe-area-inset-top)); }
.auth-hero { padding-top: calc(52px + env(safe-area-inset-top)); }
.overlay { padding-top: calc(6vh + env(safe-area-inset-top)); }
@media (max-width: 820px) { .auth-hero { padding-top: calc(30px + env(safe-area-inset-top)); } }
@media (max-width: 680px) {
  .topbar { padding-top: calc(8px + env(safe-area-inset-top)); }
  .side { padding-top: 0; }
}
html.in-app body { -webkit-tap-highlight-color: transparent; }

/* rebrand: serif page titles, cream canvas */
.topbar h1 { font-size: 28px; color: var(--brand); }
.side { background: var(--surface); }
.kpi .v { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.side-section h4 { font-family: var(--font-display); letter-spacing: .16em; color: var(--ink); }
.cat, .settings-nav a, .tabs button, .chips button, .seg button, .btn { font-family: inherit; }
.jtitle { font-family: var(--font-display); font-weight: 700; }

/* artist schedule: studio-hours summary and the custom-days picker */
.studio-hours { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; padding: 12px 14px; background: var(--cream); border-radius: 10px; font-size: 13px; }
.studio-hours b { font-family: var(--font-display); margin-right: 4px; }
.studio-hours a { flex-basis: 100%; }
.daypick { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); }
.dp-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-weight: 700; margin-bottom: 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-wd { text-align: center; font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.dp-day { min-height: 54px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px 2px; }
.dp-day b { font-size: 14px; }
.dp-day small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.dp-day.none { background: #F7F4F1; }
.dp-day.none b { color: var(--muted); font-weight: 500; }
.dp-day.cus { background: var(--sage-100); border-color: var(--brand-400); }
.dp-day.cus small { color: var(--brand); font-weight: 700; }
.dp-day.off { background: repeating-linear-gradient(-45deg, #F3EEE9, #F3EEE9 5px, #E9E1D9 5px, #E9E1D9 10px); }
.dp-day.off small { color: var(--danger); font-weight: 700; }
.dp-day.today b { text-decoration: underline; text-underline-offset: 3px; }
.dp-day.out { opacity: .45; }
.dp-day.sel { background: var(--brand); border-color: var(--brand); color: var(--cream); }
.dp-day.sel small { color: var(--sage); }
.dp-day:disabled { opacity: .3; cursor: default; }
.dp-day:not(:disabled):hover { border-color: var(--brand); }
.dp-bar { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--cream); }
.dp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.dp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.lg.reg { background: var(--surface); } .lg.cus { background: var(--sage-100); border-color: var(--brand-400); }
.lg.off { background: repeating-linear-gradient(-45deg, #F3EEE9, #F3EEE9 3px, #E9E1D9 3px, #E9E1D9 6px); } .lg.sel { background: var(--brand); border-color: var(--brand); }
@media (max-width: 560px) { .dp-day { min-height: 46px; } .dp-day small { font-size: 9px; } }

/* days off: no new appointments */
.jcol.dayoff { cursor: not-allowed; }
