/* ============================================================================
   CUC Intra — Design System (fresh, self-contained; replaces the legacy CSS).
   1. Tokens   2. Reset/base   3. Typography   4. Layout/shell (navbar, search,
   bell, DM widget, dashboard)   5. Primitives (buttons, forms, cards, tables,
   badges, alerts, avatars, modal, login).  Feature components are appended below
   this foundation by the component files.
   ============================================================================ */

/* ── 1. Tokens ────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-100: #e0e7ff;
    --accent: #ec4899;
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-nav: linear-gradient(100deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);

    /* Neutrals */
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e6e8ee;
    --border-strong: #d4d8e2;
    --text: #0f172a;
    --text-muted: #5b6473;
    --text-faint: #94a3b8;
    --on-primary: #ffffff;

    /* Semantic */
    --success: #10b981; --success-soft: #ecfdf5;
    --warning: #f59e0b; --warning-soft: #fffbeb;
    --danger: #ef4444;  --danger-soft: #fef2f2;
    --info: #3b82f6;    --info-soft: #eff6ff;

    /* Radius */
    --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-full: 999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow: 0 4px 14px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.05);
    --shadow-lg: 0 12px 34px rgba(15,23,42,.13);
    --ring: 0 0 0 3px rgba(99,102,241,.28);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: .16s cubic-bezier(.4,0,.2,1);
    --nav-h: 60px;
}

