/* FLAITOPS — Operations Reports desk */

:root {
  --opsr-bg: #06111a;
  --opsr-panel: #091a25;
  --opsr-card: #0c202a;
  --opsr-surface: #102631;
  --opsr-line: #263d48;
  --opsr-text: #f3f6f8;
  --opsr-muted: #9cadb8;
  --opsr-green: #39e600;
  --opsr-green-dark: #10331f;
  --opsr-ok: #48d87b;
  --opsr-info: #4bbdf4;
  --opsr-warn: #e6b742;
  --opsr-bad: #e85a5a;
  --opsr-assist-w: 400px;
}

#workspaceOperationsReports {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--opsr-bg);
  color: var(--opsr-text);
}

#workspaceOperationsReports[hidden] {
  display: none !important;
}

body.pro-operations-reports-active #workspaceProfessionalOverview,
body.pro-operations-reports-active #workspaceProfessionalOverview.is-mounted,
body.pro-operations-reports-active #workspaceProfessionalOverview .pro-ov--homepage,
body.pro-operations-reports-active #workspaceProfessionalOverview .hp-shell {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

body.pro-operations-reports-active .workspace-desk-scroll {
  position: relative;
  min-height: 0;
  overflow: hidden !important;
}

body.pro-operations-reports-active #workspaceOperationsReports {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

/* Hide global Assist column — Operations Assist lives inside the desk */
body.pro-operations-reports-active.pro-overview-active:not(.pro-overview-assist-min) .workspace-main,
body.workspace-unified-shell.workspace-professional.pro-operations-reports-active.pro-overview-active:not(.pro-overview-assist-min) .workspace-main {
  grid-template-columns: 80px minmax(0, 1fr) !important;
}

body.pro-operations-reports-active.pro-overview-active:not(.pro-overview-assist-min):not(.workspace-rail-collapsed) .workspace-main,
body.workspace-unified-shell.workspace-professional.pro-operations-reports-active.pro-overview-active:not(.pro-overview-assist-min):not(.workspace-rail-collapsed) .workspace-main {
  grid-template-columns: 228px minmax(0, 1fr) !important;
}

body.pro-operations-reports-active .workspace-chat-pane {
  display: none !important;
}

.opsr-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--opsr-assist-w);
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 18px 20px 20px;
  box-sizing: border-box;
}

.opsr-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.opsr-main-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.opsr-main-scroll.is-agents {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-right: 0;
}
.opsr-agents-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opsr-agents-hint {
  margin: 0;
  font-size: 13px;
  color: var(--opsr-muted);
  line-height: 1.4;
}
.opsr-agents-host {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: auto;
  border: 1px solid var(--opsr-line);
  border-radius: 14px;
  background: rgba(8, 16, 24, .35);
}
.opsr-agents-host .fl-agents,
.opsr-agents-host .fl-agents.is-embedded-ops {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 100%;
  height: auto;
  background: transparent;
  box-shadow: none;
}

.opsr-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.opsr-head-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #122433 0%, #0a1822 100%);
  border: 1px solid var(--opsr-line);
  color: var(--opsr-text);
  flex-shrink: 0;
}

.opsr-head-icon .material-symbols-rounded {
  font-size: 28px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.opsr-head-icon .opsr-layers-green {
  color: var(--opsr-green);
}

.opsr-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--opsr-text);
}

.opsr-head p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--opsr-muted);
  line-height: 1.35;
}

.opsr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.opsr-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--opsr-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.opsr-tab .material-symbols-rounded {
  font-size: 18px;
}

.opsr-tab:hover {
  color: var(--opsr-text);
  border-color: var(--opsr-line);
}

.opsr-tab.is-active {
  background: var(--opsr-green-dark);
  border-color: var(--opsr-green);
  color: #fff;
}

.opsr-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.opsr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 120px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--opsr-line);
  background: linear-gradient(165deg, #0e2430 0%, var(--opsr-card) 100%);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.opsr-card:hover,
.opsr-card.is-active {
  border-color: rgba(57, 230, 0, 0.45);
  background: linear-gradient(165deg, #123040 0%, #0e2834 100%);
}

.opsr-card-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--opsr-green);
}

.opsr-card-icon .material-symbols-rounded {
  font-size: 22px;
}

