/* ============================================================================
   THE BENCH — Microsoft 365 Captive Workspace Simulator ("Project Valkyrie")
   Authentic Fluent UI / M365 Web Shell + SharePoint Folder + Excel + 5-Page PDFs
   ============================================================================ */

:root {
  --m365-header: #0f172a;
  --m365-rail: #1e293b;
  --teams-purple: #4f52b2;
  --teams-purple-dark: #3b3d8f;
  --teams-bg: #f5f5f7;
  --excel-green: #107c41;
  --excel-green-light: #e6f4ea;
  --ppt-orange: #c43e1c;
  --ppt-orange-light: #fce8e6;
  --pdf-red: #b30b00;
  --copilot-purple: #6366f1;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --pass-green: #15803d;
  --pass-bg: #dcfce7;
  --warn-amber: #b45309;
  --warn-bg: #fef3c7;
  --fail-red: #b91c1c;
  --fail-bg: #fee2e2;
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-serif: 'Georgia', 'Times New Roman', Times, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--m365-header);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   1. TOP M365 SUITE BAR
   ============================================================================ */
.m365-topbar {
  height: 46px;
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #1e293b;
  user-select: none;
  z-index: 20;
}

.m365-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.waffle-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.waffle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.suite-title {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tenant-pill {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.active-app-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--teams-purple);
  color: #fff;
  transition: background 0.2s ease;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.m365-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xray-toggle-btn {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.xray-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.25);
}

.xray-count {
  background: #059669;
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.submit-preread-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.submit-preread-btn:hover {
  background: #1d4ed8;
}

/* ============================================================================
   2. MAIN WORKSPACE GRID
   ============================================================================ */
.workspace-shell {
  display: grid;
  grid-template-columns: 64px 1fr 340px;
  height: calc(100vh - 46px);
  width: 100vw;
  background: var(--teams-bg);
}

.workspace-shell.copilot-collapsed {
  grid-template-columns: 64px 1fr 0px;
}

.m365-rail {
  background: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 6px;
  z-index: 10;
}

.rail-btn {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.rail-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
}
.rail-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.rail-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 3px 3px 0;
}

.rail-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.rail-spacer {
  flex: 1;
}

.app-stage {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  position: relative;
}

.app-pane {
  display: none;
  height: 100%;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
}
.app-pane.active {
  display: flex;
}

/* ============================================================================
   3. MICROSOFT TEAMS PANE
   ============================================================================ */
.teams-header {
  height: 44px;
  background: var(--teams-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 600;
}

.teams-layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  flex: 1;
  overflow: hidden;
}