/* ── 2. Reset / base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}
[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--primary-100); }
.scroll-area { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ── 3. Typography ────────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
small, .text-sm { font-size: .82rem; }

/* ── 4. Layout / shell ────────────────────────────────────────────── */
.page { max-width: none; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }
.page-narrow { max-width: 760px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { display: flex; align-items: center; gap: .5rem; }
.breadcrumb { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--text-faint); }
.empty-state { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 1rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Navbar */
.navbar { background: var(--gradient-nav); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--shadow-sm); }
.nav-inner { max-width: none; margin: 0 auto; padding: 0 1.75rem; height: var(--nav-h); display: flex; align-items: center; gap: .75rem; }
.nav-brand { display: flex; align-items: center; flex-shrink: 0; }
.nav-brand img { height: 30px; }
.nav-links { display: flex; gap: .12rem; flex-wrap: nowrap; }
.nav-links a { color: rgba(255,255,255,.74); padding: .42rem .62rem; border-radius: var(--r-sm); font-weight: 600; font-size: .86rem; white-space: nowrap; transition: var(--transition); }
.nav-links a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-links a.active { background: rgba(255,255,255,.16); color: #fff; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: .55rem; flex-shrink: 0; }
.nav-user-menu { position: relative; }
.nav-user-toggle { display: flex; align-items: center; gap: .45rem; background: rgba(255,255,255,.12); color: #fff; padding: .38rem .65rem; border-radius: var(--r-full); white-space: nowrap; transition: var(--transition); }
.nav-user-toggle:hover { background: rgba(255,255,255,.22); }
.nav-user { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: .86rem; }
.nav-dropdown { position: absolute; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); min-width: 200px; overflow: hidden; padding: .35rem; animation: pop .14s ease; }
.nav-dropdown-item { display: block; padding: .55rem .7rem; color: var(--text); border-radius: var(--r-sm); font-size: .88rem; font-weight: 500; }
.nav-dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.nav-logout { color: var(--danger); margin-top: .2rem; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.badge-admin { background: linear-gradient(135deg,#f97316,#ea580c); color: #fff; font-size: .64rem; padding: .14rem .42rem; border-radius: var(--r-full); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Navbar search */
.nav-search { position: relative; flex: 0 1 200px; }
.nav-search-form { display: flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.14); border: 1px solid transparent; border-radius: var(--r-full); padding: .32rem .8rem; transition: var(--transition); }
.nav-search-form:focus-within { background: #fff; }
.nav-search-form:focus-within .nav-search-input { color: var(--text); }
.nav-search-form:focus-within .nav-search-icon { color: var(--text-muted); }
.nav-search-icon { color: rgba(255,255,255,.7); font-size: .9rem; }
/* higher specificity than the generic input[type=search] primitive, so the
   navbar search stays transparent on the gradient (not a white form field) */
.nav-search-form .nav-search-input { flex: 1; min-width: 0; width: auto; background: none; border: none; box-shadow: none; padding: 0; color: #fff; font-size: .85rem; outline: none; }
.nav-search-form .nav-search-input::placeholder { color: rgba(255,255,255,.6); }
.nav-search-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; max-height: 70vh; overflow-y: auto; z-index: 60; }
@media (max-width: 820px) { .nav-search { display: none; } }

/* Notification bell */
.notif-bell { position: relative; display: inline-flex; }
.notif-bell-toggle { position: relative; color: #fff; font-size: 1.15rem; line-height: 1; width: 38px; height: 38px; border-radius: var(--r-full); display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); }
.notif-bell-toggle:hover { background: rgba(255,255,255,.14); }
.notif-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-full); background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #312e81; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + .5rem); width: 360px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60; animation: pop .14s ease; }
.notif-dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.notif-dropdown-title { font-weight: 800; font-size: .95rem; }
.notif-mark-all { color: var(--primary); font-size: .78rem; font-weight: 600; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: var(--text-faint); font-size: .86rem; }
.notif-item { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem 1rem; color: inherit; border-bottom: 1px solid var(--surface-3); transition: var(--transition); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item-avatar, .notif-item-icon { width: 38px; height: 38px; border-radius: var(--r-full); object-fit: cover; flex: 0 0 auto; }
.notif-item-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; background: var(--primary-soft); }
.notif-item-body { min-width: 0; }
.notif-item-msg { font-size: .85rem; line-height: 1.35; color: var(--text); }
.notif-item-time { font-size: .72rem; color: var(--text-faint); margin-top: .15rem; }

/* Flash messages */
.flash-stack { position: fixed; top: calc(var(--nav-h) + .75rem); right: 1rem; z-index: 1000; max-width: 380px; display: flex; flex-direction: column; gap: .55rem; }
.flash-stack .alert { box-shadow: var(--shadow-lg); cursor: pointer; }

/* DM widget (floating) */
.dm-widget { position: fixed; bottom: 1.1rem; right: 1.1rem; z-index: 1000; }
.dm-fab { width: 56px; height: 56px; border-radius: var(--r-full); background: var(--gradient-brand); color: #fff; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); position: relative; transition: var(--transition); }
.dm-fab:hover { transform: translateY(-2px) scale(1.04); }
.dm-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-full); background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.dm-panel { position: absolute; bottom: calc(100% + .7rem); right: 0; width: 340px; max-width: calc(100vw - 2rem); height: 460px; max-height: calc(100vh - 7rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .16s ease; }
.dm-panel-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dm-panel-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dm-panel-title { font-weight: 800; font-size: .95rem; }
.dm-panel-head-actions { display: flex; gap: .25rem; }
.dm-panel-icon { width: 30px; height: 30px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.dm-panel-icon:hover { background: var(--surface-3); color: var(--text); }
.dm-panel-list { flex: 1; overflow-y: auto; }
.dm-panel-empty { padding: 1.5rem; text-align: center; color: var(--text-faint); }

/* Dashboard — classic 3-column layout (left widgets · center chat · right) */
.dashboard { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 1.25rem; align-items: start; max-width: 1180px; margin: 1.5rem auto; padding: 0 1.1rem 3rem; }
.dashboard-3 { grid-template-columns: 280px minmax(0,1fr) 320px; max-width: none; padding: 0 1.75rem 3rem; gap: 1.5rem; }
/* keep the chat readable on ultra-wide screens (cap message width, not the panel) */
.dashboard-3 .chat-msg-body { max-width: 680px; }
.dash-main, .dash-side, .dash-left, .dash-center, .dash-right { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.dash-side, .dash-left, .dash-right { position: sticky; top: calc(var(--nav-h) + 1rem); }
.dash-welcome h1 { font-size: 1.45rem; }
.dash-links { display: flex; flex-direction: column; padding: .5rem; }
.dash-links a { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: var(--r-sm); color: var(--text); font-weight: 600; font-size: .9rem; transition: var(--transition); }
.dash-links a:hover { background: var(--primary-soft); color: var(--primary); }
.dash-online-list { display: flex; flex-direction: column; gap: .15rem; max-height: 260px; overflow-y: auto; }
.dash-online-item { display: flex; align-items: center; gap: .55rem; padding: .35rem .4rem; border-radius: var(--r-sm); color: var(--text); font-size: .86rem; font-weight: 500; transition: var(--transition); }
.dash-online-item:hover { background: var(--surface-3); color: var(--text); }
.dash-quickpost { display: flex; flex-direction: column; }
.dash-quickpost-input { resize: none; min-height: 0; margin-bottom: .6rem; }
.dash-quickpost-btn { align-self: flex-end; }
.dash-welcome p { color: var(--text-muted); margin-top: .25rem; }
.dash-widget { padding: 1.1rem; }
.dash-widget-title { font-size: .92rem; margin-bottom: .8rem; display: flex; align-items: center; gap: .4rem; }
.dash-widget-more { display: inline-block; margin-top: .7rem; font-size: .82rem; font-weight: 600; }
.dash-announce { display: flex; flex-direction: column; padding: .55rem .65rem; border-radius: var(--r-sm); color: inherit; border-left: 3px solid var(--border-strong); margin-bottom: .45rem; transition: var(--transition); }
.dash-announce:hover { background: var(--surface-3); color: inherit; }
.dash-announce span { font-size: .74rem; color: var(--text-faint); margin-top: .1rem; }
.dash-announce-important { border-left-color: var(--warning); }
.dash-announce-urgent { border-left-color: var(--danger); }
.dash-online-avatar { width: 30px; height: 30px; border-radius: var(--r-full); object-fit: cover; border: 2px solid var(--success); flex-shrink: 0; }
.dash-birthday { display: flex; align-items: center; gap: .55rem; padding: .4rem 0; color: inherit; }
.dash-bday-avatar { width: 36px; height: 36px; border-radius: var(--r-full); object-fit: cover; }
.dash-bday-name { font-weight: 600; font-size: .86rem; flex: 1; }
.dash-bday-when { font-size: .74rem; color: var(--accent); font-weight: 700; }
.dash-strike { border-left: 3px solid var(--border-strong); padding: .4rem .65rem; margin-bottom: .4rem; display: flex; flex-direction: column; border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.dash-strike-date { font-size: .74rem; color: var(--text-muted); }
.dash-strike-summary { font-size: .84rem; }
@media (max-width: 1100px) {
    .dashboard-3 { grid-template-columns: 260px minmax(0,1fr); }
    .dashboard-3 .dash-right { grid-column: 1 / -1; position: static; }
    .dashboard-3 .dash-right { flex-direction: row; flex-wrap: wrap; }
    .dashboard-3 .dash-right > * { flex: 1 1 280px; }
}
@media (max-width: 760px) {
    .dashboard, .dashboard-3 { grid-template-columns: 1fr; }
    .dash-side, .dash-left, .dash-right { position: static; }
    .dashboard-3 .dash-right { flex-direction: column; }
}

/* ── 5. Primitives ────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-pad { padding: 1.1rem 1.25rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1.05rem; border-radius: var(--r-sm); font-weight: 600; font-size: .9rem; line-height: 1; white-space: nowrap; transition: var(--transition); border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: .38rem .7rem; font-size: .82rem; }
.btn-icon { padding: .45rem; width: 36px; height: 36px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; }
.form-control, input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=tel], input[type=url], input[type=number], textarea, select {
    width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    padding: .6rem .8rem; font-size: .9rem; color: var(--text); transition: var(--transition); outline: none;
}
.form-control:focus, input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--text-faint); margin-top: .3rem; }
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem; border-radius: var(--r-full); font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: #047857; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-info { background: var(--info-soft); color: #1d4ed8; }

.alert { padding: .8rem 1rem; border-radius: var(--r-sm); font-size: .88rem; border: 1px solid transparent; background: var(--surface); }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-soft); border-color: #bfdbfe; color: #1e40af; }

.avatar { border-radius: var(--r-full); object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 64px; height: 64px; }

.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; padding: .7rem .85rem; font-size: .74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.data td { padding: .65rem .85rem; border-bottom: 1px solid var(--surface-3); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }

/* Modal / lightbox */
.modal-overlay, .lightbox-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.62); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 1.5rem; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.lightbox-overlay { cursor: zoom-out; }
.lightbox-overlay img { max-width: 92vw; max-height: 90vh; border-radius: var(--r); box-shadow: var(--shadow-lg); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.mention { color: var(--primary); font-weight: 600; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 2px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 50% -10%, #312e81 0%, #1e1b4b 45%, #0f172a 100%); }
.login-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.login-header { padding: 2rem 2rem 1rem; text-align: center; }
.login-header p { color: var(--text-muted); font-size: .88rem; margin-top: .5rem; }
.login-body { padding: 1rem 2rem 2rem; }
.login-btn { width: 100%; padding: .7rem; background: var(--primary); color: #fff; border-radius: var(--r-sm); font-weight: 700; transition: var(--transition); }
.login-btn:hover { background: var(--primary-hover); }
.google-login-btn { transition: var(--transition); }
.google-login-btn:hover { border-color: var(--primary) !important; background: var(--surface-2) !important; }

/* Turbo progress bar */
.turbo-progress-bar { height: 3px; background: var(--gradient-brand); }

/* ===================== admin ===================== */
/* ============================================================================
   ADMIN — user directory + create/edit panels + settings
   Builds on the foundation (tokens, .card, .btn*, .form-*, .badge*, table.data).
   ============================================================================ */

/* ── Page wrapper & header ───────────────────────────────────────── */
.admin-users,
.admin-settings {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.admin-page-header h1 {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.admin-settings-sub {
    color: var(--text-muted);
    font-size: .9rem;
    margin-top: .25rem;
}

/* ── Card header (used by panels; not in foundation) ─────────────── */
.admin-panel .card-header,
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .45rem;
}

/* ── Create / edit panels ────────────────────────────────────────── */
.admin-panel {
    margin-bottom: 1.25rem;
    overflow: hidden;
    animation: pop .16s ease;
}
.admin-form {
    padding: 1.25rem;
}
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}
.admin-form-grid .form-group {
    margin-bottom: 1rem;
}
.admin-form-wide {
    grid-column: 1 / -1;
}
.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: .35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Directory table (reuses table.data look, keeps admin hooks) ─── */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--r);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.admin-table th {
    text-align: left;
    padding: .7rem .85rem;
    font-size: .74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.admin-table td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--surface-3);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-table tbody tr {
    transition: var(--transition);
}
.admin-table tbody tr:hover td {
    background: var(--surface-2);
}

/* User identity cell */
.admin-user-cell {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: var(--transition);
    min-width: 0;
}
.admin-user-cell:hover {
    color: var(--primary);
}
.admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.admin-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auth-method badge */
.admin-method {
    background: var(--surface-3);
    color: var(--text-muted);
    text-transform: capitalize;
    font-size: .68rem;
    letter-spacing: .02em;
}

/* Role badges (used in template, not in foundation) */
.badge-blue {
    background: var(--info-soft);
    color: #1d4ed8;
}
.badge-purple {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Last seen */
.admin-lastseen {
    color: var(--text-muted);
    font-size: .82rem;
    white-space: nowrap;
}

/* Inactive rows */
.admin-row-inactive td {
    background: var(--surface-2);
    opacity: .72;
}
.admin-row-inactive:hover td {
    opacity: 1;
}

/* Action buttons */
.admin-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.admin-inline-form {
    display: inline-flex;
    margin: 0;
}

/* ── Settings ────────────────────────────────────────────────────── */
.admin-settings-form {
    padding: 1.5rem;
}
.admin-settings-section {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    margin: 1.75rem 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.admin-settings-form > .admin-settings-section:first-of-type {
    margin-top: 0;
}
.admin-settings-hint {
    font-size: .8rem;
    color: var(--text-faint);
    margin-top: .4rem;
}

/* Toggle list */
.admin-toggle-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.admin-toggle {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem .9rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: .9rem;
    transition: var(--transition);
}
.admin-toggle:hover {
    border-color: var(--border-strong);
    background: var(--surface-3);
}
.admin-toggle:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.admin-toggle input[type=checkbox] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.admin-toggle span strong {
    font-weight: 700;
    color: var(--text);
}

.admin-settings-submit {
    margin-top: 1.75rem;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
    .admin-table th,
    .admin-table td {
        padding: .55rem .65rem;
    }
    .admin-user-name {
        max-width: 140px;
    }
    .admin-actions {
        flex-wrap: wrap;
    }
    .admin-settings-form,
    .admin-settings-section {
        margin-top: 1.25rem;
    }
}


/* ===================== wiki ===================== */
/* ============================================================================
   FEATURE: Wiki — Κανονισμοί & Οδηγοί
   Categories grid, article lists, single article prose, WYSIWYG editor,
   category manager. Matches the CUC Intra design system tokens.
   ============================================================================ */

.wiki-wrap { max-width: none; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }

/* ── Page header ──────────────────────────────────────────────── */
.wiki-page-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.wiki-page-header h1 {
    display: flex; align-items: center; gap: .55rem;
    font-size: 1.5rem; min-width: 0;
}
.wiki-header-actions { display: flex; gap: .55rem; flex-wrap: wrap; }

/* ── Shared card header (used inside wiki cards) ──────────────── */
.wiki-wrap .card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.wiki-wrap .card-title {
    display: flex; align-items: center; gap: .45rem;
    font-size: .95rem; font-weight: 800; color: var(--text);
}

/* ── Search box ───────────────────────────────────────────────── */
.wiki-search {
    position: relative; display: flex; align-items: center;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-full); box-shadow: var(--shadow-sm);
    padding: .15rem .35rem .15rem 1rem; margin-bottom: 1.75rem;
    transition: var(--transition);
}
.wiki-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.wiki-search-icon { font-size: 1rem; color: var(--text-faint); flex-shrink: 0; }
.wiki-search input {
    flex: 1; width: 100%; border: none; background: none; outline: none;
    padding: .65rem .75rem; font-size: .95rem; color: var(--text);
    box-shadow: none;
}
.wiki-search input:focus { border: none; box-shadow: none; }
.wiki-search input::placeholder { color: var(--text-faint); }

/* ── Search results ───────────────────────────────────────────── */
.wiki-results-title { font-size: 1.15rem; margin-bottom: 1rem; }
.wiki-result {
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1rem 1.15rem; margin-bottom: .75rem; color: inherit;
    transition: var(--transition); border-left: 3px solid transparent;
}
.wiki-result:hover {
    border-left-color: var(--primary); box-shadow: var(--shadow);
    transform: translateY(-1px); color: inherit;
}
.wiki-result-title { font-weight: 700; font-size: 1rem; color: var(--primary); }
.wiki-result-meta { font-size: .78rem; color: var(--text-faint); }
.wiki-result-excerpt { font-size: .88rem; color: var(--text-muted); line-height: 1.5; margin-top: .15rem; }
.wiki-back { margin-top: .5rem; }

/* ── Categories grid ──────────────────────────────────────────── */
.wiki-categories {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.wiki-cat-card {
    display: flex; align-items: center; gap: .9rem;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--r); box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.15rem; color: inherit; transition: var(--transition);
}
.wiki-cat-card:hover {
    box-shadow: var(--shadow); transform: translateY(-2px); color: inherit;
}
.wiki-cat-icon {
    width: 48px; height: 48px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0; background: var(--primary-soft);
}
.wiki-cat-body { min-width: 0; }
.wiki-cat-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.wiki-cat-count { font-size: .8rem; color: var(--text-faint); margin-top: .15rem; }

/* ── Recent & popular columns ─────────────────────────────────── */
.wiki-columns {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.wiki-list { padding: .4rem .35rem .6rem; }
.wiki-list-item {
    display: flex; flex-direction: column; gap: .1rem;
    padding: .6rem .8rem; border-radius: var(--r-sm);
    transition: var(--transition);
}
.wiki-list-item:hover { background: var(--surface-2); }
.wiki-list-item a { font-weight: 600; font-size: .92rem; }
.wiki-list-meta { font-size: .76rem; color: var(--text-faint); }
.wiki-list-empty { padding: 1.25rem .85rem; text-align: center; color: var(--text-faint); font-size: .86rem; }

/* ── Category page: article rows ──────────────────────────────── */
.wiki-article-row {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1.1rem 1.25rem; margin-bottom: .85rem;
    transition: var(--transition);
}
.wiki-article-row:hover { box-shadow: var(--shadow); }
.wiki-article-row-main { flex: 1; min-width: 0; }
.wiki-article-row-title {
    font-weight: 700; font-size: 1.05rem; color: var(--text);
    display: inline; transition: var(--transition);
}
.wiki-article-row-title:hover { color: var(--primary); }
.wiki-pin-badge { background: var(--warning-soft); color: #b45309; margin-left: .4rem; vertical-align: middle; }
.wiki-article-row-excerpt {
    font-size: .88rem; color: var(--text-muted); line-height: 1.5;
    margin: .35rem 0 .4rem;
}
.wiki-article-row-meta { font-size: .77rem; color: var(--text-faint); }
.wiki-edit-link { flex-shrink: 0; padding: .45rem .65rem; }

/* ── Single article layout ────────────────────────────────────── */
.wiki-article-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem; align-items: start;
}
.wiki-article-main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.wiki-article-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--shadow-sm);
    padding: 2rem 2.25rem;
}
.wiki-article-title { font-size: 1.9rem; line-height: 1.2; margin-bottom: .85rem; }
.wiki-article-byline {
    display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
    font-size: .82rem; color: var(--text-muted);
    padding-bottom: 1.1rem; margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--border);
}
.wiki-article-byline a { font-weight: 600; }
.wiki-article-avatar {
    width: 26px; height: 26px; border-radius: var(--r-full);
    object-fit: cover; margin-right: .15rem;
}
.wiki-pin-form { display: inline; margin: 0; }
.wiki-pin-toggle {
    color: var(--text-muted); font-size: .82rem; font-weight: 600;
    padding: 0; transition: var(--transition);
}
.wiki-pin-toggle:hover { color: var(--primary); }

/* ── Article prose (sanitized HTML) ───────────────────────────── */
.wiki-article-body { font-size: .98rem; line-height: 1.7; color: var(--text); }
.wiki-article-body > *:first-child { margin-top: 0; }
.wiki-article-body h2 {
    font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em;
    margin: 1.9rem 0 .7rem; padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}
.wiki-article-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .55rem; }
.wiki-article-body h4 { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .45rem; }
.wiki-article-body p { margin: .85rem 0; }
.wiki-article-body a { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.wiki-article-body ul, .wiki-article-body ol { margin: .85rem 0; padding-left: 1.6rem; }
.wiki-article-body li { margin: .35rem 0; }
.wiki-article-body li::marker { color: var(--primary); }
.wiki-article-body blockquote {
    margin: 1.1rem 0; padding: .7rem 1.1rem;
    border-left: 4px solid var(--primary); background: var(--primary-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--text-muted); font-style: italic;
}
.wiki-article-body blockquote p { margin: .25rem 0; }
.wiki-article-body code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: .85em; background: var(--surface-3); color: var(--accent);
    padding: .12em .4em; border-radius: var(--r-xs);
}
.wiki-article-body pre {
    margin: 1.1rem 0; padding: 1rem 1.15rem; overflow-x: auto;
    background: #0f172a; color: #e2e8f0; border-radius: var(--r-sm);
    font-size: .85rem; line-height: 1.6;
}
.wiki-article-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.wiki-article-body img { border-radius: var(--r-sm); margin: 1.1rem 0; box-shadow: var(--shadow-sm); }
.wiki-article-body hr { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }
.wiki-article-body table {
    width: 100%; border-collapse: collapse; font-size: .9rem;
    margin: 1.2rem 0; border: 1px solid var(--border); border-radius: var(--r-sm);
    overflow: hidden;
}
.wiki-article-body th, .wiki-article-body td {
    padding: .6rem .8rem; border: 1px solid var(--border); text-align: left;
}
.wiki-article-body th { background: var(--surface-2); font-weight: 700; color: var(--text-muted); }
.wiki-article-body tbody tr:nth-child(even) td { background: var(--surface-2); }

/* ── Revisions ────────────────────────────────────────────────── */
.wiki-revisions { overflow: hidden; }
.wiki-revisions-list { padding: .6rem .35rem .7rem; }
.wiki-revision {
    padding: .65rem .85rem; border-radius: var(--r-sm);
    font-size: .86rem; transition: var(--transition);
}
.wiki-revision:hover { background: var(--surface-2); }
.wiki-revision strong { font-weight: 700; }
.wiki-revision-time { color: var(--text-faint); font-size: .78rem; }
.wiki-revision-note {
    font-size: .82rem; color: var(--text-muted); margin-top: .2rem;
    padding-left: .6rem; border-left: 2px solid var(--border-strong);
}

/* ── Article sidebar (TOC + related) ──────────────────────────── */
.wiki-article-sidebar {
    position: sticky; top: calc(var(--nav-h) + 1rem);
    display: flex; flex-direction: column; gap: 1.25rem; min-width: 0;
}
.wiki-toc {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 1.1rem 1.25rem;
}
.wiki-toc-title { font-size: .9rem; font-weight: 800; margin-bottom: .6rem; }
.wiki-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.wiki-toc li { font-size: .85rem; }
.wiki-toc li.toc-h3, .wiki-toc li[data-level="3"] { padding-left: .85rem; }
.wiki-toc a {
    display: block; padding: .3rem .55rem; border-radius: var(--r-xs);
    color: var(--text-muted); transition: var(--transition);
    border-left: 2px solid transparent;
}
.wiki-toc a:hover, .wiki-toc a.active {
    background: var(--surface-2); color: var(--primary);
    border-left-color: var(--primary);
}
.wiki-toc-empty { font-size: .82rem; color: var(--text-faint); }
.wiki-related { overflow: hidden; }
.wiki-related-list { display: flex; flex-direction: column; padding: .5rem .35rem .6rem; }
.wiki-related-list a {
    padding: .5rem .8rem; border-radius: var(--r-sm);
    font-size: .88rem; font-weight: 500; transition: var(--transition);
}
.wiki-related-list a:hover { background: var(--surface-2); }

/* ── Editor ───────────────────────────────────────────────────── */
.wiki-editor-card { padding: 1.5rem; }
.wiki-editor-meta {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem;
    margin-bottom: .5rem;
}
.wiki-editor-options { display: flex; flex-direction: column; gap: .45rem; padding-top: .35rem; }
.wiki-editor-options label {
    display: flex; align-items: center; gap: .5rem;
    font-size: .88rem; font-weight: 500; color: var(--text); cursor: pointer;
}

.wiki-editor {
    border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    overflow: hidden; background: var(--surface);
    transition: var(--transition);
}
.wiki-editor:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.wiki-toolbar {
    display: flex; flex-wrap: wrap; gap: .25rem; padding: .5rem .6rem;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.wiki-toolbar button, .wiki-tool-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 .55rem;
    border-radius: var(--r-xs); background: var(--surface);
    border: 1px solid var(--border); color: var(--text-muted);
    font-size: .82rem; font-weight: 600; transition: var(--transition);
}
.wiki-toolbar button:hover, .wiki-tool-btn:hover {
    background: var(--primary-soft); border-color: var(--primary);
    color: var(--primary);
}
.wiki-toolbar button.active, .wiki-tool-btn.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.wiki-toolbar button b, .wiki-toolbar button i, .wiki-toolbar button u { font-style: inherit; }
.wiki-toolbar button i { font-style: italic; }

.wiki-content-editable {
    min-height: 320px; padding: 1.1rem 1.25rem; outline: none;
    font-size: .98rem; line-height: 1.7; color: var(--text);
}
.wiki-content-editable:empty::before {
    content: attr(data-placeholder); color: var(--text-faint);
}
.wiki-content-editable h2 { font-size: 1.4rem; font-weight: 800; margin: 1.4rem 0 .6rem; }
.wiki-content-editable h3 { font-size: 1.15rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
.wiki-content-editable p { margin: .7rem 0; }
.wiki-content-editable ul, .wiki-content-editable ol { margin: .7rem 0; padding-left: 1.6rem; }
.wiki-content-editable blockquote {
    margin: .9rem 0; padding: .6rem 1rem;
    border-left: 4px solid var(--primary); background: var(--primary-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-muted);
}
.wiki-content-editable a { color: var(--primary); text-decoration: underline; }
.wiki-content-editable hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.wiki-editor-actions {
    display: flex; gap: .65rem; margin-top: 1.25rem;
    padding-top: 1.25rem; border-top: 1px solid var(--border);
}

/* ── Category manager ─────────────────────────────────────────── */
.wiki-cat-panel { padding: 0 0 1.25rem; margin-bottom: 1.25rem; overflow: hidden; }
.wiki-cat-panel form { padding: 1.25rem 1.25rem 0; }
.wiki-cat-fields {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem;
}
.wiki-color-input { padding: .25rem; height: 42px; cursor: pointer; }
.wiki-cat-panel-actions {
    display: flex; justify-content: flex-end; gap: .65rem;
    margin-top: .25rem;
}

.wiki-cat-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.wiki-cat-table th {
    text-align: left; padding: .75rem .9rem; font-size: .74rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.wiki-cat-table td {
    padding: .7rem .9rem; border-bottom: 1px solid var(--surface-3);
    vertical-align: middle;
}
.wiki-cat-table tr:last-child td { border-bottom: none; }
.wiki-cat-table tbody tr:hover td { background: var(--surface-2); }
.wiki-cat-table-icon { font-size: 1.25rem; }
.wiki-cat-table-name { font-weight: 600; color: var(--text); }
.wiki-color-swatch {
    display: inline-block; width: 16px; height: 16px; border-radius: var(--r-xs);
    border: 1px solid var(--border); vertical-align: middle; margin-right: .35rem;
}
.wiki-cat-table-actions { display: flex; gap: .35rem; }
.wiki-cat-table-actions .btn { padding: .4rem .6rem; }
.wiki-inline-form { display: inline; margin: 0; }
.wiki-delete-btn:hover { background: var(--danger-soft); color: var(--danger); }
.wiki-cat-table-empty { text-align: center; color: var(--text-faint); padding: 2rem 1rem; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .wiki-article-layout { grid-template-columns: 1fr; }
    .wiki-article-sidebar { position: static; order: -1; }
    .wiki-columns { grid-template-columns: 1fr; }
    .wiki-categories { grid-template-columns: 1fr; }
    .wiki-editor-meta { grid-template-columns: 1fr; }
    .wiki-cat-fields { grid-template-columns: 1fr; }
    .wiki-article-content { padding: 1.4rem 1.25rem; }
    .wiki-article-title { font-size: 1.5rem; }
    .wiki-page-header h1 { font-size: 1.3rem; }
    .wiki-cat-table { font-size: .84rem; }
    .wiki-cat-table th, .wiki-cat-table td { padding: .6rem .55rem; }
}

/* ===================== gallery ===================== */
/* ============================================================================
   Gallery — albums grid, album view, photo grid, upload dropzone, create modal.
   ============================================================================ */

/* ── Page wrap & header ───────────────────────────────────────────── */
.gallery-wrap { max-width: none; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }

.gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.gallery-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

/* ── Empty state ──────────────────────────────────────────────────── */
.gallery-empty { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.gallery-empty-icon { font-size: 2.6rem; line-height: 1; opacity: .8; }

/* ── Albums grid ──────────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
}
.album-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    color: inherit;
    transition: var(--transition);
}
.album-card:hover {
    color: inherit;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}
.album-card-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--surface-3);
    transition: var(--transition);
}
.album-card:hover .album-card-cover { transform: scale(1.03); }
.album-card-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--text-faint);
    background: var(--surface-3);
    transform: none !important;
}
.album-card-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.album-card-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.3;
    color: var(--text);
}
.album-card-private {
    flex-shrink: 0;
    background: var(--surface-3);
    color: var(--text-muted);
    padding: .1rem .35rem;
    font-size: .72rem;
}
.album-card-meta {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .8rem;
    color: var(--text-muted);
}

/* ── Album view: breadcrumb ───────────────────────────────────────── */
.gallery-breadcrumb {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.gallery-breadcrumb a { color: var(--primary); font-weight: 600; }
.gallery-breadcrumb-sep { color: var(--text-faint); }

/* ── Album view: header ───────────────────────────────────────────── */
.gallery-album-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.gallery-album-desc { color: var(--text-muted); margin-top: .35rem; max-width: 60ch; }
.gallery-album-info {
    margin-top: .5rem;
    font-size: .82rem;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}
.gallery-album-delete { flex-shrink: 0; color: var(--danger); }
.gallery-album-delete:hover { background: var(--danger-soft); color: var(--danger); }

/* ── Upload dropzone ──────────────────────────────────────────────── */
.gallery-dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--r);
    background: var(--surface-2);
    padding: 1.75rem 1rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.25rem;
}
.gallery-dropzone:hover,
.gallery-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-hover);
}
.gallery-dropzone-icon { font-size: 2rem; line-height: 1; margin-bottom: .35rem; }
.gallery-dropzone-hint { font-size: .78rem; color: var(--text-faint); margin-top: .3rem; }

/* ── Upload preview ───────────────────────────────────────────────── */
.gallery-upload-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: .9rem 1rem;
    margin-bottom: 1.25rem;
}
.gallery-upload-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-muted);
}
.gallery-upload-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: .5rem;
}
.gallery-upload-thumbs img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-3);
}

/* ── Photo grid ───────────────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .6rem;
}
.photo-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface-3);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
}
.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.photo-grid-item:hover img { transform: scale(1.08); }

/* ── Photo overlay actions ────────────────────────────────────────── */
.photo-overlay {
    position: absolute;
    top: .4rem;
    right: .4rem;
    display: flex;
    gap: .3rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: var(--transition);
}
.photo-grid-item:hover .photo-overlay { opacity: 1; transform: none; }
.photo-overlay-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    background: rgba(255,255,255,.92);
    color: var(--text);
    font-size: .9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
    transition: var(--transition);
}
.photo-overlay-btn:hover { background: #fff; transform: scale(1.08); }
.photo-overlay-btn.is-cover {
    background: var(--warning);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(245,158,11,.35), var(--shadow-sm);
}
.photo-overlay-btn.danger:hover { background: var(--danger); color: #fff; }

/* ── Create-album modal ───────────────────────────────────────────── */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(3px);
    animation: pop .14s ease;
}
.gallery-modal-card {
    width: 100%;
    max-width: 460px;
    padding: 1.25rem 1.35rem 1.4rem;
    box-shadow: var(--shadow-lg);
}
.gallery-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.gallery-modal-title { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: .45rem; }
.gallery-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.gallery-modal-close:hover { background: var(--surface-3); color: var(--text); }
.gallery-modal-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin: .25rem 0 1.1rem;
}
.gallery-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}
.gallery-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.gallery-modal-submit { width: 100%; }

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .gallery-wrap { padding: 1.1rem .9rem 2.5rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4rem; }
    .gallery-album-head { flex-direction: column; }
    .gallery-album-delete { align-self: flex-start; }
    .photo-overlay { opacity: 1; transform: none; }
}

