/* G4-CMEM1 — the sheet of «ذاكرة الشركة» (Codex lane B3) */
/* Company memory in the CFO Hub */
.cm-screen { display: grid; gap: 1rem; min-width: 0; }
.cm-screen .nx-tabs, .cm-tools, .cm-filters, .cm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.cm-screen button[aria-pressed=true] { background: var(--primary); color: white; } /* G4-HUBTABS1: the tab row's look is nx.css's, one for every tab row */
.cm-screen button.cm-link[data-topic] { color: #632bb3; }
.cm-card, .cm-paper { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(.8rem,2vw,1.4rem); }
.cm-filters { align-items: end; margin-block: 1.1rem .7rem; }
.cm-filters label, .cm-editor label { display: grid; gap: .25rem; }
.cm-filters label:first-child { flex: 1 1 15rem; }
.cm-screen input:not([type=checkbox]), .cm-screen select, .cm-screen textarea { max-width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: .5rem; font: inherit; }
.cm-line { border: 1px solid var(--line); border-inline-start: 3px solid var(--primary); padding: .85rem; border-radius: 10px; margin-block: .5rem; overflow-wrap: anywhere; }
.cm-kind { display: inline-block; margin-inline-end: .6rem; background: var(--surface-alt, #eef4ff); border-radius: 20px; padding: .15rem .6rem; font-size: .85rem; }
.cm-meta, .cm-scroll small { display: block; margin-block: .5rem; color: var(--muted); font-size: .85rem; }
.cm-wrong { color: var(--danger,#a33232); }
.cm-editor { position: fixed; inset: 0; margin: auto; z-index: 20; color: var(--ink); background: var(--surface); box-shadow: 0 0 0 100vmax #18233466; width: min(28rem,90vw); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; }
.cm-editor textarea { min-height: 6rem; }
.cm-editor label { margin-block: .7rem; }
.cm-paper { overflow-x: auto; margin-block: 1rem; }
.cm-screen table { width: 100%; border-collapse: collapse; }
.cm-screen th,.cm-screen td { text-align: start; padding: .55rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.cm-scroll { overflow-x: auto; }
.cm-map, .cm-history { display: block; width: 100%; margin-block: .8rem; }
.cm-map { min-height: 240px; touch-action: none; border: 1px solid var(--line); border-radius: 12px; cursor: grab; }
.cm-map text { text-anchor: middle; fill: var(--ink); font-size: 11px; }
.cm-map .cm-center { fill: white; font-weight: bold; }
.cm-map circle { fill: var(--primary); }
.cm-node { cursor: pointer; }
.cm-node path { stroke: #68b99c; }
.cm-node rect { fill: var(--surface); stroke: #38a078; }
.cm-node.empty rect,.cm-node.empty path { stroke: var(--muted); stroke-dasharray: 4 3; }
.cm-node:focus rect { stroke: var(--primary); stroke-width: 3; }
.cm-history { max-height: 180px; }
.cm-history polyline { fill: none; stroke: var(--primary); stroke-width: 2; }
.cm-history circle { fill: var(--primary); }
@media(max-width:600px) { .cm-filters label { flex: 1 1 42%; min-width: 0; } .cm-line .cm-tools button { font-size: .8rem; } }
.cm-print-only { display: none; }
@media print {
  .cm-screen .cm-tools, .cm-screen .cm-chips, .cm-screen .cm-filters, .cm-screen .nx-tabs, .cm-editor { display: none; }
  .cm-screen:has(.cm-print-only) > :not(.cm-print-only) { display: none; }
  .cm-screen .cm-print-only { display: block; }
  .cm-paper { overflow: visible; border: 0; } .cm-paper tr { break-inside: avoid; } }

/* G4-CMEM1 (fidelity): the design's header, tabs, numbers, switch, filter panel, chips, month headings, type chips, struck line, add window, corrector's page */
.cm-head h1 { font-size: 1.6rem; margin: 0; } .cm-head p { color: var(--muted); margin: .2rem 0 0; }
.cm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.cm-mx { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 10px; background: var(--cx-mx,#6d28d9); color: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.cm-link { border: 0; background: none; color: var(--primary); font: inherit; font-size: .82rem; cursor: pointer; padding: .1rem .3rem; text-decoration: underline; text-underline-offset: 3px; }
/* G4-HUBTABS1: «جديد» on the tab row is nx.css .nx-hub-new, the same chip on every HUB page */
/* G4-HUBTABS1: the active tab's line is nx.css's: straight, 2px, the full tab (it was 3px under the generic tab's 8px corners: a bent line) */
.cm-stats { display: flex; gap: 3rem; flex-wrap: wrap; padding-inline: .3rem; }
.cm-stats div { display: grid; } .cm-stats b { font-size: 1.15rem; } .cm-stats span { color: var(--muted); font-size: .8rem; }
.cm-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-inline-start: auto; } /* G4-HUBTABS1: no float; the switch ends its own row */
.cm-swrow { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-block: 0 .3rem; } .cm-swrow .cm-note { margin: 0; flex: 1 1 16rem; } /* G4-HUBTABS1: the filters' sentence and the switch on one row (state-mem); with the sentence hidden the switch still ends the row */
.cm-switch button { border: 0; background: var(--surface); padding: .35rem .9rem; font: inherit; font-size: .85rem; cursor: pointer; }
.cm-screen .cm-switch button[aria-pressed=true] { background: var(--primary); color: #fff; }
.cm-note { color: var(--muted); font-size: .82rem; margin: .2rem 0 .6rem; }
.cm-filters { background: var(--surface-alt,#f3f6fb); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin-block: .4rem .8rem; }
.cm-filters .cm-q { flex: 1 1 18rem; }
.cm-count { margin: 0; color: var(--muted); font-size: .85rem; } .cm-count b { color: var(--primary); font-size: 1.3rem; }
.cm-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; }
.cm-chip b { margin-inline-start: .35rem; }
.cm-month { color: var(--primary); border-inline-start: 3px solid var(--primary); padding-inline-start: .5rem; margin-block: 1rem .4rem; font-size: 1rem; }
.cm-line { border-inline-start: 1px solid var(--line); }
.cm-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cm-row strong { font-weight: 500; flex: 1 1 14rem; }
.cm-kind.cm-blue { background: #e8efff; color: #2e4fb8; } .cm-kind.cm-violet { background: #f0e9ff; color: #6a35c2; } .cm-kind.cm-teal { background: #e3f6f3; color: #157a6e; }
.cm-kind.cm-amber { background: #fff3df; color: #9c6a06; } .cm-kind.cm-slate { background: #eceff4; color: #3b4658; } .cm-kind.cm-green { background: #e6f6ee; color: #1d7a4f; }
.cm-kind.cm-rose { background: #fdebf1; color: #b0306a; } .cm-kind.cm-indigo { background: #e9eaff; color: #3a3fb3; }
.cm-meta { display: flex; flex-wrap: wrap; gap: .9rem; } .cm-meta b { color: var(--ink); font-weight: 600; }
.cm-struck { background: #fff5f5; border-color: #f3c7c7; }
.cm-bad { background: #fde2e2; color: #b42323; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; }
.cm-wrong { background: #fdecec; color: var(--ink); border-radius: 8px; padding: .55rem .7rem; font-size: .88rem; }
.cm-line-tools { opacity: 0; } .cm-line:hover .cm-line-tools, .cm-line:focus-within .cm-line-tools { opacity: 1; }
@media (hover:none) { .cm-line-tools { opacity: 1; } }
.cm-editor { width: min(31rem,92vw); } .cm-editor h2 { margin: .2rem 0 .8rem; }
.cm-x { position: absolute; inset-inline-end: .9rem; top: .9rem; border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 2rem; height: 2rem; cursor: pointer; }
.cm-editor { position: fixed; }
.cm-seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; width: 100%; }
.cm-seg label { display: block; margin: 0; } .cm-seg input { position: absolute; opacity: 0; }
.cm-seg span { display: block; padding: .3rem 1rem; cursor: pointer; } .cm-seg input:checked + span { background: var(--primary); color: #fff; }
.cm-seg input:focus-visible + span { outline: 2px solid var(--primary); }
.cm-two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.cm-info { background: #eef3ff; border: 1px solid #cdd9fb; border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; }
.cm-actions { display: flex; gap: .6rem; justify-content: flex-start; }
.cm-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.cm-yes { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #e6f6ee; color: #1d7a4f; } .cm-no { color: var(--muted); }
.cm-fix label { display: grid; gap: .3rem; margin-block: .7rem; } .cm-fix textarea { min-height: 5rem; }
@media(max-width:700px) { .cm-split, .cm-two { grid-template-columns: 1fr; } .cm-stats { gap: 1.4rem; } .cm-switch { float: none; } }

/* G4-CMEM1 (fidelity, part 2) */
.cm-line { position: relative; } .cm-line-tools { position: absolute; inset-inline-end: .6rem; bottom: .45rem; background: var(--surface); }
.cm-filters .cm-q { flex: 1 1 14rem; }
.cm-gtabs { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); margin-block: .2rem .8rem; }
.cm-gtabs button { border: 0; background: none; font: inherit; padding: .5rem .1rem; cursor: pointer; color: var(--ink); }
.cm-screen .cm-gtabs button[aria-pressed=true] { background: none; color: var(--primary); border-bottom: 3px solid var(--primary); }
.cm-history { max-height: 230px; } .cm-history text { font-size: 12px; text-anchor: middle; fill: var(--ink); } .cm-history .cm-m { fill: var(--muted); }
.cm-history circle { fill: #fff; stroke: var(--primary); stroke-width: 3; } .cm-history polyline { stroke-width: 3; }
.cm-scroll td small { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.cm-side tr.cm-group th { padding-top: .9rem; } .cm-side tr.cm-on td { background: #eef3ff; }
.cm-figlink { border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; padding: 0; text-decoration: underline dotted; text-underline-offset: 3px; }

/* G4-CMEM1 (fidelity, part 3): the mind map */
.cm-mapbox { position: relative; background: #f6f8fc; border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.cm-zoom { position: absolute; inset-inline-end: .7rem; top: .6rem; } .cm-zoom .nx-btn { min-width: 2rem; padding: .2rem .5rem; }
.cm-map { border: 0; min-height: 320px; } .cm-node rect { fill: #e9f7f0; stroke: #2f9e6e; stroke-width: 2; } .cm-node path { stroke: #7cc9a5; stroke-width: 2.5; }
.cm-node .cm-t { font-size: 14px; font-weight: 700; } .cm-node .cm-s { font-size: 10px; fill: var(--muted); } .cm-dot { fill: #1f9d62; }
.cm-node.empty rect { fill: #f2f4f7; } .cm-map .cm-ring { fill: none; stroke: #c3d2ff; stroke-width: 2; } .cm-map .cm-center { font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .cm-map { cursor: default; } }

/* G4-CMEM1 (fidelity, part 4): the phone */
.cm-map .cm-dot { fill: #1f9d62; }
.cm-mt, .cm-mobile-mx { display: none; }
@media (max-width: 600px) {
  .cm-dt, .cm-head p, .cm-head .cm-tools, .cm-tabs, .cm-stats, .cm-switch, .cm-note, .cm-chips, .cm-filters label:not(.cm-q), .cm-filters .nx-btn, .cm-count, .cm-lbl, .cm-month, .cm-line-tools { display: none; }
  .cm-mt { display: inline; } .cm-head h1 { font-size: 1.15rem; }
  .cm-filters { background: none; border: 0; padding: 0; margin: 0 0 .4rem; } .cm-filters .cm-q { flex: 1 1 100%; }
  .cm-card { padding: .6rem; border: 0; background: none; } .cm-line { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .cm-row { justify-content: space-between; flex-wrap: nowrap; align-items: flex-start; } .cm-row .cm-kind { order: 2; } .cm-row strong { font-weight: 700; }
  .cm-meta span:nth-child(1), .cm-meta span:nth-child(4) { display: none; } .cm-meta { gap: .4rem; font-size: .8rem; }
  .cm-mobile-mx { display: block; } .cm-mobile-mx .cm-mx { width: 100%; justify-content: center; }
  .cm-screen .cm-tabs, .cm-screen .cm-head .cm-tools, .cm-screen .cm-chips { display: none; }
}

/* G4-CMEM1 (fidelity, part 5): the print page */
.cm-ptools { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; } .cm-lang { width: auto; }
.cm-strip { background: #eef3ff; border: 1px solid #cdd9fb; border-radius: 12px; padding: .7rem 1rem; margin: 0; }
.cm-ptypes { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .85rem; } .cm-ptypes label { display: inline-flex; gap: .25rem; align-items: center; }
.cm-paper { max-width: 52rem; margin-inline: auto; box-shadow: 0 2px 10px #0000000f; }
.cm-ph { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .4rem; }
.cm-ph h2 { margin: 0; font-size: 1.05rem; } .cm-ph span, .cm-scope, .cm-pfoot { color: var(--muted); font-size: .8rem; }
.cm-pfoot { border-top: 1px solid var(--line); padding-top: .5rem; }
.cm-paper td:last-child, .cm-paper td:nth-child(2) { white-space: nowrap; }
