/* 補充元件樣式(移植自 dev/mvp/v19/partials/styles.php)。
   沿用 style.css 的 :root 變數(--ink / --paper / --c-* / --sh-* / --font-*)。
   登入頁 / Console / 統計卡 / 表單用。 */

/* ---------- header 登入態小標 ---------- */
.nav-user { display: inline-flex; flex-direction: column; align-items: flex-end; justify-content: center; line-height: 1.15; margin-right: 4px; max-width: 180px; }
.nav-user-name { font-family: var(--font-pixel); font-weight: 700; font-size: 13px; color: var(--ink); letter-spacing: .5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-plan { font-family: var(--font-pixel); font-size: 11px; font-weight: 700; color: var(--ink); background: var(--c-yellow); border: 2px solid var(--ink); padding: 1px 6px; margin-top: 3px; letter-spacing: .5px; }
@media (max-width: 860px) {
  .nav-user { display: none; }
  .nav-inner.open .nav-user { display: inline-flex; order: 5; flex-basis: 100%; align-items: flex-start; margin: 6px 0 0; }
}

/* ---------- 通用卡片 / 表單 ---------- */
.card { background: #fff; border: 4px solid var(--ink); box-shadow: var(--sh-hard); padding: 18px; }
.flash { border: 3px solid var(--ink); padding: 10px 14px; margin-bottom: 16px; font-weight: 700; font-size: 14px; box-shadow: var(--sh-sm); }
.flash.error { background: #ffd9de; color: #7a1822; }
.flash.success { background: var(--c-mint); color: var(--ink); }
.flash.info { background: var(--c-sky); color: var(--ink); }

.auth-form .form-row, .form-row { margin-bottom: 14px; }
.form-row label { display: block; font-family: var(--font-pixel); font-weight: 700; font-size: 14px; color: var(--ink); letter-spacing: .5px; margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email], .form-row input[type=number], .form-row select {
  width: 100%; padding: 11px 12px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 15px; font-family: var(--font-body); }
.form-row input:focus, .form-row select:focus { outline: 3px solid var(--c-sky); outline-offset: 1px; }
.demo-hint { margin-top: 22px; padding: 12px 14px; background: var(--paper-2); border: 2px dashed var(--c-lilac-d); font-size: 13px; color: var(--ink); line-height: 1.7; }
.demo-hint code, .auth-form code { background: var(--ink); color: var(--c-yellow); padding: 1px 6px; font-family: var(--font-pixel), monospace; font-size: 12px; }

/* ---------- Console 版面 ---------- */
.console-wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; position: relative; z-index: 1; }
.console-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.console-head h1 { font-family: var(--font-head); font-size: clamp(20px,3vw,28px); color: var(--ink); letter-spacing: 1px; line-height: 1.4; }
.console-head .sub { color: var(--ink-soft); font-size: 15px; font-weight: 600; margin-top: 6px; }
.console-layout { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: start; }
.console-side { background: #fff; border: 4px solid var(--ink); box-shadow: var(--sh-hard); padding: 10px; position: sticky; top: 16px; }
.console-side a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; border: 2px solid transparent; }
.console-side a .ico { font-size: 17px; }
.console-side a:hover { background: var(--paper-2); }
.console-side a.is-active { background: var(--c-sky); border-color: var(--ink); box-shadow: var(--sh-sm); }
.console-main { min-width: 0; }

/* ---------- 統計卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 16px; }
.stat-card { background: #fff; border: 4px solid var(--ink); box-shadow: var(--sh-hard); padding: 18px; }
.stat-card .label { font-family: var(--font-pixel); font-size: 13px; font-weight: 700; color: var(--ink-soft); letter-spacing: .5px; }
.stat-card .value { font-family: var(--font-head); font-size: 26px; color: var(--ink); margin-top: 10px; line-height: 1.2; }
.stat-card .value small { font-family: var(--font-body); font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.stat-card .stat-sub { font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); margin-top: 8px; opacity: .8; line-height: 1.3; }
.stat-card.accent-yellow { background: var(--c-yellow); }
.stat-card.accent-mint { background: var(--c-mint); }
.stat-card.accent-sky { background: var(--c-sky); }
.stat-card.accent-pink { background: var(--c-pink); }

.section-block { margin-top: 30px; }
.section-block > h2 { font-family: var(--font-pixel); font-weight: 700; font-size: 20px; color: var(--ink); letter-spacing: 1px; margin-bottom: 14px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 14px; }
.quick-card { display: block; text-align: center; padding: 20px 12px; background: #fff; border: 4px solid var(--ink); box-shadow: var(--sh-hard); color: var(--ink); text-decoration: none; }
.quick-card:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-pop); }
.quick-card .qi { font-size: 30px; }
.quick-card .ql { font-weight: 900; margin-top: 8px; font-size: 15px; }

/* ---------- 狀態徽章 ---------- */
.st-badge { display: inline-block; font-family: var(--font-pixel); font-size: 12px; font-weight: 700; padding: 3px 9px; border: 2px solid var(--ink); letter-spacing: .5px; }
.st-badge.done { background: var(--c-mint); color: var(--ink); }
.st-badge.queued { background: var(--c-yellow); color: var(--ink); }
.st-badge.failed { background: #ffd9de; color: #7a1822; }
.st-badge.muted { background: #ececf2; color: #6b7188; }
.scope-badge { display: inline-block; font-family: var(--font-pixel); font-size: 11px; font-weight: 700; padding: 2px 8px; border: 2px solid var(--ink); }
.scope-badge.public { background: var(--c-sky); color: var(--ink); }
.scope-badge.secret { background: var(--c-lilac); color: var(--ink); }
code.key-mono { font-family: var(--font-pixel), monospace; font-size: 13px; color: var(--ink); }

/* ---------- 手機響應式(console) ---------- */
@media (max-width: 860px) {
  .console-layout { grid-template-columns: 1fr; }
  .console-side { position: static; top: auto; display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding: 8px; }
  .console-side a { flex: 0 0 auto; white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .console-main .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .console-head { align-items: flex-start; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