/* ===================== feed ===================== */
/* ============================================================================
   FEED — social feed: composer, post cards, reactions, comments
   ============================================================================ */

/* ── Layout wrapper ─────────────────────────────────────────────── */
.feed-wrap {
    max-width: 640px;
    margin: 1.5rem auto;
    padding: 0 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    align-self: flex-start;
    padding: .35rem .25rem;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary); }

/* ── Composer ───────────────────────────────────────────────────── */
.post-composer {
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.composer-top {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.composer-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: var(--surface-2);
    border-radius: var(--r);
    padding: .7rem .85rem;
    font-size: .95rem;
    line-height: 1.5;
    resize: none;
    color: var(--text);
    transition: var(--transition);
}
.composer-input::placeholder { color: var(--text-faint); }
.composer-input:focus {
    outline: none;
    background: var(--surface);
    box-shadow: var(--ring);
}

.composer-link-preview {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: .7rem .85rem;
    background: var(--surface-2);
    font-size: .85rem;
    color: var(--text-muted);
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: .85rem;
}
.composer-attach {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .8rem;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.composer-attach:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.composer-files {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.composer-files img,
.composer-files video {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}
.composer-submit { margin-left: auto; }

/* ── Post card ──────────────────────────────────────────────────── */
.feed-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: .7rem;
}
.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.post-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.post-author {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
}
.post-dept {
    font-size: .76rem;
    color: var(--text-faint);
}
.post-time {
    font-size: .76rem;
    color: var(--text-faint);
    font-weight: 500;
    transition: var(--transition);
}
.post-time:hover { color: var(--primary); }
.post-pin {
    margin-left: auto;
    font-size: .95rem;
    line-height: 1;
}

/* Post menu (dropdown) */
.post-menu {
    position: relative;
    margin-left: auto;
}
.post-pin + .post-menu { margin-left: .35rem; }
.post-menu-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--transition);
}
.post-menu-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}
.post-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + .35rem);
    min-width: 168px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    z-index: 30;
    animation: pop .14s ease;
}
.post-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: .5rem .65rem;
    border-radius: var(--r-sm);
    font-size: .86rem;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}
