/* ============================================================
   KOM IGEN, SVERIGE! — WORK HUB
   Delat designsystem för alla interna sidor (hub, crm, brandbook, nu2026).
   Källa: brandbook.html · Version: 1.0 (2026-05-04)
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Färger — primär */
  --midnight: #1a1a2e;
  --midnight-2: #2c3a5a;
  --midnight-deep: #14120e;

  --gold: #e8a838;
  --gold-light: #f5cc6a;
  --gold-dark: #c48820;
  --gold-soft: #fef9ec;

  --sky: #4a90b8;
  --sky-dark: #2d6a8a;
  --sky-soft: #e6effa;

  --rust: #c45c3e;
  --rust-dark: #8a3e29;
  --rust-soft: #fde8ec;

  /* Stöd */
  --warm-white: #faf6f0;
  --cream: #f5efe3;
  --earth: #8b7355;
  --forest: #2d5a3d;
  --light-gray: #e0ddd7;
  --medium-gray: #666666;
  --charcoal: #333333;

  /* Status */
  --green: #2d5a3d;
  --green-soft: #e6efea;

  /* Typografi */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-editorial: 'Playfair Display', Georgia, serif;

  /* Layout */
  --wh-header-h: 64px;
  --wh-radius-sm: 8px;
  --wh-radius-md: 12px;
  --wh-radius-lg: 18px;
  --wh-shadow-sm: 0 1px 3px rgba(20,18,14,0.08);
  --wh-shadow-md: 0 6px 20px rgba(20,18,14,0.10);
  --wh-shadow-lg: 0 12px 40px rgba(20,18,14,0.18);

  /* Spacing-skala (8pt-grid) — 2026-05-07
     Använd dessa istället för ad-hoc px-värden.
     Ex: padding: var(--sp-3); margin-top: var(--sp-5); gap: var(--sp-2); */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Font-size-skala (modular — 1.125 ratio) — 2026-05-07
     --fs-xs(11) · --fs-sm(13) · --fs-base(15) · --fs-md(17)
     --fs-lg(20) · --fs-xl(24) · --fs-2xl(30) · --fs-3xl(36) · --fs-4xl(48) */
  --fs-xs:  0.74rem;
  --fs-sm:  0.86rem;
  --fs-base: 1rem;
  --fs-md:   1.08rem;
  --fs-lg:   1.22rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  1.875rem;
  --fs-3xl:  2.25rem;
  --fs-4xl:  3rem;

  /* Font-weight aliases */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;
}

/* ---------- SHARED HEADER ---------- */
.wh-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, var(--midnight) 0%, #172038 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-ui);
}
.wh-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--wh-header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.wh-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.wh-brand-logo {
  font-family: var(--font-editorial);
  font-weight: 700;
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #fff;
}
.wh-brand-logo .accent {
  color: var(--gold);
  background: linear-gradient(180deg, #e1b45a 0%, var(--gold) 55%, #8a6a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.wh-brand-sub {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  font-style: normal;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255,255,255,0.18);
}

.wh-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  align-items: center;
}
.wh-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.wh-nav-item i { font-size: 0.78rem; opacity: 0.85; }
.wh-nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.wh-nav-item.active {
  background: var(--gold);
  color: var(--midnight);
}
.wh-nav-item.active i { opacity: 1; }

