:root { color-scheme: light; --blue:#1769e0; --ink:#172033; --muted:#64748b; --line:#dbe4f0; --bg:#f5f8fc; --good:#087f5b; --bad:#c92a2a; }
* { box-sizing: border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--ink); background:var(--bg); }
.shell { width:min(1180px,calc(100% - 32px)); margin:28px auto 60px; }
.card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px; margin-bottom:18px; box-shadow:0 8px 26px rgba(25,52,93,.05); }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:30px; margin-bottom:6px; }
h2 { font-size:20px; }
.muted { color:var(--muted); }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.grid3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.grid4 { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
label { display:block; font-weight:650; font-size:14px; }
input,select { width:100%; margin-top:7px; min-height:44px; padding:9px 12px; border:1px solid #cbd7e6; border-radius:10px; font-size:15px; background:#fff; }
.credential-status { display:block; margin-top:6px; color:var(--muted); font-size:12px; font-weight:500; }
button,.button { border:0; border-radius:10px; min-height:42px; padding:10px 18px; font-weight:700; font-size:15px; cursor:pointer; background:var(--blue); color:#fff; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
button.secondary,.button.secondary { background:#eaf1fb; color:#234164; }
button.danger { background:#c92a2a; }
button.ghost-danger { background:#fff0f0; color:#b42318; border:1px solid #ffd1d1; }
button.compact { min-height:34px; padding:7px 12px; font-size:13px; }
button:disabled { opacity:.55; cursor:not-allowed; }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:16px; }
.stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.stat { padding:14px; border:1px solid var(--line); border-radius:12px; background:#fbfdff; }
.stat strong { display:block; font-size:24px; margin-top:4px; }
.notice { padding:12px 14px; border-radius:10px; margin:12px 0; background:#edf5ff; color:#174b86; white-space:pre-wrap; }
.notice.error { background:#fff0f0; color:var(--bad); }
.notice.good { background:#ebfbee; color:var(--good); }
.setup-guide { margin:14px 0 18px; padding:15px 17px; border:1px solid #cfe0f5; border-radius:12px; background:#f6faff; }
.setup-guide ol { margin:10px 0; padding-left:22px; color:#334155; line-height:1.7; }
.setup-guide p { margin:8px 0 0; color:var(--muted); }
.target-card { margin:16px 0 18px; padding:17px; border:1px solid #d6e0ec; border-radius:14px; background:#fbfdff; }
.target-card[data-state="ready"] { border-color:#9fd8c2; background:#f0fbf6; }
.target-card[data-state="warning"] { border-color:#ffd18a; background:#fff9ed; }
.target-card[data-state="error"] { border-color:#ffc9c9; background:#fff5f5; }
.target-card-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.target-card-heading h3 { margin:8px 0 5px; font-size:20px; }
.target-card-heading p { margin:0; }
.target-badge { display:inline-flex; align-items:center; min-height:25px; padding:4px 9px; border-radius:999px; background:#e9eef5; color:#516176; font-size:12px; font-weight:800; }
.target-card[data-state="ready"] .target-badge { background:#d9f5e8; color:#087f5b; }
.target-card[data-state="warning"] .target-badge { background:#fff0c7; color:#8a5a00; }
.target-card[data-state="error"] .target-badge { background:#ffe0e0; color:#b42318; }
.target-meta { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:15px; }
.target-meta div { min-width:0; padding:11px 12px; border:1px solid rgba(166,183,204,.5); border-radius:10px; background:rgba(255,255,255,.76); }
.target-meta span,.target-meta strong { display:block; }
.target-meta span { color:var(--muted); font-size:11px; }
.target-meta strong { margin-top:5px; font-size:13px; overflow-wrap:anywhere; }
.binding-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.binding-chip { display:inline-flex; align-items:center; min-height:28px; padding:5px 9px; border-radius:999px; font-size:12px; font-weight:700; background:#e8f7ef; color:#087f5b; }
.binding-chip.missing { background:#fff0d8; color:#925b00; }
.target-promise { margin:13px 0 0; padding-top:12px; border-top:1px dashed #cbd7e6; color:#334155; font-size:13px; font-weight:650; }
.required { margin-left:5px; color:#c92a2a; font-size:12px; font-weight:700; }
.field-mapping { margin-top:16px; padding:14px 16px 17px; border:1px solid var(--line); border-radius:12px; background:#fbfdff; }
.field-mapping summary { cursor:pointer; font-weight:800; }
.field-mapping .muted { margin:10px 0 14px; }
.hidden { display:none !important; }
.toolbar { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; }
.assets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:14px; }
.asset { border:1px solid var(--line); border-radius:12px; padding:14px; display:grid; grid-template-columns:auto 1fr; gap:12px; }
.asset input { width:20px; height:20px; min-height:0; margin:2px 0 0; }
.asset h3 { font-size:16px; line-height:1.45; margin-bottom:8px; }
.asset p { margin:4px 0; font-size:13px; color:var(--muted); }
.asset a { color:var(--blue); overflow-wrap:anywhere; }
.tenant-row { border-top:1px solid var(--line); padding:16px 0; display:grid; grid-template-columns:1.2fr 1fr 1fr auto; gap:12px; align-items:center; }
.tenant-row:first-child { border-top:0; }
code { background:#eef3f9; padding:2px 6px; border-radius:6px; }

.admin-shell { width:min(1360px,calc(100% - 32px)); }
.admin-hero { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; padding:28px; background:linear-gradient(135deg,#ffffff 0%,#f3f8ff 68%,#eaf3ff 100%); }
.admin-hero h1 { margin-bottom:8px; }
.admin-hero .muted { margin-bottom:0; max-width:760px; line-height:1.65; }
.admin-hero-actions { justify-content:flex-end; }
.eyebrow { margin:0 0 8px; color:var(--blue); font-size:12px; font-weight:850; letter-spacing:.14em; }
.overview-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.overview-stat { background:#fff; box-shadow:0 8px 26px rgba(25,52,93,.04); }
.overview-stat span { display:block; color:var(--muted); font-size:12px; margin-top:7px; }
.section-heading { align-items:flex-end; margin-bottom:18px; }
.section-heading h2,.section-heading p { margin-bottom:0; }
.sync-meta { display:inline-flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.live-dot { width:9px; height:9px; border-radius:50%; background:#20a36a; box-shadow:0 0 0 4px rgba(32,163,106,.12); }
.credential-box { margin-top:16px; padding:15px 16px; border:1px solid #b9d5ff; border-radius:12px; background:#f3f8ff; }
.credential-box pre { margin:12px 0 0; padding:12px; border-radius:10px; background:#fff; border:1px solid var(--line); font:14px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.tenant-list { display:grid; gap:16px; }
.tenant-card { border:1px solid var(--line); border-radius:15px; padding:18px; background:#fcfdff; }
.tenant-card-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.tenant-title-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.tenant-title-line h3 { margin:0; font-size:19px; }
.tenant-code { display:inline-block; margin-top:7px; color:#4a617c; }
.tenant-header-actions { margin-top:0; }
.status-badge { display:inline-flex; align-items:center; min-height:26px; padding:4px 9px; border-radius:999px; font-size:12px; font-weight:800; }
.status-badge.active { color:#087f5b; background:#dff8ed; }
.status-badge.paused { color:#9b2c2c; background:#fff0f0; }
.tenant-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:16px; }
.tenant-metric { padding:12px 13px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.tenant-metric span,.tenant-metric small { display:block; color:var(--muted); font-size:12px; }
.tenant-metric strong { display:block; margin:5px 0 4px; font-size:22px; }
.tenant-monitor-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
.monitor-block { padding:13px; border-radius:11px; background:#f1f5fa; }
.monitor-block strong,.monitor-block span { display:block; }
.monitor-block strong { margin-bottom:7px; font-size:14px; }
.monitor-block span { color:#5d6d82; font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
.tenant-editor { display:grid; grid-template-columns:1fr .6fr 1.35fr auto; gap:10px; align-items:end; margin-top:14px; padding-top:14px; border-top:1px dashed #ccd8e6; }
.tenant-field { min-width:0; }
.tenant-editor-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.activity-list { display:grid; }
.activity-row { display:grid; grid-template-columns:14px 1fr; gap:12px; padding:13px 0; border-top:1px solid #edf1f6; }
.activity-row:first-child { border-top:0; }
.activity-marker { width:10px; height:10px; margin-top:5px; border-radius:50%; background:var(--blue); box-shadow:0 0 0 4px rgba(23,105,224,.1); }
.activity-marker.failed { background:#d94841; box-shadow:0 0 0 4px rgba(217,72,65,.1); }
.activity-heading { display:flex; justify-content:space-between; gap:12px; }
.activity-time { color:var(--muted); font-size:12px; white-space:nowrap; }
.activity-copy { margin-top:3px; color:#334155; font-size:14px; }
.activity-detail { margin-top:5px; color:#a33a32; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.empty-state { padding:28px; text-align:center; border:1px dashed #cbd7e6; border-radius:12px; color:var(--muted); background:#fbfdff; }

@media(max-width:1050px){
  .overview-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .grid4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tenant-editor { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tenant-editor-actions { grid-column:1/-1; }
}
@media(max-width:800px){
  .grid,.grid3,.grid4,.assets,.stats,.overview-grid,.tenant-metrics,.tenant-monitor-grid,.tenant-editor,.target-meta { grid-template-columns:1fr; }
  .target-card-heading { flex-direction:column; }
  .tenant-row { grid-template-columns:1fr; }
  .admin-hero,.tenant-card-header { align-items:stretch; flex-direction:column; }
  .admin-hero-actions,.tenant-header-actions { justify-content:flex-start; }
  .activity-heading { flex-direction:column; gap:3px; }
}
