/* منصة المركز الإعلامي — يعتمد على tokens.css (نظام Localization & Export Forum) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg-page); color: var(--fg); font-size: 16px; line-height: 28px; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: var(--border-focus) solid var(--focus-ring); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-subtle); }
.small { font-size: 12px; line-height: 20px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* shell */
.shell { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }
.side { flex: 1 1 264px; max-width: 100%; background: var(--bg-surface); border-inline-end: 1px solid var(--border); }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 40px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 860px) { .main { padding: 20px 16px 32px; } .side { flex-basis: 100%; } }
.nav { display: flex; flex-direction: column; gap: 24px; padding: 28px 16px 32px; }
.nav-brand { display: flex; flex-direction: column; gap: 16px; padding: 0 8px 24px; border-bottom: 1px solid var(--border); }
.nav-brand img { height: 52px; width: auto; display: block; }
.pill-brand { align-self: flex-start; padding: 4px 16px; border-radius: var(--radius-pill); background: var(--gradient-brand); color: var(--ink); font-size: 14px; line-height: 22px; font-weight: 600; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav a.item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-md); color: var(--fg); text-decoration: none; font-size: 14px; line-height: 22px; font-weight: 500; }
.nav a.item:hover { background: var(--bg-sunken); }
.nav a.item[aria-current="page"] { background: var(--bg-accent-subtle); font-weight: 600; }
.nav .no { min-width: 22px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.nav a.item[aria-current="page"] .no { color: var(--fg); }
.nav svg { flex: none; }
.nav .grow { flex: 1 1 auto; }
.nav .badge { min-width: 24px; height: 24px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--forest); color: var(--white); font-size: 12px; line-height: 24px; font-weight: 600; text-align: center; }
.nav .group { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.nav button.item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: start; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-sunken); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: var(--white); display: grid; place-items: center; font-size: 14px; font-weight: 600; }

/* page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-title { display: flex; align-items: center; gap: 12px; }
.page-title h1 { font-size: 32px; line-height: 48px; font-weight: 700; color: var(--fg); }
.sec-pill { flex: none; padding: 2px 14px; border-radius: var(--radius-pill); background: var(--gradient-brand); color: var(--ink); font-size: 14px; line-height: 22px; font-weight: 600; }
.gold-rule { display: block; width: 96px; height: 1px; margin: 8px 0 6px; background: var(--gold); }
.page-sub { font-size: 14px; line-height: 24px; color: var(--fg-subtle); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; line-height: 22px; color: var(--fg-subtle); }

/* buttons (LEF Button) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-6); border-radius: var(--radius-pill); border: var(--border-control) solid var(--action-primary); background: var(--action-primary); color: var(--on-action-primary); font: inherit; font-size: 16px; line-height: 24px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color var(--duration-fast) var(--ease-standard); }
.btn:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--on-action-primary); }
.btn.secondary { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--bg-accent-subtle); border-color: var(--indicator); color: var(--fg); }
.btn.ghost { background: transparent; color: var(--fg); border-color: transparent; }
.btn.ghost:hover { background: var(--bg-accent-subtle); color: var(--fg); }
.btn.danger { background: transparent; color: var(--danger-fg); border-color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.btn.sm { min-height: var(--control-sm); padding: 0 var(--space-4); font-size: 14px; line-height: 20px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: var(--opacity-disabled); cursor: not-allowed; pointer-events: none; }
form.inline { display: inline; }

/* fields (LEF TextField / Select) */
.field { display: grid; gap: var(--space-2); }
.field > label, .field > .label { color: var(--fg-strong); font-size: 14px; line-height: 22px; font-weight: 500; }
.field .hint { font-size: 12px; line-height: 20px; color: var(--fg-subtle); }
.field .req { color: var(--danger-fg); }
.input, select.input, textarea.input { width: 100%; min-height: var(--control-md); padding: 8px var(--space-4); background: var(--bg-surface); border: var(--border-control) solid var(--border-strong); border-radius: var(--radius-sm); color: var(--fg-strong); font: inherit; font-size: 16px; line-height: 26px; }
textarea.input { min-height: 120px; resize: vertical; }
.input:hover { border-color: var(--fg); }
.input:focus { outline: var(--border-focus) solid var(--focus-ring); outline-offset: 2px; border-color: var(--fg); }
input[type=email].input, input[type=url].input, input[type=tel].input { direction: ltr; text-align: start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 22px; color: var(--fg-strong); }
.check input { width: 20px; height: 20px; accent-color: var(--indicator); }
fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--fg-strong); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.form-grid .wide { grid-column: 1 / -1; }

/* surfaces */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.strong { border: 1.5px solid var(--forest); }
.card h2 { font-size: 20px; line-height: 32px; font-weight: 600; }
.card h3 { font-size: 16px; line-height: 26px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > .grow2 { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.row > .grow1 { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 20px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.filters .field { flex: 1 1 170px; min-width: 150px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-sunken); border-radius: var(--radius-pill); }
.segmented a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--radius-pill); color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 500; }
.segmented a[aria-current="true"] { background: var(--forest); color: var(--white); }

/* tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 12px; line-height: 24px; font-weight: 600; white-space: nowrap; background: var(--bg-sunken); color: var(--fg-strong); }
.tag.green { background: var(--green-light); color: var(--forest); }
.tag.forest { background: var(--forest); color: var(--white); }
.tag.gold { background: var(--gold-light); color: var(--gold-text); }
.tag.mist { background: var(--mist-light); color: var(--mist-text); }
.tag.danger { background: var(--danger-bg); color: var(--danger-fg); }

/* alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-md); border: 1px solid var(--info-border); border-inline-start-width: 4px; background: var(--info-bg); color: var(--fg-strong); font-size: 14px; line-height: 24px; }
.alert strong { display: block; color: var(--info-fg); }
.alert.success { background: var(--success-bg); border-color: var(--success-border); }
.alert.success strong { color: var(--success-fg); }
.alert.warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert.warning strong { color: var(--warning-fg); }
.alert.danger { background: var(--danger-bg); border-color: var(--danger-border); }
.alert.danger strong { color: var(--danger-fg); }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; color: var(--fg-strong); }
table.t th, table.t td { padding: 10px 12px; text-align: start; vertical-align: middle; }
table.t thead th { background: var(--bg-sunken); font-weight: 600; white-space: nowrap; }
table.t tbody tr { border-bottom: 1px solid var(--bg-sunken); }
table.t tbody tr:hover { background: var(--bg-accent-subtle); }
table.t tbody th { font-weight: 500; }
table.t .end { text-align: end; font-variant-numeric: tabular-nums; }
table.t tfoot td, table.t tfoot th { background: var(--bg-sunken); font-weight: 600; }
.logo-cell img { display: block; height: 28px; width: auto; max-width: 140px; object-fit: contain; }
.logo-name { font-size: 13px; line-height: 20px; color: var(--fg); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--gradient-card-green); color: var(--fg); text-decoration: none; }
.kpi:hover { border-color: var(--forest); color: var(--fg); }
.kpi .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 22px; font-weight: 500; }
.kpi .val { font-size: 56px; line-height: 60px; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12px; line-height: 20px; color: var(--fg-subtle); }
.kpi.brand { background: var(--forest); color: var(--white); border-color: var(--forest); }
.kpi.brand .val { color: var(--white); }
.kpi.brand .note { color: var(--green-light); }
.kpi.alert-k { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.kpi.alert-k .val, .kpi.alert-k .note { color: var(--danger); }
.kpi.gray { background: var(--gradient-card-gray); padding: 16px 20px; gap: 4px; }
.kpi.gold { background: var(--gradient-card-gold); border-color: var(--gold); padding: 16px 20px; gap: 4px; }
.kpi.gray .val, .kpi.gold .val { font-size: 40px; line-height: 48px; }
.kpi.gold .note { color: var(--gold-text); }
.bar { display: block; height: 6px; border-radius: var(--radius-pill); background: rgba(255,255,255,.25); overflow: hidden; }
.bar > span { display: block; height: 6px; background: var(--gradient-brand); }
.pg { display: inline-block; flex: none; width: 40px; height: 40px; background-color: currentColor; -webkit-mask: var(--pg) center / contain no-repeat; mask: var(--pg) center / contain no-repeat; }
.pg.s32 { width: 32px; height: 32px; }

/* charts */
.chart-days { display: flex; align-items: flex-end; gap: 6px; height: 220px; border-bottom: 1px solid var(--gray); direction: ltr; }
.chart-days .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.chart-days .v { font-size: 12px; line-height: 18px; text-align: center; color: var(--ink); }
.chart-days .o { background: var(--forest-light); border-radius: 3px 3px 0 0; }
.chart-days .p { background: var(--forest); }
.chart-labels { display: flex; gap: 6px; direction: ltr; }
.chart-labels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 12px; line-height: 18px; color: var(--fg-subtle); border-top: 3px solid transparent; padding-top: 4px; }
.chart-labels span.today { color: var(--ink); font-weight: 700; border-top-color: var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; line-height: 20px; color: var(--ink); list-style: none; margin: 0; padding: 0; }
.legend li, .legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.stack { display: flex; height: 20px; border-radius: var(--radius-sm); overflow: hidden; gap: 2px; }
.minibar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; gap: 1px; }

