/* ============================================================
   CEO-OS — سیستم‌عامل مدیرعامل اکوملک
   Design system for CEO-OS portal pages.
   Reuses global tokens from tokens.css and components from content.css.
   ============================================================ */

/* Page wrapper ------------------------------------------------ */
.ceoos-page {
  scroll-margin-top: 1rem;
}

.ceoos-page .page-header-line {
  color: #6b7c85;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

/* Hero / chapter cover ---------------------------------------- */
.ceoos-hero {
  background: linear-gradient(135deg, #0f4c5c 0%, #115e6e 60%, #1a6f7f 100%);
  color: #fff;
  border-radius: 18px;
  padding: 2.75rem 2.25rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 12px 36px rgba(15, 76, 92, 0.18);
  position: relative;
  overflow: hidden;
}
.ceoos-hero::before,
.ceoos-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.ceoos-hero::before { top: -60px; left: -60px; width: 220px; height: 220px; }
.ceoos-hero::after  { bottom: -90px; right: -90px; width: 280px; height: 220px; }

.ceoos-hero-eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}
.ceoos-hero-num {
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 0.4rem;
  letter-spacing: 2px;
}
.ceoos-hero-title {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 0.35rem;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.ceoos-hero-sub {
  font-size: 1.05rem;
  opacity: 0.85;
  font-weight: 500;
  margin-bottom: 1.5rem;
  direction: ltr;
  text-align: right;
}
.ceoos-hero-divider {
  width: 80px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 0 1.25rem;
}
.ceoos-hero-lead {
  font-size: 1rem;
  line-height: 1.85;
  opacity: 0.92;
  max-width: 70ch;
  text-align: justify;
}

/* Section anchor target --------------------------------------- */
.ceoos-anchor {
  scroll-margin-top: 1.5rem;
  padding-top: 0.5rem;
}

/* Module / stage card ----------------------------------------- */
.ceoos-module-card {
  background: #ffffff;
  border: 1px solid #eef2f5;
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.03);
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.ceoos-module-card:hover {
  box-shadow: 0 10px 30px rgba(15, 76, 92, 0.08);
  transform: translateY(-2px);
}
.ceoos-module-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 5px; height: 100%;
  background: var(--primary);
}
.ceoos-module-card.accent::before { background: var(--accent); }
.ceoos-module-card.warning::before { background: var(--warning); }
.ceoos-module-card.danger::before  { background: var(--danger); }

.ceoos-module-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.ceoos-module-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.ceoos-module-card.accent .ceoos-module-num { background: var(--accent); }
.ceoos-module-card.warning .ceoos-module-num { background: var(--warning); }
.ceoos-module-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.ceoos-module-tagline {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.ceoos-module-body {
  font-size: 0.94rem;
  line-height: 1.85;
  color: #334155;
  text-align: justify;
}
.ceoos-module-body p { margin-bottom: 0.85rem; }
.ceoos-module-body ul,
.ceoos-module-body ol {
  margin: 0.5rem 1.5rem 1rem 0;
}
.ceoos-module-body li { margin-bottom: 0.4rem; }

/* Principle grid (Constitution) ------------------------------- */
.ceoos-principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}
.ceoos-principle {
  background: linear-gradient(160deg, #ffffff 0%, #f4f9fa 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1.1rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ceoos-principle:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 76, 92, 0.08);
}
.ceoos-principle-num {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  font-size: 1.7rem;
  font-weight: 900;
  color: rgba(15, 76, 92, 0.12);
  line-height: 1;
  direction: ltr;
}
.ceoos-principle-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 0.5rem;
  padding-left: 2.2rem;
}
.ceoos-principle-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.7;
  text-align: justify;
}