.teams-sidebar {
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.teams-section-label {
  padding: 12px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.chat-thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.12s;
}
.chat-thread-item:hover {
  background: #e2e8f0;
}
.chat-thread-item.active {
  background: #fff;
  border-left: 3px solid var(--teams-purple);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.status-busy { background: #ef4444; }
.status-away { background: #f59e0b; }
.status-online { background: #22c55e; }

.thread-meta {
  flex: 1;
  min-width: 0;
}
.thread-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.thread-name {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-primary);
}
.thread-time {
  font-size: 10.5px;
  color: var(--text-muted);
}
.thread-preview {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teams-chat-main {
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 100%;
  overflow: hidden;
}

.chat-topbar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.msg-bubble {
  max-width: 78%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
}
.msg-bubble.outbound {
  align-self: flex-end;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.msg-sender {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-primary);
}
.msg-role-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}
.msg-timestamp {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: auto;
}

.msg-body {
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
}
.msg-body p {
  margin: 0 0 8px 0;
}
.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-receipt {
  margin-top: 6px;
  font-size: 10.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.iphone-sig {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.teams-compose-bar {
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compose-input-row {
  display: flex;
  gap: 8px;
}
.compose-input-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-sans);
}
.compose-send-btn {
  background: var(--teams-purple);
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================================
   4. SHAREPOINT DATA ROOM DIRECTORY + OPEN TABS + EXCEL + 5-PAGE PDF VIEWER
   ============================================================================ */
.files-subnav {
  height: 42px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  overflow-x: auto;
}

.file-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  margin-top: 6px;
}
.file-tab-btn:hover {
  background: #cbd5e1;
}
.file-tab-btn.active {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.tab-close-x {
  margin-left: 4px;
  font-size: 11px;
  color: #64748b;
  border-radius: 3px;
  padding: 0 4px;
}
.tab-close-x:hover {
  background: #fee2e2;
  color: #dc2626;
}

.file-viewer-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* SharePoint Folder Directory View */
.sp-folder-shell {
  padding: 24px 32px;
  overflow-y: auto;
  height: 100%;
  background: #fff;
}
.sp-breadcrumb {
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sp-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 13px;
}
.sp-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sp-table tr.sp-row {
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.sp-table tr.sp-row:hover {
  background: #f8fafc;
}
.sp-table td {
  padding: 11px 12px;
  color: #1e293b;
}

/* Excel Online Replica */
.excel-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}
.excel-ribbon {
  background: var(--excel-green);
  color: #fff;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.excel-formula-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12px;
}
.cell-ref-box {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 3px;
  min-width: 48px;
  text-align: center;
  font-weight: 700;
  color: #334155;
}
.fx-badge {
  font-style: italic;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 4px;
}
.excel-grid-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}
.excel-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.excel-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  font-weight: 600;
  color: #475569;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.excel-table td {
  border: 1px solid #e2e8f0;
  padding: 5px 8px;
  color: #1e293b;
  vertical-align: top;
  cursor: cell;
}
.excel-table td.selected-cell {
  outline: 2px solid var(--excel-green);
  outline-offset: -2px;
  background: #f0fdf4 !important;
}
.excel-row-num {
  background: #f1f5f9 !important;
  color: #64748b !important;
  text-align: center;
  width: 34px;
  font-weight: 600;
  user-select: none;
  cursor: default !important;
}
.cell-error {
  color: #dc2626 !important;
  font-weight: 700;
  font-family: var(--font-mono);
  background: #fef2f2;
}
.cell-highlight-yellow {
  background: #fef08a !important;
}
.cell-sticky-note {
  background: #fef9c3;
  border-left: 3px solid #eab308 !important;
  font-style: italic;
}

.excel-sheet-tabs {
  height: 36px;
  background: #f1f5f9;
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 4px;
}
.sheet-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  color: #475569;
}
.sheet-tab.active {
  background: #fff;
  color: var(--excel-green);
  border-top: 2px solid var(--excel-green);
}

/* PDF Reader Replica + Ctrl+F Search Bar */
.pdf-viewer-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #525659;
}
.pdf-toolbar {
  height: 44px;
  background: #323639;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  gap: 12px;
}
.pdf-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e2022;
  border: 1px solid #525659;
  padding: 3px 8px;
  border-radius: 4px;
}
.pdf-search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  width: 190px;
  outline: none;
}
.pdf-search-nav-btn {
  background: #323639;
  color: #e2e8f0;
  border: 1px solid #525659;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  cursor: pointer;
}
.pdf-search-nav-btn:hover {
  background: #475569;
}

.pdf-pages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.pdf-page {
  width: 100%;
  max-width: 780px;
  min-height: 920px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
  padding: 48px 56px;
  position: relative;
  color: #1e293b;
  font-family: var(--font-serif);
  font-size: 12.8px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}
