/* CHERT Base console. Values come from chert-tokens.css only (CHERT Design System). */
@font-face { font-family: "Inter"; src: url("fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-ui); font-size: var(--fs-sm); line-height: var(--lh-base); color: var(--chert-ink); background: var(--chert-surface-alt); }
a { color: var(--chert-orange-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: var(--fs-h3); margin: 0 0 var(--space-4); line-height: var(--lh-snug); }
h2 { font-size: var(--fs-lg); margin: var(--space-5) 0 var(--space-3); }
code, .mono { font-family: var(--font-mono); font-size: var(--fs-xs); }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.side { background: var(--chert-dark); color: var(--chert-dark-text); padding: var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); font-weight: 700; letter-spacing: .04em; }
.brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.brand small { display: block; font-weight: 400; color: var(--chert-dark-muted); letter-spacing: 0; }
.side a { color: var(--chert-dark-text); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); display: block; }
.side a:hover { background: var(--chert-dark-surface); text-decoration: none; }
.side a.on { background: var(--chert-orange); color: var(--chert-ink); font-weight: 600; }
.side .who { margin-top: auto; color: var(--chert-dark-muted); font-size: var(--fs-xs); word-break: break-all; }
.side .who button { margin-top: var(--space-2); }
.main { padding: var(--space-6); max-width: var(--maxw-wide); width: 100%; }
.crumbs { color: var(--chert-muted); margin-bottom: var(--space-2); font-size: var(--fs-xs); }
.panel { background: var(--chert-surface); border: 1px solid var(--chert-border); border-radius: var(--radius-card); padding: var(--space-5); margin-bottom: var(--space-5); box-shadow: var(--shadow-card); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.tile { background: var(--chert-surface); border: 1px solid var(--chert-border); border-radius: var(--radius-md); padding: var(--space-4); }
.tile b { display: block; font-size: var(--fs-h2); line-height: var(--lh-tight); }
.tile span { color: var(--chert-muted); font-size: var(--fs-xs); }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: var(--fs-overline); text-transform: uppercase; letter-spacing: .06em; color: var(--chert-muted); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--chert-border-strong); white-space: nowrap; }
td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--chert-border); vertical-align: top; word-break: break-word; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--chert-muted); padding: var(--space-4) 0; }
.pill { display: inline-block; padding: 1px var(--space-2); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--chert-surface-alt); border: 1px solid var(--chert-border); }
.pill.ok { background: var(--chert-success-tint); border-color: var(--chert-success); }
.pill.warn { background: var(--chert-warning-tint); border-color: var(--chert-warning); }
.pill.bad { background: var(--chert-error-tint); border-color: var(--chert-error); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: 1px solid var(--chert-border-strong); margin-bottom: var(--space-5); }
.tabs a { padding: var(--space-2) var(--space-3); color: var(--chert-ink); border-bottom: 2px solid transparent; }
.tabs a.on { border-bottom-color: var(--chert-orange); font-weight: 600; }
.tabs a:hover { text-decoration: none; background: var(--chert-orange-tint); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-4); }
.row label { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-xs); color: var(--chert-muted); }
input, select, textarea { font: inherit; padding: var(--space-2) var(--space-3); border: 1px solid var(--chert-border-strong); border-radius: var(--radius-sm); background: var(--chert-surface); color: var(--chert-ink); min-width: 180px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--chert-orange); outline-offset: 1px; }
button { font: inherit; font-weight: 600; cursor: pointer; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--chert-orange-deep); background: var(--chert-orange); color: var(--chert-ink); }
button:hover { background: var(--chert-orange-deep); }
button.quiet { background: transparent; border-color: var(--chert-border-strong); font-weight: 500; }
button.quiet:hover { background: var(--chert-orange-tint); }
button.danger { background: transparent; border-color: var(--chert-error); color: var(--chert-error); }
button.danger:hover { background: var(--chert-error-tint); }
button.small { padding: 2px var(--space-3); font-size: var(--fs-xs); }
button:disabled { opacity: .5; cursor: not-allowed; }
.note { background: var(--chert-info-tint); border: 1px solid var(--chert-info); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-4); }
.note.warn { background: var(--chert-warning-tint); border-color: var(--chert-warning); }
.note.bad { background: var(--chert-error-tint); border-color: var(--chert-error); }
.note.good { background: var(--chert-success-tint); border-color: var(--chert-success); }
.secret { font-family: var(--font-mono); font-size: var(--fs-xs); background: var(--chert-cream); border: 1px dashed var(--chert-border-strong); padding: var(--space-3); border-radius: var(--radius-sm); word-break: break-all; user-select: all; }
pre { background: var(--chert-dark); color: var(--chert-dark-text); padding: var(--space-4); border-radius: var(--radius-sm); overflow: auto; font-family: var(--font-mono); font-size: var(--fs-xs); max-height: 420px; }
.login { max-width: 400px; margin: 12vh auto; }
.login .brand { color: var(--chert-ink); }
.login label { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); color: var(--chert-muted); font-size: var(--fs-xs); }
.login input { width: 100%; }
.muted { color: var(--chert-muted); }
.right { text-align: end; }
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } .side { flex-direction: row; flex-wrap: wrap; align-items: center; } .side .who { margin: 0 0 0 auto; } .main { padding: var(--space-4); } }

/* Arabic: the design system's Arabic face and line height; layout follows the document direction. */
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
html[lang="ar"] body { font-family: var(--font-ar); line-height: var(--lh-ar); }
html[lang="ar"] th { letter-spacing: 0; }
html[lang="ar"] .brand { letter-spacing: 0; }
code, .mono, .secret, pre { direction: ltr; unicode-bidi: isolate; text-align: left; }
.secret { white-space: pre-wrap; }
label input[type="checkbox"] { min-width: 0; width: 18px; height: 18px; }
/* A table wider than its panel scrolls inside the panel; the page itself never scrolls sideways. */
.panel { overflow-x: auto; }
.main { min-width: 0; }

/* Bar charts (SVG): the brand orange for bars, muted text for labels. */
.chartbox { margin-bottom: var(--space-4); }
.chart { width: 100%; max-width: 640px; height: auto; display: block; direction: ltr; }
.chart .bar { fill: var(--chert-orange); }
.chart .val { font-size: 11px; text-anchor: middle; fill: var(--chert-ink); font-family: var(--font-ui); }
.chart .lab { font-size: 10px; text-anchor: middle; fill: var(--chert-muted); font-family: var(--font-ui); }
input[type="file"] { padding: var(--space-1); }