.post-menu-item:hover { background: var(--surface-3); }
.post-menu-item.danger { color: var(--danger); }
.post-menu-item.danger:hover { background: var(--danger-soft); }

/* ── Post content ───────────────────────────────────────────────── */
.post-content {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--text);
    word-break: break-word;
}
.post-content a { color: var(--primary); font-weight: 500; }
.post-content a:hover { text-decoration: underline; }

/* ── Media grid ─────────────────────────────────────────────────── */
.post-media {
    display: grid;
    gap: 4px;
    border-radius: var(--r-sm);
    overflow: hidden;
    grid-template-columns: 1fr;
}
.post-media.media-count-2 { grid-template-columns: 1fr 1fr; }
.post-media.media-count-3 {
    grid-template-columns: 1fr 1fr;
}
.post-media.media-count-3 .post-media-item:first-child {
    grid-column: 1 / -1;
}
.post-media.media-count-4 { grid-template-columns: 1fr 1fr; }

.post-media-item {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--surface-3);
    cursor: pointer;
    aspect-ratio: 16 / 10;
}
.post-media.media-count-1 .post-media-item { aspect-ratio: auto; max-height: 520px; }
.post-media-item img,
.post-media-item video,
video.post-media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-media.media-count-1 .post-media-item img,
.post-media.media-count-1 .post-media-item video,
video.post-media-item.post-media-item:only-child {
    object-fit: contain;
    background: #0f172a;
}
video.post-media-item { aspect-ratio: 16 / 10; }

/* ── Link card ──────────────────────────────────────────────────── */
.post-link-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    color: inherit;
    transition: var(--transition);
}
.post-link-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    color: inherit;
}
.post-link-thumb {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    background: var(--surface-3);
}
.post-link-info {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem .9rem;
    background: var(--surface-2);
    min-width: 0;
}
.post-link-domain {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-faint);
    font-weight: 700;
}
.post-link-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-link-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Stats row ──────────────────────────────────────────────────── */
.post-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .82rem;
    color: var(--text-muted);
    min-height: 1.2rem;
}
.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
}
.reaction-badge:empty { display: none; }
.reaction-badge > span:not(.reaction-count) {
    font-size: 1rem;
    line-height: 1;
}
.reaction-count {
    margin-left: .3rem;
    font-weight: 600;
    color: var(--text-muted);
}
.comment-count {
    color: var(--text-faint);
    cursor: default;
}

/* ── Action bar ─────────────────────────────────────────────────── */
.post-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: .3rem 0;
    margin: 0 -.25rem;
}
.post-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem .5rem;
    border-radius: var(--r-sm);
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
}
.post-action-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}
.post-action-btn.reacted {
    color: var(--primary);
}

/* Reaction palette (pops above the like button on hover) */
.react-wrap {
    position: relative;
    flex: 1;
    display: flex;
}
.react-wrap .react-trigger { flex: 1; }
.react-palette {
    position: absolute;
    bottom: calc(100% + .5rem);
    left: 0;
    display: flex;
    gap: .15rem;
    padding: .35rem .45rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(.95);
    transform-origin: bottom left;
    transition: var(--transition);
    z-index: 25;
}
.react-wrap:hover .react-palette,
.react-palette:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.react-option {
    font-size: 1.5rem;
    line-height: 1;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    transition: transform .12s cubic-bezier(.4,0,.2,1), background var(--transition);
}
.react-option:hover {
    transform: scale(1.3) translateY(-3px);
    background: var(--surface-3);
}

/* ── Comments ───────────────────────────────────────────────────── */
.post-comments {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding-top: .3rem;
}
.comment {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}
.comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.comment-bubble {
    background: var(--surface-2);
    border-radius: var(--r);
    padding: .55rem .8rem;
    min-width: 0;
    max-width: 100%;
}
.comment-author {
    display: block;
    font-weight: 700;
    font-size: .84rem;
    color: var(--text);
}
.comment-body {
    font-size: .88rem;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}
.comment-body a { color: var(--primary); }
.comment-body a:hover { text-decoration: underline; }
.comment-time {
    display: block;
    font-size: .72rem;
    color: var(--text-faint);
    margin-top: .2rem;
}

.comment-form {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .2rem;
}
.comment-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r-full);
    padding: .55rem .95rem;
    font-size: .88rem;
    color: var(--text);
    transition: var(--transition);
}
.comment-input::placeholder { color: var(--text-faint); }
.comment-input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* ── Load more ──────────────────────────────────────────────────── */
.load-more {
    align-self: center;
    margin-top: .25rem;
    min-width: 220px;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .feed-wrap {
        margin: 1rem auto;
        padding: 0 .75rem 2.5rem;
        gap: .85rem;
    }
    .post-composer,
    .feed-post { padding: 1rem; }
    .composer-actions { gap: .5rem; }
    .composer-submit {
        margin-left: 0;
        flex: 1;
    }
    .post-avatar { width: 40px; height: 40px; }
    .post-action-btn { font-size: .82rem; padding: .5rem .25rem; }
    .react-option { width: 38px; height: 38px; font-size: 1.35rem; }
    .post-media.media-count-1 .post-media-item { max-height: 380px; }
}


/* ===================== strikes ===================== */
/* ============================================================================
   Strikes (Απεργίες) — feature component
   ============================================================================ */

.strikes-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

.strikes-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.45rem;
    margin-bottom: 1.25rem;
}

/* ── Category filter pills ─────────────────────────────────────────── */
.strike-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.strike-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .85rem;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--text-muted);
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: var(--transition);
}

.strike-filter-btn:hover {
    background: var(--surface-3);
    box-shadow: var(--shadow-xs);
}

.strike-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

/* ── Date group header ─────────────────────────────────────────────── */
.strike-date-group {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 1.4rem 0 .65rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.strike-date-group:first-child {
    margin-top: 0;
}

/* ── Strike item card ──────────────────────────────────────────────── */
.strike-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    padding: .95rem 1.1rem;
    margin-bottom: .75rem;
    transition: var(--transition);
}

.strike-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.strike-item.strike-today {
    background: var(--primary-soft);
    border-color: var(--primary-100);
}

.strike-item-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
}

.strike-category-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    border-radius: var(--r-full);
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    flex-shrink: 0;
}

.strike-summary {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

/* ── Expandable description ────────────────────────────────────────── */
.strike-desc {
    display: none;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px dashed var(--border);
    font-size: .88rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.strike-desc.show {
    display: block;
    animation: pop .14s ease;
}

.strike-toggle {
    margin-top: .55rem;
    padding: 0;
    background: none;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 600;
    transition: var(--transition);
}

.strike-toggle:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ── Empty state ───────────────────────────────────────────────────── */
.strike-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
}

.strike-empty-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: .75rem;
}

.strike-empty p {
    font-size: .95rem;
    max-width: 32ch;
    margin: 0 auto;
}

/* ── Source footnote ───────────────────────────────────────────────── */
.strike-source {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-faint);
}

.strike-source a {
    font-weight: 600;
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .strikes-wrap {
        padding: 1.1rem .9rem 2.5rem;
    }
    .strikes-title {
        font-size: 1.25rem;
    }
    .strike-item-head {
        gap: .45rem;
    }
    .strike-summary {
        flex-basis: 100%;
    }
}

/* ===================== announcements ===================== */
/* ============================================================================
   Feature: Announcements
   ============================================================================ */

.announce-wrap {
    max-width: none;
    margin: 0 auto;
    padding: 1.5rem 1.75rem 3rem;
}
.announce-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 1.1rem;
    align-items: start;
}

/* ── List header ─────────────────────────────────────────────────── */
.announce-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .25rem;
}
.announce-page-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 600;
    width: fit-content;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary); }

/* ── Create form ─────────────────────────────────────────────────── */
.announce-form-card {
    padding: 1.25rem 1.35rem;
    animation: pop .16s ease;
}
.announce-textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.6;
}
.announce-attach {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .9rem;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-sm);
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.announce-attach:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}
.announce-file-info {
    display: inline-block;
    margin-left: .6rem;
    font-size: .82rem;
    color: var(--text-faint);
}
.announce-form-row {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.announce-priority {
    flex: 0 1 240px;
    margin-bottom: 0;
}
.announce-ack-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .55rem;
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.announce-ack-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.announce-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* ── Announcement card ───────────────────────────────────────────── */
.announce-card {
    position: relative;
    padding: 1.25rem 1.4rem;
    border-left: 4px solid var(--border-strong);
    transition: var(--transition);
}
a .announce-card:hover,
.announce-card:hover {
    box-shadow: var(--shadow);
}
.announce-priority-important { border-left-color: var(--warning); }
.announce-priority-urgent { border-left-color: var(--danger); }

.announce-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .65rem;
}
.announce-badge-important {
    background: var(--warning-soft);
    color: #b45309;
}
.announce-badge-urgent {
    background: var(--danger-soft);
    color: #b91c1c;
}
.announce-badge-ack {
    background: var(--primary-soft);
    color: var(--primary);
}
.announce-badge-inactive {
    background: var(--surface-3);
    color: var(--text-faint);
}

.announce-card-title {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.3;
    margin-bottom: .5rem;
}
.announce-card-title a {
    color: var(--text);
    transition: var(--transition);
}
.announce-card-title a:hover { color: var(--primary); }

.announce-excerpt {
    color: var(--text-muted);
    font-size: .92rem;
    line-height: 1.6;
}

/* ── Thumbnails (list) ───────────────────────────────────────────── */
.announce-thumbs {
    display: flex;
    gap: .5rem;
    margin-top: .9rem;
    flex-wrap: wrap;
}
.announce-thumb {
    width: 78px;
    height: 78px;
    border-radius: var(--r-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.announce-thumb-video {
    background: var(--surface-3);
    color: var(--text-muted);
}
.announce-thumb-more {
    font-size: .95rem;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--surface-2);
}

/* ── Card footer ─────────────────────────────────────────────────── */
.announce-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
}
.announce-author {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .84rem;
    color: var(--text-muted);
    min-width: 0;
}
.announce-author > span { white-space: nowrap; }
.announce-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
}
.announce-author-name {
    font-weight: 700;
    color: var(--text);
}
.announce-dot {
    color: var(--text-faint);
}

/* ── Read progress / ack ─────────────────────────────────────────── */
.announce-ack-status {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.announce-progress {
    width: 90px;
    height: 7px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    overflow: hidden;
    flex: 0 0 auto;
}
.announce-progress-lg {
    width: 200px;
    height: 9px;
}
.announce-progress-bar {
    height: 100%;
    border-radius: var(--r-full);
    background: var(--gradient-brand);
    transition: width .4s cubic-bezier(.4,0,.2,1);
}
.announce-ack-num {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.announce-ack-done {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--success);
}
.announce-inline-form { display: inline-flex; }
.announce-ack-btn {
    color: var(--primary);
    font-weight: 700;
    padding: .35rem .7rem;
    border: 1px solid var(--border);
}
.announce-ack-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

/* ── Empty state ─────────────────────────────────────────────────── */
.announce-empty {
    padding: 3rem 1.5rem;
}
.announce-empty-icon {
    font-size: 2.6rem;
    margin-bottom: .5rem;
    opacity: .85;
}

/* ── Full / single view ──────────────────────────────────────────── */
.announce-full {
    padding: 1.6rem 1.8rem;
}
.announce-full-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    margin: .35rem 0 .9rem;
}
.announce-full-author {
    font-size: .88rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}
.announce-full-author .announce-avatar {
    width: 38px;
    height: 38px;
}

.announce-content {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.75;
}
.announce-content > * + * { margin-top: 1rem; }
.announce-content h1,
.announce-content h2,
.announce-content h3 {
    margin-top: 1.6rem;
    line-height: 1.3;
}
.announce-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.announce-content ul,
.announce-content ol {
    padding-left: 1.4rem;
}
.announce-content li + li { margin-top: .35rem; }
.announce-content img {
    border-radius: var(--r-sm);
    margin: 1rem 0;
}
.announce-content blockquote {
    border-left: 3px solid var(--primary);
    padding: .25rem 0 .25rem 1rem;
    color: var(--text-muted);
    font-style: italic;
}
.announce-content pre {
    background: var(--surface-3);
    border-radius: var(--r-sm);
    padding: .9rem 1rem;
    overflow-x: auto;
    font-size: .86rem;
}
.announce-content code {
    background: var(--surface-3);
    border-radius: var(--r-xs);
    padding: .1rem .35rem;
    font-size: .86em;
}

