/* GetBeyondOps.com ("Get Beyond Operations") - Enterprise ERP Suite v3 */
:root { --client-accent: #3b82f6; }
.gbo-shell { padding: 20px 0 64px; }
.gbo-brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; display: none; }
.gbo-brand-logo.has-logo { display: inline-block; }
.gbo-tagline { font-size: 0.72rem; color: var(--teal); font-weight: 600; display: block; line-height: 1.1; }

/* Role Security Banner */
.role-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 14px; margin-bottom: 14px; border-radius: 10px;
  background: rgba(59, 130, 246, 0.09); border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 0.82rem;
}
.role-bar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-pill { padding: 3px 9px; border-radius: 99px; font-weight: 700; font-size: 0.75rem; background: var(--client-accent); color: #fff; }

/* Module Bar */
.module-nav {
  display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px;
  padding: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.mod-btn {
  flex: 1 1 135px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted);
  padding: 9px 10px; border-radius: 9px; font-size: 0.82rem; font-weight: 700; cursor: pointer; text-align: center;
}
.mod-btn.active { background: var(--client-accent); border-color: var(--client-accent); color: #fff; }
.mod-btn.locked { opacity: 0.42; cursor: not-allowed; }

/* Top Bar & Drop-Box */
.erp-topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.erp-topbar h1 { margin: 0 0 4px; font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.erp-topbar p { margin: 0; color: var(--text-muted); font-size: 0.89rem; }
.erp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dropbox-zone {
  border: 2px dashed var(--teal);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(59, 130, 246, 0.06));
  border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 16px;
}
.dropbox-zone.drag-over { border-color: var(--client-accent); background: rgba(59, 130, 246, 0.16); }
.dropbox-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.dropbox-head h2 { margin: 0; font-size: 1.02rem; }
.dropbox-meta { font-size: 0.79rem; color: var(--text-muted); margin-top: 4px; }
.dropbox-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.pii-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.dropbox-progress { display: none; margin-top: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.dropbox-progress.active { display: block; }
.progress-track { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--client-accent)); transition: width 0.2s; }

/* KPI Strip */
.erp-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.erp-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; }
.erp-kpi-label { font-size: 0.73rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.erp-kpi-val { font-size: 1.38rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.erp-kpi-sub { font-size: 0.73rem; color: var(--text-dim); margin-top: 2px; }

/* Smart Search Bar & Filters */
.erp-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 14px;
}
.erp-view-tabs, .erp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.erp-tab { border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); padding: 7px 12px; border-radius: 8px; font-size: 0.83rem; font-weight: 600; cursor: pointer; }
.erp-tab.active { background: var(--client-accent); border-color: var(--client-accent); color: #fff; }
.erp-filters .input-control, .erp-filters .select-control { padding: 7px 10px; font-size: 0.83rem; min-height: 36px; }
.count-pill { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

/* Tables & Pills */
.erp-group { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.erp-group-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-left: 5px solid var(--client-accent); background: rgba(59, 130, 246, 0.07); cursor: pointer; user-select: none; }
.erp-group-head h3 { margin: 0; font-size: 0.94rem; display: flex; align-items: center; gap: 8px; }
.erp-table-wrap { width: 100%; overflow-x: auto; }
.erp-table { width: 100%; border-collapse: collapse; min-width: 960px; font-size: 0.85rem; }
.erp-table th { text-align: left; font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); white-space: nowrap; }
.erp-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.erp-inline-input { width: 100%; min-width: 110px; background: transparent; border: 1px solid transparent; color: var(--text); padding: 4px 6px; border-radius: 6px; font-size: 0.84rem; }
.col-wide { min-width: 220px !important; }
.col-med { min-width: 155px !important; }
.next-action-text { color: #5eead4; font-size: 0.76rem; margin-top: 3px; font-weight: 600; }
[data-theme="light"] .next-action-text { color: #0f766e; }
[data-theme="light"] .btn-ghost { color: #334155; border-color: #cbd5e1; }
#btnConfirmFinalDelete:disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.7); }
.gantt-axis { display: grid; grid-template-columns: 240px 1fr 110px; gap: 12px; padding: 6px 14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); font-weight: 700; }
.gantt-axis-scale { display: flex; justify-content: space-between; }
.erp-inline-input:focus { outline: none; border-color: var(--client-accent); background: var(--bg-input); }

.status-select, .prio-select { border: none; border-radius: 6px; padding: 5px 8px; font-size: 0.77rem; font-weight: 700; color: #fff; cursor: pointer; width: 100%; min-width: 112px; }
.st-done { background: #15803d; }
.st-working { background: #d97706; }
.st-stuck { background: #dc2626; }
.st-expiring { background: #9333ea; }
.st-pending { background: #475569; }
.pr-critical { background: #b91c1c; }
.pr-high { background: #ea580c; }
.pr-medium { background: #2563eb; }
.pr-low { background: #0f766e; }

.due-badge { display: inline-block; font-size: 0.71rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-top: 3px; }
.due-overdue { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.due-soon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.due-ok { background: rgba(34, 197, 94, 0.16); color: #4ade80; }

/* Kanban & CRM */
.kanban-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.kanban-col { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 230px; }
.kanban-col.drop-target { border-color: var(--teal); background: rgba(20, 184, 166, 0.08); }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 0.83rem; margin-bottom: 10px; }
.kanban-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.kanban-card h4 { margin: 0 0 6px; font-size: 0.87rem; }
.kanban-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 6px; margin-bottom: 6px; }

/* Timeline, Finance & Rich AI Briefing */
.timeline-list { display: grid; gap: 10px; }
.timeline-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: grid; grid-template-columns: 240px 1fr 110px; gap: 12px; align-items: center; }
.timeline-bar-wrap { height: 18px; background: var(--bg-input); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.timeline-bar { height: 100%; border-radius: 99px; }

.erp-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.erp-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.erp-panel h3 { margin: 0 0 10px; font-size: 1rem; }
.anomaly-item { padding: 8px 10px; border-radius: 8px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); font-size: 0.83rem; margin-bottom: 8px; }

/* Rich Executive Briefing Styles */
.briefing-rich {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; font-size: 0.9rem; line-height: 1.65; max-height: 520px; overflow-y: auto;
}
.briefing-rich h3, .briefing-rich h4 {
  margin: 16px 0 8px; color: var(--teal); font-size: 1.02rem;
  border-bottom: 1px solid var(--border); padding-bottom: 5px;
}
.briefing-rich h3:first-child, .briefing-rich h4:first-child { margin-top: 0; }
.briefing-rich p { margin: 6px 0 10px; color: var(--text); }
.briefing-rich ul { margin: 6px 0 12px 18px; padding: 0; }
.briefing-rich li { margin-bottom: 5px; }
.briefing-table-wrap { width: 100%; overflow-x: auto; margin: 10px 0 14px; }
.briefing-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.briefing-table th { background: #1b365d; color: #fff; text-align: left; padding: 9px 11px; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.briefing-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); }
.briefing-table tr:nth-child(even) td { background: rgba(59, 130, 246, 0.05); }
#briefingMeta { white-space: normal; max-width: 100%; line-height: 1.35; }

/* Animated HiveMind Working Spinner */
.hive-loader {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px;
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 10px;
}
.hive-spinner {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid rgba(20, 184, 166, 0.25); border-top-color: #14b8a6; border-right-color: #3b82f6;
  animation: hiveSpin 0.85s linear infinite;
}
.mini-spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; vertical-align: middle;
  border: 2.5px solid rgba(20, 184, 166, 0.25); border-top-color: #14b8a6; border-right-color: #3b82f6;
  animation: hiveSpin 0.75s linear infinite;
}
@keyframes hiveSpin { to { transform: rotate(360deg); } }

/* Finance Sub-Tabs & Accounting Grid */
.fin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fin-tab { border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); padding: 7px 13px; border-radius: 8px; font-size: 0.83rem; font-weight: 700; cursor: pointer; }
.fin-tab.active { background: var(--teal); border-color: var(--teal); color: #042f2e; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.acct-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; gap: 10px; }
.acct-row strong { font-variant-numeric: tabular-nums; }
.comm-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 0.84rem; }
.comm-meta { font-size: 0.74rem; color: var(--teal); font-weight: 700; margin-bottom: 4px; display: flex; justify-content: space-between; }

/* Smart DMS Folder Grid & Expiry Proposal Cards */
.dms-folder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dms-folder {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; width: 100%; overflow: hidden; box-sizing: border-box;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  cursor: pointer; text-align: left; color: var(--text); transition: border-color 0.2s, transform 0.15s;
}
.dms-folder strong { display: block; width: 100%; font-size: 0.84rem; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; color: var(--text); }
.dms-folder span { display: block; width: 100%; font-size: 0.75rem; line-height: 1.3; color: var(--text-muted); }
.dms-folder:hover, .dms-folder.active { border-color: var(--teal); background: rgba(20, 184, 166, 0.1); transform: translateY(-1px); }
.dms-folder-name { font-weight: 700; font-size: 0.86rem; margin-bottom: 4px; }
.dms-folder-meta { font-size: 0.75rem; color: var(--text-muted); }
.next-action-pill {
  display: inline-block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--text);
}
[dir="rtl"] .erp-table th, [dir="rtl"] .erp-table td { text-align: right; }
[dir="rtl"] .erp-group-head { border-left: none; border-right: 5px solid var(--client-accent); }

/* Access Denied Lock Card */
.access-lock-card {
  background: var(--bg-card); border: 1px solid rgba(239, 68, 68, 0.35); border-radius: var(--radius-lg);
  padding: 32px 24px; text-align: center; margin: 20px 0;
}
.access-lock-card h2 { margin: 0 0 8px; color: #f87171; }

.doc-viewer-body { max-height: 68vh; overflow: auto; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.doc-viewer-body img, .doc-viewer-body iframe { width: 100%; border: none; border-radius: 6px; }

.storage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.storage-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }

.erp-footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; font-size: 0.8rem; color: var(--text-dim); }
.hidden { display: none !important; }

@media (max-width: 780px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .header-actions { flex-wrap: wrap; width: 100%; gap: 6px; }
  .header-actions .btn { font-size: 0.78rem; padding: 6px 10px; }
  .module-nav { padding: 6px; gap: 6px; }
  .mod-btn { flex: 1 1 135px; padding: 8px 9px; font-size: 0.78rem; }
  .erp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-actions, .erp-filters { width: 100%; }
  .erp-actions .select-control, .erp-filters .input-control, .erp-filters .select-control { width: 100%; max-width: 100%; min-width: 0; }
  .timeline-row { grid-template-columns: 1fr; }
  .erp-topbar { align-items: flex-start; }
}

/* Staging v10: Redline Diff, E-Sign Canvas, Cloud Sync Pill & Audio Recorder */
.pulse-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 0.76rem; font-weight: 700; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); }
.sync-pill.synced { border-color: rgba(20, 184, 166, 0.5); color: #5eead4; background: rgba(20, 184, 166, 0.1); }
.diff-box { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 14px; line-height: 1.7; font-size: 0.88rem; max-height: 320px; overflow-y: auto; white-space: pre-wrap; }
.diff-add { background: rgba(34, 197, 94, 0.22); color: #4ade80; padding: 1px 3px; border-radius: 4px; text-decoration: none; font-weight: 600; }
.diff-del { background: rgba(239, 68, 68, 0.22); color: #f87171; padding: 1px 3px; border-radius: 4px; text-decoration: line-through; }
[data-theme="light"] .diff-add { color: #15803d; }
[data-theme="light"] .diff-del { color: #b91c1c; }
.esign-canvas { width: 100%; height: 150px; background: #ffffff; border: 2px dashed #94a3b8; border-radius: 8px; cursor: crosshair; touch-action: none; display: block; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; display: inline-block; animation: gbo-pulse 1s infinite; }
@keyframes gbo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Staging v11: Executive Paper-Sheet Document Viewer */
.doc-viewer-modal.is-fullscreen { max-width: 99vw !important; width: 99vw !important; height: 95vh; display: flex; flex-direction: column; }
.doc-viewer-modal.is-fullscreen .doc-reader-stage { flex: 1; max-height: none; }
.doc-reader-stage { background: #1e293b; border-radius: 10px; padding: 18px; max-height: 76vh; overflow-y: auto; }
.doc-reader-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(15, 23, 42, 0.9); border: 1px solid #334155; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; color: #e2e8f0; font-size: 0.82rem; }
.doc-paper { background: #ffffff; color: #1e293b; max-width: 860px; margin: 0 auto; padding: 38px 44px; border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42); font-family: "Segoe UI", Inter, Georgia, Arial, sans-serif; line-height: 1.72; font-size: 15px; transition: font-size 0.15s ease; overflow-wrap: break-word; }
.doc-reader-stage.dark-paper .doc-paper { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; }
.doc-paper h1 { font-size: 1.75em; color: #1b365d; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin: 0 0 14px; }
.doc-paper h2 { font-size: 1.35em; color: #1b365d; margin: 22px 0 10px; }
.doc-paper h3 { font-size: 1.12em; color: #0f766e; margin: 16px 0 8px; }
.doc-reader-stage.dark-paper .doc-paper h1, .doc-reader-stage.dark-paper .doc-paper h2 { color: #93c5fd; border-bottom-color: #334155; }
.doc-reader-stage.dark-paper .doc-paper h3 { color: #5eead4; }
.doc-paper p { margin: 0 0 12px; }
.doc-paper ul, .doc-paper ol { margin: 0 0 14px 22px; }
.doc-paper li { margin-bottom: 5px; }
.doc-paper img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
.doc-paper table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9em; }
.doc-paper th, .doc-paper td { border: 1px solid #cbd5e1; padding: 8px 10px; text-align: left; }
.doc-paper th, .doc-paper tr:first-child td { background: #1b365d; color: #ffffff; font-weight: 700; }
.doc-paper tr:nth-child(even) td { background: #f8fafc; }
.doc-reader-stage.dark-paper .doc-paper td { border-color: #334155; }
.doc-reader-stage.dark-paper .doc-paper tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.doc-sheet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.doc-sheet-tab { background: #0f172a; color: #cbd5e1; border: 1px solid #334155; border-radius: 6px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.doc-sheet-tab.active { background: #1b365d; color: #ffffff; border-color: #3b82f6; }
.doc-slide-card { background: #ffffff; color: #0f172a; max-width: 860px; margin: 0 auto 16px; padding: 28px 32px; border-radius: 10px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); border-top: 5px solid #1b365d; }
.doc-slide-num { display: inline-block; background: #1b365d; color: #ffffff; padding: 3px 10px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; margin-bottom: 10px; }
.doc-pdf-page { max-width: 860px; margin: 0 auto 16px; background: #ffffff; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.doc-pdf-label { background: #0f172a; color: #94a3b8; font-size: 0.74rem; padding: 5px 12px; font-weight: 700; }
@media (max-width: 780px) { .doc-paper { padding: 20px 18px; } }
