:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f5f7fb;
}

.auth-card {
  display: grid;
  width: min(100%, 420px);
  gap: 14px;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.12);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #33415c;
  font-size: 13px;
  font-weight: 700;
}

.auth-card input {
  min-height: 42px;
  width: 100%;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  padding: 0 12px;
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  height: 100vh;
  padding: 24px;
}

.meeting {
  display: flex;
  height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e3e9f3;
  padding: 18px 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user {
  max-width: 220px;
  overflow: hidden;
  color: #63708a;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.modal {
  display: flex;
  width: min(100%, 720px);
  max-height: min(720px, calc(100vh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e3e9f3;
  padding: 18px 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.modal-status {
  border-bottom: 1px solid #edf1f7;
  color: #63708a;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
}

.active-meetings-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 16px 20px 20px;
}

.active-meeting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  background: #f8fafd;
  padding: 14px;
}

.active-meeting-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.active-meeting-card strong,
.active-meeting-card span,
.active-meeting-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-meeting-card span,
.active-meeting-card small {
  color: #63708a;
  font-size: 12px;
}

.danger-button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #b42318;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.topbar h1,
.panel h2,
.project-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #63708a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #0d6efd;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

.secondary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.secondary-button {
  width: 100%;
  border: 1px solid #0d6efd;
  background: #ffffff;
  color: #0d6efd;
  margin-top: 10px;
}

.ghost-button {
  border: 1px solid #d4deeb;
  background: #ffffff;
  color: #233047;
  padding: 0 12px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.workspace {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-open .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(620px, 42vw);
}

.report-active .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(760px, 52vw);
}

.video-pane {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #111827;
}

.daily-frame {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.daily-frame.active {
  display: block;
}

.open-tavus-link {
  position: absolute;
  right: 14px;
  top: 14px;
  display: none;
  min-height: 38px;
  align-items: center;
  border-radius: 6px;
  background: #ffffff;
  color: #0d6efd;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
  text-decoration: none;
}

.open-tavus-link.active {
  display: inline-flex;
}

.video-tools {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.video-tools[hidden] {
  display: none;
}

.video-tool-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.video-tool-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 32px;
  color: #d8e2f1;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state span {
  font-size: 22px;
  font-weight: 800;
}

.empty-state p {
  max-width: 360px;
  margin: 8px auto 0;
  color: #aebbd0;
}

.panel {
  display: none;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  border-left: 1px solid #e3e9f3;
  padding: 12px;
}

.panel-open .panel {
  display: flex;
}

.report-active .panel {
  background: #f3f5f9;
  padding: 12px;
}

.panel-open .panel-header,
.panel-open .tool-status,
.panel-open .info-grid,
.panel-open .project-card,
.panel-open .session-output {
  display: none;
}

.report-active .projects-list {
  gap: 12px;
}

.report-live-frame-wrap {
  min-height: min(82vh, 840px);
  overflow: hidden;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #ffffff;
}

.report-live-frame {
  display: block;
  width: 100%;
  height: min(82vh, 840px);
  border: 0;
  background: #ffffff;
}

.report-active .report-presentation-stage {
  min-height: min(84vh, 860px);
  padding: 10px;
}

.report-active .report-stage-summary {
  display: none;
}

.panel-header h2 {
  font-size: 20px;
}

.tool-status {
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #f7faff;
  color: #4d5d76;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-grid div,
.project-card {
  border: 1px solid #dde5f1;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
}

.info-grid span {
  display: block;
  margin-bottom: 6px;
  color: #6b7891;
  font-size: 12px;
}

.info-grid strong {
  display: block;
  min-height: 18px;
  font-size: 14px;
}

.project-card p:last-child {
  margin-bottom: 0;
  color: #54627a;
  line-height: 1.45;
}

.panel-mode-badge {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid #b9d3ff;
  border-radius: 6px;
  background: #f6f9ff;
  color: #0d6efd;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.projects-list {
  display: grid;
  gap: 10px;
}

.mini-project {
  display: grid;
  gap: 10px;
  border: 1px solid #dde5f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.simulation-card {
  border-color: #b9d3ff;
  background: #f6f9ff;
}

.report-preview {
  display: grid;
  gap: 10px;
}

.report-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.report-preview-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.report-presentation-stage {
  display: grid;
  gap: 12px;
  min-height: min(78vh, 720px);
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  padding: 14px;
}

.report-stage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-stage-summary div {
  min-width: 0;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.report-stage-summary span {
  display: block;
  color: #66758f;
  font-size: 11px;
  font-weight: 700;
}

.report-stage-summary strong {
  display: block;
  margin-top: 4px;
  color: #172033;
  font-size: 15px;
  line-height: 1.2;
}

.report-compact-body {
  display: grid;
  gap: 10px;
}

.report-visual-body {
  min-height: min(62vh, 680px);
  align-content: start;
}

.report-hero-card,
.report-section {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.report-hero-card {
  background: #0f172a;
  color: #ffffff;
}

.report-hero-card h4,
.report-section h4 {
  margin: 0;
  letter-spacing: 0;
}

.report-hero-card h4 {
  margin-top: 8px;
  font-size: 18px;
}

.report-hero-card p,
.report-note {
  margin: 5px 0 0;
  color: #66758f;
  font-size: 12px;
  line-height: 1.45;
}

.report-hero-card p {
  color: #cbd5e1;
}

.report-pill {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.risk-bajo {
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
}

.risk-medio {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.risk-alto {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.report-hero-grid,
.report-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.report-hero-grid div,
.report-metric {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  padding: 9px;
}

.report-hero-grid span,
.report-metric span,
.ranking-row span,
.peer-row span {
  display: block;
  color: #71809a;
  font-size: 11px;
}

.report-hero-grid span {
  color: #94a3b8;
}

.report-hero-grid strong,
.report-metric strong {
  display: block;
  margin-top: 3px;
  color: inherit;
  font-size: 13px;
  line-height: 1.25;
}

.report-section h4 {
  color: #172033;
  font-size: 14px;
}

.ranking-bars,
.risk-list,
.peer-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ranking-row {
  display: grid;
  gap: 6px;
}

.ranking-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ranking-row strong {
  font-size: 12px;
}

.ranking-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.ranking-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0d6efd;
}

.risk-row {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
}

.risk-row strong,
.peer-row strong {
  display: block;
  color: #172033;
  font-size: 12px;
}

.risk-row p {
  margin: 2px 0 0;
  color: #66758f;
  font-size: 11px;
  line-height: 1.35;
}

.risk-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f59e0b;
}

.status-ok {
  background: #10b981;
}

.status-alerta {
  background: #ef4444;
}

.status-parcial {
  background: #f59e0b;
}

.peer-row {
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
}

.peer-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.mini-project-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mini-project h4 {
  margin: 0 0 3px;
  font-size: 15px;
}

.mini-project span {
  color: #63708a;
  font-size: 12px;
}

.mini-project strong {
  white-space: nowrap;
  font-size: 14px;
}

.mini-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-mini-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: #0d6efd;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.notice {
  border: 1px solid #f1d6a5;
  border-radius: 8px;
  background: #fff8e8;
  color: #73510a;
  font-size: 13px;
  line-height: 1.4;
  padding: 12px;
}

.session-output {
  overflow: auto;
  min-height: 160px;
  max-height: 280px;
  margin: 0;
  border-radius: 8px;
  background: #101827;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.5;
  padding: 14px;
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 0;
  }

  body {
    height: auto;
    overflow: auto;
  }

  .meeting {
    height: auto;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .panel-open .workspace {
    grid-template-columns: 1fr;
  }

  .report-active .workspace {
    grid-template-columns: 1fr;
  }

  .video-pane {
    min-height: 560px;
  }

  .panel {
    overflow: visible;
    border-left: 0;
    border-top: 1px solid #e3e9f3;
  }

  .report-presentation-stage {
    min-height: 0;
  }

  .report-stage-summary {
    grid-template-columns: 1fr 1fr;
  }
}
