.adm { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav .brand { padding: 4px 8px 14px; }
.nav > button { background: none; border: 0; color: var(--muted); text-align: left; padding: 9px 10px; border-radius: 6px; }
.nav > button.on { background: #1d2430; color: var(--ink); }
.navfoot { margin-top: auto; display: flex; gap: 6px; }
.badge { background: var(--down); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; margin-left: 4px; }

.main { padding: 20px 24px; min-width: 0; }
.main h1 { font-size: 20px; margin: 0 0 16px; display: flex; align-items: center; justify-content: space-between; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.box .h { border-bottom: 1px solid var(--line); }
.pill { display: inline-block; border-radius: 9px; padding: 1px 8px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.up { border-color: #14532d; color: var(--up); } .pill.down { border-color: #7f1d1d; color: var(--down); } .pill.warn { border-color: #78350f; color: var(--warn); }
.act { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 3px 10px; margin-left: 4px; }
.act.danger { color: var(--down); }
.act.ok { color: var(--up); }
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input { width: auto; }

/* 方案設定器 */
.sheet.wide { width: min(980px, 96vw); max-height: 92vh; overflow: auto; }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fgrid label, .ph label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; font-size: 13px; }
.ph { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; }
.ph .t { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.ph .g { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.chk { flex-direction: row !important; align-items: center !important; gap: 6px !important; }
.chk input { width: auto; }
.formfoot { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.formfoot .primary { width: auto; padding: 9px 20px; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 違規明細展開列 */
tr.detail > td { background: var(--downbg); font-size: 13px; line-height: 1.7; padding: 12px 14px; }


/* 風控 */
.alert { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.alert.high { border-left: 3px solid var(--down); }
.alert.medium { border-left: 3px solid var(--warn); }
.alert.done { opacity: .55; }
.alert .t { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.alert .t .who { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 13px; }
.alert p { margin: 6px 0; color: var(--muted); font-size: 13px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; font-variant-numeric: tabular-nums; }
.aiwrap { display: flex; flex-direction: column; height: calc(100vh - 110px); }
.aiwrap .chatlog { flex: 1; padding: 14px; }
.aiwrap .bub.them { max-width: 92%; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.sugg button { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 16px; padding: 5px 12px; font-size: 13px; }
.aibox { margin-top: 10px; background: var(--panel2); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; line-height: 1.6; }
.sup { display: grid; grid-template-columns: 280px 1fr; gap: 14px; height: calc(100vh - 110px); }
.sup .list { overflow-y: auto; }
.sup .list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); padding: 10px 12px; }
.sup .list button.on { background: #1d2430; }
.sup .list .l2 { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup .thread { display: flex; flex-direction: column; padding: 12px; min-height: 0; }
.sup .thread .chatlog { flex: 1; }
