/* core screens: styles for this module only. Loaded after index.html and theme.css, so a plain selector here wins ties. */

/* ---------- atoms ---------- */
#page[data-module="core"] .cic { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 14px -8px rgba(var(--cg), .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
#page[data-module="core"] .cic svg { width: 16px; height: 16px; }
#page[data-module="core"] .cav { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 4px 10px -6px rgba(var(--cg), .9); }
#page[data-module="core"] .cwho { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
#page[data-module="core"] .cwho-t { min-width: 0; }
#page[data-module="core"] .cwho-t b { font-weight: 500; white-space: nowrap; }
#page[data-module="core"] .cbar { display: block; flex: 1; min-width: 40px; height: 6px; border-radius: 999px; background: rgba(var(--cg), .12); overflow: hidden; }
#page[data-module="core"] .cbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); transform-origin: left; }
#page[data-module="core"].page-in .cbar i { animation: db-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
#page[data-module="core"] .cring { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; }
#page[data-module="core"] .cring svg { position: absolute; inset: 0; }
#page[data-module="core"] .cring .tk { fill: none; stroke: rgba(var(--cg), .14); stroke-width: 4.5; }
#page[data-module="core"] .cring .fl { fill: none; stroke: var(--c1); stroke-width: 4.5; stroke-linecap: round; }
#page[data-module="core"] .cring b { font-size: 11px; font-weight: 600; color: #1E1B4B; }
#page[data-module="core"] h2.cht { display: flex; align-items: center; gap: 10px; font-size: 15px; }
#page[data-module="core"] .card > h2.cht { margin-bottom: 14px; }
#page[data-module="core"] .ch h2.cht { margin: 0; }
#page[data-module="core"] .card > .ch { margin-bottom: 14px; }

/* stat tiles: the icon takes the tile's tone */
#page[data-module="core"] .kpi[class*="db-t-"] .l .ic { background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 16px -9px rgba(var(--cg), .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
#page[data-module="core"] .kpi .s { color: var(--text-3); }

/* quieter lists and tables inside cards */
#page[data-module="core"] .li { border-bottom-color: rgba(241, 245, 249, .8); }
#page[data-module="core"] .t td .sub { color: var(--text-3); }

/* ---------- overview: health across modules ---------- */
#page[data-module="core"] .hmx { display: flex; flex-direction: column; }
#page[data-module="core"] :is(.hm-h, .hm-r) { display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(90px, 1fr) minmax(90px, 1fr) 88px 64px; gap: 16px; align-items: center; }
#page[data-module="core"] .hm-h { padding: 0 4px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 500; }
#page[data-module="core"] .hm-r { padding: 8px 4px; border-radius: 10px; transition: background .2s; }
#page[data-module="core"] .hm-r:hover { background: rgba(111, 99, 240, .04); }
#page[data-module="core"] .hm-m { display: flex; align-items: center; gap: 10px; min-width: 0; }
#page[data-module="core"] .hm-m b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page[data-module="core"] .hm-v { display: flex; align-items: center; gap: 10px; }
#page[data-module="core"] .hm-v b { width: 20px; text-align: right; font-weight: 600; font-size: 13px; }
#page[data-module="core"] .hm-v.is-bad b { color: var(--red); }
#page[data-module="core"] .hm-a { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 13px; }
#page[data-module="core"] .hm-a svg { width: 13px; height: 13px; color: var(--text-3); }
#page[data-module="core"] .r { text-align: right; }

/* people tiles and entity bars */
#page[data-module="core"] .pp-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#page[data-module="core"] .pp { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(248, 250, 252, .9); }
#page[data-module="core"] .pp > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
#page[data-module="core"] .pp b { font-size: 20px; font-weight: 600; color: #1E1B4B; }
#page[data-module="core"] .pp > span:last-child > span { font-size: 12px; color: var(--text-2); }
#page[data-module="core"] .ent-b { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
#page[data-module="core"] .eb { display: grid; grid-template-columns: 64px 1fr 28px; gap: 10px; align-items: center; }
#page[data-module="core"] .eb b { text-align: right; font-weight: 600; font-size: 13px; }

/* needs attention */
#page[data-module="core"] .at-li { gap: 12px; }
#page[data-module="core"] .at-n { font-size: 18px; font-weight: 600; min-width: 24px; color: #1E1B4B; }

/* company setup */
#page[data-module="core"] .su-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#page[data-module="core"] .su-l { display: flex; flex-direction: column; gap: 8px; }
#page[data-module="core"] .su { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#page[data-module="core"] .su svg { width: 16px; height: 16px; flex: none; }
#page[data-module="core"] .su.ok svg { color: #10b981; }
#page[data-module="core"] .su.todo svg { color: #f59e0b; }
#page[data-module="core"] .su.ok span { color: var(--text-2); }

/* module bars */
#page[data-module="core"] .mb-l { display: flex; flex-direction: column; gap: 10px; }
#page[data-module="core"] .mb { display: grid; grid-template-columns: 32px minmax(80px, 120px) 1fr 32px; gap: 10px; align-items: center; font-size: 13px; }
#page[data-module="core"] .mb b { text-align: right; font-weight: 600; }

/* compact timeline */
#page[data-module="core"] .ctl { position: relative; display: flex; flex-direction: column; }
#page[data-module="core"] .ctl::before { content: ""; position: absolute; left: 14px; top: 16px; bottom: 16px; width: 2px; background: linear-gradient(rgba(111, 99, 240, .25), rgba(111, 99, 240, .05)); }
#page[data-module="core"] .ctl-i { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
#page[data-module="core"] .ctl-i .cav { box-shadow: 0 0 0 3px #fff, 0 4px 10px -6px rgba(var(--cg), .9); }
#page[data-module="core"] .ctl-i .grow { flex: 1; min-width: 0; }
#page[data-module="core"] .ctl-i .grow b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#page[data-module="core"] .ctl-i > .xs { white-space: nowrap; }

