:root {
  color-scheme: dark;
  --bg: #07080f;
  --bg-2: #0c0e1a;
  --panel: #11142200;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf5;
  --muted: #8b92ab;
  --muted-2: #5d6582;
  --accent: #b14dff;
  --danger: #ff5470;
  --ok: #3ddc84;
  --rainbow: linear-gradient(90deg, #ff4d6d, #ffb84d, #ffe14d, #3ddc84, #4d9bff, #b14dff);
  --radius: 16px;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.85);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(177, 77, 255, 0.16), transparent 60%),
    radial-gradient(800px 480px at 92% 4%, rgba(77, 155, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(61, 220, 132, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  background: rgba(9, 11, 20, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  text-decoration: none;
}
.brand .logo {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--rainbow);
  box-shadow: 0 0 18px rgba(177, 77, 255, 0.5);
}
.brand .name {
  background: var(--rainbow); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; align-items: center; gap: 8px; }

.navlink {
  text-decoration: none; color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 10px;
}
.navlink:hover { color: var(--text); background: var(--card); }
.navuser { color: var(--muted); font-size: 14px; }
.navuser b { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  padding: 10px 16px; border-radius: 11px;
  font-size: 14px; font-weight: 600;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  border: none; color: #0a0612; font-weight: 800;
  background: var(--rainbow); background-size: 200% auto;
  box-shadow: 0 10px 30px -10px rgba(177, 77, 255, 0.6);
}
.btn.primary:hover { background-position: right center; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255, 84, 112, 0.4); }
.btn.danger:hover { background: rgba(255, 84, 112, 0.12); }
.btn.ok { color: var(--ok); border-color: rgba(61, 220, 132, 0.4); }
.btn.ok:hover { background: rgba(61, 220, 132, 0.12); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.add-btn {
  font-size: 15px; padding: 12px 20px;
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 30px; }
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.03em;
  font-weight: 850;
}
.hero h1 .grad {
  background: var(--rainbow); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue 8s linear infinite;
}
.hero p { color: var(--muted); font-size: 18px; max-width: 620px; margin-top: 16px; }
.hero .cta-row { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

@keyframes hue { to { background-position: 200% center; } }

.section-head {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0 18px;
}
.section-head h2 { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }
.section-head .count {
  font-size: 13px; color: var(--muted); background: var(--card);
  border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px;
}
.section-head .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- Gallery grid ---------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  padding-bottom: 70px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px); border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: #0e1322; border-bottom: 1px solid var(--border);
}
.thumb .frame-wrap {
  position: absolute; inset: 0; pointer-events: none;
  overflow: hidden;
}
.thumb iframe {
  width: 1280px; height: 800px; border: 0; background: #fff;
  transform: scale(0.27); transform-origin: top left;
}
.thumb .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 7px;
  background: rgba(8, 10, 18, 0.78); border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
}
.thumb .badge.url { color: #6db8ff; }
.thumb .badge.html { color: #ffb84d; }
.thumb .views {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  font-size: 12px; font-weight: 600; color: #cdd3e6;
  padding: 4px 9px; border-radius: 7px;
  background: rgba(8, 10, 18, 0.78); border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.thumb .overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 40%, rgba(7, 8, 15, 0.15));
}
.card .body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .body h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card .body p { color: var(--muted); font-size: 13.5px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.card .author { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.card .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rainbow); display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #0a0612;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--card);
}
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 5, 10, 0.72); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 6vh 18px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 620px;
  background: linear-gradient(180deg, #11142a, #0c0e1a);
  border: 1px solid var(--border-strong); border-radius: 20px;
  box-shadow: var(--shadow);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal.drag-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.modal .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
}
.modal .head h2 { font-size: 19px; font-weight: 750; }
.modal .x { background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; }
.modal .x:hover { color: var(--text); }
.modal .body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .textarea {
  width: 100%; background: rgba(0, 0, 0, 0.28); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 11px;
  padding: 11px 13px; font-size: 14.5px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(177, 77, 255, 0.18); }
.textarea { resize: vertical; min-height: 200px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

.mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); border-radius: 12px; padding: 5px;
}
.mode-toggle button {
  border: none; background: transparent; color: var(--muted);
  padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700;
  transition: all .15s ease;
}
.mode-toggle button.active { background: var(--rainbow); color: #0a0612; }

.checkrow { display: flex; align-items: center; gap: 10px; }
.checkrow input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkrow label { font-size: 14px; color: var(--text); }
.hint { font-size: 12.5px; color: var(--muted-2); }

.modal .foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 18px 22px; border-top: 1px solid var(--border);
}
.form-error { color: var(--danger); font-size: 13.5px; min-height: 18px; flex: 1; text-align: left; }