.pdf-page h2, .pdf-page h3, .pdf-page h4 {
  font-family: var(--font-sans);
  color: #0f172a;
}
.pdf-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
}
.pdf-doc-table th, .pdf-doc-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  text-align: left;
}
.pdf-doc-table th {
  background: #f1f5f9;
  font-weight: 700;
}
.pdf-page-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 10px;
  color: #64748b;
}
mark.pdf-hit {
  background: #fde047;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}
mark.pdf-hit.active-hit {
  background: #f97316;
  color: #fff;
  box-shadow: 0 0 0 2px #f97316;
}

/* ============================================================================
   5. MICROSOFT POWERPOINT ONLINE EDITOR
   ============================================================================ */
.ppt-ribbon {
  background: var(--ppt-orange);
  color: #fff;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.ppt-workspace {
  display: grid;
  grid-template-columns: 190px 1fr;
  flex: 1;
  overflow: hidden;
  background: #e2e8f0;
}

.ppt-thumbnails {
  background: #f1f5f9;
  border-right: 1px solid var(--border-strong);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.slide-thumb {
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.slide-thumb:hover {
  border-color: #94a3b8;
}
.slide-thumb.active {
  border-color: var(--ppt-orange);
  box-shadow: 0 0 0 2px rgba(196, 62, 28, 0.18);
}
.thumb-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--ppt-orange);
  margin-bottom: 3px;
}
.thumb-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.ppt-stage {
  padding: 18px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.slide-partner-redbox {
  width: 100%;
  max-width: 860px;
  background: #fef2f2;
  border: 2px solid #dc2626;
  border-left: 6px solid #dc2626;
  color: #991b1b;
  padding: 9px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.12);
}

.slide-canvas {
  width: 100%;
  max-width: 860px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 5px solid #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  padding: 24px 34px 18px 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.consulting-slide-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.consulting-kicker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #0284c7;
  margin-bottom: 4px;
}

.consulting-logo-corner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  flex-shrink: 0;
}

.consulting-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.consulting-title-wrap {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 10px;
}

.ppt-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.ppt-editable-title {
  width: 100%;
  font-size: 17.5px;
  font-weight: 800;
  color: #0f172a;
  border: 1px solid transparent;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: 4px;
  font-family: var(--font-serif);
  background: transparent;
  transition: all 0.15s;
}
.ppt-editable-title:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.ppt-editable-title:focus,
.ppt-editable-body:focus,
.ppt-editable-callout:focus,
.ppt-editable-footnote:focus {
  outline: none;
  border: 1px solid #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.consulting-exhibit-box {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.consulting-exhibit-header {
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ppt-editable-body {
  width: 100%;
  min-height: 128px;
  font-size: 13px;
  line-height: 1.58;
  color: #1e293b;
  border: 1px solid transparent;
  padding: 12px 14px;
  font-family: var(--font-sans);
  resize: vertical;
  background: #ffffff;
}
.ppt-editable-body:hover {
  background: #f8fafc;
}

.consulting-takeaway-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #0f172a;
  border-radius: 4px;
  padding: 10px 14px;
}

.ppt-editable-callout {
  width: 100%;
  min-height: 54px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #0f172a;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: 4px;
  font-family: var(--font-sans);
  resize: vertical;
}
.ppt-editable-callout:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.consulting-slide-footer {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ppt-editable-footnote {
  flex: 1;
  font-size: 11px;
  font-style: italic;
  color: #475569;
  border: 1px solid transparent;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 4px;
  font-family: var(--font-sans);
  background: transparent;
}
.ppt-editable-footnote:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.ribbon-action-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s;
}
.ribbon-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
}
.ribbon-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================================
   6. RIGHT SIDEBAR: M365 COPILOT
   ============================================================================ */
