/* Pipelume app UI. Uses tokens from styles.css */
.app-body { background: var(--mist); min-height: 100vh; }
.loading { text-align: center; padding: 80px 24px; color: var(--slate); }
.hidden { display: none !important; }

/* Auth + onboarding */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 28px; }
.auth-card .brand { margin-bottom: 20px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card p.sub { color: var(--slate); margin: 0 0 20px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--violet-dark); text-decoration: underline; cursor: pointer; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--violet-tint); border-color: var(--violet); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn-danger { background: var(--white); color: #c0213f; border-color: #f3c2cb; }
.btn-danger:hover { background: #fff1f3; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.error { color: #c0213f; background: #fff1f3; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.notice-ok { color: #0d7a52; background: #e8faf2; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }

/* Shell */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand .mark { width: 32px; height: 32px; }
.topbar .wordmark { font-size: 22px; }
.ws-name { color: var(--slate); font-size: 14px; font-weight: 500; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { background: var(--white); border-bottom: 1px solid var(--line); }
.tabs-in { max-width: 1200px; margin: 0 auto; padding: 0 8px; display: flex; gap: 4px; overflow-x: auto; }
.tab { padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--slate); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--violet-dark); border-bottom-color: var(--violet); }
.main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 80px; }
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.view-head h1 { font-size: 26px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar .input { flex: 1 1 180px; width: auto; }
.toolbar .select { width: auto; flex: 0 1 160px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.form-grid { display: grid; gap: 0 14px; }
.empty { text-align: center; color: var(--slate); padding: 36px 16px; }
.empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* Lists */
.list { display: grid; gap: 10px; }
.row { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%; font: inherit; color: inherit; }
button.row { cursor: pointer; }
button.row:hover { border-color: var(--violet); }
.row-main { min-width: 0; flex: 1 1 0; }
.row { min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--slate); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; gap: 8px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.badge-s { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: var(--violet-tint); color: var(--violet-dark); }
.badge-s.src { background: var(--mist); color: var(--slate); }
.badge-s.warn { background: #fff4de; color: #8a5a00; }
.badge-s.good { background: #e8faf2; color: #0d7a52; }
.badge-s.bad { background: #fff1f3; color: #c0213f; }
.back { margin-bottom: 12px; }

/* Timeline */
.timeline { display: grid; gap: 10px; margin-top: 12px; }
.tl-item { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.tl-meta { font-size: 12px; color: var(--slate); }
.tl-body { white-space: pre-wrap; word-break: break-word; }

/* Pipeline board */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 260px; background: var(--violet-tint); border-radius: 16px; padding: 12px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.col-head h2 { font-size: 15px; }
.col-sum { font-size: 12px; color: var(--slate); }
.deal { background: var(--white); border-radius: 12px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.deal-title { font-weight: 600; word-break: break-word; }
.deal-meta { font-size: 13px; color: var(--slate); margin: 2px 0 8px; }
.deal-actions { display: flex; gap: 8px; }
.deal-actions .select { font-size: 14px; padding: 7px 8px; }
.col-empty { font-size: 13px; color: var(--slate); text-align: center; padding: 10px 0; }

/* Tasks */
.task { display: flex; gap: 12px; align-items: flex-start; }
.task input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.task-done .row-title { text-decoration: line-through; color: var(--slate); }

/* Settings */
.keybox { background: var(--ink); color: var(--white); border-radius: 12px; padding: 14px; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; margin: 10px 0; }
pre.code { background: var(--ink); color: #e9e7ff; border-radius: 12px; padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 10px 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: 90vw; }
.toast.bad { background: #c0213f; }

@media (min-width: 700px) {
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .main { padding: 28px 24px 80px; }
}

.powered { margin-top: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }
.formbox { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.formbox .input[readonly] { font-size: 14px; }

.ws-switch { width: auto; max-width: 44vw; padding: 7px 10px; font-size: 14px; }
.sub-h { font-size: 16px; margin: 18px 0 6px; }
