/* Owner login + dashboard. Builds on /styles.css tokens. */

[hidden] { display: none !important; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading { opacity: .7; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; text-align: left; }
.linkish:hover { color: var(--ink); }

/* ---------- form fields ---------- */
.f { display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.f > span, .f legend { font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 0; }
.f-help { font-size: 13px !important; font-weight: 400 !important; color: var(--muted) !important; }
.dash input:not([type=checkbox]):not([type=file]), .dash select, .dash textarea,
.auth input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 13px; min-height: 46px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dash textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.dash input:focus, .dash select:focus, .dash textarea:focus, .auth input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft);
}
.dash ::placeholder, .auth ::placeholder { color: #a99f90; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15.5px; margin: 0 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; margin: 0; }
.form-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.form-msg.err { color: var(--accent-ink); }
.form-msg.ok { color: var(--green); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---------- login ---------- */
.auth { max-width: 460px; margin: 0 auto; padding: 72px 20px 96px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px 30px 26px; box-shadow: 0 30px 60px -40px rgba(40, 20, 10, .25); }
.auth h1 { font-family: var(--serif); font-size: 44px; line-height: 1; margin: 16px 0 12px; }
.auth-card p { margin: 0 0 22px; }
.auth-step .btn { margin-top: 4px; }
.auth-alt { margin: 18px 0 0 !important; color: var(--muted); }
.auth-foot { text-align: center; margin-top: 22px; }
.code-input { letter-spacing: .35em; font-variant-numeric: tabular-nums; font-size: 22px !important; text-align: center; }
@media (max-width: 480px) { .auth { padding-top: 40px; } .auth-card { padding: 26px 20px 20px; } }

/* ---------- dashboard shell ---------- */
.dash-page .nav .wrap { gap: 14px; }
.dash-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dash-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.outlet-pick select { min-height: 40px !important; padding: 6px 30px 6px 12px !important; font-size: 14.5px !important; max-width: 220px; border-radius: 999px !important; }
@media (max-width: 720px) { .dash-email { display: none; } .outlet-pick select { max-width: 150px; } }
@media (max-width: 480px) {
  .dash-page .logo { font-size: 0; gap: 0; }
  .dash-page .nav .btn { padding: 0 14px; }
  .outlet-pick select { max-width: 170px; }
}

.dash { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 120px; align-items: start; }
.dash-tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 92px; }
.dash-tabs a { text-decoration: none; padding: 10px 14px; border-radius: 10px; font-size: 15.5px; color: var(--ink-2); }
.dash-tabs a:hover { background: var(--paper-2); color: var(--ink); }
.dash-tabs a[aria-current=page] { background: var(--ink); color: var(--paper); }
.dash-main { min-width: 0; }
.dash-main > .dash-loading { padding: 40px 0; }
.dash-tabs[hidden] + .dash-main { grid-column: 1 / -1; max-width: 640px; margin: 0 auto; width: 100%; }
@media (max-width: 860px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 18px; }
  .dash-tabs { flex-direction: row; overflow-x: auto; position: sticky; top: 68px; z-index: 5; margin: 0 -24px; padding: 10px 24px; background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: 14.5px; }
}

.dash-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 10px; }
.dash-h1 { font-family: var(--serif); font-size: clamp(36px, 4.4vw, 50px); line-height: 1.02; letter-spacing: -0.02em; }
.box .dash-h1 { margin: 14px 0 10px; }
.lede-sm { font-size: 17px; color: var(--ink-2); margin: 4px 0 30px; max-width: 42em; }
.sub-h { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.dash-main > p.muted { margin: 0 0 24px; max-width: 42em; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin: 0 0 20px; min-width: 0; }
.box.flush { padding: 0; overflow: hidden; }
.box-pad { padding: 22px 24px; }
.box-pad + .tbl { border-top: 1px solid var(--line); }
.box-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 10px; padding: 0; }
.box-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 22px 24px 0; }
.box:has(> .box-row) { padding: 0; overflow: hidden; }
.box:has(> .box-row) > .empty { padding: 0 24px 22px; }
.box:has(> .box-row) > .tbl { margin-top: 14px; }
.box p:last-child { margin-bottom: 0; }
.box .btn { min-height: 44px; font-size: 15px; margin-top: 6px; }
.group { margin-bottom: 20px; }
.group legend { float: left; width: 100%; margin-bottom: 16px; }
.group legend + * { clear: both; }
.big-num { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .box { padding: 20px; } }