/* calendar */
.cal-cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.cal-col { flex: 1 1 190px; min-width: 190px; display: flex; flex-direction: column; gap: 8px; }
.cal-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--fg); }
.cal-head.today { background: var(--forest); color: var(--white); }
.cal-head .d { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 700; }
.cal-head .d span:last-child { font-size: 14px; font-weight: 500; }
.cal-head .c { font-size: 12px; line-height: 20px; font-weight: 600; }
.ccard { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--white); border: 1.5px solid var(--forest); color: var(--ink); text-decoration: none; }
.ccard:hover { color: var(--ink); box-shadow: var(--shadow-sm); }
.ccard.forum { background: var(--gold-light); border-color: var(--gold); }
.ccard.story { background: var(--green-light); border-color: var(--green); }
.ccard.repost { background: var(--white); border-color: var(--gray); }
.ccard.interview { background: var(--mist-light); border-color: var(--mist); }
.ccard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.ccard .top img { height: 22px; width: auto; max-width: 112px; object-fit: contain; }
.ccard .org { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--fg); }
.ccard .tm { flex: none; font-size: 12px; font-weight: 600; direction: ltr; }
.ccard .ct { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--fg-muted); }
.ccard .ti { font-size: 14px; line-height: 22px; font-weight: 600; }
.ccard .flag { align-self: flex-start; padding: 0 8px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid currentColor; font-size: 12px; line-height: 20px; font-weight: 600; color: var(--fg); }
.ccard .st { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 20px; font-weight: 600; }
.ccard .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ccard .pf { align-self: flex-end; font-size: 12px; line-height: 18px; color: var(--fg-subtle); direction: ltr; }
.st-draft { color: var(--neutral-text); } .st-preparing { color: var(--gold-text); } .st-ready { color: var(--teal-text); }
.st-published { color: var(--forest); } .st-postponed { color: var(--gold-text); } .st-cancelled { color: var(--neutral-text); } .st-late { color: var(--danger); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month .cell { min-height: 110px; padding: 8px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--border); font-size: 12px; line-height: 18px; overflow: hidden; }
.month .cell.out { background: var(--bg-sunken); color: var(--fg-subtle); }
.month .cell .dn { font-weight: 700; font-size: 14px; }
.month .cell a { display: block; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month .wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--fg-subtle); }
@media (max-width: 860px) { .month { grid-template-columns: repeat(2, minmax(0, 1fr)); } .month .wd { display: none; } }

/* lists */
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bg-sunken); font-size: 14px; line-height: 22px; }
.kv dt { color: var(--fg-subtle); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--bg-sunken); font-size: 14px; line-height: 22px; }
.list > li a { color: var(--ink); text-decoration: none; font-weight: 500; }
.board { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.board-col { flex: 1 1 230px; min-width: 230px; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--bg-sunken); border-radius: var(--radius-lg); }
.board-col header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; border-bottom: 3px solid var(--gray); }
.board-col h2 { font-size: 16px; line-height: 26px; font-weight: 700; }
.scard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.scard:hover { border-color: var(--forest); color: var(--ink); }
.empty { padding: 24px; text-align: center; color: var(--fg-subtle); font-size: 14px; }
.chip { padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12px; line-height: 20px; }

/* auth */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 400px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 56px; background: var(--forest); border-inline-end: 6px solid var(--green); color: var(--white); }
.auth-brand img { height: 80px; width: auto; align-self: flex-start; }
.auth-brand h2 { max-width: 14ch; font-size: 48px; line-height: 68px; font-weight: 500; }
.auth-brand p { max-width: 36ch; font-size: 18px; line-height: 32px; }
.auth-brand .foot { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 20px; color: var(--forest-light); }
.auth-form { flex: 1.4 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 20px; padding: 40px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.steps li { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 20px; color: var(--fg-subtle); }
.steps li::before { content: ""; display: block; height: 3px; border-radius: var(--radius-pill); background: var(--gray-light); }
.steps li.done::before, .steps li.cur::before { background: var(--forest); }
.steps li.cur { color: var(--fg); font-weight: 600; }

/* print: executive summary on one A4 landscape page */
/* ---------- library ---------- */
.lib-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-cat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.lib-cat:hover { border-color: var(--forest-light, #28ac4a); }
.lib-cat.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.lib-cat .pg { width: 20px; height: 20px; }
.lib-cat.on .pg { background: #fff; }
.lib-cat .num { color: inherit; opacity: .75; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 200px; }
.lib-card.key { border-top: 4px solid var(--gold); }
.lib-card h2 a { color: var(--ink); text-decoration: none; }
.lib-card h2 a:hover { color: var(--forest); text-decoration: underline; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; color: var(--fg-muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--forest); border-bottom-color: var(--gold); }
.cat-head th { background: var(--bg-sunken); color: var(--forest); font-weight: 600; }
.notif { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.notif.unread .dot { background: var(--green, #28ac4a); }
.notif.unread a { font-weight: 600; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; font-size: 10px; line-height: 15px; }
  .side, .no-print, .footer .no-print { display: none !important; }
  .main { padding: 0; gap: 8px; }
  .card { padding: 8px 10px; gap: 6px; break-inside: avoid; }
  .kpi { padding: 8px 10px; gap: 2px; }
  .kpi .val { font-size: 26px; line-height: 30px; }
  .kpi.gray .val, .kpi.gold .val { font-size: 20px; line-height: 24px; }
  .pg { width: 22px; height: 22px; }
  .chart-days { height: 90px; }
  table.t th, table.t td { padding: 2px 6px; }
  .logo-cell img { height: 16px; }
  .page-title h1 { font-size: 18px; line-height: 24px; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