/* ── Media gallery (single) ──────────────────────────────────────── */
.announce-media {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .7rem;
    margin-top: 1.5rem;
}
.announce-media.media-count-1 {
    grid-template-columns: 1fr;
}
.announce-media.media-count-3 .announce-media-item:first-child {
    grid-column: span 2;
}
.announce-media-item {
    display: block;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--border);
    aspect-ratio: 16 / 10;
    cursor: zoom-in;
    transition: var(--transition);
}
.announce-media-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.announce-media-item img,
video.announce-media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
video.announce-media-item {
    cursor: default;
    background: #000;
}

/* ── Ack bar (single) ────────────────────────────────────────────── */
.announce-ack-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
    padding: 1rem 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.announce-ack-done-lg {
    font-size: .92rem;
    padding: .5rem .9rem;
    background: var(--success-soft);
    border-radius: var(--r-sm);
}
.announce-ack-btn-lg {
    font-weight: 700;
}

/* ── Admin: per-user read status ─────────────────────────────────── */
.announce-admin {
    padding: 1.25rem 1.4rem;
}
.announce-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.announce-admin-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.announce-delete-btn {
    color: var(--danger);
    font-weight: 600;
}
.announce-delete-btn:hover {
    background: var(--danger-soft);
}

.announce-read-list {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.announce-read-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .65rem;
    border-radius: var(--r-sm);
    transition: var(--transition);
}
.announce-read-row:hover { background: var(--surface-2); }
.announce-read-row .announce-avatar {
    width: 36px;
    height: 36px;
}
.announce-read-row.is-pending {
    opacity: .85;
}
.announce-read-user {
    flex: 1;
    min-width: 0;
}
.announce-read-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.announce-read-dept {
    font-size: .76rem;
    color: var(--text-faint);
}
.announce-read-ok {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
    flex: 0 0 auto;
}
.announce-read-pending {
    font-size: .76rem;
    font-weight: 700;
    color: var(--warning);
    background: var(--warning-soft);
    padding: .2rem .55rem;
    border-radius: var(--r-full);
    white-space: nowrap;
    flex: 0 0 auto;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .announce-wrap { padding: 1rem .9rem 2.5rem; }
    .announce-page-title { font-size: 1.35rem; }
    .announce-full { padding: 1.2rem 1.1rem; }
    .announce-full-title { font-size: 1.4rem; }
    .announce-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }
    .announce-ack-status { width: 100%; }
    .announce-form-row { flex-direction: column; align-items: stretch; gap: .5rem; }
    .announce-priority { flex: 1 1 auto; }
    .announce-ack-toggle { padding-bottom: 0; }
    .announce-ack-bar { flex-direction: column; align-items: stretch; }
    .announce-progress-lg { width: 100%; }
    .announce-media,
    .announce-media.media-count-3 .announce-media-item:first-child {
        grid-template-columns: 1fr;
        grid-column: auto;
    }
    .announce-thumb { width: 64px; height: 64px; }
}

/* ===================== search ===================== */
/* ============================================================================
   FEATURE: Search — full results page + navbar quick-dropdown items
   ============================================================================ */

/* ── Search results page ──────────────────────────────────────────── */
.search-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

/* Big query input row */
.search-page-form {
    display: flex;
    gap: .6rem;
    margin-bottom: 1.5rem;
}
.search-page-form input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: .8rem 1.1rem;
    font-size: 1.02rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.search-page-form input[type="text"]::placeholder {
    color: var(--text-faint);
}
.search-page-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}
.search-page-form .btn {
    flex-shrink: 0;
    border-radius: var(--r-full);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Summary line */
.search-summary {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
    padding-left: .15rem;
}
.search-summary strong {
    color: var(--text);
    font-weight: 700;
}

/* Empty / no-results state */
.search-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.75rem 1.5rem;
}
.search-empty-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: .8rem;
    opacity: .9;
}
.search-empty p {
    font-size: .95rem;
    margin: 0;
}

/* ── Result groups by category ────────────────────────────────────── */
.search-section {
    margin-bottom: 1.75rem;
}
.search-section:last-child {
    margin-bottom: 0;
}
.search-section-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: .65rem;
    padding-left: .15rem;
}

/* ── Result item card ─────────────────────────────────────────────── */
.search-result {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: .9rem 1.05rem;
    margin-bottom: .6rem;
    color: var(--text);
    transition: var(--transition);
}
.search-result:last-child {
    margin-bottom: 0;
}
.search-result:hover {
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

/* User result variant: avatar beside body */
.search-result-user {
    display: flex;
    align-items: center;
    gap: .85rem;
}
.search-result-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.search-result-body {
    min-width: 0;
    flex: 1;
}

/* Head row (author / badge + time) for post/wiki/announcement results */
.search-result-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}
.search-result-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.search-result-author {
    font-weight: 700;
    font-size: .86rem;
    color: var(--text);
}
.search-result-time {
    margin-left: auto;
    font-size: .74rem;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Titles & text */
.search-result-title {
    font-weight: 700;
    font-size: .98rem;
    color: var(--text);
    line-height: 1.35;
}
.search-result-meta {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .12rem;
}
.search-result-text {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: .3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Highlighted match (the highlight filter emits <mark>) */
.search-result mark,
.search-page mark {
    background: var(--warning-soft);
    color: var(--text);
    font-weight: 700;
    padding: 0 .1em;
    border-radius: var(--r-xs);
}

/* Category / priority badges inside results */
.search-badge {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .5rem;
    border-radius: var(--r-full);
    background: var(--surface-3);
    color: var(--text-muted);
    line-height: 1;
}
.search-badge-wiki {
    background: var(--primary-soft);
    color: var(--primary);
}
.search-badge-normal {
    background: var(--surface-3);
    color: var(--text-muted);
}
.search-badge-important {
    background: var(--warning-soft);
    color: #b45309;
}
.search-badge-urgent {
    background: var(--danger-soft);
    color: #b91c1c;
}

/* ── Navbar quick-dropdown items (.nav-search-dropdown is foundation) ── */
.nav-search-none {
    padding: 1.1rem 1rem;
    text-align: center;
    font-size: .85rem;
    color: var(--text-faint);
}
.nav-search-group {
    padding: .35rem 0;
    border-bottom: 1px solid var(--surface-3);
}
.nav-search-group:last-of-type {
    border-bottom: none;
}
.nav-search-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-faint);
    padding: .4rem .85rem .25rem;
}
.nav-search-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .85rem;
    color: var(--text);
    transition: var(--transition);
}
.nav-search-item:hover,
.nav-search-item.active,
.nav-search-item:focus-visible {
    background: var(--surface-2);
    color: var(--text);
}
.nav-search-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}
.nav-search-item-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.nav-search-item-title {
    font-size: .86rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-search-item-meta {
    font-size: .76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-search-all {
    display: block;
    padding: .65rem .85rem;
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    transition: var(--transition);
}
.nav-search-all:hover {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .search-page {
        padding: 1.1rem .9rem 2.5rem;
    }
    .search-page-form {
        flex-direction: column;
        gap: .5rem;
    }
    .search-page-form .btn {
        width: 100%;
    }
    .search-result-user {
        gap: .7rem;
    }
    .search-result-avatar {
        width: 40px;
        height: 40px;
    }
}

/* ===================== chat ===================== */
/* ── Chat (global group chat panel) ──────────────────────────────── */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 520px;
    max-height: 520px;
    overflow: hidden;
    padding: 0;
}

/* Header */
.chat-panel-header {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}
.chat-panel-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
}
.chat-panel-sub {
    font-size: .8rem;
    color: var(--text-muted);
}

/* Messages scroll area */
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* Empty state */
.chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem 1rem;
}
.chat-empty-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: .55rem;
    opacity: .85;
}
.chat-empty p {
    font-size: .9rem;
    color: var(--text-muted);
}

/* A single message row */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    max-width: 100%;
    animation: chat-msg-in .18s ease;
}
@keyframes chat-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.chat-msg.own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.chat-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
}

.chat-msg-body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    max-width: 78%;
}
.chat-msg.own .chat-msg-body {
    align-items: flex-end;
}

.chat-sender {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-left: .15rem;
}
.chat-sender:hover { color: var(--primary); }

/* Bubble + actions row */
.chat-bubble-row {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.chat-msg.own .chat-bubble-row {
    flex-direction: row-reverse;
}

.chat-bubble {
    background: var(--surface-3);
    color: var(--text);
    padding: .55rem .8rem;
    border-radius: var(--r-lg);
    border-bottom-left-radius: var(--r-xs);
    font-size: .9rem;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-shadow: var(--shadow-xs);
    max-width: 100%;
}
.chat-msg.own .chat-bubble {
    background: var(--gradient-brand);
    color: #fff;
    border-bottom-left-radius: var(--r-lg);
    border-bottom-right-radius: var(--r-xs);
}
.chat-bubble a {
    color: var(--primary);
    text-decoration: underline;
}
.chat-msg.own .chat-bubble a {
    color: #fff;
}
.chat-bubble .mention {
    font-weight: 700;
}

/* Attachments */
.chat-attachment {
    display: block;
    margin-top: .4rem;
    border-radius: var(--r-sm);
    overflow: hidden;
    line-height: 0;
}
.chat-attachment img {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: var(--r-sm);
    object-fit: cover;
    transition: var(--transition);
}
.chat-attachment:hover img {
    opacity: .92;
}
.chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .4rem;
    padding: .4rem .65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}
.chat-attachment-file:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}
.chat-msg.own .chat-attachment-file {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}
.chat-msg.own .chat-attachment-file:hover {
    background: rgba(255,255,255,.28);
}

/* Like / delete buttons */
.chat-like-btn,
.chat-del-btn {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .2rem .35rem;
    border-radius: var(--r-full);
    font-size: .82rem;
    line-height: 1;
    color: var(--text-faint);
    opacity: 0;
    transition: var(--transition);
}
.chat-msg:hover .chat-like-btn,
.chat-msg:hover .chat-del-btn,
.chat-like-btn.liked {
    opacity: 1;
}
.chat-like-btn:hover,
.chat-del-btn:hover {
    background: var(--surface-3);
}
.chat-del-btn:hover {
    background: var(--danger-soft);
}
.chat-like-icon {
    display: inline-flex;
    line-height: 1;
}
.chat-like-btn:hover .chat-like-icon {
    transform: scale(1.15);
}
.chat-like-count {
    font-size: .74rem;
    font-weight: 700;
    color: var(--text-muted);
}
.chat-like-btn.liked .chat-like-count {
    color: var(--accent);
}

/* Timestamp */
.chat-time {
    font-size: .7rem;
    color: var(--text-faint);
    padding: 0 .25rem;
}

/* Input bar */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .85rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}
.chat-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: var(--r-full);
    font-size: 1.05rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.chat-attach:hover {
    background: var(--surface-3);
    color: var(--text);
}
.chat-input {
    flex: 1;
    min-width: 0;
    padding: .55rem .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: .9rem;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}