.note { background: var(--green-soft); border: 1px solid #c4dccd; color: #164f35; border-radius: var(--radius); padding: 12px 16px; font-size: 15px; margin: 0 0 22px; }

.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; padding: 5px 12px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-trial { background: var(--accent-soft); border-color: #e6c6b7; color: var(--accent-ink); }
.badge-active { background: var(--green-soft); border-color: #c4dccd; color: var(--green); }
.badge-paused, .badge-cancelled { color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 13.5px; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 40px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--muted); }
.meter { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* tables */
.dash .tbl { margin: 0; border: 0; border-radius: 0; }
.dash .tbl th { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--paper); }
.dash .tbl td { font-size: 15px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.call-sum span { display: block; }
.call-sum { min-width: 220px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 550; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.tag-order { background: var(--green-soft); color: var(--green); }
.tag-booking { background: var(--accent-soft); color: var(--accent-ink); }
.tag-handoff { background: #ece6f3; color: #4d3a6b; }
.empty { padding: 4px 0; }
.box.flush > div > .empty { padding: 22px 24px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* menu editor */
.menu-tbl td { padding: 6px 6px !important; vertical-align: middle !important; }
.menu-tbl th { padding: 10px 6px !important; }
.menu-tbl th:first-child, .menu-tbl td:first-child { padding-left: 18px !important; }
.menu-tbl th:last-child, .menu-tbl td:last-child { padding-right: 14px !important; }
.menu-tbl input:not([type=checkbox]), .menu-tbl select { min-height: 40px !important; padding: 7px 10px !important; font-size: 15px !important; border-color: transparent !important; background: transparent !important; }
.menu-tbl input:not([type=checkbox]):hover, .menu-tbl select:hover { border-color: var(--line-2) !important; }
.menu-tbl input:focus, .menu-tbl select:focus { border-color: var(--ink) !important; background: var(--card) !important; }
.menu-tbl td:nth-child(1) { width: 22%; }
.menu-tbl td:nth-child(3) { width: 110px; }
.menu-tbl td:nth-child(4) { width: 120px; }
.menu-tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.menu-tbl table { min-width: 640px; }
.price-in { text-align: right; font-variant-numeric: tabular-nums; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); color: var(--accent-ink); }

.paste { margin-top: 16px; }
.paste summary { cursor: pointer; font-size: 15px; color: var(--ink-2); }
.paste p { margin: 10px 0; }
.paste textarea { margin-bottom: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 14.5px !important; }

.files { list-style: none; margin: 0 0 12px; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.files li:last-child { border-bottom: 0; }
.files li .linkish { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 12px; margin-top: 6px; }
.langs-pick legend { margin-bottom: 4px; }

/* sticky save */
.save-bar { position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 10px 10px 10px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 12px 30px -16px rgba(40, 20, 10, .3); }
.save-bar .form-msg { margin: 0; flex: 1; min-height: 0; }
.save-bar.dirty { border-color: var(--ink); }
.save-bar .btn { min-height: 44px; }
@media (max-width: 480px) { .save-bar { border-radius: var(--radius); flex-wrap: wrap; padding: 12px; } .save-bar .btn { width: 100%; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 100; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-size: 15px; transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent-ink); }

/* calls as stacked rows on phones */
@media (max-width: 600px) {
  .calls-tbl thead { display: none; }
  .calls-tbl table, .calls-tbl tbody { display: block; }
  .calls-tbl tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .calls-tbl tr:last-child { border-bottom: 0; }
  .calls-tbl td { display: block; padding: 0 !important; border: 0 !important; }
  .calls-tbl td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 14px; color: var(--muted); }
  .calls-tbl td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .calls-tbl td:nth-child(4) { grid-column: 3; grid-row: 1; }
  .calls-tbl td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .calls-tbl td:nth-child(5) { display: none; }
}
