/* ==========================================================================
   HR Hub – application stylesheet
   ========================================================================== */
:root {
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --blue: #1f4e9c;
  --blue-dark: #173d7a;
  --blue-soft: #e8effa;
  --text: #1f2a44;
  --text-2: #4b5563;
  --muted: #6b7280;
  --border: #e5e8ee;
  --bg: #f6f7fa;
  --card: #ffffff;
  --success: #2f9e44;
  --danger: #d64545;
  --warning: #e8611a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .12);
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
img, svg { display: inline-block; vertical-align: middle; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.2; }
p { margin: 0 0 .75em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { width: 1.5em; height: 1.5em; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.container { max-width: var(--container); margin: 0 auto; padding-inline: 24px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(31, 78, 156, .45); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 8px;
  font-weight: 700; font-size: 14.5px; border: 1.5px solid transparent; transition: .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--outline { background: #fff; color: var(--text); border-color: #c9cfda; }
.btn--outline:hover { border-color: var(--blue); color: var(--blue); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: #eef0f4; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: 13.5px; }
.btn--block { width: 100%; justify-content: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.icon-btn--danger:hover { background: #fdecec; color: var(--danger); }
.icon-btn .count { position: absolute; top: -4px; right: -4px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 22px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 44px; width: auto; max-width: 150px; object-fit: contain; }
.brand-text { font-weight: 800; font-size: 15px; letter-spacing: .02em; color: #2b3345; white-space: nowrap; }
.brand-text--strong { font-size: 22px; color: var(--blue); }
.brand-divider { width: 1px; height: 40px; background: var(--border); }
.main-nav { display: flex; align-items: center; gap: 8px; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 18px 8px; color: var(--text);
  font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; position: relative;
}
.nav-item:hover { text-decoration: none; color: var(--blue); }
.nav-item.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.nav-item .icon { width: 24px; height: 24px; }
.nav-icon-wrap { position: relative; display: inline-flex; }
.badge { position: absolute; top: -8px; right: -12px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.user-menu { position: relative; margin-left: 12px; }
.user-menu-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 8px; border-radius: 10px; font-weight: 700; }
.user-menu-btn:hover { background: #f2f4f8; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar--initials { display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 15px; }
.avatar--xl { width: 88px; height: 88px; font-size: 28px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 240px; padding: 8px; display: none; z-index: 60;
}
.dropdown.is-open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; text-align: left; font-weight: 600; font-size: 14px; }
.dropdown a:hover, .dropdown button:hover { background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.dropdown-header { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-header small { color: var(--muted); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 42px; height: 42px; align-items: center; justify-content: center; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; min-height: 320px;
  background: linear-gradient(100deg, #e9eff6 0%, #dde6ef 45%, #cfd9e4 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 78% 30%, rgba(255,255,255,.55), transparent 32%),
    radial-gradient(circle at 92% 80%, rgba(31,78,156,.18), transparent 30%),
    radial-gradient(circle at 60% 90%, rgba(74,156,46,.14), transparent 25%);
}
.hero.has-image { background-image: var(--hero-image); background-size: cover; background-position: right center; }
.hero.has-image::before { background: linear-gradient(90deg, rgba(232,239,246,.96) 0%, rgba(232,239,246,.9) 35%, rgba(232,239,246,.35) 60%, rgba(232,239,246,0) 80%); }
.hero-inner { position: relative; padding-block: 64px 56px; max-width: 720px; margin-left: 0; }
.hero-kicker { font-size: 26px; font-weight: 600; color: #2b3345; margin: 0; }
.hero-title { font-size: clamp(48px, 7vw, 78px); font-weight: 900; color: #1c2331; letter-spacing: -.02em; margin: 2px 0 10px; }
.hero-sub { font-size: 19px; color: #2b3345; margin: 0 0 30px; }
.search { position: relative; display: flex; align-items: center; background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(16,24,40,.12); max-width: 720px; }
.search input {
  flex: 1; border: 0; background: transparent; padding: 17px 20px; font-size: 16px; border-radius: 10px; min-width: 0;
}
.search input:focus { outline: none; }
.search button { border: 0; background: transparent; padding: 0 18px; color: var(--text); display: flex; align-items: center; height: 56px; }
.search button:hover { color: var(--blue); }
.search--page { box-shadow: none; border: 1px solid var(--border); margin-bottom: 20px; max-width: none; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 40; max-height: 420px; overflow: auto; padding: 6px;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.is-focused { background: var(--blue-soft); text-decoration: none; }
.search-results .sr-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sr-color, var(--blue)); color: #fff; flex-shrink: 0; }
.search-results .sr-icon .icon { width: 18px; height: 18px; }
.search-results .sr-text { min-width: 0; display: flex; flex-direction: column; }
.search-results .sr-text strong { font-size: 14.5px; }
.search-results .sr-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .sr-type { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.search-results .sr-empty, .search-results .sr-all { padding: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* --------------------------------------------------------------------------
   Cards & home layout
   -------------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.section-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; color: #1c2331; }
.section-title--sm { font-size: 18px; margin-bottom: 16px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(280px, 1fr); gap: 24px; padding-block: 28px 12px; }
.home-grid > *, .topic-layout > * { min-width: 0; }
.topics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.topic-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 26px 20px 22px; border: 1px solid var(--border); border-radius: 12px; background: #fff; transition: .18s;
}
.topic-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #d8dee8; }
.topic-icon {
  width: 80px; height: 80px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tc, var(--blue)); color: #fff;
}
.topic-icon:hover { text-decoration: none; }
.topic-icon--lg { width: 88px; height: 88px; }
.topic-title { font-size: 18px; font-weight: 800; }
.topic-title a { color: var(--tc, var(--blue)); }
.topic-desc { font-size: 13.5px; color: #3d4757; margin: 0; }
.topic-view { margin-top: auto; }
.fav-btn {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent;
  color: #b8c0cc; display: inline-flex; align-items: center; justify-content: center; transition: .15s; z-index: 2;
}
.fav-btn:hover { background: #fff6dd; color: #f2a900; }
.fav-btn.is-on { color: #f2a900; }
.fav-btn.is-on .icon { fill: #f2a900; }

.quick-links { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; }
.quick-links li a { display: flex; align-items: center; gap: 14px; padding: 9px 4px; color: var(--text); font-weight: 600; font-size: 15px; border-radius: 8px; }
.quick-links li a:hover { background: var(--blue-soft); text-decoration: none; color: var(--blue); }
.ql-icon { width: 26px; height: 26px; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ql-icon .icon { width: 24px; height: 24px; }
.ql-icon--lg { width: 52px; height: 52px; border-radius: 50%; background: var(--blue-soft); }
.ql-icon--tinted { background: color-mix(in srgb, var(--tc, var(--blue)) 12%, #fff); color: var(--tc, var(--blue)); }
.link-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 8px; }
.link-more--right { display: flex; justify-content: flex-end; }
.announcements { list-style: none; margin: 0; padding: 0; }
.announcement { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.announcement:last-child { border-bottom: 0; }
.announcement h3 { font-size: 15px; font-weight: 800; }
.announcement h3 a { color: var(--text); }
.announcement p { font-size: 13.5px; color: #3d4757; margin: 4px 0 4px; }
.announcement time { font-size: 12px; color: var(--muted); }
.ann-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--tc, var(--blue)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ann-icon--lg { width: 44px; height: 44px; }
.announcement-full { display: flex; gap: 18px; }
.announcement-full h2 { font-size: 20px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.ann-meta { font-size: 13px; color: var(--muted); }
.announcement-full h2 a { color: var(--text); }
.announcement-page-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.announcement-page-head .page-title { font-size: 26px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.announcement-body { font-size: 16px; color: #2b3345; margin-bottom: 20px; white-space: normal; }
.help-text { color: #3d4757; font-size: 14.5px; margin-bottom: 16px; }
.empty { color: var(--muted); font-size: 14px; }

/* Popular tools carousel */
.tools-carousel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.carousel-btn { border: 0; background: transparent; color: #7a8494; width: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }
.carousel-btn:hover { background: var(--blue-soft); color: var(--blue); }
.tools-track { display: flex; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; }
.tools-track::-webkit-scrollbar { display: none; }
.tool {
  flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 12px;
  text-align: center; color: var(--text); border-right: 1px solid var(--border); font-size: 13px; font-weight: 700;
}
.tool:last-child { border-right: 0; }
.tool:hover { text-decoration: none; color: var(--blue); }
.tool-icon { width: 58px; height: 58px; border-radius: 50%; border: 1.5px solid #9fb2d4; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; background: #fff; transition: .15s; }
.tool:hover .tool-icon { background: var(--blue); color: #fff; border-color: var(--blue); }

/* --------------------------------------------------------------------------
   Generic pages
   -------------------------------------------------------------------------- */
.page { padding-block: 28px 12px; }
.page--narrow { max-width: 860px; }
.page-title { font-size: 30px; margin-bottom: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .page-title { margin-bottom: 0; }
.page-head-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb span { margin: 0 6px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.link-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 12px; transition: .15s; }
.link-card:hover { box-shadow: var(--shadow-lg); border-color: #d8dee8; }
.link-card-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 18px 20px; color: var(--text); }
.link-card-body:hover { text-decoration: none; }
.link-card-title { font-weight: 800; font-size: 15px; }
.link-card-url { font-size: 12.5px; color: var(--muted); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .icon { color: #c5cbd6; margin-bottom: 8px; }
.empty-state h2 { color: var(--text); font-size: 20px; margin-bottom: 6px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef1f5; color: #3d4757; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill--sharepoint { background: #e3f0ff; color: #0f5fc4; }
.pill--external { background: #eef1f5; }
.pill--document { background: #fff1e0; color: #b45309; }
.pill--form { background: #e8f7ec; color: #237a3a; }
.pill--internal { background: #efe7fb; color: #6b3fa0; }
.pill--video { background: #fdeaea; color: #b42323; }
.pill-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* Topic page */
.topic-header { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }
.topic-header-text { flex: 1; }
.topic-header-text p { color: #3d4757; margin: 0; font-size: 16px; }
.topic-header .page-title { margin-bottom: 4px; color: var(--tc, var(--text)); }
.topic-header-actions { display: flex; align-items: center; gap: 8px; }
.topic-header-actions .fav-btn { position: static; width: 40px; height: 40px; }
.topic-layout { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(280px, 1fr); gap: 24px; }
.resource-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.resource { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 12px; transition: .15s; }
.resource:hover { box-shadow: var(--shadow); border-color: #d8dee8; }
.resource-main { display: flex; gap: 16px; align-items: flex-start; padding: 18px 56px 18px 18px; color: var(--text); }
.resource-main:hover { text-decoration: none; }
.resource-icon { width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--tc, var(--blue)) 12%, #fff); color: var(--tc, var(--blue)); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.resource-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.resource-title { font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.resource-title .icon { color: var(--muted); }
.resource-desc { font-size: 14px; color: #3d4757; }
.resource-meta { margin-top: 4px; }
.resource .fav-btn { top: 50%; transform: translateY(-50%); right: 14px; }

/* Notifications */
.notif-list { padding: 8px; }
.notif { border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; background: none; border: 0; text-align: left; border-radius: 8px; }
.notif-btn:hover { background: var(--blue-soft); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.notif.is-unread .notif-dot { background: var(--blue); }
.notif.is-unread strong { color: var(--blue); }
.notif-body { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; }
.notif-body time { font-size: 12px; color: var(--muted); }
.notif-arrow { color: #b8c0cc; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form label, .form .label { font-weight: 700; font-size: 14px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="search"], .form input[type="number"], .form input[type="datetime-local"], .form select, .form textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid #cfd5df; border-radius: 8px; background: #fff; font-size: 15px; transition: .15s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,78,156,.15); }
.form input[readonly], .form input[disabled] { background: #f2f4f8; color: var(--muted); }
.form textarea { resize: vertical; min-height: 90px; }
.form input[type="file"] { font-size: 14px; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 0; font-weight: 600; }
.help { color: var(--muted); font-size: 12.5px; margin: 0; }
.req { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid--admin { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.form-grid--admin .field { grid-column: span 12; }
.form-grid--admin .field--half { grid-column: span 6; }
.form-grid--admin .field--third { grid-column: span 4; }
.form-grid--admin .field--quarter { grid-column: span 3; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--blue); width: 16px; height: 16px; }
.check--box { padding: 12px 14px; border: 1.5px solid #cfd5df; border-radius: 8px; width: 100%; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.input-with-btn { position: relative; }
.input-with-btn input { padding-right: 44px; }
.input-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.input-btn:hover { color: var(--blue); background: var(--blue-soft); }
.profile-avatar-row { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.inline-search { display: flex; gap: 6px; }
.inline-search input { padding: 8px 12px; border: 1.5px solid #cfd5df; border-radius: 8px; min-width: 220px; }

/* Icon & colour pickers */
.icon-picker { border: 1.5px solid #cfd5df; border-radius: 8px; padding: 10px; }
.icon-filter { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow: auto; }
.icon-option { width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); position: relative; }
.icon-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-option:hover { border-color: var(--blue); color: var(--blue); }
.icon-option:has(input:checked) { background: var(--blue); border-color: var(--blue); color: #fff; }
.icon-option.is-hidden { display: none; }
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-option { width: 36px; height: 36px; position: relative; cursor: pointer; }
.color-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.color-option span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--border); }
.color-option:has(input:checked) span { box-shadow: 0 0 0 3px var(--text); }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.perm-group { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.perm-group legend { font-weight: 800; padding: 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Flash */
.flash-stack { max-width: var(--container); margin: 16px auto 0; padding-inline: 24px; display: flex; flex-direction: column; gap: 8px; }
.admin-main .flash-stack { padding-inline: 0; margin-top: 0; margin-bottom: 16px; }
.auth-wrap .flash-stack { padding-inline: 0; width: 100%; max-width: 440px; margin-bottom: 12px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid; margin-bottom: 12px; }
.flash--success { background: #e9f8ee; border-color: #b7e4c5; color: #1e6b33; }
.flash--error { background: #fdecec; border-color: #f5c2c2; color: #9b2323; }
.flash--info { background: var(--blue-soft); border-color: #c5d6f2; color: var(--blue-dark); }
.flash-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; display: inline-flex; }
.flash-close:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-body { background: linear-gradient(135deg, #e9eff6 0%, #dde6ef 50%, #cfd9e4 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 36px; width: 100%; max-width: 440px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.auth-brand h1 { font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.auth-brand .hero-kicker { font-size: 15px; line-height: 1; }
.auth-foot { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.error-card { text-align: center; }
.error-code { font-size: 64px; font-weight: 900; color: var(--blue); margin: 0; line-height: 1; }
.error-card h1 { margin: 8px 0 10px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { margin-top: 24px; }
.support-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 24px; }
.support-text { padding-bottom: 30px; }
.support-text h2 { font-size: 24px; margin-bottom: 8px; }
.support-text p { color: #3d4757; margin: 0; max-width: 420px; }
.support-art { line-height: 0; }
.footer-bar { background: #eef1f5; border-top: 1px solid var(--border); font-size: 13px; }
.footer-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; flex-wrap: wrap; }
.footer-bar nav { display: flex; gap: 0; }
.footer-bar nav a { color: var(--text); padding: 0 16px; border-left: 1px solid #cdd3dc; }
.footer-bar nav a:first-child { border-left: 0; }

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */
.admin-body { background: #f1f3f7; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; flex-shrink: 0; background: #1c2331; color: #cfd6e2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand a { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 17px; }
.admin-brand a:hover { text-decoration: none; }
.admin-brand small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8e9bb0; }
.admin-brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-nav { padding: 12px; flex: 1; overflow: auto; }
.admin-nav-section { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #7f8ca2; padding: 16px 12px 6px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #cfd6e2; font-weight: 600; font-size: 14.5px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-nav a.is-active { background: var(--blue); color: #fff; }
.admin-sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-sidebar-footer a { color: #cfd6e2; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.admin-page-title { font-size: 22px; flex: 1; }
.admin-topbar .user-menu { margin-left: 0; }
.admin-topbar .avatar { width: 36px; height: 36px; font-size: 13px; }
.admin-main { padding: 28px; max-width: 1400px; width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text); box-shadow: var(--shadow); transition: .15s; }
.stat:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.stat.is-static { pointer-events: none; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 900; line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.admin-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.activity li { display: flex; gap: 12px; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex-shrink: 0; }
.card--table { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; background: #fafbfc; white-space: nowrap; }
.table tbody tr:hover { background: #f7f9fc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact th, .table--compact td { padding: 9px 12px; }
.table tr.is-inactive td { opacity: .55; }
.table tr.is-inactive td.col-actions { opacity: 1; }
.table tr.is-dragging { opacity: .4; }
.table tr.is-drop-target td { border-top: 2px solid var(--blue); }
.col-drag { width: 36px; }
.drag-handle { cursor: grab; color: #b8c0cc; display: inline-flex; }
.drag-handle:hover { color: var(--blue); }
.col-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions form { display: inline; }
.row-title { font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.row-title:hover { color: var(--blue); }
.row-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--tc, var(--blue)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.url-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot--on { background: var(--success); }
.dot--off { background: #cbd2dc; }
.details-cell code { font-size: 12px; color: var(--text-2); word-break: break-all; }
.pagination { display: flex; gap: 4px; padding: 14px; justify-content: center; }
.pagination a { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); font-weight: 700; }
.pagination a.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.logo-slot { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.logo-slot input[type="text"] { padding: 8px 10px; font-size: 14px; }
.logo-preview { height: 70px; border-radius: 8px; background: #f7f9fc; display: flex; align-items: center; justify-content: center; padding: 8px; }
.logo-preview img { max-height: 54px; }
.hero-setting { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.hero-preview { height: 130px; border-radius: 10px; background: linear-gradient(100deg, #e9eff6, #cfd9e4) center/cover; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand { gap: 14px; }
  .brand-logo { height: 36px; }
}
@media (max-width: 900px) {
  .home-grid, .topic-layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px 16px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow-lg); }
  .main-nav.is-open { display: flex; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav-item.is-active { border-left-color: var(--blue); }
  .badge { position: static; margin-left: 6px; }
  .user-menu { margin: 8px 0 0; }
  .dropdown { position: static; box-shadow: none; border: 0; padding: 0; }
  .hero-inner { padding-block: 44px 40px; }
  .hero-kicker { font-size: 20px; }
  .support-band { flex-direction: column; align-items: flex-start; }
  .admin-sidebar { position: fixed; left: -280px; transition: left .2s; z-index: 40; }
  .admin-sidebar.is-open { left: 0; box-shadow: var(--shadow-lg); }
  .hero-setting { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid--admin .field--half, .form-grid--admin .field--third, .form-grid--admin .field--quarter { grid-column: span 12; }
}
@media (max-width: 600px) {
  .container { padding-inline: 16px; }
  .topics-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .hero-title { font-size: 46px; }
  .search input { padding: 14px 16px; }
  .brand-text { font-size: 13px; }
  .brand-divider { display: none; }
  .brand { gap: 10px; flex-wrap: wrap; }
  .admin-main { padding: 16px; }
  .admin-topbar { padding: 12px 16px; }
  .user-name { display: none; }
}