.chat-input::placeholder { color: var(--text-faint); }
.chat-input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}
.chat-send-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* File hint (selected attachment name) */
.chat-file-hint {
    padding: .45rem 1.15rem .65rem;
    font-size: .78rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* Mobile */
@media (max-width: 760px) {
    .chat-panel {
        height: 460px;
        max-height: 70vh;
    }
    .chat-msg-body { max-width: 85%; }
    .chat-attachment img { max-width: 180px; max-height: 180px; }
    .chat-like-btn,
    .chat-del-btn { opacity: 1; }
}

/* ===================== changelog ===================== */
/* ============================================================================
   CHANGELOG — vertical timeline of version cards
   ============================================================================ */

.changelog-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

/* Header */
.changelog-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.changelog-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.changelog-version {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .01em;
}

/* Timeline rail — entries sit to the right of a vertical line with node dots */
.changelog-card {
    position: relative;
    margin-left: 1.6rem;
    margin-bottom: 1.4rem;
    padding: 1.25rem 1.4rem 1.1rem;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.changelog-card:last-child {
    margin-bottom: 0;
}
.changelog-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

/* Vertical connecting line running through the stack */
.changelog-card::before {
    content: "";
    position: absolute;
    left: -1.6rem;
    top: 1.9rem;
    bottom: -1.4rem;
    width: 2px;
    background: var(--border);
}
.changelog-card:last-child::before {
    display: none;
}

/* Node dot anchored on the rail, aligned with the version pill */
.changelog-card::after {
    content: "";
    position: absolute;
    left: calc(-1.6rem - 5px);
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: var(--r-full);
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border);
}

/* Card head: version pill + date */
.changelog-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding-bottom: .85rem;
    margin-bottom: .85rem;
    border-bottom: 1px solid var(--border);
}
.changelog-release {
    display: inline-flex;
    align-items: center;
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    background: var(--primary-soft);
    color: var(--primary);
    padding: .26rem .7rem;
    border-radius: var(--r-full);
}
.changelog-date {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Card body holds the list of changes */
.changelog-card .card-body {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

/* A single change row: type badge + descriptive text */
.changelog-row {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .35rem 0;
}
.changelog-row + .changelog-row {
    border-top: 1px solid var(--surface-3);
    padding-top: .65rem;
}
.changelog-type {
    flex: 0 0 auto;
    margin-top: .08rem;
    min-width: 74px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .66rem;
}
.changelog-text {
    flex: 1;
    min-width: 0;
    font-size: .92rem;
    line-height: 1.5;
    color: var(--text);
}

/* Reuse-friendly aliases used by the template */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    list-style: none;
    padding: 0;
}
.changelog-item {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}
.changelog-badge {
    flex: 0 0 auto;
    margin-top: .08rem;
}
.changelog-entry {
    position: relative;
}

/* Mobile */
@media (max-width: 760px) {
    .changelog-card {
        margin-left: 1.1rem;
        padding: 1rem 1.1rem;
    }
    .changelog-card::before {
        left: -1.1rem;
    }
    .changelog-card::after {
        left: calc(-1.1rem - 5px);
    }
    .changelog-card-head {
        justify-content: flex-start;
    }
    .changelog-row {
        flex-direction: column;
        gap: .3rem;
    }
    .changelog-type {
        min-width: 0;
    }
}

/* ===================== polls ===================== */
/* ============================================================================
   Polls — poll cards, clickable options with animated result bars, create form.
   ============================================================================ */

/* ── Page wrap & header ───────────────────────────────────────────── */
.polls-wrap { max-width: none; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }
.poll-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1.1rem; align-items: start; }
.polls-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .25rem; }
.polls-title { display: flex; align-items: center; gap: .5rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

/* ── Create form ──────────────────────────────────────────────────── */
.poll-form { padding: 1.25rem 1.35rem; }
.poll-form-hint { font-weight: 500; color: var(--text-faint); font-size: .78rem; }
.poll-form-options { display: flex; flex-direction: column; gap: .55rem; }
.poll-form-option { display: flex; align-items: center; gap: .5rem; }
.poll-form-option .form-control { flex: 1; }
.poll-add-option { align-self: flex-start; margin-top: .6rem; color: var(--primary); font-weight: 600; font-size: .85rem; padding: .35rem .15rem; transition: var(--transition); }
.poll-add-option:hover { color: var(--primary-hover); text-decoration: underline; }
.poll-add-option:disabled { color: var(--text-faint); cursor: not-allowed; text-decoration: none; }

.poll-form-flags { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.poll-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text); cursor: pointer; }
.poll-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }

.poll-closes-input { max-width: 280px; }

.poll-form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .25rem; }

/* ── Empty state ──────────────────────────────────────────────────── */
.poll-empty { padding: 2.75rem 1rem; }
.poll-empty-icon { font-size: 2.6rem; margin-bottom: .5rem; opacity: .85; }

/* ── Poll card ────────────────────────────────────────────────────── */
.poll-card { padding: 1.15rem 1.3rem; display: flex; flex-direction: column; gap: .85rem; transition: box-shadow var(--transition); }
.poll-card:hover { box-shadow: var(--shadow); }

.poll-card-head { display: flex; align-items: center; gap: .65rem; }
.poll-avatar { width: 42px; height: 42px; border-radius: var(--r-full); object-fit: cover; flex-shrink: 0; }
.poll-card-meta { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.poll-card-author { font-weight: 700; font-size: .92rem; color: var(--text); line-height: 1.25; }
.poll-card-time { font-size: .76rem; color: var(--text-faint); }
.poll-closed-badge { background: var(--surface-3); color: var(--text-muted); }
.poll-anon-badge { background: var(--primary-soft); color: var(--primary); }

/* Card menu (⋯) */
.poll-card-menu { position: relative; flex-shrink: 0; }
.poll-menu-btn { width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.25rem; line-height: 1; transition: var(--transition); }
.poll-menu-btn:hover { background: var(--surface-3); color: var(--text); }
.poll-menu-list { position: absolute; right: 0; top: calc(100% + .35rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); min-width: 160px; padding: .35rem; z-index: 30; animation: pop .14s ease; }
.poll-menu-item { display: block; width: 100%; text-align: left; padding: .5rem .65rem; border-radius: var(--r-sm); font-size: .86rem; font-weight: 500; color: var(--text); transition: var(--transition); }
.poll-menu-item:hover { background: var(--surface-3); }
.poll-menu-item.danger { color: var(--danger); }
.poll-menu-item.danger:hover { background: var(--danger-soft); }

/* ── Question ─────────────────────────────────────────────────────── */
.poll-question { font-size: 1.08rem; font-weight: 700; color: var(--text); line-height: 1.4; }

/* ── Options ──────────────────────────────────────────────────────── */
.poll-options { display: flex; flex-direction: column; gap: .55rem; }

.poll-option {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    overflow: hidden;
    transition: var(--transition);
}
.poll-option:not(:disabled) { cursor: pointer; }
.poll-option:not(:disabled):hover { border-color: var(--primary); background: var(--primary-soft); }

/* Result bar (fills by width %) */
.poll-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: var(--primary-soft);
    border-radius: inherit;
    transition: width .55s cubic-bezier(.4,0,.2,1);
    z-index: 0;
}

/* Body sits above the bar */
.poll-option-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .85rem;
}

/* Radio dot (hidden once results show) */
.poll-radio {
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    background: var(--surface);
    transition: var(--transition);
}
.poll-option:not(:disabled):hover .poll-radio { border-color: var(--primary); }

.poll-option-text { flex: 1; min-width: 0; font-size: .92rem; font-weight: 500; color: var(--text); }

.poll-percent { flex-shrink: 0; font-size: .85rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Result state: bar visible, radio collapses */
.poll-option.is-result { cursor: default; }
.poll-option.is-result .poll-radio { display: none; }
.poll-option.is-result .poll-percent { color: var(--text); }

/* Voted option highlighted with primary — LIGHT fill + dark primary text so the
   label/percent stay readable regardless of how far the bar has filled
   (white-on-track was invisible past the fill width). */
.poll-option.is-voted { border-color: var(--primary); background: var(--primary-soft); }
.poll-option.is-voted .poll-bar { background: var(--primary-100); }
.poll-option.is-voted .poll-option-text { color: var(--primary); font-weight: 700; }
.poll-option.is-voted .poll-percent { color: var(--primary); font-weight: 800; }

/* ── Meta row ─────────────────────────────────────────────────────── */
.poll-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--text-muted); }
.poll-deadline { color: var(--warning); font-weight: 600; }
.poll-hint { color: var(--success); font-weight: 600; }

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .polls-wrap { padding: 1.1rem .85rem 2.5rem; }
    .polls-head { gap: .6rem; }
    .polls-title { font-size: 1.35rem; }
    .poll-form { padding: 1rem 1rem; }
    .poll-form-flags { gap: .65rem 1.25rem; }
    .poll-closes-input { max-width: none; }
    .poll-card { padding: 1rem 1rem; }
    .poll-question { font-size: 1rem; }
}

/* ===================== dm ===================== */
/* ============================================================================
   FEATURE: dm — direct messages (full page + floating widget inner views)
   ============================================================================ */

/* ── Full-page layout: sidebar + chat ─────────────────────────────── */
.dm-container {
    max-width: 1180px;
    margin: 1.25rem auto;
    padding: 0 1.1rem;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.1rem;
    height: calc(100vh - var(--nav-h) - 3rem);
    min-height: 480px;
    align-items: stretch;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.dm-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.dm-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.dm-sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    margin: 0;
}

/* New-message inline panel (user picker) */
.dm-new-panel {
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}
.dm-new-search {
    padding: .7rem .8rem .55rem;
}
.dm-new-search .form-control {
    width: 100%;
}
.dm-user-picker {
    max-height: 240px;
    overflow-y: auto;
    padding: 0 .4rem .5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.dm-user-picker::-webkit-scrollbar { width: 8px; }
.dm-user-picker::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.dm-user-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .6rem;
    border-radius: var(--r-sm);
    color: var(--text);
    transition: var(--transition);
}
.dm-user-option:hover {
    background: var(--surface-3);
    color: var(--text);
}
.dm-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
}
.dm-user-name {
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.2;
}
.dm-user-dept {
    font-size: .74rem;
    color: var(--text-faint);
    margin-top: .1rem;
}

/* Conversation list */
.dm-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: .4rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.dm-conv-list::-webkit-scrollbar { width: 8px; }
.dm-conv-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.dm-conv-empty {
    text-align: center;
    color: var(--text-faint);
    font-size: .86rem;
    line-height: 1.5;
    padding: 2.5rem 1rem;
}
.dm-conv-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .65rem;
    border-radius: var(--r-sm);
    color: var(--text);
    position: relative;
    transition: var(--transition);
}
.dm-conv-item + .dm-conv-item {
    margin-top: 2px;
}
.dm-conv-item:hover {
    background: var(--surface-3);
    color: var(--text);
}
.dm-conv-item.active {
    background: var(--primary-soft);
}
.dm-conv-item.active .dm-conv-name span:first-child {
    color: var(--primary);
}
.dm-conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
}
.dm-conv-info {
    min-width: 0;
    flex: 1;
}
.dm-conv-name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    font-weight: 600;
    font-size: .9rem;
}
.dm-conv-name span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dm-conv-time {
    font-size: .7rem;
    font-weight: 500;
    color: var(--text-faint);
    flex-shrink: 0;
}
.dm-conv-preview {
    font-size: .8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: .1rem;
}
.dm-conv-item.has-unread .dm-conv-name span:first-child,
.dm-conv-item.has-unread .dm-conv-preview {
    color: var(--text);
    font-weight: 700;
}
.dm-conv-unread {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
}

/* ── Chat area ────────────────────────────────────────────────────── */
.dm-chat-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.dm-chat-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem 1.1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}
.dm-chat-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--r-full);
    object-fit: cover;
}
.dm-chat-header-name {
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.2;
}
.dm-chat-header-dept {
    font-size: .76rem;
    color: var(--text-faint);
    margin-top: .1rem;
}

/* Messages scroll region */
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    background: var(--surface-2);
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.dm-messages::-webkit-scrollbar { width: 8px; }
.dm-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* Single message row */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    max-width: 78%;
    margin-right: auto;
}
.chat-msg.own {
    margin-left: auto;
    margin-right: 0;
    flex-direction: row-reverse;
}
.chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
}
.chat-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .55rem .8rem;
    border-radius: var(--r-lg);
    border-bottom-left-radius: var(--r-xs);
    box-shadow: var(--shadow-xs);
    min-width: 0;
}
.chat-msg.own .chat-bubble {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    border-radius: var(--r-lg);
    border-bottom-right-radius: var(--r-xs);
    border-bottom-left-radius: var(--r-lg);
}
.chat-text {
    font-size: .9rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.chat-msg.own .chat-text a {
    color: #fff;
    text-decoration: underline;
}
.chat-attachment {
    display: block;
    margin-top: .4rem;
}
.chat-attachment img {
    max-width: 220px;
    max-height: 240px;
    border-radius: var(--r-sm);
    object-fit: cover;
}
.chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .35rem;
    padding: .35rem .6rem;
    background: var(--surface-3);
    border-radius: var(--r-sm);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}
.chat-msg.own .chat-attachment-file {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
.chat-time {
    font-size: .68rem;
    color: var(--text-faint);
    margin-top: .25rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.chat-msg.own .chat-time {
    justify-content: flex-end;
    color: rgba(255, 255, 255, .8);
}
.dm-read-receipt {
    font-size: .68rem;
    letter-spacing: -.5px;
}

/* Input area */
.dm-input-area {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .8rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.chat-attach {
    width: 38px;
    height: 38px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.chat-attach:hover {
    background: var(--surface-3);
    color: var(--text);
}
.dm-input {
    flex: 1;
    min-width: 0;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface-2);
    font-size: .9rem;
    outline: none;
    transition: var(--transition);
}
.dm-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--ring);
}
.dm-send-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--r-full);
    font-size: 1rem;
}

