/* OPSY Concierge — minimal stylesheet aligned with the OPSY brand tokens */
:root {
  --opsy-bg: #0f1419;
  --opsy-surface: #1a2028;
  --opsy-surface-2: #242b36;
  --opsy-border: #2d3644;
  --opsy-text: #e8e5db;
  --opsy-text-dim: #a8a59c;
  --opsy-text-muted: #6b6860;
  --opsy-accent: #d4a574;
  --opsy-accent-soft: rgba(212, 165, 116, 0.15);
  --opsy-good: #4ade80;
  --opsy-watch: #facc15;
  --opsy-abnormal: #fb923c;
  --opsy-extreme: #f87171;
  --opsy-radius: 10px;
  --opsy-radius-sm: 6px;
  --opsy-font-serif: 'Amiri', Georgia, 'Times New Roman', serif;
  --opsy-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--opsy-font-sans); color: var(--opsy-text); background: var(--opsy-bg); min-height: 100%; }
a { color: var(--opsy-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--opsy-font-serif); font-weight: 600; letter-spacing: 0.01em; margin-top: 0; }
code, pre { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }

.opsy-topbar { background: var(--opsy-surface); border-bottom: 1px solid var(--opsy-border); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.opsy-topbar h1 { font-size: 20px; margin: 0; }
.opsy-topbar .muted { color: var(--opsy-text-dim); font-size: 13px; margin-left: 12px; }

.opsy-main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.opsy-card { background: var(--opsy-surface); border: 1px solid var(--opsy-border); border-radius: var(--opsy-radius); padding: 20px; margin-bottom: 20px; }
.opsy-card h2 { font-size: 18px; margin-bottom: 16px; }

.opsy-btn { display: inline-block; background: var(--opsy-accent); color: #1a1a1a; border: 0; border-radius: var(--opsy-radius-sm); padding: 10px 16px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px; }
.opsy-btn:hover { filter: brightness(1.1); }
.opsy-btn-ghost { background: transparent; color: var(--opsy-text); border: 1px solid var(--opsy-border); }
.opsy-btn-ghost:hover { background: var(--opsy-accent-soft); }
.opsy-btn-danger { background: var(--opsy-extreme); color: #fff; }
.opsy-input, .opsy-select { background: var(--opsy-surface-2); color: var(--opsy-text); border: 1px solid var(--opsy-border); border-radius: var(--opsy-radius-sm); padding: 10px 12px; font-family: inherit; font-size: 14px; width: 100%; }
.opsy-input:focus, .opsy-select:focus { outline: 2px solid var(--opsy-accent); outline-offset: -2px; }

.opsy-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── Simulator (Telegram-ish chat) ── */
.sim-shell { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: calc(100vh - 160px); min-height: 520px; }
.sim-shell .sim-sidebar { display: flex; flex-direction: column; gap: 12px; }
.sim-chat { display: flex; flex-direction: column; background: var(--opsy-surface); border: 1px solid var(--opsy-border); border-radius: var(--opsy-radius); overflow: hidden; }
.sim-header { padding: 12px 16px; background: var(--opsy-surface-2); border-bottom: 1px solid var(--opsy-border); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.sim-stream { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sim-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.sim-msg.bot { background: var(--opsy-surface-2); color: var(--opsy-text); align-self: flex-start; border-bottom-left-radius: 4px; }
.sim-msg.owner { background: var(--opsy-accent); color: #1a1a1a; align-self: flex-end; border-bottom-right-radius: 4px; }
.sim-msg img, .sim-msg svg { max-width: 100%; border-radius: 6px; }
.sim-msg strong { color: var(--opsy-accent); }
/* Telegram-style inline keyboards: stacked full-width buttons attached under the bot message. */
.sim-buttons { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; margin-left: -14px; margin-right: -14px; margin-bottom: -10px; border-top: 1px solid rgba(255,255,255,0.06); }
.sim-btn { background: transparent; color: var(--opsy-accent); border: none; border-top: 1px solid rgba(255,255,255,0.05); padding: 10px 14px; cursor: pointer; font-size: 13px; font-family: inherit; text-align: center; transition: background 0.08s; }
.sim-btn:first-child { border-top: none; }
.sim-btn:hover { background: rgba(212, 165, 116, 0.1); }
.sim-btn:active { background: rgba(212, 165, 116, 0.2); }
.sim-choice { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: var(--opsy-accent); font-style: italic; }
.sim-choice::before { content: "✓ "; opacity: 0.9; }
.sim-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--opsy-border); background: var(--opsy-surface-2); }
.sim-input-row input { flex: 1; }
.sim-caption { color: var(--opsy-text-dim); font-size: 12px; margin-top: 4px; font-style: italic; }

.sim-sidebar .section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--opsy-text-muted); margin: 12px 0 6px; }
.sim-sidebar .owner-row { font-size: 12px; padding: 6px 8px; background: var(--opsy-surface-2); border-radius: 4px; margin-bottom: 4px; cursor: pointer; display: flex; justify-content: space-between; }
.sim-sidebar .owner-row:hover { background: var(--opsy-accent-soft); }
.sim-sidebar .owner-row.active { border-left: 3px solid var(--opsy-accent); }

/* ── Tables ── */
table.opsy-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.opsy-table th, table.opsy-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--opsy-border); }
table.opsy-table thead { background: var(--opsy-surface-2); }
table.opsy-table tr:hover { background: var(--opsy-accent-soft); cursor: pointer; }

.band-good     { color: var(--opsy-good); }
.band-watch    { color: var(--opsy-watch); }
.band-abnormal { color: var(--opsy-abnormal); }
.band-extreme  { color: var(--opsy-extreme); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-urgent    { background: var(--opsy-extreme); color: #fff; }
.badge-attention { background: var(--opsy-abnormal); color: #1a1a1a; }
.badge-info      { background: var(--opsy-watch); color: #1a1a1a; }
.badge-draft     { background: var(--opsy-surface-2); color: var(--opsy-text-dim); border: 1px dashed var(--opsy-border); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--opsy-border); margin-bottom: 20px; }
.tab { padding: 10px 16px; cursor: pointer; font-size: 13px; color: var(--opsy-text-dim); border-bottom: 2px solid transparent; }
.tab.active { color: var(--opsy-accent); border-bottom-color: var(--opsy-accent); }

/* Heat-map cells */
.heatcell { display: inline-block; width: 48px; text-align: center; padding: 6px 0; border-radius: 3px; font-size: 12px; font-weight: 600; }

details { background: var(--opsy-surface-2); border: 1px solid var(--opsy-border); border-radius: var(--opsy-radius-sm); padding: 10px 14px; margin-bottom: 10px; }
details summary { cursor: pointer; font-weight: 600; }

.draft-banner { background: var(--opsy-surface-2); border: 1px dashed var(--opsy-abnormal); color: var(--opsy-abnormal); padding: 10px 14px; border-radius: var(--opsy-radius-sm); margin-bottom: 16px; font-size: 13px; }