/* Avatar med bild */
.wh-avatar-img { padding: 0; overflow: hidden; }
.wh-avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Profil-modal */
.wh-profile-overlay {
  position: fixed; inset: 0; background: rgba(10,10,25,0.6); z-index: 1100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  backdrop-filter: blur(4px);
}
.wh-profile-modal {
  background: #faf6f0; color: #1a1a2e; border-radius: 16px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  padding: 28px 28px 20px; position: relative; box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  font-family: 'Inter', sans-serif;
}
.wh-profile-modal h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  margin: 0 0 18px; font-size: 1.5rem;
}
.wh-profile-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 0; width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; color: #666; font-size: 0.95rem;
}
.wh-profile-close:hover { background: rgba(0,0,0,0.05); color: #1a1a2e; }
.wh-profile-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding-bottom: 14px; border-bottom: 1px solid #e0ddd7;
}
.wh-profile-avatar-wrap {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #e8a838, #c48820); color: #1a1a2e;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem; flex-shrink: 0; overflow: hidden;
}
.wh-profile-avatar-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
.wh-profile-avatar-fallback { z-index: 0; }
.wh-profile-name { line-height: 1.3; }
.wh-profile-name strong { display: block; font-size: 1rem; }
.wh-profile-name span { display: block; font-size: 0.85rem; color: #666; }
.wh-profile-modal label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: #666; font-weight: 700;
  margin-top: 14px; margin-bottom: 4px;
}
.wh-profile-modal input,
.wh-profile-modal textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d4cdb8; border-radius: 6px;
  font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.wh-profile-modal textarea { resize: vertical; min-height: 70px; }