/* Empty chat state */
.dm-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: var(--text-faint);
    text-align: center;
    padding: 2rem;
}
.dm-empty-icon {
    font-size: 2.8rem;
    opacity: .55;
}
.dm-empty p {
    font-size: .92rem;
    color: var(--text-muted);
}

/* ============================================================================
   Floating widget — inner views (beyond foundation .dm-panel primitives)
   ============================================================================ */

/* Picker search row */
.dm-panel-search {
    padding: .6rem .7rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.dm-panel-search .form-control {
    width: 100%;
}

/* Inbox / picker list items (rendered into .dm-panel-list) */
.dm-conv-row,
.dm-user-pick {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .8rem;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--surface-3);
    transition: var(--transition);
}
.dm-conv-row:hover,
.dm-user-pick:hover {
    background: var(--surface-2);
    color: var(--text);
}
.dm-conv-row.has-unread {
    background: var(--primary-soft);
}
.dm-conv-row-avatar,
.dm-user-pick-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
}
.dm-conv-row-info,
.dm-user-pick-info {
    min-width: 0;
    flex: 1;
}
.dm-conv-row-name,
.dm-user-pick-name {
    font-weight: 600;
    font-size: .86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dm-conv-row-preview,
.dm-user-pick-dept {
    font-size: .76rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: .05rem;
}
.dm-conv-row.has-unread .dm-conv-row-name,
.dm-conv-row.has-unread .dm-conv-row-preview {
    font-weight: 700;
    color: var(--text);
}
.dm-conv-row-unread {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.dm-conv-row-time {
    font-size: .68rem;
    color: var(--text-faint);
    flex-shrink: 0;
}

/* Mini conversation view */
.dm-panel-chat {
    min-height: 0;
}
.dm-panel-chat .dm-panel-head {
    gap: .55rem;
}
.dm-panel-chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex-shrink: 0;
}
.dm-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    background: var(--surface-2);
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.dm-panel-messages::-webkit-scrollbar { width: 7px; }
.dm-panel-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* Message bubbles inside widget (JS-rendered .dm-msg / .dm-msg.own) */
.dm-msg {
    max-width: 82%;
    margin-right: auto;
}
.dm-msg.own {
    margin-left: auto;
    margin-right: 0;
}
.dm-msg-bubble {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .45rem .7rem;
    border-radius: var(--r-lg);
    border-bottom-left-radius: var(--r-xs);
    font-size: .85rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    box-shadow: var(--shadow-xs);
}
.dm-msg.own .dm-msg-bubble {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    border-bottom-left-radius: var(--r-lg);
    border-bottom-right-radius: var(--r-xs);
}
.dm-msg-time {
    font-size: .64rem;
    color: var(--text-faint);
    margin-top: .15rem;
    padding: 0 .35rem;
}
.dm-msg.own .dm-msg-time {
    text-align: right;
}

/* Compose / input row in widget */
.dm-panel-input,
.dm-compose {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .7rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.dm-panel-input-field,
.dm-compose-input {
    flex: 1;
    min-width: 0;
    padding: .5rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface-2);
    font-size: .85rem;
    outline: none;
    transition: var(--transition);
}
.dm-panel-input-field:focus,
.dm-compose-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--ring);
}
.dm-panel-send,
.dm-compose-send {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: var(--transition);
}
.dm-panel-send:hover,
.dm-compose-send:hover {
    background: var(--primary-hover);
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .dm-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        gap: .9rem;
    }
    .dm-sidebar {
        max-height: 46vh;
    }
    .dm-chat-area {
        height: 72vh;
        min-height: 420px;
    }
    .chat-msg,
    .dm-msg {
        max-width: 86%;
    }
}

/* ===================== audit ===================== */
/* ============================================================================
   Audit log viewer — filter bar, admin table, action chips, pagination.
   ============================================================================ */

.audit-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

/* ── Header ──────────────────────────────────────────────────────── */
.audit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.audit-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.audit-count {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: var(--r-full);
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 600;
}

/* ── Filter bar ──────────────────────────────────────────────────── */
.audit-filters {
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.1rem;
}
.audit-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.audit-filter-field {
    flex: 1 1 180px;
    min-width: 0;
    margin: 0;
}
.audit-filter-field .form-label {
    margin-bottom: .35rem;
}
.audit-filter-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    padding-bottom: 1px;
}

/* ── Toolbar (optional hook) ─────────────────────────────────────── */
.audit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* ── Log table ───────────────────────────────────────────────────── */
.audit-table-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.audit-table-wrap::-webkit-scrollbar { height: 8px; }
.audit-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.audit-table th {
    text-align: left;
    padding: .7rem .9rem;
    font-size: .74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.audit-table td {
    padding: .65rem .9rem;
    border-bottom: 1px solid var(--surface-3);
    vertical-align: middle;
}
.audit-table tbody tr:last-child td {
    border-bottom: none;
}
.audit-table tbody tr {
    transition: var(--transition);
}
.audit-table tbody tr:hover td {
    background: var(--surface-2);
}

.audit-col-date { width: 1%; white-space: nowrap; }
.audit-col-ip { width: 1%; white-space: nowrap; }

/* Row hook */
.audit-row { transition: var(--transition); }

/* Date / time cell */
.audit-date,
.audit-time {
    color: var(--text-muted);
    font-size: .82rem;
    white-space: nowrap;
}

/* User cell */
.audit-user {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}
.audit-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--surface-3);
}
.audit-avatar-system {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    background: var(--primary-soft);
    border-color: var(--primary-100);
}
.audit-user-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Action chip */
.audit-badge,
.audit-action {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    border-radius: var(--r-full);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}
.audit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex: 0 0 auto;
}

/* Entity type */
.audit-entity {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
}

/* Description */
.audit-desc {
    color: var(--text);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* IP address */
.audit-ip {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
    font-size: .8rem;
    color: var(--text-faint);
    white-space: nowrap;
}

/* Empty row */
.audit-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem !important;
    font-size: .9rem;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.audit-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.audit-pager-info {
    font-size: .82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .audit-wrap { padding: 1.1rem .85rem 2.5rem; }
    .audit-title { font-size: 1.35rem; }
    .audit-filter-form { gap: .75rem; }
    .audit-filter-field { flex: 1 1 100%; }
    .audit-filter-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .audit-table { font-size: .82rem; }
    .audit-table th,
    .audit-table td { padding: .55rem .65rem; }
    .audit-desc { max-width: 180px; }
    .audit-user-name { max-width: 110px; }
    .audit-pager { gap: .6rem; padding: .85rem; }
}

/* ===================== profile ===================== */
/* ============================================================================
   FEATURE: Profile (edit + public view)
   Scoped under .profile-wrap; uses foundation tokens & primitives.
   ============================================================================ */

.profile-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 3rem;
}

/* ── Header / breadcrumb ──────────────────────────────────────────── */
.profile-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.profile-page-header h1 {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.profile-breadcrumb {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.profile-breadcrumb a { color: var(--primary); font-weight: 600; }
.profile-breadcrumb a:hover { color: var(--primary-hover); }
.profile-breadcrumb-sep { color: var(--text-faint); }

/* ── Layout grid (sidebar + main) ─────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.profile-side {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    min-width: 0;
}
.profile-main {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

/* ── Card header (used by profile cards / picker) ─────────────────── */
.profile-wrap .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .95rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.profile-wrap .card-title {
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .45rem;
}

/* ── Summary / identity card ──────────────────────────────────────── */
.profile-summary {
    padding: 1.6rem 1.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Avatar upload (edit page) */
.profile-avatar-upload {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto .9rem;
}
.profile-avatar-upload img {
    width: 132px;
    height: 132px;
    border-radius: var(--r-full);
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border), var(--shadow);
    background: var(--surface-3);
}
.profile-avatar-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    background: var(--primary);
    color: var(--on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--surface), var(--shadow-sm);
    transition: var(--transition);
}
.profile-avatar-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.06);
}

/* Avatar (public view) */
.profile-view-avatar {
    width: 132px;
    height: 132px;
    border-radius: var(--r-full);
    object-fit: cover;
    margin: 0 auto .9rem;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border), var(--shadow);
    background: var(--surface-3);
}

/* Summary text */
.profile-summary-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    margin-top: .4rem;
}
.profile-summary-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: .2rem;
}
.profile-summary-dept {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .1rem;
}
.profile-summary-bio {
    font-size: .86rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
    width: 100%;
    text-align: left;
}

.profile-summary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
    width: 100%;
}

/* The "choose avatar" button sits between avatar block and name */
.profile-summary > .btn {
    margin-top: -.2rem;
    margin-bottom: .4rem;
}

/* ── Info list ────────────────────────────────────────────────────── */
.profile-info-list {
    width: 100%;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .15rem;
    text-align: left;
}
.profile-info-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    font-size: .86rem;
    border-bottom: 1px solid var(--surface-3);
}
.profile-info-item:last-child { border-bottom: none; }
.profile-info-label {
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.profile-info-item > span:last-child,
.profile-info-item > a {
    text-align: right;
    word-break: break-word;
    min-width: 0;
}
.profile-info-item a { color: var(--primary); font-weight: 500; }
.profile-info-item a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ── Edit forms ───────────────────────────────────────────────────── */
.profile-form {
    padding: 1.25rem;
}
.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.profile-form .btn {
    margin-top: .3rem;
}
.profile-password-card .form-group:last-of-type {
    margin-bottom: 1rem;
}

/* ── Avatar picker ────────────────────────────────────────────────── */
.profile-avatar-picker form {
    padding: 1.25rem;
}
.preset-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: .65rem;
}
.preset-avatar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .55rem .35rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    cursor: pointer;
    transition: var(--transition);
}
.preset-avatar-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.preset-avatar-btn img {
    width: 52px;
    height: 52px;
    border-radius: var(--r-full);
    object-fit: cover;
    background: var(--surface-3);
}
.preset-avatar-label {
    font-size: .68rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.preset-avatar-btn.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: var(--ring);
}
.preset-avatar-btn.active .preset-avatar-label {
    color: var(--primary);
    font-weight: 700;
}

.profile-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* ── Posts column (public view) ───────────────────────────────────── */
.profile-posts-heading {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-side {
        position: static;
    }
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
    .profile-form,
    .profile-avatar-picker form {
        padding: 1.1rem;
    }
    .profile-wrap .card-header {
        padding: .85rem 1.1rem;
    }
}

/* ============================================================================
   App footer — copyright + version link to changelog (ports legacy footer)
   ============================================================================ */
.app-footer {
    text-align: center;
    padding: 1.75rem 1.5rem 2.5rem;
    color: var(--text-faint, #94a3b8);
    font-size: .8rem;
}
.app-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }
.app-footer .app-footer-version {
    margin-left: .35rem;
    padding: .1rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm, 6px);
    font-size: .74rem;
}
.app-footer .app-footer-version:hover {
    background: var(--primary-soft, #eef2ff);
    text-decoration: none;
}

/* ============================================================================
   Dashboard restored widgets — profile card, enriched announcements, latest-poll,
   date + weather (Open-Meteo), grouped strikes, quick-post media/emoji, chat online.
   Ports the legacy 3-column dashboard widgets onto the Symfony home.
   ============================================================================ */

/* ── Profile card (left column) ── */
.dash-profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.dash-profile-avatar { width: 64px; height: 64px; border-radius: var(--r-full); object-fit: cover; border: 3px solid var(--primary-soft); margin-bottom: .55rem; }
.dash-profile-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.dash-profile-dept { font-size: .78rem; color: var(--text-muted); margin-bottom: .4rem; }
.dash-profile-card .dash-links { width: 100%; align-self: stretch; padding: .35rem 0 0; }

/* ── Enriched announcements widget ── */
.dash-announce-head { display: flex; align-items: center; gap: .45rem; margin: 0; }
.dash-announce .dash-announce-head { font-size: .85rem; color: var(--text); margin-top: 0; }
.dash-announce .dash-announce-head strong { font-weight: 700; font-size: .85rem; color: var(--text); }
.dash-announce-head .dash-ann-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 0; background: var(--info); }
.dash-ann-dot-urgent { background: var(--danger) !important; }
.dash-ann-dot-important { background: var(--warning) !important; }
.dash-ann-dot-normal { background: var(--info) !important; }
.dash-announce .dash-announce-excerpt { font-size: .76rem; color: var(--text-muted); margin: .25rem 0 .15rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-announce .dash-announce-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .1rem; }
.dash-announce .dash-announce-time { font-size: .72rem; color: var(--text-faint); }
.dash-announce .dash-announce-unread { font-size: .68rem; font-weight: 700; color: var(--danger); }
.dash-announce .dash-announce-acked { font-size: .68rem; font-weight: 600; color: var(--success); }