/* ---------- Auth modal ---------- */
.auth-modal { max-width: 420px; }
.auth-tabs { display: flex; gap: 6px; background: rgba(0,0,0,.3); border:1px solid var(--border); border-radius: 12px; padding: 5px; }
.auth-tabs button { flex: 1; border: none; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.auth-tabs button.active { background: var(--card-hover); color: var(--text); }

/* ---------- Dashboard works table cards ---------- */
.work-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  transition: border-color .2s ease;
}
.work-row:hover { border-color: var(--border-strong); }
.work-row .mini {
  width: 88px; height: 58px; border-radius: 9px; overflow: hidden;
  background: #0e1322; border: 1px solid var(--border); flex-shrink: 0; position: relative;
}
.work-row .mini iframe { width: 1280px; height: 800px; border: 0; transform: scale(0.0688); transform-origin: top left; pointer-events: none; background:#fff; }
.work-row .info { flex: 1; min-width: 0; }
.work-row .info h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.work-row .info p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-row .actions { display: flex; gap: 8px; flex-shrink: 0; }

.tag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-strong);
}
.tag.url { color: #6db8ff; } .tag.html { color: #ffb84d; }
.tag.hidden { color: var(--muted); } .tag.suspended { color: var(--danger); border-color: rgba(255,84,112,.4); }
.tag.active { color: var(--ok); } .tag.admin { color: #c98bff; }

.stack { display: flex; flex-direction: column; gap: 12px; padding-bottom: 70px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  background: var(--rainbow); filter: blur(40px); opacity: .25; border-radius: 50%;
}
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 38px; font-weight: 850; letter-spacing: -0.02em; margin-top: 6px; }

/* ---------- Tables ---------- */
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 26px;
}
.panel .ph { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.cell-strong { font-weight: 700; color: var(--text); }
.cell-muted { color: var(--muted); }

.log-action {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
}
.log-action.login, .log-action.register { color: var(--ok); }
.log-action.create, .log-action.update { color: #6db8ff; }
.log-action.delete, .log-action.admin_remove, .log-action.admin_suspend { color: var(--danger); }
.log-action.admin_reinstate { color: var(--ok); }
.log-action.logout { color: var(--muted); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #11142a; border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastin .25s ease;
}
.toast.error { border-color: rgba(255,84,112,.5); }
.toast.ok { border-color: rgba(61,220,132,.5); }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Misc ---------- */
.center-note { text-align: center; color: var(--muted); padding: 60px 0; }
.guard {
  display: grid; place-items: center; min-height: 70vh; text-align: center;
}
.guard .box { max-width: 380px; }
.guard h2 { font-size: 24px; margin-bottom: 10px; }
.guard p { color: var(--muted); margin-bottom: 22px; }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .topbar .name-full { display: none; }
}

/* ====================================================================
   RAINBOW INTRO SPLASH
   ==================================================================== */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: #04050a; overflow: hidden;
  cursor: pointer;
}
.splash.hidden { display: none; }

.splash .aurora {
  position: absolute; width: 160vmax; height: 160vmax;
  background: conic-gradient(from 0deg,
    #ff4d6d, #ffb84d, #ffe14d, #3ddc84, #4d9bff, #b14dff, #ff4d6d);
  filter: blur(90px); opacity: 0.55;
  border-radius: 45%;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.splash .ring {
  position: absolute; border-radius: 50%;
  border: 2px solid transparent;
  background: var(--rainbow) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  width: 120px; height: 120px; opacity: 0;
  animation: ringpulse 2.6s ease-out infinite;
}
.splash .ring.r2 { animation-delay: .5s; }
.splash .ring.r3 { animation-delay: 1s; }
@keyframes ringpulse {
  0% { width: 80px; height: 80px; opacity: .9; }
  100% { width: 900px; height: 900px; opacity: 0; }
}

.splash .center { position: relative; text-align: center; z-index: 2; }
.splash .wordmark {
  font-size: clamp(46px, 12vw, 132px); font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(90deg, #ff4d6d, #ffb84d, #ffe14d, #3ddc84, #4d9bff, #b14dff, #ff4d6d);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative;
  animation: wordin 1.1s cubic-bezier(.2,.8,.2,1) both, hue 6s linear infinite 1.1s;
  filter: drop-shadow(0 8px 40px rgba(177,77,255,.4));
}
.splash .wordmark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.85) 50%, transparent 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 220% auto;
  animation: shimmer 2.4s ease-in-out .9s infinite;
}
@keyframes wordin {
  0% { opacity: 0; transform: perspective(800px) rotateX(40deg) scale(.6); filter: blur(22px); }
  100% { opacity: 1; transform: perspective(800px) rotateX(0) scale(1); filter: blur(0); }
}
@keyframes shimmer { 0% { background-position: 200% center; } 60%, 100% { background-position: -120% center; } }

.splash .subtitle {
  margin-top: 14px; font-size: clamp(13px, 2vw, 17px); letter-spacing: .42em;
  text-transform: uppercase; color: #aab1c9; font-weight: 600;
  opacity: 0; animation: subin .7s ease 1s forwards;
}
@keyframes subin { to { opacity: 1; letter-spacing: .3em; } }

.splash .skip {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-size: 12.5px; color: #757c97; letter-spacing: .06em;
  opacity: 0; animation: subin .6s ease 1.4s forwards;
}

/* Exit: rainbow curtain wipe + zoom */
.splash.leaving { animation: splashzoom .9s cubic-bezier(.7,0,.84,0) forwards; }
@keyframes splashzoom {
  to { transform: scale(1.5); opacity: 0; }
}
.splash .curtain {
  position: absolute; inset: 0; z-index: 5;
  background: var(--rainbow); background-size: 300% 100%;
  transform: scaleY(0); transform-origin: bottom;
}
.splash.leaving .curtain { animation: curtain .9s cubic-bezier(.76,0,.24,1) forwards; }
@keyframes curtain {
  0% { transform: scaleY(0); transform-origin: bottom; }
  45% { transform: scaleY(1); transform-origin: bottom; }
  55% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: top; }
}