.wh-profile-modal input:focus,
.wh-profile-modal textarea:focus {
  outline: none; border-color: #e8a838; box-shadow: 0 0 0 3px rgba(232,168,56,0.15);
}
.wh-pf-upload-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; margin-bottom: 8px;
}
.wh-pf-upload-btn {
  background: #1a1a2e; color: #e8a838; border: 0; padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.wh-pf-upload-btn:hover { background: #2d2d4a; }
.wh-pf-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wh-pf-upload-ghost { background: transparent; color: #666; border: 1px solid #d4cdb8; }
.wh-pf-upload-ghost:hover { background: #faf6f0; color: #1a1a2e; }
.wh-pf-upload-danger { background: transparent; color: #b04a2e; border: 1px solid #d4cdb8; padding: 8px 12px; }
.wh-pf-upload-danger:hover { background: #fef0eb; }

.wh-profile-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px;
}
.wh-profile-cancel, .wh-profile-save {
  padding: 8px 18px; border-radius: 8px; font-family: inherit; font-size: 0.9rem;
  cursor: pointer; border: 1px solid #d4cdb8;
}
.wh-profile-cancel { background: #fff; color: #666; }
.wh-profile-save { background: #1a1a2e; color: #e8a838; border-color: #1a1a2e; font-weight: 600; }
.wh-profile-save:hover { background: #2d2d4a; }
.wh-profile-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Emoji-picker (wh-emoji.js) ===== */
.wh-emoji-pop {
  position: absolute; z-index: 10000;
  width: 320px; max-height: 360px;
  background: #fff; color: #1a1a2e;
  border: 1px solid #d4cdb8; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(20,18,14,0.18);
  display: none; flex-direction: column; overflow: hidden;
  font-family: var(--font-ui, 'Inter', sans-serif);
}
.wh-emoji-pop.open { display: flex; }
.wh-emoji-search { padding: 8px 10px; border-bottom: 1px solid #eae5d6; }
.wh-emoji-search-input {
  width: 100%; padding: 6px 10px;
  border: 1px solid #d4cdb8; border-radius: 8px;
  font-size: 13px; outline: none; box-sizing: border-box;
}
.wh-emoji-search-input:focus { border-color: #b38b3f; }
.wh-emoji-tabs {
  display: flex; gap: 2px; padding: 4px 6px;
  border-bottom: 1px solid #eae5d6; overflow-x: auto;
}
.wh-emoji-tab {
  background: none; border: none; padding: 4px 8px;
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 6px; opacity: 0.55; transition: all 0.15s;
  flex-shrink: 0;
}
.wh-emoji-tab:hover { opacity: 1; background: #f5efe3; }
.wh-emoji-tab.active { opacity: 1; background: #1a1a2e; color: #fff; }
.wh-emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px; overflow-y: auto; flex: 1;
  min-height: 200px;
}
.wh-emoji-cell {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  padding: 6px; border-radius: 6px; cursor: pointer;
  transition: background 0.1s;
}
.wh-emoji-cell:hover { background: #f5efe3; }
.wh-emoji-empty {
  grid-column: 1 / -1; text-align: center;
  color: #999; padding: 30px 10px; font-size: 13px;
}
.wh-emoji-foot {
  font-size: 11px; color: #999; text-align: center;
  padding: 6px; border-top: 1px solid #eae5d6;
}

/* 2026-05-07 — Sticky-konsolideringen.
   Scroll-aware-hide togs bort helt. EN sticky-zon: wh-header.
   Alla sub-toolbars (.tab-bar.sticky, .proj-tabs, .editor-toolbar)
   klistrar klassiskt under headern utan animation. Källan till
   #37 + #42 var att flera lager konkurrerade. */

/* ===== Skeleton-loaders =====
   Pulsande grå rektanglar som ersätter "Hämtar..."-spinners för perceived
   performance. Användning:
     <div class="wh-skel wh-skel-text"></div>          — en textrad
     <div class="wh-skel wh-skel-card"></div>          — ett kort
     <div class="wh-skel wh-skel-row"></div>           — en list-rad
     <div class="wh-skel wh-skel-thumb"></div>         — bild-thumbnail
   Eller via helper: WH.skeleton('row', 5) → 5 rader. */
.wh-skel {
  background: linear-gradient(90deg,
    var(--cream, #f5efe3) 0%,
    var(--light-gray, #e0ddd7) 50%,
    var(--cream, #f5efe3) 100%);
  background-size: 200% 100%;
  border-radius: var(--wh-radius-sm, 8px);
  animation: wh-skel-pulse 1.4s ease-in-out infinite;
}
@keyframes wh-skel-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.wh-skel-text  { width: 80%; height: 12px; margin: 6px 0; }
.wh-skel-text.long  { width: 95%; }
.wh-skel-text.short { width: 40%; }
.wh-skel-card  { width: 100%; height: 84px; margin: 8px 0; }
.wh-skel-row   { width: 100%; height: 48px; margin: 4px 0; }
.wh-skel-thumb { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; }
.wh-skel-row-list {
  display: flex; flex-direction: column; gap: 8px;
}
.wh-skel-row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: #fff; border-radius: 8px;
  border: 1px solid var(--light-gray, #e0ddd7);
}
.wh-skel-row-item .body { flex: 1; }

/* ===== Mobile bottom-sheet — modaler slidar upp från botten på mobil
   2026-05-07: gäller alla modal-typer i Work Hub via deras gemensamma
   container-klasser. Inga JS-ändringar — ren CSS-override. */
@media (max-width: 720px) {
  /* Container: align-end istället för center, ingen padding */
  .modal-overlay,
  .pj-modal-backdrop,
  .cc-overlay,
  .fixed.inset-0.modal-overlay,
  .fixed.inset-0[class*="modal-overlay"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  /* Sheet: full bredd, rounded only at top, slide upp-animation */
  .modal-overlay > .modal,
  .pj-modal-backdrop > .pj-modal,
  .cc-overlay > .cc-modal,
  .fixed.inset-0.modal-overlay > div,
  .fixed.inset-0[class*="modal-overlay"] > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    animation: wh-sheet-up 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
    position: relative;
  }
  /* Drag-handle */
  .modal-overlay > .modal::before,
  .pj-modal-backdrop > .pj-modal::before,
  .cc-overlay > .cc-modal::before,
  .fixed.inset-0.modal-overlay > div::before,
  .fixed.inset-0[class*="modal-overlay"] > div::before {
    content: "";
    display: block;
    width: 36px; height: 4px;
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
    margin: 8px auto 4px;
    position: sticky; top: 0;
  }
}
@keyframes wh-sheet-up {
  from { transform: translateY(100%); opacity: 0.7; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ===== Breadcrumbs (wh-breadcrumb) =====
   Tunn sticky-rad direkt under wh-header som visar var man är.
   Render via work-hub.js från meta name="wh-breadcrumb" content="...".
   Path-syntax: "Hub|/hub.html › 1104 Fakta dig!|/projekt.html?id=8 › Möten" */
.wh-breadcrumb {
  /* INTE sticky längre — overlap mot project-hero blev irriterande.
     Breadcrumben är ändå synlig direkt under wh-header på toppen
     av varje sida och scrollar bort med innehållet. */
  background: var(--warm-white, #faf6f0);
  border-bottom: 1px solid var(--light-gray);
  padding: 6px 22px;
  font-size: 0.82rem;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  /* Höjd som andra sticky-element kan ta hänsyn till */
  --wh-breadcrumb-h: 32px;
}
/* Breadcrumb är inte längre sticky — andra sticky-rader (CRM tab-bar,
   wh-subnav) stackar bara under wh-header. */
.wh-breadcrumb a, .wh-breadcrumb span.wh-bc-leaf {
  color: var(--medium-gray);
  text-decoration: none;
  padding: 2px 4px; border-radius: 4px;
  white-space: nowrap;
}
.wh-breadcrumb a:hover { color: var(--midnight); background: var(--cream); }
.wh-breadcrumb span.wh-bc-leaf {
  color: var(--midnight);
  font-weight: 600;
}
.wh-breadcrumb .wh-bc-sep {
  color: var(--light-gray);
  margin: 0 2px;
  user-select: none;
}
@media (max-width: 720px) {
  .wh-breadcrumb { padding: 5px 14px; font-size: 0.76rem; }
}

/* ===== Mail-bell + popover (📨 nav-ping för svar) ===== */
.wh-mail-bell {
  position: relative;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  margin-right: 0.2rem;
  transition: background 0.15s, color 0.15s;
}
.wh-mail-bell:hover { background: rgba(255,255,255,0.1); color: #fff; }
.wh-mail-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--gold);
  color: var(--midnight);
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 0 0 2px var(--midnight);
}
.wh-mail-pop {
  position: absolute;
  top: calc(var(--wh-header-h, 64px) - 6px);
  right: 80px;
  width: 360px;
  max-height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  border: 1px solid var(--light-gray);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}
/* Säkerställ att hidden-attributet faktiskt döljer popovern — display:flex
   ovan kan annars override:a browser-default för [hidden]. */
.wh-mail-pop[hidden] { display: none !important; }
.wh-mail-pop-header {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--midnight);
  border-bottom: 1px solid var(--light-gray);
  background: var(--warm-white, #faf6f0);
}
.wh-mail-pop-body {
  overflow-y: auto;
  flex: 1;
}
.wh-mail-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--medium-gray);
}
.wh-mail-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f0ea;
  text-decoration: none;
  color: var(--midnight);
  transition: background 0.12s;
}
.wh-mail-item:hover { background: var(--cream, #fefaf2); }
.wh-mail-item:last-child { border-bottom: 0; }
.wh-mail-item.is-new { background: #fef9e8; }
.wh-mail-item.is-new:hover { background: #fbf2d5; }
.wh-mail-item-from {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--midnight);
  line-height: 1.25;
}
.wh-mail-item-subj {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wh-mail-item-meta {
  font-size: 0.7rem;
  color: var(--medium-gray);
  margin-top: 3px;
}
.wh-mail-section {
  padding: 8px 14px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--medium-gray);
  background: var(--warm-white, #faf6f0);
  border-bottom: 1px solid #f0ece4;
}
.wh-mail-section-auto {
  background: #f3f6fb;
  color: #4a5b7a;
  border-top: 1px solid #e6ebf3;
}
.wh-mail-item-auto { background: #fafbfd; }
.wh-mail-item-auto:hover { background: #f0f4fa; }
.wh-mail-pill {
  display: inline-block;
  background: #e6ebf3;
  color: #4a5b7a;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}
@media (max-width: 720px) {
  .wh-mail-pop { right: 8px; left: 8px; width: auto; }
}

.wh-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 0.82rem;
  margin-left: 0.4rem;
  transition: background .15s, color .15s;
}
.wh-help-link i { font-size: 0.95rem; opacity: 0.9; }
.wh-help-link:hover { background: rgba(255,255,255,0.07); color: #fff; }

.wh-userbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.85rem;
  margin-left: 0.4rem;
  border-left: 1px solid rgba(255,255,255,0.12);
  position: relative;
}
.wh-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
}
.wh-user-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.wh-user-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.wh-user-btn[aria-expanded="true"] {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

/* Dropdown-meny */
.wh-user-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: var(--midnight, #0d1729);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  padding: 0.45rem;
  z-index: 100;
}
.wh-user-menu[hidden] { display: none; }
.wh-user-menu-header {
  padding: 0.6rem 0.75rem 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.35rem;
}
.wh-user-menu-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.95);
}
.wh-user-menu-email {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.15rem;
}
.wh-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.wh-user-menu-item:hover {
  background: rgba(255,255,255,0.08);
}
.wh-user-menu-item i {
  width: 16px;
  text-align: center;
  opacity: 0.85;
}
.wh-user-menu-hint {
  margin-left: auto;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.wh-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--midnight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.wh-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}
.wh-logout:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

/* Mobil-meny */
.wh-burger {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.2rem;
  margin-left: auto;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 8px;
}
.wh-burger:hover { background: rgba(255,255,255,0.08); }

@media (max-width: 880px) {
  .wh-brand-sub { display: none; }
  .wh-nav, .wh-userbox { display: none; }
  .wh-burger { display: inline-flex; }
  .wh-header.open .wh-nav,
  .wh-header.open .wh-userbox {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    margin: 0;
    padding: 0.75rem 0;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: var(--midnight);
  }
  .wh-header.open {
    height: auto;
  }
  .wh-header.open .wh-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0;
    align-items: center;
  }
  .wh-header.open .wh-userbox {
    justify-content: space-between;
  }
}

/* ---------- SUBNAV (sidspecifik nav under shared header) ----------
   Inte sticky längre (2026-05-10): subnav är vy-byte, inte action,
   och behöver inte följa med mid-läsning. wh-header räcker som
   alltid-synlig nav. Jonas-feedback aa4dfc24cb46. */
.wh-subnav {
  background: #fff;
  border-bottom: 1px solid var(--light-gray);
  position: relative;
  z-index: 50;
  font-family: var(--font-ui);
}
.wh-subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  align-items: center;
  scrollbar-width: thin;
}
.wh-subnav-inner::-webkit-scrollbar { height: 4px; }
.wh-subnav-inner::-webkit-scrollbar-thumb { background: var(--light-gray); border-radius: 2px; }
.wh-subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--medium-gray);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.wh-subnav-tab:hover { color: var(--midnight); }
.wh-subnav-tab.active {
  color: var(--midnight);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* ---------- SHARED FOOTER ---------- */
.wh-footer {
  margin-top: 4rem;
  background: var(--cream);
  border-top: 1px solid var(--light-gray);
  font-family: var(--font-ui);
  color: var(--charcoal);
}
.wh-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}
@media (min-width: 720px) {
  .wh-footer-inner {
    grid-template-columns: 1fr auto;
  }
}
.wh-footer-brand {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1rem;
  color: var(--midnight);
}
.wh-footer-brand b {
  font-style: normal;
  font-weight: 700;
  color: var(--gold-dark);
}
.wh-footer-meta {
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--medium-gray);
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}
.wh-quicklinks {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.wh-quicklinks a {
  color: var(--medium-gray);
  text-decoration: none;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.wh-quicklinks a:hover { color: var(--gold-dark); }
.wh-quicklinks a i { opacity: 0.75; }

/* ---------- HJÄLPKLASSER ---------- */
.wh-only-mobile { display: none; }
.wh-only-desktop { display: initial; }
@media (max-width: 720px) {
  .wh-only-mobile { display: initial; }
  .wh-only-desktop { display: none; }
}

/* ---------- WIP-banner (för stora omarbetningar live) ---------- */
.wh-wip-banner {
  background: var(--gold-soft);
  border-bottom: 1px solid var(--gold);
  color: var(--gold-dark);
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  text-align: center;
  font-weight: 500;
}
.wh-wip-banner b { color: var(--charcoal); }

/* ===== Kalender-sektion i profil-modalen ===== */
.wh-cal-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule, #ece7db); }
.wh-cal-hint { font-size: 0.8rem; color: var(--text-muted, #888); margin: 2px 0 8px; }
.wh-cal-tag { font-weight: 400; font-size: 0.72rem; color: #2e5060; background: #e7eef0; padding: 1px 7px; border-radius: 10px; }
.wh-cal-muted { color: var(--text-muted, #999); font-size: 0.82rem; }
.wh-cal-sub .wh-cal-url { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wh-cal-sub code { flex: 1; min-width: 180px; background: #f4f1ea; padding: 6px 9px; border-radius: 7px;
  font-size: 0.74rem; word-break: break-all; color: #444; }
.wh-cal-help { font-size: 0.76rem; color: var(--text-muted, #888); margin-top: 7px; line-height: 1.5; }
.wh-cal-ext { display: flex; flex-direction: column; gap: 7px; }
.wh-cal-item { display: flex; align-items: center; gap: 10px; background: #faf8f3;
  border: 1px solid var(--rule, #ece7db); border-radius: 9px; padding: 8px 10px; }
.wh-cal-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.wh-cal-item-main { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.wh-cal-item-main strong { font-size: 0.88rem; }
.wh-cal-status { font-size: 0.74rem; color: var(--text-muted, #999); }
.wh-cal-del { background: none; border: none; color: #b06; cursor: pointer; padding: 4px 8px; opacity: .6; }
.wh-cal-del:hover { opacity: 1; }
.wh-cal-addrow { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.wh-cal-addrow input { flex: 1; min-width: 120px; }
.wh-cal-addrow input[type=url] { flex: 2; min-width: 180px; }

/* ===== Page Toolbar (delad sid-verktygsrad: CRM + Projekt) ===== */
.wh-pt { background: var(--cream, #f5efe3); border-bottom: 1px solid var(--light-gray, #e0ddd7); position: relative; z-index: 40; }
.wh-pt-inner { max-width: 1200px; margin: 0 auto; padding: 0.55rem 1.25rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.wh-pt-spacer { flex: 1 1 auto; }
.wh-pt-heading { display: flex; flex-direction: column; line-height: 1.1; padding-right: 0.75rem; border-right: 1px solid var(--light-gray, #e0ddd7); margin-right: 0.2rem; }
.wh-pt-title { font-family: var(--font-display, 'DM Serif Display', Georgia, serif); font-size: 1.05rem; color: var(--charcoal, #1a1a2e); }
.wh-pt-desc { font-size: 0.68rem; color: var(--medium-gray, #666); letter-spacing: 0.04em; margin-top: 1px; }

.wh-pt-searchwrap { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 360px; }
.wh-pt-searchicon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--medium-gray, #9ca3af); font-size: 0.78rem; pointer-events: none; }
.wh-pt-search { width: 100%; background: #fff; border: 1px solid var(--light-gray, #d8dde3); border-radius: 8px; padding: 0.4rem 2.6rem 0.4rem 2rem; font-size: 0.82rem; color: var(--charcoal, #1a1a2e); outline: none; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.wh-pt-search:focus { border-color: var(--gold, #e8a838); box-shadow: 0 0 0 3px rgba(232,168,56,0.15); }
.wh-pt-kbd { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); border: 1px solid var(--light-gray, #d8dde3); background: #fff; border-radius: 5px; font-size: 0.62rem; color: var(--medium-gray, #9ca3af); padding: 0.12rem 0.32rem; cursor: pointer; line-height: 1; }
.wh-pt-kbd:hover { color: var(--charcoal, #1a1a2e); border-color: var(--gold, #e8a838); }

.wh-pt-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.85rem; border-radius: 8px; font-size: 0.8rem; font-weight: 500; cursor: pointer; border: 1px solid var(--light-gray, #e0ddd7); background: #fff; color: var(--charcoal, #333); font-family: inherit; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.wh-pt-btn:hover { background: var(--warm-white, #faf6f0); border-color: var(--medium-gray, #b9b4ab); color: var(--charcoal, #1a1a2e); }
.wh-pt-btn--primary { background: var(--midnight, #1a1a2e); color: #fff; border-color: var(--midnight, #1a1a2e); font-weight: 600; }
.wh-pt-btn--primary:hover { background: #0f1a35; color: #fff; border-color: #0f1a35; }
.wh-pt-btn--ai { background: linear-gradient(135deg, #fef6d7 0%, #f5cc6a 100%); color: #1a1a2e; border-color: var(--gold, #e8a838); font-weight: 600; box-shadow: 0 1px 3px rgba(232,168,56,0.25); }
.wh-pt-btn--ai:hover { background: linear-gradient(135deg, #f5cc6a 0%, #e8a838 100%); box-shadow: 0 2px 8px rgba(232,168,56,0.4); }
.wh-pt-btn--ai i { color: #c48820; }

.wh-pt-iconbar { display: inline-flex; gap: 1px; background: var(--warm-white, #faf6f0); border: 1px solid var(--light-gray, #e0ddd7); border-radius: 9px; padding: 2px; }
.wh-pt-iconbtn { background: transparent; border: 0; padding: 0.4rem 0.55rem; border-radius: 6px; cursor: pointer; color: var(--medium-gray, #555); font-size: 0.85rem; transition: background .15s, color .15s; }
.wh-pt-iconbtn:hover { background: rgba(20,18,14,0.06); color: var(--charcoal, #1a1a2e); }
.wh-pt-iconbtn--danger { color: #dc2626; }

.wh-pt-tabbar { background: #fff; border-bottom: 1px solid var(--light-gray, #e0ddd7); }
.wh-pt-tabbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; display: flex; align-items: center; overflow-x: auto; }
.wh-pt-tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.1rem; margin: 0 0.7rem; font-size: 0.82rem; font-weight: 500; color: var(--medium-gray, #666); border: none; background: transparent; cursor: pointer; position: relative; white-space: nowrap; font-family: inherit; transition: color .16s; }
.wh-pt-tab:first-child { margin-left: 0; }
.wh-pt-tab:hover { color: var(--charcoal, #1a1a2e); }
.wh-pt-tab.active { color: var(--charcoal, #1a1a2e); font-weight: 600; }
.wh-pt-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold, #e8a838); border-radius: 2px 2px 0 0; }
.wh-pt-badge { background: var(--warm-white, #f0ece3); color: var(--medium-gray, #666); border-radius: 999px; padding: 1px 7px; font-size: 0.7rem; font-weight: 600; }
.wh-pt-secondrow { max-width: 1200px; margin: 0 auto; padding: 0.4rem 1.25rem 0.6rem; display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; overflow-x: auto; }

@media (max-width: 880px) {
  .wh-pt-heading { display: none; }
  .wh-pt-searchwrap { flex-basis: 100%; max-width: none; order: 10; }
  .wh-pt-iconbar { overflow-x: auto; }
}
