/*
 * AI Hub · notification center, announcements and the theme picker, in the classic (original) look: flat white
 * surfaces, thin borders, small radii. Loaded for every theme; when the admin role has chosen Liquid glass,
 * glass.css is loaded after this and restyles the same classes.
 */

/* ---- Icons and the notification kinds ---- */
.hub-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hub-icon--lg { width: 32px; height: 32px; stroke-width: 1.5; }
.hub-kind {
    --h: 240;
    width: 36px; height: 36px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    color: oklch(0.42 0.14 var(--h)); background: oklch(0.95 0.04 var(--h));
}
.hub-kind--news { --h: 240; }
.hub-kind--challenge { --h: 148; }
.hub-kind--update { --h: 300; }
.hub-kind--service { --h: 40; }
.hub-kind--participation { --h: 180; }
.hub-kind--submission { --h: 262; }
.hub-kind--discussion { --h: 85; }

/* ---- The bell in the header ---- */
.hub-bell { position: relative; }
.hub-bell--mobile { display: none; }
.hub-bell__button {
    position: relative; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; border: 1px solid var(--hub-navy-line-2); background: transparent; color: #fff; cursor: pointer;
}
.hub-bell__button:hover, .hub-bell__button[aria-expanded="true"] { background: var(--hub-navy-3); }
.hub-bell__count {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    border-radius: 999px; background: var(--hub-orange); color: #fff; font: 700 10.5px/18px var(--hub-mono); text-align: center;
    box-shadow: 0 0 0 2px var(--hub-navy);
}
.hub-bell__panel {
    position: absolute; right: -8px; top: calc(100% + 10px); width: 380px; max-width: calc(100vw - 24px); z-index: 1045;
    display: flex; flex-direction: column; max-height: min(72vh, 560px); overflow: hidden;
    background: #fff; color: var(--hub-ink); border: 1px solid var(--hub-line); border-radius: 10px;
    box-shadow: 0 12px 32px oklch(0.2 0.06 245 / 0.18);
}
.hub-bell__panel[hidden] { display: none; }
.hub-bell__head, .hub-bell__foot { flex: none; }
.hub-bell__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--hub-line-soft); }
.hub-bell__head h2 { font-size: 15px; font-weight: 600; margin: 0; color: var(--hub-ink); }
.hub-bell__markall { border: 0; background: none; padding: 4px 8px; border-radius: 6px; font: 600 12px var(--hub-font); color: var(--hub-link); cursor: pointer; }
.hub-bell__markall:hover:not(:disabled) { background: var(--hub-bg); }
.hub-bell__markall:disabled { color: var(--hub-muted-3); cursor: default; }
.hub-bell__list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.hub-bell__item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--hub-ink); }
a.hub-bell__item:hover, a.hub-bell__item:focus { background: var(--hub-bg); text-decoration: none; color: var(--hub-ink); }
.hub-bell__item.is-unread { background: oklch(0.975 0.015 240); }
.hub-bell__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hub-bell__text strong { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.hub-bell__body { font-size: 13px; line-height: 1.45; color: var(--hub-muted-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hub-bell__meta { font: 500 11px var(--hub-mono); color: var(--hub-muted-3); margin-top: 2px; }
.hub-bell__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--hub-blue); }
.hub-bell__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 20px; margin: 0; color: var(--hub-muted); font-size: 14px; }
.hub-bell__foot { border-top: 1px solid var(--hub-line-soft); padding: 4px; }
.hub-bell__foot a { display: block; text-align: center; padding: 9px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--hub-link); text-decoration: none; }
.hub-bell__foot a:hover, .hub-bell__foot a:focus { background: var(--hub-bg); text-decoration: none; }

.hub-usermenu__count { font: 600 11px var(--hub-mono); background: var(--hub-orange); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 8px; }