@media (prefers-reduced-motion: reduce) {
  .splash .aurora, .splash .ring, .splash .wordmark, .splash .wordmark::after,
  .splash .subtitle, .splash .skip { animation: none !important; opacity: 1; }
  .splash .wordmark { transform: none; filter: none; }
  .splash.leaving { animation: fadeout .3s ease forwards; }
  @keyframes fadeout { to { opacity: 0; } }
  .hero h1 .grad, .brand .name { animation: none; }
}

/* ---- Add team member (admin) ---- */
.add-worker { display: flex; gap: 10px; padding: 16px 18px; flex-wrap: wrap; align-items: center; }
.add-worker .input { flex: 1; min-width: 160px; }
.add-worker select.input { flex: 0 0 130px; }

/* ---- Team chat ---- */
.chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  height: calc(100vh - 230px);
  min-height: 420px;
  padding-bottom: 28px;
}
.roster {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  overflow-y: auto;
}
.roster h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 12px;
}
.roster .member {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 6px; border-radius: 9px; font-size: 14px;
}
.roster .member .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); flex-shrink: 0;
}
.roster .member .dot.off { background: var(--muted); }
.roster .member .nm {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.chat-main {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; min-width: 0;
}
.chat-feed {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: 74%; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; padding: 0 4px; }
.msg .bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 9px 13px; border-radius: 13px;
  font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.msg.mine { align-self: flex-end; }
.msg.mine .who { text-align: right; }
.msg.mine .bubble {
  background: linear-gradient(135deg, #7c3aed, #b14dff);
  color: #fff; border: none;
}
.chat-input {
  display: flex; gap: 10px; padding: 14px;
  border-top: 1px solid var(--border);
}
.chat-input .input { flex: 1; }

/* ---- Tasks ---- */
.assign-form {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 16px 18px;
}
.assign-form .full { grid-column: 1 / -1; }
.task-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; gap: 14px; align-items: flex-start;
}
.task-card.done { opacity: 0.6; }
.task-card .tmain { flex: 1; min-width: 0; }
.task-card h3 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.task-card.done h3 { text-decoration: line-through; }
.task-card p { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.task-card .tmeta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.task-card .tactions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 720px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .roster { max-height: 160px; }
  .chat-main { height: 70vh; }
  .assign-form { grid-template-columns: 1fr; }
}

/* ---- Home hub ---- */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 26px;
}
.hub-link { text-decoration: none; transition: transform 0.12s ease, border-color 0.12s ease; }
.hub-link:hover { transform: translateY(-2px); border-color: var(--accent); }
.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 36px;
}
.hub-card.wide { grid-column: 1 / -1; }
.hub-card .ph {
  display: flex; align-items: center; justify-content: space-between;
}
.hub-card .ph .navlink { font-size: 13px; padding: 4px 8px; }
.hub-body { padding: 6px 8px 12px; }
.hub-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
}
.hub-row + .hub-row { border-top: 1px solid var(--border); }
.hub-row-main { flex: 1; min-width: 0; }
.hub-row-main b { font-size: 14px; }
.hub-row-main p {
  color: var(--muted); font-size: 13px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-meta { font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.hub-empty { color: var(--muted); font-size: 14px; padding: 18px 12px; text-align: center; }
.hub-sites {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 6px 0 4px;
}
.mini-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: rgba(255, 255, 255, 0.02); transition: transform 0.12s ease, border-color 0.12s ease;
}
.mini-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.mini-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: #0a0b16; border-bottom: 1px solid var(--border);
}
.mini-thumb iframe {
  position: absolute; top: 0; left: 0;
  width: 200%; height: 200%; transform: scale(0.5); transform-origin: top left;
  border: 0; pointer-events: none;
}
.mini-body { padding: 10px 12px; }
.mini-body b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-body span { font-size: 12px; color: var(--muted); }

/* ---- News / announcements ---- */
.news-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  display: flex; gap: 14px; align-items: flex-start;
}
.news-card .news-main { flex: 1; min-width: 0; }
.news-card h3 { font-size: 16px; font-weight: 750; }
.news-card p { color: var(--text); opacity: 0.85; font-size: 14px; margin-top: 6px; white-space: pre-wrap; line-height: 1.5; }
.news-card .news-meta { font-size: 12px; color: var(--muted); margin-top: 10px; }

@media (max-width: 820px) {
  .hub-stats { grid-template-columns: repeat(2, 1fr); }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-sites { grid-template-columns: repeat(2, 1fr); }
}
