:root {
  --accent: #1D4ED8;
  --accent-dark: #15399E;
  --ink: #11151B;
  --muted: #6B7280;
  --subtle: #9AA1AC;
  --border: #E3E6EA;
  --bg: #F5F6F8;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.shell { display: flex; min-height: 100vh; }

.sidebar { width: 220px; flex: 0 0 220px; background: #1C2230; color: #fff; padding: 20px 14px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { font-weight: 700; font-size: 15px; margin-bottom: 20px; padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #C7CCD6; padding: 10px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.nav a:hover { background: #2A3142; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.build-info { margin-top: auto; padding: 10px 8px 0; font-size: 11px; line-height: 1.5; color: #7C8495; border-top: 1px solid #2A3142; }

.content { flex: 1 1 auto; padding: 28px 32px; max-width: 980px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.page-sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.card-desc { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-text { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: #1B9E5A; }
.dot-off { background: #D1472C; }
.dot-warn { background: #B8860B; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid #D9DCE1; }
.btn-secondary:hover { background: #F7F8FA; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px dashed #D9DCE1; }
.btn[disabled] { opacity: 0.6; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-width: 420px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.field input, .field select { min-height: 38px; border: 1px solid #D9DCE1; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.hint { font-size: 11px; color: var(--subtle); }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #EEF2FF; color: var(--accent); font-size: 12px; font-weight: 600; font-family: inherit; border: none; }
button.chip:hover { background: #DCE4FF; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge-source { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: #EEF2FF; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { min-height: 40px; padding: 9px 18px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; background: #EEF0F3; color: #374151; }
.tabs button.active { background: var(--accent); color: #fff; }

.table-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F0F1F3; font-size: 13px; align-items: center; }
.table-row:last-child { border-bottom: none; }
.table-row .col-1 { flex: 0 0 160px; font-weight: 600; }
.table-row .col-2 { flex: 1; color: var(--muted); }
.table-row .col-3 { flex: 0 0 auto; color: var(--subtle); font-size: 12px; }

.level-badge { display: inline-flex; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; }
.level-info { background: #EAF1FD; color: #1D4ED8; }
.level-warn { background: #FDF2E3; color: #92620A; }
.level-error { background: #FBE7E7; color: #B42318; }

.result-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 12px; background: #FAFBFC; font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* Adaptive Card preview -- a lightweight stand-in for how Teams would
   actually render the card this bot just built, so "Test this function"
   shows something closer to the real reply instead of a dump of its JSON.
   See renderAdaptiveCardPreview() in app.js. */
.card-preview-label { font-size: 11px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.card-preview { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fff; box-shadow: 0 1px 2px rgba(17,21,27,0.05); max-width: 440px; }
.card-preview-text { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; max-width: 440px; font-size: 13px; line-height: 1.4; }
.card-text { line-height: 1.45; font-size: 13px; color: var(--ink); }
.card-text a { color: var(--accent); font-weight: 600; }
.card-factset { border-collapse: collapse; margin-top: 8px; }
.card-fact-title { font-weight: 600; color: var(--muted); padding: 2px 14px 2px 0; vertical-align: top; white-space: nowrap; font-size: 13px; }
.card-fact-value { padding: 2px 0; font-size: 13px; }
.card-image { max-width: 100%; border-radius: 6px; margin-top: 10px; display: block; }
.card-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.card-btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--accent); background: #fff; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.card-btn:hover { background: #EEF2FF; }
.card-preview-nested { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; display: none; }
.card-unknown { font-size: 11px; color: var(--subtle); background: #FAFBFC; padding: 6px; border-radius: 6px; margin-top: 6px; }
.card-preview-raw { margin-top: 10px; }
.card-preview-raw summary { cursor: pointer; font-size: 12px; color: var(--subtle); }

.warn-box { display: flex; gap: 10px; background: #FDF2E3; border: 1px solid #F3DCB5; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #6B4A12; margin-bottom: 14px; max-width: 560px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #11151B; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