/* ── Latest-poll widget block (reuses .poll-card) ── */
.dash-widget-block { display: flex; flex-direction: column; gap: .5rem; }
.dash-widget-title-loose { margin-bottom: .2rem; }
.dash-widget-block .poll-card { margin: 0; }

/* ── Date + weather card ── */
.dash-date-card { text-align: center; }
.dash-date-big { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1; }
.dash-date-full { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.dash-weather { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); min-height: 48px; }
.dash-weather-loading { display: flex; align-items: center; justify-content: center; gap: .5rem; color: var(--text-faint); font-size: .76rem; }
.dash-weather-loading .spinner { margin: .3rem auto; }
.dash-weather-msg, .dash-weather-prompt { font-size: .8rem; color: var(--text-muted); padding: .3rem 0; }
.dash-weather-pin { font-size: 1.4rem; margin-bottom: .25rem; }
.dash-weather-hint { font-size: .7rem; color: var(--text-faint); margin-top: .3rem; }
.dash-weather-btn { margin-top: .5rem; background: var(--primary); color: #fff; border: none; padding: .4rem .8rem; border-radius: var(--r-sm); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.dash-weather-btn:hover { background: var(--primary-700, var(--primary)); filter: brightness(1.05); }
.dash-weather-now { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.dash-weather-icon { font-size: 2.2rem; }
.dash-weather-now-text { text-align: left; }
.dash-weather-temp { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.dash-weather-desc { font-size: .76rem; color: var(--text-muted); }
.dash-weather-meta { display: flex; justify-content: center; gap: 1rem; margin-top: .5rem; font-size: .74rem; color: var(--text-muted); }
.dash-weather-forecast { display: flex; justify-content: space-around; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.dash-weather-day { text-align: center; }
.dash-weather-day-name { font-size: .7rem; color: var(--text-faint); font-weight: 600; }
.dash-weather-day-icon { font-size: 1.1rem; }
.dash-weather-day-temps { font-size: .72rem; font-weight: 600; }
.dash-weather-max { color: var(--danger); }
.dash-weather-min { color: var(--info); }
.dash-weather-loc { font-size: .66rem; color: var(--text-faint); margin-top: .4rem; }

/* ── Strikes widget: date grouping + today highlight ── */
.dash-strike-day { font-size: .72rem; font-weight: 700; color: var(--text-muted); margin: .55rem 0 .25rem; }
.dash-strike-day:first-child { margin-top: 0; }
.dash-strike-today { background: var(--primary-soft); }
.dash-strike-empty { font-size: .82rem; color: var(--text-faint); text-align: center; padding: .5rem 0; }

/* ── Quick-post: photo upload + emoji ── */
.dash-quickpost-actions { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.dash-quickpost-photo { cursor: pointer; font-size: 1.15rem; line-height: 1; padding: .25rem; border-radius: var(--r-sm); transition: var(--transition); }
.dash-quickpost-photo:hover { background: var(--surface-3); }
.dash-quickpost-filecount { font-size: .72rem; color: var(--text-faint); }
.dash-quickpost .dash-quickpost-btn { margin-left: auto; }

/* ── Emoji picker (reusable) ── */
.emoji-toggle-btn { background: none; border: none; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: .25rem; border-radius: var(--r-sm); transition: var(--transition); }
.emoji-toggle-btn:hover { background: var(--surface-3); }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: .15rem; padding: .5rem; margin: .3rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); max-height: 180px; overflow-y: auto; }
.emoji-item { background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: .25rem; border-radius: var(--r-sm); transition: var(--transition); }
.emoji-item:hover { background: var(--primary-soft); transform: scale(1.15); }

/* ── Chat panel online count ── */
.chat-panel-online { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.chat-panel-online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex-shrink: 0; }

/* ── @mention autocomplete (mention-picker controller, appended to <body>) ── */
.mention-picker {
    position: absolute;
    z-index: 3000;
    min-width: 230px;
    max-width: 320px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: .3rem;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .5rem;
    border-radius: var(--r-sm);
    cursor: pointer;
}
.mention-item.active,
.mention-item:hover { background: var(--primary-soft); }
.mention-item-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mention-item-info { min-width: 0; line-height: 1.25; }
.mention-item-name { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-item-user { font-size: .76rem; color: var(--text-muted); }

/* ── Reaction summary: per-type pills + "who reacted" trigger ── */
.reaction-summary { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.reaction-summary.has-reactions { cursor: pointer; }
.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.reaction-summary.has-reactions:hover .reaction-pill { color: var(--primary); }
.reaction-summary-empty { font-size: .8rem; color: var(--text-faint); }

/* ── Reaction-users modal (tabs + list) ── */
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 .25rem;
    border-radius: var(--r-sm);
}
.modal-close:hover { color: var(--text); background: var(--surface-3); }
.reaction-modal { max-width: 420px; }
.reaction-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.reaction-tab {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.reaction-tab:hover { background: var(--surface-3); }
.reaction-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.reaction-users-list { display: flex; flex-direction: column; gap: .15rem; }
.reaction-user-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .5rem;
    border-radius: var(--r-sm);
    color: inherit;
}
.reaction-user-item:hover { background: var(--surface-2); color: inherit; }
.reaction-user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.reaction-user-name { flex: 1; font-size: .88rem; font-weight: 600; color: var(--text); }
.reaction-user-emoji { font-size: 1.1rem; }
.reaction-users-empty { text-align: center; padding: 1.5rem; color: var(--text-faint); }

/* ── Composer: upload previews with rotate / remove ── */
.upload-previews { display: flex; flex-wrap: wrap; gap: .55rem; }
.upload-preview-item {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.upload-preview-file { font-size: .68rem; color: var(--text-muted); padding: .3rem; text-align: center; word-break: break-word; }
.img-rotate-btn,
.img-remove-btn {
    position: absolute;
    top: 3px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .68);
    color: #fff;
    font-size: .9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-rotate-btn { left: 3px; }
.img-remove-btn { right: 3px; }
.img-rotate-btn:hover,
.img-remove-btn:hover { background: var(--primary); }

/* ── Inline poll widget embedded in a feed post (compact mode) ── */
.post-poll { margin: 0; }
.poll-card-feed {
    padding: .85rem;
    gap: .65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.poll-card-feed:hover { box-shadow: none; }
.poll-feed-all {
    margin-left: auto;
    font-size: .76rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.poll-feed-all:hover { text-decoration: underline; }

/* ── Auto-growing textareas (.auto-resize, grown by assets/app.js) ── */
.auto-resize { overflow: hidden; resize: none; }

/* ── Published-image edit rotation ── */
.post-image-wrapper { position: relative; }
.post-image-wrapper.editing { outline: 2px solid var(--primary); outline-offset: -2px; }
.img-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .6);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 2;
}
.post-image-wrapper:hover .img-edit-btn { opacity: 1; }
.img-edit-toolbar {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: flex;
    gap: .35rem;
    padding: .35rem;
    background: rgba(15, 23, 42, .82);
    border-radius: var(--r-sm);
    z-index: 3;
}
.img-tb-btn {
    border: none;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: .8rem;
    padding: .3rem .55rem;
    cursor: pointer;
}
.img-tb-btn:hover { background: rgba(255, 255, 255, .3); }
.img-tb-btn.save { background: var(--primary); }
.img-tb-btn.cancel { background: rgba(255, 255, 255, .12); }
.img-tb-btn:disabled { opacity: .6; cursor: default; }

/* ── Composer link preview: thumbnail chooser ── */
.composer-link-preview { position: relative; }
.lp-remove {
    position: absolute;
    top: .4rem;
    right: .4rem;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.lp-remove:hover { background: var(--danger, #ef4444); color: #fff; }
.lp-thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .55rem; }
.lp-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--surface-3);
}
.lp-thumb.selected { border-color: var(--primary); }
.lp-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.lp-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.lp-desc { font-size: .82rem; color: var(--text-muted); }
.lp-domain { font-size: .74rem; color: var(--text-faint); font-weight: 600; }

/* ── Comments: "view all" + per-comment emoji picker ── */
.view-all-comments {
    display: inline-block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    margin: .25rem 0 .5rem;
}
.view-all-comments:hover { text-decoration: underline; }
.comment-form { position: relative; }
.comment-emoji-btn { flex-shrink: 0; }
.comment-emoji-panel {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0;
    z-index: 60;
    width: 280px;
    margin: 0;
}
.composer-emoji-panel { width: 100%; }

/* ── Site-wide announcement banner (highest-priority unacked urgent/important) ── */
.ann-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.1rem;
    color: #fff;
    font-size: .9rem;
}
.ann-banner-important { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ann-banner-urgent { background: linear-gradient(135deg, #ef4444, #dc2626); }
.ann-banner-icon { font-size: 1.15rem; flex-shrink: 0; }
.ann-banner-text { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; }
.ann-banner-label {
    text-transform: uppercase;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .05em;
    background: rgba(255, 255, 255, .22);
    padding: .12rem .45rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.ann-banner-title {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ann-banner-title:hover { text-decoration: underline; }
.ann-banner-cta {
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: .95;
}
.ann-banner-cta:hover { text-decoration: underline; }
.ann-banner-dismiss {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
    opacity: .85;
    flex-shrink: 0;
}
.ann-banner-dismiss:hover { opacity: 1; }
@media (max-width: 640px) {
    .ann-banner-cta { display: none; }
}

/* ── Notification permission banner (notif_permission_controller) ── */
.notif-perm-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .65rem 1.1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: .88rem;
}
.notif-perm-msg { flex: 1; min-width: 200px; }
.notif-perm-banner .btn { flex-shrink: 0; }
.notif-perm-dismiss {
    background: rgba(255, 255, 255, .15);
    color: #fff;
    border-color: transparent;
}
.notif-perm-dismiss:hover { background: rgba(255, 255, 255, .28); color: #fff; }

/* ── Inactive announcement (dimmed in the admin list) + admin actions ── */
.announce-card.announce-inactive { opacity: .55; }
.announce-foot-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.announce-toggle-btn { padding: .3rem .5rem; font-size: 1rem; line-height: 1; }
.announce-admin-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── Settings: SMTP test-email row + custom-link editor + nav separator ── */
.admin-test-email { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.admin-test-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.admin-test-row .form-control { flex: 1; min-width: 220px; }
.admin-link-row { display: grid; grid-template-columns: 64px 1fr 1.6fr; gap: .5rem; margin-bottom: .5rem; }
.admin-link-icon { text-align: center; }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: .35rem 0; }
.admin-oauth-status { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.admin-oauth-badge { font-size: .76rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.admin-oauth-badge.is-on { background: #dcfce7; color: #166534; }
.admin-oauth-badge.is-off { background: var(--surface-3); color: var(--text-muted); }
@media (max-width: 560px) {
    .admin-link-row { grid-template-columns: 56px 1fr; }
}

/* ── Gallery lightbox navigation (prev/next, counter, close) ── */
.gallery-lightbox { cursor: default; }
.gallery-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--r); box-shadow: var(--shadow-lg); }
.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    z-index: 1;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(15, 23, 42, .82); }
.lightbox-close { top: 1rem; right: 1.25rem; width: 40px; height: 40px; border-radius: 50%; font-size: 1.6rem; line-height: 1; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border-radius: var(--r-sm); font-size: 2.2rem; line-height: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, .6);
    color: #fff;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
}

/* ── Gallery: admin delete-originals UI ── */
.gallery-album-admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.gallery-delete-originals { background: var(--warning); color: #1f2937; border-color: transparent; }
.gallery-delete-originals:hover { filter: brightness(.95); }
.space-savings {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--r-sm);
    font-size: .85rem;
    color: #92400e;
}
.gallery-originals-deleted {
    display: inline-block;
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: .8rem;
    padding: .4rem .8rem;
    background: var(--surface-3);
    border-radius: var(--r-sm);
}

/* ── Admin: invite-by-email bar ── */
.admin-invite-bar {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.admin-invite-label { font-weight: 600; font-size: .9rem; color: var(--text); }
.admin-invite-bar .form-control { flex: 1; min-width: 220px; }

/* ── Chat input: emoji picker (reused) + live presence ── */
.chat-input-bar { position: relative; }
.chat-emoji-btn { flex-shrink: 0; }
.chat-emoji-panel {
    position: absolute;
    bottom: calc(100% + 6px);
    right: .85rem;
    z-index: 60;
    width: 300px;
    max-width: calc(100% - 1.7rem);
    margin: 0;
}