/* The nav shares the bar with the bell: keep it on one line when the bar gets tight */
.hub-nav { flex-wrap: nowrap; min-width: 0; }
@media (min-width: 981px) and (max-width: 1200px) {
    .hub-header__bar { gap: 14px; }
    .hub-header__menus { gap: 10px; }
    .hub-nav a { padding: 8px 9px; font-size: 13px; }
    .hub-usermenu__button > span:not(.hub-avatar):not(.hub-caret) { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---- The notification center (/notifications/) ---- */
.hub-nc { max-width: 880px; }
.hub-nc__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--hub-line-2); }
.hub-nc__tools { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.hub-nc__tools form { margin: 0; }
.hub-seg { display: flex; }
.hub-seg__item {
    padding: 12px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center;
    font: 600 14px var(--hub-font); color: var(--hub-muted); text-decoration: none; white-space: nowrap;
}
.hub-seg__item:hover, .hub-seg__item:focus { color: var(--hub-ink); text-decoration: none; }
.hub-seg__item.is-active { color: var(--hub-ink); border-bottom-color: var(--hub-ink); }
.hub-seg__count { font: 500 11px var(--hub-mono); background: oklch(0.93 0.01 240); color: oklch(0.4 0.04 245); border-radius: 4px; padding: 2px 6px; }
a.hub-chip { display: inline-block; text-decoration: none; }
a.hub-chip:hover, a.hub-chip:focus { text-decoration: none; color: oklch(0.35 0.04 245); }
.hub-chip.is-active, a.hub-chip.is-active { background: var(--hub-ink); border-color: var(--hub-ink); color: #fff; }
.hub-nc__kinds { margin: 16px 0 20px; }
.hub-nc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hub-nc__item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 18px;
    background: #fff; border: 1px solid var(--hub-line); border-radius: 10px;
}
.hub-nc__item.is-unread { border-left: 4px solid var(--hub-blue); padding-left: 15px; }
.hub-nc__title { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--hub-ink); }
.hub-nc__title a { color: inherit; text-decoration: none; }
.hub-nc__title a:hover, .hub-nc__title a:focus { text-decoration: underline; color: inherit; }
.hub-nc__new { font: 700 10px var(--hub-mono); letter-spacing: 0.08em; color: #fff; padding: 3px 7px; border-radius: 4px; background: var(--hub-blue); }
.hub-nc__body { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--hub-ink-2); overflow-wrap: anywhere; }
.hub-nc__meta { margin: 8px 0 0; font: 500 12px var(--hub-mono); color: var(--hub-muted-3); }
.hub-nc__actions { display: flex; gap: 6px; }
.hub-nc__actions form { margin: 0; }
.hub-nc__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--hub-muted); }
.hub-nc__empty p { margin: 0; max-width: 460px; }
.hub-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }

/* ---- Announcements (homepage dashboard) ---- */
.hub-reach {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 24px; overflow: hidden;
    background: #fff; border: 1px solid var(--hub-line); border-radius: 10px;
}
.hub-reach__tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border-left: 1px solid var(--hub-line-soft); }
.hub-reach__tile:first-child { border-left: 0; }
.hub-reach__value { font: 600 28px var(--hub-mono); letter-spacing: -0.02em; line-height: 1.1; color: var(--hub-ink); }
.hub-reach__label { font-size: 13px; color: var(--hub-muted-2); }