.opsr-card strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  color: var(--opsr-text);
}

.opsr-card span {
  font-size: 12.5px;
  color: var(--opsr-muted);
  line-height: 1.35;
  max-width: 92%;
}

.opsr-card-chevron {
  position: absolute;
  top: 16px;
  right: 14px;
  color: var(--opsr-muted);
  font-size: 18px;
}

.opsr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.opsr-section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.opsr-filter {
  appearance: none;
  height: 34px;
  padding: 0 32px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--opsr-line);
  background: var(--opsr-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CADB8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--opsr-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.opsr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
}

.opsr-row {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 8px 12px 8px 10px;
  border-radius: 13px;
  border: 1px solid var(--opsr-line);
  background: linear-gradient(180deg, rgba(16, 38, 49, 0.55) 0%, rgba(9, 26, 37, 0.9) 100%);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
  text-align: left;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.opsr-row:hover {
  border-color: rgba(57, 230, 0, 0.28);
}

.opsr-row.is-selected {
  border-color: var(--opsr-green);
  background: linear-gradient(180deg, rgba(16, 51, 31, 0.35) 0%, rgba(9, 26, 37, 0.95) 100%);
  box-shadow: inset 0 0 0 1px rgba(57, 230, 0, 0.15);
}

.opsr-thumb {
  width: 165px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  background: #07111b;
  display: block;
}

.opsr-row-body {
  min-width: 0;
}

.opsr-row-title {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--opsr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opsr-row-desc {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--opsr-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opsr-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--opsr-muted);
}

.opsr-qc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 650;
}

.opsr-qc .material-symbols-rounded {
  font-size: 15px;
}

.opsr-qc.is-ok { color: var(--opsr-ok); }
.opsr-qc.is-partial { color: var(--opsr-warn); }
.opsr-qc.is-blocked,
.opsr-qc.is-failed { color: var(--opsr-bad); }
.opsr-qc.is-muted { color: var(--opsr-muted); }

.opsr-row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.opsr-period {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
}

.opsr-period.is-daily {
  color: var(--opsr-green);
  background: rgba(57, 230, 0, 0.1);
  border-color: rgba(57, 230, 0, 0.35);
}

.opsr-period.is-weekly {
  color: var(--opsr-info);
  background: rgba(75, 189, 244, 0.1);
  border-color: rgba(75, 189, 244, 0.35);
}

.opsr-period.is-ondemand {
  color: var(--opsr-muted);
  background: rgba(156, 173, 184, 0.08);
  border-color: var(--opsr-line);
}

.opsr-open-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--opsr-line);
  background: var(--opsr-surface);
  color: var(--opsr-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 160ms ease, background 160ms ease;
}

.opsr-open-btn:hover {
  border-color: var(--opsr-green);
  color: var(--opsr-green);
}

.opsr-open-btn .material-symbols-rounded {
  font-size: 18px;
}

.opsr-empty,
.opsr-error,
.opsr-loading {
  padding: 28px 18px;
  border-radius: 14px;
  border: 1px dashed var(--opsr-line);
  background: rgba(12, 32, 42, 0.55);
  color: var(--opsr-muted);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}

.opsr-error { color: #f0b4b4; border-style: solid; border-color: rgba(232, 90, 90, 0.35); }

.opsr-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.opsr-history-filters .opsr-filter { min-width: 140px; }

/* —— Operations Assist panel —— */
.opsr-assist {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  border: 1px solid var(--opsr-line);
  background: linear-gradient(180deg, #0b1c27 0%, var(--opsr-panel) 40%, #07141d 100%);
  padding: 18px 18px 16px;
  box-sizing: border-box;
}

.opsr-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.opsr-assist-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 650;
  margin: 0;
}

.opsr-assist-title .material-symbols-rounded {
  color: var(--opsr-green);
  font-size: 22px;
}

.opsr-assist-info {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--opsr-line);
  background: transparent;
  color: var(--opsr-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.opsr-assist-info .material-symbols-rounded { font-size: 18px; }

.opsr-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(7, 17, 27, 0.65);
  border: 1px solid var(--opsr-line);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.opsr-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--opsr-muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.opsr-mode-btn .material-symbols-rounded { font-size: 16px; }

.opsr-mode-btn.is-active {
  background: var(--opsr-green-dark);
  border-color: var(--opsr-green);
  color: #fff;
}

.opsr-mode-btn.is-active .material-symbols-rounded { color: var(--opsr-green); }

.opsr-assist-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.opsr-current {
  padding: 16px 17px;
  border-radius: 15px;
  border: 1px solid rgba(57, 230, 0, 0.28);
  background: rgba(16, 51, 31, 0.42);
}

.opsr-current-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--opsr-ok);
  margin-bottom: 8px;
}