@media (max-width: 720px) {
  #page[data-module="core"] .hm-h { display: none; }
  #page[data-module="core"] .hm-r { grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 10px 4px; border-bottom: 1px solid var(--hair); border-radius: 0; }
  #page[data-module="core"] .hm-m { grid-column: 1 / -1; }
  #page[data-module="core"] .hm-a { justify-content: flex-start; }
  #page[data-module="core"] .ctl-i > .xs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #page[data-module="core"] .cbar i { animation: none !important; }
}

/* ---------- tables: number with a bar, chips ---------- */
#page[data-module="core"] .nbar { display: flex; align-items: center; gap: 10px; min-width: 110px; }
#page[data-module="core"] .nbar b { min-width: 22px; text-align: right; font-weight: 600; }
#page[data-module="core"] .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
#page[data-module="core"] .chn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f5f3ff; color: #6d28d9; white-space: nowrap; }
#page[data-module="core"] .chn svg { width: 12px; height: 12px; }
#page[data-module="core"] .mfa { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
#page[data-module="core"] .mfa svg { width: 15px; height: 15px; }
#page[data-module="core"] .mfa.on { color: #047857; }
#page[data-module="core"] .mfa.off { color: #b45309; }

/* users: account mix split bar */
#page[data-module="core"] .us-mix { padding: 14px 18px; }
#page[data-module="core"] .split { display: flex; gap: 3px; height: 10px; margin: 10px 0; border-radius: 999px; overflow: hidden; }
#page[data-module="core"] .split i { display: block; min-width: 4px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
#page[data-module="core"] .us-mix .leg i { background: linear-gradient(135deg, var(--c1), var(--c2)); border-radius: 50%; }

/* approvals inbox rows */
#page[data-module="core"] .ap-li { gap: 14px; padding: 12px 0; flex-wrap: wrap; }
#page[data-module="core"] .ap-li .grow { min-width: 220px; }
#page[data-module="core"] .ap-s { display: block; font-weight: 500; }
#page[data-module="core"] .ap-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 12px; color: var(--text-2); }
#page[data-module="core"] .ap-who { display: inline-flex; align-items: center; gap: 6px; }
#page[data-module="core"] .ap-who .cav { width: 20px; height: 20px; font-size: 9px; }
#page[data-module="core"] .ap-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#page[data-module="core"] .age { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; white-space: nowrap; }
#page[data-module="core"] .age.bad { background: #fff1f2; color: #be123c; }
#page[data-module="core"] .age svg { width: 12px; height: 12px; }
#page[data-module="core"] .ap-subj { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* audit log as a timeline: a rail through the first column with a toned dot per entry */
#page[data-module="core"] [data-tbl^="audCore"] tbody td:first-child { position: relative; padding-left: 16px; }
#page[data-module="core"] [data-tbl^="audCore"] tbody td:first-child::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: 2px; background: rgba(111, 99, 240, .14); }
#page[data-module="core"] [data-tbl^="audCore"] tbody tr:first-child td:first-child::before { top: 50%; }
#page[data-module="core"] [data-tbl^="audCore"] tbody tr:last-child td:first-child::before { bottom: 50%; }
#page[data-module="core"] [data-tbl^="audCore"] .t td { border-bottom: 0; }
#page[data-module="core"] .tl-w { position: relative; display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text-2); font-size: 12px; }
#page[data-module="core"] .tl-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 0 0 3px #fff; }
#page[data-module="core"] .tl-dot svg { width: 13px; height: 13px; }

/* permission matrix: clear on and off marks */
#page[data-module="core"] .mx input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; cursor: pointer; background: #f1f5f9; border: 1px dashed #cbd5e1; display: inline-block; vertical-align: middle; transition: background .15s, transform .15s; }
#page[data-module="core"] .mx input[type=checkbox]:hover:not(:disabled) { transform: scale(1.08); border-color: #a5b4fc; }
#page[data-module="core"] .mx input[type=checkbox]:checked { border: 0; background: linear-gradient(135deg, #5B4CF0, #8F7DF6) center / 100% no-repeat; box-shadow: 0 4px 10px -6px rgba(91, 76, 240, .9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E"), linear-gradient(135deg, #5B4CF0, #8F7DF6); background-size: 14px, 100%; background-position: center; }
#page[data-module="core"] .mx input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
#page[data-module="core"] .mx input[type=checkbox]:focus-visible { outline: 2px solid #5B4CF0; outline-offset: 2px; }
#page[data-module="core"] .mx td.chg { background: #fef3c7; }

/* org tree */
#page[data-module="core"] .node .cic { width: 28px; height: 28px; border-radius: 9px; }
#page[data-module="core"] .node .cic svg { width: 14px; height: 14px; }
#page[data-module="core"] .nd-b { width: 60px; margin-left: auto; padding-left: 10px; }
#page[data-module="core"] .node:has(.nd-b) { display: flex; }
#page[data-module="core"] .org-hc { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
#page[data-module="core"] .org-hc b { font-size: 20px; font-weight: 600; color: #1E1B4B; }

@media (max-width: 720px) {
  #page[data-module="core"] .ap-r { margin-left: 46px; flex-wrap: wrap; }
  #page[data-module="core"] .ap-subj { max-width: 200px; }
  #page[data-module="core"] .nd-b { display: none; }
}
