/* Flowthera back office */
.wordmark { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.wordmark b { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.wordmark span { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.admin-nav { min-height: 64px; }
.tabs { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.tabs a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.tabs a.active { background: var(--ink); color: #fff; }
.admin-main { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 36px); letter-spacing: -0.02em; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .num { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .label { margin-top: 8px; color: var(--ink-3); font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { font-size: 17px; font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 2fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: #edefeb; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.spark span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.list li:first-child { border-top: 0; }
.list a { color: var(--ink); text-decoration: none; font-weight: 600; }
.list a:hover { color: var(--accent); }
.list .meta { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.empty { color: var(--ink-3); font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { font: inherit; font-size: 15px; min-height: 44px; padding: 0 12px; border: 1px solid #cfd5d2; border-radius: 10px; background: var(--surface); color: var(--ink); }
.toolbar input { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
th { border-top: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; background: var(--bg); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
.status { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.status-new { background: #fdf0d9; color: #7a4a05; }
.status-talking { background: var(--accent-soft); color: var(--accent-ink); }
.status-customer { background: var(--accent); color: #fff; }
.status-lost { background: #edefeb; color: var(--ink-3); }
.detail { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input, .field select, .field textarea { min-height: 44px; }
.field textarea { min-height: 90px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input[type=date], .inline input[type=text] { font: inherit; font-size: 15px; min-height: 44px; padding: 0 12px; border: 1px solid #cfd5d2; border-radius: 10px; background: var(--bg); }
.inline input[type=text] { flex: 1; min-width: 160px; }
.note { padding: 12px 0; border-top: 1px solid var(--line); white-space: pre-wrap; font-size: 15px; color: var(--ink-2); }
.note:first-of-type { border-top: 0; }
.note time, .fu time { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.fu { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.fu input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.fu.done span { text-decoration: line-through; color: var(--ink-3); }
.overdue { color: #a3361b; font-weight: 600; }
.btn-danger { border-color: #a3361b; color: #a3361b; background: transparent; }
.btn-danger:hover { background: #a3361b; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 100; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(13, 27, 30, .4); }
@media (max-width: 860px) {
  .stats, .two, .detail, .form-grid { grid-template-columns: 1fr; }
}

/* Sign-in */
.login-body { min-height: 100vh; display: flex; }
.login-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; display: flex; flex-direction: column; gap: 24px; }
.login-card h1 { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.02em; }
.form-plain { display: flex; flex-direction: column; gap: 16px; }
.form-plain[hidden], .field[hidden] { display: none; }

/* Settings */
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); }
.key-row { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.key-row:first-of-type { border-top: 0; }
.key-row code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.key-row input { font: inherit; font-size: 15px; min-height: 44px; padding: 0 12px; border: 1px solid #cfd5d2; border-radius: 10px; background: var(--bg); width: 100%; }
.pill-ok { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.pill-off { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #edefeb; color: var(--ink-3); }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.qr img, .qr svg { width: 100%; height: 100%; }
.secret-once { background: #fdf0d9; border: 1px solid #f0d9a8; border-radius: 12px; padding: 12px 14px; font-size: 15px; }
@media (max-width: 860px) {
  .key-row { grid-template-columns: 1fr; }
  .admin-nav { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .user-menu span { display: none; }
}