.copilot-sidebar {
  background: #ffffff;
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.copilot-header {
  height: 44px;
  padding: 0 14px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 12.5px;
}

.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.copilot-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.copilot-card.ai-reply {
  border-left: 3px solid #7c3aed;
}

.copilot-paste-btn {
  margin-top: 8px;
  width: 100%;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.copilot-paste-btn:hover {
  background: #ddd6fe;
}

.copilot-prompts {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cp-chip {
  text-align: left;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.3;
}
.cp-chip:hover {
  background: #ede9fe;
}

/* ============================================================================
   7. MODERN-WEB-GUIDANCE: TOP-LAYER TELEMETRY X-RAY DRAWER (navigation-drawer)
   ============================================================================ */
.Drawer {
  --drawer-width: min(36em, 88dvw);
  --drawer-backdrop: 0;
  width: auto;
  height: auto;
  background: transparent;
  border: 0;
  overflow: visible;
  padding: 0;
  margin: 0;
}

.Drawer::backdrop {
  background: #000;
  opacity: calc(var(--drawer-backdrop) / 2);
}

.Drawer-scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  width: 100vw;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

@media (prefers-reduced-motion: no-preference) {
  .Drawer-scroller {
    scroll-behavior: smooth;
  }
}

.Drawer-scroller::after {
  content: '';
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}

.Drawer-sheet {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100svh;
  background: #0f172a;
  color: #f8fafc;
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: thin;
  border-right: 1px solid #334155;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

@supports (animation-timeline: scroll()) {
  .Drawer {
    timeline-scope: --drawer-fade;
    animation: fade-drawer-backdrop linear both;
    animation-timeline: --drawer-fade;
  }

  .Drawer-scroller {
    scroll-timeline: --drawer-fade x;
  }

  @property --drawer-backdrop {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
  }

  @keyframes fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

/* ============================================================================
   8. MODERN-WEB-GUIDANCE: PERSISTENT TOAST NOTIFICATIONS (popover="manual")
   ============================================================================ */
.toast-stack {
  position: fixed;
  top: 56px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

[popover].teams-toast:is(:popover-open, .\:popover-open) {
  display: block;
}

.teams-toast {
  position: fixed;
  top: 58px;
  right: 20px;
  margin: 0;
  width: 370px;
  background: #1e1f4b;
  color: #fff;
  border: 1px solid #6366f1;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transition-behavior: allow-discrete;
}

.teams-toast + .teams-toast {
  margin-top: 1rem;
}

/* ============================================================================
   9. VIVA VOCE + MARKING QUERY DOSSIER MODAL OVERLAY
   ============================================================================ */
.viva-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.viva-modal-backdrop.active {
  display: flex;
}

.viva-modal-card {
  width: 100%;
  max-width: 1080px;
  height: 88vh;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.mic-btn {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mic-btn.recording {
  background: #fee2e2;
  color: #dc2626;
  border-color: #f87171;
  animation: pulseDot 1.2s infinite;
}

.query-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.query-table th, .query-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.query-table th {
  background: #f1f5f9;
  font-weight: 700;
}
.badge-pass {
  background: var(--pass-bg);
  color: var(--pass-green);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}
.badge-fail {
  background: var(--fail-bg);
  color: var(--fail-red);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-amber);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

/* ============================================================================
   10. AUTHENTIC TEAMS VIDEO CALLS & VIVA VOCE VIDEO STAGE (HEYGEN INTEGRATION)
   ============================================================================ */
.teams-call-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teams-call-card {
  width: 360px;
  background: #1e1f4b;
  border: 1px solid #6366f1;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: callModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes callModalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.avatar-ring-pulse {
  position: relative;
  display: inline-block;
  border-radius: 50%;
}
.avatar-ring-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  animation: ringPulse 1.6s infinite ease-out;
}

@keyframes ringPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.3); opacity: 0; }
}

.incoming-status-pill {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
}

.call-pulse-dot {
  width: 8px;
  height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 1s infinite;
}

.teams-call-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.teams-call-btn.accept {
  background: #10b981;
  color: #fff;
}
.teams-call-btn.accept:hover {
  background: #059669;
}
.teams-call-btn.decline {
  background: #ef4444;
  color: #fff;
}
.teams-call-btn.decline:hover {
  background: #dc2626;
}

/* Teams Meeting Pop-Out Overlay */
.teams-meeting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.teams-meeting-window {
  width: 100%;
  max-width: 800px;
  height: 520px;
  background: #111827;
  border-radius: 10px;
  border: 1px solid #374151;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
}

.teams-meeting-topbar {
  height: 42px;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #374151;
}

.teams-meeting-stage {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.teams-participant-tag {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

.teams-meeting-controls {
  height: 54px;
  background: #1f2937;
  border-top: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.teams-hangup-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.teams-hangup-btn:hover {
  background: #dc2626;
}

/* Viva Voce Split Layout with Julian Video Stage */
.viva-video-stage {
  width: 480px;
  background: #020617;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
}

.viva-video-header {
  height: 42px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.viva-video-replay-btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  cursor: pointer;
  font-weight: 600;
}
.viva-video-replay-btn:hover {
  color: #fff;
  background: #334155;
}

.viva-video-container {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.viva-speaker-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.88);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(4px);
}

.viva-video-footer {
  height: 38px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.viva-transcript-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