.opsr-current-label .material-symbols-rounded { font-size: 16px; }

.opsr-current strong {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 6px;
}

.opsr-current p {
  margin: 0;
  font-size: 12px;
  color: var(--opsr-muted);
}

.opsr-current.is-empty {
  border-color: var(--opsr-line);
  background: var(--opsr-surface);
}

.opsr-current.is-empty .opsr-current-label { color: var(--opsr-muted); }

.opsr-qa-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--opsr-muted);
}

.opsr-qa {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.opsr-qa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--opsr-line);
  background: var(--opsr-surface);
  color: var(--opsr-text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.opsr-qa-btn:hover:not(:disabled) {
  border-color: rgba(57, 230, 0, 0.4);
  background: #143140;
}

.opsr-qa-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.opsr-qa-btn .material-symbols-rounded:first-child {
  font-size: 18px;
  color: #c9d6de;
}

.opsr-qa-btn span:nth-child(2) { flex: 1; }

.opsr-qa-btn .opsr-qa-chevron {
  margin-left: auto;
  color: var(--opsr-muted);
  font-size: 18px;
}

.opsr-chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 120px;
}

.opsr-chat-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.opsr-chat-bubble.is-user {
  align-self: flex-end;
  background: var(--opsr-green-dark);
  border: 1px solid rgba(57, 230, 0, 0.35);
  max-width: 92%;
}

.opsr-chat-bubble.is-assist {
  align-self: stretch;
  background: var(--opsr-surface);
  border: 1px solid var(--opsr-line);
  color: #d7e2e9;
}

.opsr-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 26px;
  border: 1px solid var(--opsr-line);
  background: #07141d;
  flex-shrink: 0;
}

.opsr-ask .material-symbols-rounded.is-spark {
  color: var(--opsr-green);
  font-size: 20px;
}

.opsr-ask input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--opsr-text);
  font-size: 13.5px;
  height: 40px;
}

.opsr-ask input::placeholder { color: var(--opsr-muted); }

.opsr-ask-send {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--opsr-green);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.opsr-ask-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.opsr-ask-send .material-symbols-rounded { font-size: 20px; }

.opsr-assist-mobile-toggle {
  display: none;
}

.opsr-bookmark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--opsr-line);
  background: transparent;
  color: var(--opsr-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.opsr-bookmark.is-on {
  color: var(--opsr-green);
  border-color: rgba(57, 230, 0, 0.4);
}

.opsr-bookmark .material-symbols-rounded { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .opsr-tab,
  .opsr-card,
  .opsr-row,
  .opsr-mode-btn,
  .opsr-qa-btn,
  .opsr-open-btn {
    transition: none;
  }
}

@media (max-width: 1440px) {
  .opsr-shell {
    --opsr-assist-w: 360px;
    gap: 14px;
  }
}

@media (max-width: 1180px) {
  .opsr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opsr-shell {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
  }
  .opsr-assist {
    position: absolute;
    inset: 12px 12px 12px auto;
    width: min(400px, 92vw);
    z-index: 60;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    transform: translateX(110%);
    transition: transform 180ms ease;
  }
  .opsr-shell.is-assist-open .opsr-assist {
    transform: translateX(0);
  }
  .opsr-assist-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--opsr-line);
    background: var(--opsr-surface);
    color: var(--opsr-text);
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
  }
}

@media (max-width: 720px) {
  .opsr-shell { padding: 12px; }
  .opsr-cards { grid-template-columns: 1fr; }
  .opsr-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .opsr-thumb {
    width: 100%;
    height: 120px;
  }
  .opsr-head h1 { font-size: 24px; }
  .opsr-row-side { justify-content: space-between; width: 100%; }
}