/* Stage timeline (Growth Roadmap) ----------------------------- */
.ceoos-stage-timeline {
  position: relative;
  margin: 2rem 0;
  padding-right: 2rem;
  border-right: 3px solid #cfd8dc;
}
.ceoos-stage {
  position: relative;
  margin-bottom: 2.25rem;
}
.ceoos-stage:last-child { margin-bottom: 0; }
.ceoos-stage-marker {
  position: absolute;
  right: -2.65rem;
  top: 0.4rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px rgba(26, 147, 111, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  direction: ltr;
}
.ceoos-stage:nth-child(even) .ceoos-stage-marker {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 76, 92, 0.18);
}
.ceoos-stage-card {
  background: #fff;
  border: 1px solid #eef2f5;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}
.ceoos-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ceoos-stage-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.ceoos-stage-role {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
}
.ceoos-stage-body {
  font-size: 0.92rem;
  line-height: 1.8;
  color: #334155;
  text-align: justify;
}

/* KPI dashboard mockup ---------------------------------------- */
.ceoos-kpi-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.ceoos-kpi-tile {
  background: linear-gradient(140deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  text-align: center;
  transition: transform 0.2s;
}
.ceoos-kpi-tile:hover { transform: scale(1.03); }
.ceoos-kpi-tile-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.ceoos-kpi-tile-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.ceoos-kpi-tile-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}
.ceoos-kpi-tile.gold {
  background: linear-gradient(140deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.ceoos-kpi-tile.gold .ceoos-kpi-tile-value { color: #b45309; }
.ceoos-kpi-tile.gold .ceoos-kpi-tile-label { color: #92400e; }

/* Decision / matrix table ------------------------------------- */
.ceoos-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.ceoos-matrix th {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 0.8rem 1rem;
  text-align: right;
  font-size: 0.88rem;
}
.ceoos-matrix td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: top;
}
.ceoos-matrix tr:last-child td { border-bottom: none; }
.ceoos-matrix tr:nth-child(even) { background: #f8fafc; }
.ceoos-matrix tr:hover { background: #eef4f6; }
.ceoos-matrix .cell-strong { font-weight: 700; color: var(--primary); }

/* Lifecycle / funnel steps ------------------------------------ */
.ceoos-lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  align-items: stretch;
}
.ceoos-lifecycle-step {
  flex: 1 1 130px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  position: relative;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.ceoos-lifecycle-step-num {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.6rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.ceoos-lifecycle-step-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.ceoos-lifecycle-step-desc {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.5;
}
.ceoos-lifecycle-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
}

/* CEO cockpit layout ------------------------------------------ */
.ceoos-cockpit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.ceoos-cockpit-panel {
  background: #0f4c5c;
  color: #e2f3f6;
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.ceoos-cockpit-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}
.ceoos-cockpit-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 0.5rem;
}
.ceoos-cockpit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ceoos-cockpit-list li {
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.ceoos-cockpit-list li:last-child { border-bottom: none; }
.ceoos-cockpit-list .ck-key { opacity: 0.85; }
.ceoos-cockpit-list .ck-val { font-weight: 700; color: #fff; }

/* Signal / status badges -------------------------------------- */
.ceoos-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.ceoos-signal::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}
.ceoos-signal.green  { background: #d1fae5; color: #047857; }
.ceoos-signal.green::before  { background: #10b981; }
.ceoos-signal.yellow { background: #fef3c7; color: #b45309; }
.ceoos-signal.yellow::before { background: #f59e0b; }
.ceoos-signal.red    { background: #fee2e2; color: #b91c1c; }
.ceoos-signal.red::before    { background: #ef4444; }

/* Callout / alert boxes --------------------------------------- */
.ceoos-callout {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  line-height: 1.75;
  border-right: 4px solid;
}
.ceoos-callout-title {
  font-weight: 800;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ceoos-callout.info {
  background: #e8f5f0;
  border-color: var(--accent);
  color: #0f5132;
}
.ceoos-callout.warn {
  background: #fff7e6;
  border-color: var(--warning);
  color: #7a4a06;
}
.ceoos-callout.danger {
  background: #fdecea;
  border-color: var(--danger);
  color: #7f1d1d;
}
.ceoos-callout.gold {
  background: #fffbeb;
  border-color: #d97706;
  color: #78350f;
}

/* Checklist block --------------------------------------------- */
.ceoos-checklist {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
.ceoos-checklist-title {
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.ceoos-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ceoos-checklist li {
  padding: 0.4rem 0 0.4rem 1.75rem;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #334155;
}
.ceoos-checklist li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 0.35rem;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1.2rem;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Mini TOC / chapter nav -------------------------------------- */
.ceoos-toc {
  background: #f4f9fa;
  border: 1px solid #d8e6e9;
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
}
.ceoos-toc-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.6rem;
  letter-spacing: 0.3px;
}
.ceoos-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.3rem;
}
.ceoos-toc a {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.ceoos-toc a:hover { background: #e2f0f2; color: var(--primary); }
.ceoos-toc .toc-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
  direction: ltr;
}

/* Responsive -------------------------------------------------- */
@media (max-width: 768px) {
  .ceoos-hero { padding: 1.75rem 1.25rem; border-radius: 14px; }
  .ceoos-hero-title { font-size: 1.5rem; }
  .ceoos-module-card { padding: 1.25rem; }
  .ceoos-stage-timeline { padding-right: 1.25rem; }
  .ceoos-stage-marker { right: -1.9rem; width: 1.15rem; height: 1.15rem; }
  .ceoos-lifecycle-step { flex: 1 1 100%; }
  .ceoos-lifecycle-arrow { display: none; }
}