.hub-ann-list { padding: 0; }
.hub-ann { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--hub-line-soft); }
.hub-ann:last-child { border-bottom: 0; }
.hub-ann__stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; min-width: 120px; }
.hub-ann__stats strong { font-family: var(--hub-mono); }
.hub-meter { display: block; width: 110px; height: 6px; border-radius: 3px; background: oklch(0.93 0.01 240); overflow: hidden; }
.hub-meter > span { display: block; height: 100%; background: var(--hub-green); }
.hub-status { display: inline-block; font: 700 10px var(--hub-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; margin-right: 6px; background: oklch(0.94 0.01 240); color: var(--hub-muted); }
.hub-status--sent { background: var(--hub-green-bg); color: var(--hub-green-ink); }
.hub-status--sending { background: var(--hub-blue-bg); color: var(--hub-blue-ink); }
.hub-status--failed { background: var(--hub-red-bg); color: var(--hub-red-ink); }
.hub-flash__item--warning { background: oklch(0.96 0.06 85); color: oklch(0.42 0.1 70); }

.hub-ann-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hub-ann-head__title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 4px; color: var(--hub-ink); }
.hub-ann-head__note { margin: 0; }
.hub-ann-error { padding: 12px 16px; border-radius: 8px; background: var(--hub-red-bg); margin: 0 0 16px; }
.hub-ann-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.hub-ann-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.hub-ann-side { position: sticky; top: 84px; }
.hub-ann-sample { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.hub-ann-sample .hub-bell__item { background: var(--hub-bg); border: 1px solid var(--hub-line); }
.hub-ann-email[hidden] { display: none; }
.hub-ann-email { margin-top: 16px; }
.hub-ann-actions { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 0; border-top: 1px solid var(--hub-line-2); }
.hub-ann-actions__spacer { flex: 1; }
.hub-retry { margin: 0 0 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hub-retry p { margin: 0; }
.hub-retry form { margin: 0; }
.hub-retry__list { margin: 0; padding-left: 18px; font-size: 12px; }

.hub-choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.hub-choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0; border-radius: 8px; cursor: pointer; border: 1px solid var(--hub-line); background: #fff; }
.hub-choice:hover { background: var(--hub-bg); }
.hub-choice:has(input:checked) { background: var(--hub-green-bg); border-color: oklch(0.75 0.1 150); }
.hub-choice input { margin: 3px 0 0; width: 17px; height: 17px; flex: none; }
.hub-choice__body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.hub-choice__body small { color: var(--hub-muted-2); font-size: 12px; line-height: 1.45; }

.hub-aud { padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.hub-aud__filter { border-radius: 8px; border: 1px solid var(--hub-line); background: #fff; }
.hub-aud__filter[open] { background: oklch(0.99 0.003 240); }
.hub-aud__filter > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; color: var(--hub-ink); }
.hub-aud__filter > summary::-webkit-details-marker { display: none; }
.hub-aud__filter > summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--hub-muted); border-bottom: 2px solid var(--hub-muted); transform: rotate(45deg); }
.hub-aud__filter[open] > summary::after { transform: rotate(-135deg); }
.hub-aud__badge { font: 600 11px var(--hub-mono); background: var(--hub-green-bg); color: var(--hub-green-ink); border-radius: 4px; padding: 2px 8px; }
.hub-aud__badge[hidden] { display: none; }
.hub-aud__body { padding: 2px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.hub-aud__checklist { list-style: none; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; border-radius: 6px; border: 1px solid var(--hub-line); background: #fff; }
.hub-aud__checklist li[hidden] { display: none; }
.hub-aud__checklist .hub-inline-check { display: flex; align-items: center; gap: 10px; white-space: normal; padding: 7px 10px; border-radius: 6px; width: 100%; box-sizing: border-box; }
.hub-aud__checklist .hub-inline-check:hover { background: var(--hub-bg); }
.hub-aud__checklist .hub-inline-check span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hub-aud__n { font-family: var(--hub-mono); }
.hub-aud__radios { display: flex; flex-direction: column; gap: 6px; }
.hub-aud__radios ul { list-style: none; padding: 0; margin: 0; }
.hub-aud__tiers { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hub-aud__tiers legend { width: 100%; border: 0; margin: 0 0 6px; padding: 0; font-size: 12px; }
.hub-aud__presets { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-chip-check { margin: 0; cursor: pointer; }
.hub-chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.hub-chip-check span { display: inline-block; padding: 6px 12px; border-radius: 999px; font: 500 13px var(--hub-font); border: 1px solid oklch(0.86 0.01 240); background: #fff; }
.hub-chip-check:hover span { border-color: var(--hub-ink); }
.hub-chip-check input:checked + span { background: var(--hub-ink); border-color: var(--hub-ink); color: #fff; }
.hub-chip-check input:focus-visible + span { outline: 2px solid var(--hub-link); outline-offset: 2px; }

.hub-preview { padding: 22px 24px; border-radius: 10px; background: var(--hub-navy); color: #fff; }
.hub-preview.is-loading .hub-preview__total strong { opacity: 0.45; }
.hub-preview__title { font: 600 12px var(--hub-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--hub-on-navy-2); margin: 0 0 10px; }
.hub-preview__total { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.hub-preview__total strong { font: 600 44px var(--hub-mono); letter-spacing: -0.03em; line-height: 1; color: var(--hub-green-text); }
.hub-preview__total span { color: var(--hub-on-navy); font-size: 15px; }
.hub-preview__email { margin: 8px 0 0; font-size: 14px; color: var(--hub-on-navy); }
.hub-preview__email strong { font-family: var(--hub-mono); color: #fff; }
.hub-preview__summary { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--hub-on-navy); }
.hub-preview__summary li { padding: 6px 10px; border-radius: 6px; background: var(--hub-navy-3); }
.hub-preview__sample { margin: 12px 0 0; color: var(--hub-on-navy-3); }
.hub-preview .hub-error { color: oklch(0.82 0.13 40); margin-top: 10px; }
.hub-dash-card .hub-preview__summary { color: var(--hub-ink-2); }
.hub-dash-card .hub-preview__summary li { background: var(--hub-bg); }
.hub-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 18px 0 0; font-size: 13px; }
.hub-facts dt { color: var(--hub-muted-2); font-weight: 500; }
.hub-facts dd { margin: 0; color: var(--hub-ink); }

/* ---- Appearance: choosing the theme ---- */
.hub-theme-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.hub-theme-card {
    display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 14px; cursor: pointer; font-weight: 400;
    border: 2px solid var(--hub-line); border-radius: 10px; background: #fff;
}
.hub-theme-card:hover { border-color: var(--hub-line-2); background: var(--hub-bg); }
.hub-theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.hub-theme-card:has(input:checked) { border-color: var(--hub-green); background: var(--hub-green-bg); }
.hub-theme-card:has(input:focus-visible) { outline: 2px solid var(--hub-link); outline-offset: 2px; }
.hub-theme-card__body { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.hub-theme-card__body strong { font-size: 15px; color: var(--hub-ink); }
.hub-theme-card__body small { color: var(--hub-muted-2); font-size: 13px; line-height: 1.5; }
.hub-theme-card__now { font: 600 10px var(--hub-mono); letter-spacing: 0.08em; text-transform: uppercase; background: var(--hub-green-bg); color: var(--hub-green-ink); border-radius: 4px; padding: 2px 6px; margin-left: 6px; vertical-align: 1px; }
/* Little pictures of each theme: flat pieces, whatever theme is on */
.hub-theme-mock { display: block; height: 118px; border-radius: 6px; overflow: hidden; position: relative; border: 1px solid oklch(0.85 0.01 240); }
.hub-theme-mock__bar { display: flex; gap: 6px; align-items: center; height: 24px; padding: 0 10px; box-sizing: border-box; }
.hub-theme-mock__bar i { display: block; width: 26px; height: 6px; border-radius: 3px; background: oklch(1 0 0 / 0.45); }
.hub-theme-mock__body { display: flex; gap: 10px; padding: 12px; }
.hub-theme-mock__card { flex: 1; height: 62px; display: block; }
.hub-theme-mock--classic { background: oklch(0.975 0.006 230); }
.hub-theme-mock--classic .hub-theme-mock__bar { background: var(--hub-navy); }
.hub-theme-mock--classic .hub-theme-mock__card { background: #fff; border: 1px solid var(--hub-line); border-radius: 4px; }
.hub-theme-mock--glass {
    background:
        radial-gradient(60% 70% at 12% 10%, oklch(0.82 0.14 150 / 0.6), transparent 70%),
        radial-gradient(60% 70% at 92% 20%, oklch(0.8 0.11 240 / 0.6), transparent 70%),
        radial-gradient(60% 70% at 70% 100%, oklch(0.88 0.13 78 / 0.5), transparent 70%), oklch(0.97 0.01 230);
}
.hub-theme-mock--glass .hub-theme-mock__bar { background: oklch(0.25 0.07 245 / 0.82); }
.hub-theme-mock--glass .hub-theme-mock__bar i { border-radius: 99px; background: oklch(1 0 0 / 0.5); }
.hub-theme-mock--glass .hub-theme-mock__card {
    background: linear-gradient(145deg, oklch(1 0 0 / 0.75), oklch(1 0 0 / 0.35)); border: 1px solid oklch(1 0 0 / 0.7); border-radius: 12px;
    box-shadow: 0 6px 14px -6px oklch(0.2 0.06 245 / 0.3);
}

/* The dashboard has ten tabs now */
.hub-dash__tabs .hub-tab { padding-left: 12px; padding-right: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .hub-ann-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-ann-side { position: static; }
}
@media (max-width: 980px) {
    /* The bell leaves the folded menu: it sits next to the menu button, so the badge stays in view. */
    .hub-header__actions .hub-bell { display: none; }
    .hub-bell--mobile { display: block; margin-left: auto; }
    .hub-bell--mobile + .hub-burger { margin-left: 10px; }
    .hub-bell__panel { position: fixed; left: 12px; right: 12px; top: 68px; width: auto; max-width: none; }
}
@media (max-width: 820px) {
    .hub-ann { grid-template-columns: auto minmax(0, 1fr); }
    .hub-ann__stats { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
    .hub-ann .hub-dash-item__tools { grid-column: 1 / -1; justify-content: flex-start; }
    .hub-nc__item { grid-template-columns: auto minmax(0, 1fr); }
    .hub-nc__actions { grid-column: 2; }
}
@media (max-width: 720px) {
    .hub-ann { padding: 14px 16px; }
    .hub-reach__tile { padding: 14px 16px; }
    .hub-ann-actions .hub-btn--lg { width: 100%; }
    .hub-ann-actions__spacer { display: none; }
    .hub-seg__item { padding: 12px 12px; }
}
