/* ops.css — FornoCloud Phase 7.3 Operations Dashboard — Dark Theme */
.ops-wrap { padding: 20px; max-width: 1100px; margin: 0 auto; font-family: 'Inter', sans-serif; }
.ops-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ops-title { font-size: 22px; font-weight: 700; color: #F5F5F7; margin: 0; }
.ops-overall-badge { padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 13px; background: rgba(29,184,124,0.15); color: #1DB87C; border: 1px solid rgba(29,184,124,0.3); }
.ops-overall-badge.warn { background: rgba(240,165,0,0.15); color: #F0A500; border-color: rgba(240,165,0,0.3); }
.ops-overall-badge.crit { background: rgba(212,43,43,0.15); color: #D42B2B; border-color: rgba(212,43,43,0.3); }

/* Tabs */
.ops-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; background: #2C2C32; border-radius: 12px; padding: 6px; }
.ops-tab { background: transparent; border: none; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #6B6B78; cursor: pointer; transition: all .2s; white-space: nowrap; }
.ops-tab:hover { background: #3D3D45; color: #B0B0BC; }
.ops-tab.active { background: #2D6BE4; color: #fff; box-shadow: 0 1px 4px rgba(45,107,228,.25); }

/* Content area */
.ops-content { min-height: 300px; }

/* Metric grid */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ops-metric { background: #1A1A1E; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.3); border-left: 4px solid #2D6BE4; }
.ops-metric.ok { border-left-color: #1DB87C; }
.ops-metric.warn { border-left-color: #F0A500; }
.ops-metric.crit { border-left-color: #D42B2B; }
.ops-metric-label { font-size: 11px; font-weight: 600; color: #6B6B78; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ops-metric-val { font-size: 26px; font-weight: 800; color: #F5F5F7; line-height: 1; }
.ops-metric-sub { font-size: 11px; color: #6B6B78; margin-top: 4px; }

/* Tables */
.ops-table-wrap { overflow-x: auto; background: #1A1A1E; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table th { background: #2C2C32; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6B6B78; border-bottom: 1px solid #3D3D45; }
.ops-table td { padding: 10px 14px; border-bottom: 1px solid #2C2C32; color: #F5F5F7; vertical-align: middle; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table tr:hover td { background: #2C2C32; }

/* Buttons */
.ops-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.ops-btn-primary { background: #2D6BE4; color: #fff; }
.ops-btn-primary:hover { background: #245bc0; transform: translateY(-1px); }
.ops-btn-secondary { background: #2C2C32; color: #B0B0BC; }
.ops-btn-secondary:hover { background: #3D3D45; }
.ops-btn-danger { background: rgba(212,43,43,0.15); color: #D42B2B; }
.ops-btn-danger:hover { background: rgba(212,43,43,0.25); }
.ops-btn-success { background: rgba(29,184,124,0.15); color: #1DB87C; }
.ops-btn-success:hover { background: rgba(29,184,124,0.25); }
.ops-btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* Section headers */
.ops-section-hdr { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.ops-section-title { font-size: 15px; font-weight: 700; color: #F5F5F7; margin: 0; }

/* Flags */
.ops-flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ops-flag-card { background: #1A1A1E; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: space-between; border: 1px solid #3D3D45; }
.ops-flag-name { font-size: 14px; font-weight: 600; color: #F5F5F7; }
.ops-flag-loc { font-size: 11px; color: #6B6B78; margin-top: 2px; }
.ops-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.ops-toggle input { opacity: 0; width: 0; height: 0; }
.ops-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #3D3D45; border-radius: 24px; transition: .3s; }
.ops-toggle-slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #B0B0BC; border-radius: 50%; transition: .3s; }
.ops-toggle input:checked + .ops-toggle-slider { background: #2D6BE4; }
.ops-toggle input:checked + .ops-toggle-slider:before { transform: translateX(20px); background: #fff; }

/* Emergency */
.ops-em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ops-em-card { background: #1A1A1E; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.3); border-top: 3px solid #3D3D45; border: 1px solid #3D3D45; }
.ops-em-card.active { border-top-color: #D42B2B; background: rgba(212,43,43,0.08); }
.ops-em-label { font-size: 15px; font-weight: 700; color: #F5F5F7; margin-bottom: 4px; }
.ops-em-desc { font-size: 12px; color: #6B6B78; margin-bottom: 14px; }
.ops-em-btns { display: flex; gap: 8px; }

/* Alerts */
.ops-alert-list { display: flex; flex-direction: column; gap: 10px; }
.ops-alert-card { background: #1A1A1E; border-radius: 10px; padding: 14px 16px; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: flex; align-items: flex-start; gap: 14px; border-left: 4px solid #F0A500; border: 1px solid #3D3D45; border-left-width: 4px; }
.ops-alert-card.critical { border-left-color: #D42B2B; }
.ops-alert-card.info { border-left-color: #2D6BE4; }
.ops-alert-card.acked { border-left-color: #3D3D45; opacity: .6; }
.ops-alert-icon { font-size: 22px; }
.ops-alert-body { flex: 1; }
.ops-alert-msg { font-size: 14px; font-weight: 600; color: #F5F5F7; }
.ops-alert-meta { font-size: 11px; color: #6B6B78; margin-top: 3px; }

/* Integrity */
.ops-integrity-list { display: flex; flex-direction: column; gap: 8px; }
.ops-integrity-row { background: #1A1A1E; border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.25); border: 1px solid #2C2C32; }
.ops-integrity-icon { font-size: 18px; }
.ops-integrity-name { font-size: 14px; font-weight: 600; color: #F5F5F7; flex: 1; }
.ops-integrity-val { font-size: 13px; font-weight: 700; }
.ops-integrity-val.ok { color: #1DB87C; }
.ops-integrity-val.warn { color: #F0A500; }
.ops-integrity-val.fail { color: #D42B2B; }

/* Audit pagination */
.ops-pagination { display: flex; gap: 8px; align-items: center; margin-top: 14px; justify-content: flex-end; }

/* Toast */
.ops-toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: ops-fadein .2s ease; }
.ops-toast.success { background: #1DB87C; color: #fff; }
.ops-toast.error { background: #D42B2B; color: #fff; }
.ops-toast.info { background: #2D6BE4; color: #fff; }
@keyframes ops-fadein { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* Loading/empty states */
.ops-loading { text-align: center; color: #6B6B78; padding: 40px; font-size: 14px; }
.ops-empty { text-align: center; color: #3D3D45; padding: 30px; font-size: 13px; }
.ops-error { background: rgba(212,43,43,0.15); color: #D42B2B; padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; border: 1px solid rgba(212,43,43,0.3); }

/* Emergency state header */
.ops-em-state { background: rgba(240,165,0,0.12); border: 1px solid rgba(240,165,0,0.3); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.ops-em-state.ok { background: rgba(29,184,124,0.12); border-color: rgba(29,184,124,0.3); }
.ops-em-state-icon { font-size: 20px; }
.ops-em-state-msg { font-size: 13px; font-weight: 600; color: #F5F5F7; }

/* Backup action bar */
.ops-action-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }


/* ── Missing classes added by bugfix_alpha ─────────────────────────── */

/* Metric grid & cards (used in health tab) */
.ops-metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ops-metric-card { background: #1A1A1E; border-radius: 12px; padding: 16px; border: 1px solid #2C2C32; border-top: 3px solid #3D3D45; position: relative; overflow: hidden; }
.ops-metric-green { border-top-color: #1DB87C; }
.ops-metric-yellow { border-top-color: #F0A500; }
.ops-metric-red { border-top-color: #D42B2B; }

/* Section cards (card wrapper used throughout ops) */
.ops-section-card { background: #1A1A1E; border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 1px solid #2C2C32; }
.ops-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ops-section-desc { font-size: 12px; color: #6B6B78; margin-bottom: 14px; }
.ops-section-desc-inline { font-size: 12px; color: #6B6B78; }

/* Warn / info card variants */
.ops-warn-card { border-left: 4px solid #F0A500 !important; background: rgba(240,165,0,0.05) !important; }
.ops-info-card { border-left: 4px solid #2D6BE4 !important; background: rgba(45,107,228,0.05) !important; }
.ops-ok-empty { color: #1DB87C; }

/* Emergency health grid items (from loadHealth emergency section) */
.ops-em-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #111116; border-radius: 8px; border: 1px solid #2C2C32; font-size: 13px; font-weight: 600; color: #EDEDF0; }
.ops-em-item.ops-em-active { background: rgba(212,43,43,0.08); border-color: rgba(212,43,43,0.3); }
.ops-em-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ops-em-val { margin-left: auto; font-size: 11px; font-weight: 700; color: #8E8E9A; background: #2C2C32; padding: 2px 8px; border-radius: 10px; }
.ops-em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }

/* Emergency control rows (from loadEmergency) */
.ops-em-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ops-em-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: #111116; border-radius: 10px; border: 1px solid #2C2C32; }
.ops-em-row-active { background: rgba(212,43,43,0.08); border-color: rgba(212,43,43,0.3); }
.ops-em-info { flex: 1; }
.ops-em-ctrl { flex-shrink: 0; }
.ops-em-icon-label { font-size: 14px; font-weight: 700; color: #F5F5F7; margin-bottom: 4px; }
.ops-em-by { font-size: 11px; color: #6B6B78; margin-top: 4px; }
.ops-em-warning { font-size: 13px; color: #F0A500; margin-bottom: 12px; }

/* Alert cards */
.ops-alert-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ops-alert-type { font-size: 11px; font-weight: 700; color: #8E8E9A; text-transform: uppercase; letter-spacing: 0.5px; }
.ops-alert-sev { font-size: 11px; font-weight: 700; text-transform: capitalize; }
.ops-alert-time { font-size: 11px; color: #6B6B78; margin-left: auto; }
.ops-alert-actions { margin-top: 10px; display: flex; gap: 8px; }

/* Feature flags */
.ops-flag-on { border-color: rgba(29,184,124,0.4) !important; }
.ops-flag-off { opacity: 0.75; }
.ops-flag-group { margin-bottom: 20px; }
.ops-flag-group-title { font-size: 12px; font-weight: 700; color: #6B6B78; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.ops-flag-meta { font-size: 10px; color: #6B6B78; margin-top: 6px; line-height: 1.4; }
.ops-toggle-on { background: #2D6BE4; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.ops-toggle-off { background: #2C2C32; color: #6B6B78; border: 1px solid #3D3D45; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* Integrity summary */
.ops-integrity-summary { display: flex; gap: 20px; padding: 16px 20px; background: #1A1A1E; border-radius: 12px; border: 1px solid #2C2C32; margin-bottom: 16px; justify-content: center; }
.ops-int-stat { text-align: center; }
.ops-int-val { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.ops-int-lbl { font-size: 11px; font-weight: 600; color: #6B6B78; text-transform: uppercase; letter-spacing: 0.5px; }
.ops-ok-txt { color: #1DB87C; }
.ops-warn-txt { color: #F0A500; }
.ops-err-txt { color: #D42B2B; }

/* Utility */
.ops-chip { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; background: #2C2C32; color: #B0B0BC; }
.ops-code { display: block; background: #0D0D10; border: 1px solid #2C2C32; border-radius: 8px; padding: 12px 14px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #A0D8AF; overflow-x: auto; margin-top: 8px; word-break: break-all; }
.ops-detail-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #6B6B78; }
.ops-nowrap { white-space: nowrap; }
.ops-mono { font-family: 'JetBrains Mono', monospace; }
.ops-preview-label { font-size: 11px; color: #F0A500; }
.ops-btn-lg { padding: 10px 20px; font-size: 14px; font-weight: 700; border-radius: 8px; cursor: pointer; border: none; }
.ops-btn-outline { background: transparent; border: 1px solid #3D3D45; color: #B0B0BC; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ops-btn-outline:hover { border-color: #6B6B78; color: #F5F5F7; }
.ops-btn-warn { background: rgba(240,165,0,0.15); color: #F0A500; border: 1px solid rgba(240,165,0,0.3); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ops-btn-warn:hover { background: rgba(240,165,0,0.25); }
.ops-table-sm td, .ops-table-sm th { padding: 7px 10px; font-size: 12px; }
