:root {
  /* Palette drawn from the border artwork */
  --green-900: #163f31;
  --green-700: #1f5a45;
  --green-500: #5f8f72;
  --terracotta: #c9532d;
  --ochre: #d98a2b;
  --sand: #f3e6d2;
  --cream: #fbf8f2;
  --paper: #ffffff;
  --ink: #1b1d1c;
  --ink-soft: #4b5653;
  --muted: #6b7a76;
  --line: #e8e1d5;

  --radius-panel: 28px;
  --radius-card: 12px;
  --shadow-card: 0 1px 2px rgba(40, 30, 10, .04), 0 4px 14px rgba(40, 30, 10, .04);
  --shadow-hover: 0 4px 10px rgba(40, 30, 10, .06), 0 14px 30px rgba(40, 30, 10, .08);

  /* Frame thickness (image slices: 48 112 60 112 px). The panel stops above the bottom band so nothing scrolls under it. */
  --frame-t: 42px;
  --frame-r: 96px;
  --frame-b: 52px;
  --frame-l: 96px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow: hidden;
}

a { color: inherit; }

/* ---------- Decorative frame ---------- */
.frame {
  position: fixed;
  inset: 0;
  border-style: solid;
  border-width: var(--frame-t) var(--frame-r) var(--frame-b) var(--frame-l);
  border-image: url("../assets/borderstatic.png") 48 112 60 112 fill / var(--frame-t) var(--frame-r) var(--frame-b) var(--frame-l) stretch;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Main panel ---------- */
.panel {
  position: fixed;
  inset: 0 0 var(--frame-b) 0;
  background: var(--cream);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
  scrollbar-width: none;
}

.panel::-webkit-scrollbar { display: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: calc(var(--frame-t) + 6px) calc(var(--frame-r) + 28px) 12px calc(var(--frame-l) + 28px);
  background: rgba(251, 248, 242, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 84px;
  width: auto;
  margin: -12px 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-sub {
  font-size: 14px;
  color: var(--muted);
}

.brand-label {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-900);
}

.mainnav {
  display: flex;
  gap: 8px;
  margin: 0 auto;
}

.mainnav a {
  position: relative;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.mainnav a:hover { color: var(--ink); background: rgba(31, 90, 69, .06); }

.mainnav a.active { color: var(--green-900); font-weight: 600; }

.mainnav a.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--green-700);
}

.user-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #4b4f4e;
  cursor: pointer;
}

.icon-btn:hover { background: rgba(0, 0, 0, .05); }

.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }

.badge-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 2px var(--cream);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.chev { width: 20px; height: 20px; }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}

.dropdown-head {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.dropdown-head span { font-size: 13px; color: var(--muted); }

.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
}

.dropdown a:hover { background: var(--cream); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Content ---------- */
.content {
  max-width: calc(1320px + var(--frame-l) + var(--frame-r));
  margin: 0 auto;
  padding: 22px calc(var(--frame-r) + 48px) 32px calc(var(--frame-l) + 48px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.05;
}

.hero p {
  margin: 6px 0 0;
  font-size: clamp(17px, 1.6vw, 23px);
  color: #2c3230;
}

.search {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 0 20px;
  height: 54px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  color: #505856;
  transition: border-color .15s, box-shadow .15s;
}

.search:focus-within {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(31, 90, 69, .12);
}

.search svg { width: 22px; height: 22px; flex-shrink: 0; }

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
}

.search input::placeholder { color: #7d8683; }

h2 {
  margin: 26px 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ---------- Tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 160px;
  padding: 18px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #dccfb9;
  outline: none;
}

.tile-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 8px;
}

.tile-title {
  font-size: 20px;
  font-weight: 700;
}

.tile-sub {
  font-size: 16px;
  color: var(--muted);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Bottom row ---------- */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.card {
  padding: 16px 20px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.update a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px;
  margin: 0 -6px;
  border-radius: 10px;
  text-decoration: none;
}

.update a:hover { background: var(--cream); }

.update + .update { margin-top: 6px; }

.update-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
}

.update-icon svg { width: 26px; height: 26px; fill: currentColor; }

.update-body { flex: 1; min-width: 0; }

.update-title { font-size: 17px; }

.update-title strong { font-weight: 700; }

.update-desc {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
}

.arrow {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #555;
}

.quicklinks ul {
  display: flex;
  flex-wrap: wrap;
}

.quicklink {
  flex: 1 1 0;
  min-width: 150px;
}

.quicklink + .quicklink { border-left: 1px solid var(--line); }

.quicklink a {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  height: 100%;
  padding: 10px 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
}

.quicklink a:hover { background: var(--cream); }

.quicklink .ql-icon { width: 32px; height: 32px; flex-shrink: 0; }

.quicklink .arrow { width: 18px; height: 18px; margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .brand-text { display: none; }
}

@media (max-width: 900px) {
  :root {
    --frame-t: 26px;
    --frame-r: 48px;
    --frame-b: 32px;
    --frame-l: 48px;
  }

  .topbar { padding: calc(var(--frame-t) + 4px) calc(var(--frame-r) + 16px) 12px calc(var(--frame-l) + 16px); gap: 12px; }
  .nav-toggle { display: grid; place-items: center; order: 3; }
  .user-area { margin-left: auto; }

  .mainnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 8px calc(var(--frame-r) + 16px) 16px calc(var(--frame-l) + 16px);
    background: var(--cream);
    border-bottom: 1px solid var(--line);
  }

  .mainnav.open { display: flex; }
  .mainnav a.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }

  .content { padding: 28px calc(var(--frame-r) + 24px) 36px calc(var(--frame-l) + 24px); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root {
    --frame-t: 16px;
    --frame-r: 22px;
    --frame-b: 20px;
    --frame-l: 22px;
    --radius-panel: 18px;
  }

  .brand-logo { height: 52px; }
  .content { padding: 22px calc(var(--frame-r) + 14px) 28px calc(var(--frame-l) + 14px); }
  h2 { font-size: 24px; margin-top: 30px; }
  .tile { min-height: 150px; padding: 18px 10px; }
  .tile-icon { width: 60px; height: 60px; }
  .tile-title { font-size: 17px; }
  .tile-sub { font-size: 14px; }
  .quicklink + .quicklink { border-left: 0; border-top: 1px solid var(--line); }
  .quicklink { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Notifications ---------- */

.badge-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--terracotta);
  box-shadow: 0 0 0 2px var(--cream);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 40px;
  z-index: 20;
  width: min(390px, calc(100vw - 32px));
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
}

.notif-head,
.notif-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.notif-head { border-bottom: 1px solid var(--line); }
.notif-head strong { font-size: 16px; }
.notif-foot { justify-content: center; border-top: 1px solid var(--line); }

.notif-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-700);
  text-decoration: none;
  cursor: pointer;
}

.notif-muted { font-size: 13px; color: var(--muted); }

.notif-list {
  max-height: 420px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.notif-list a {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
}

.notif-list li + li a { border-top: 1px solid var(--line); }
.notif-list a:hover { background: var(--cream); }
.notif-list a.unread { background: #f4f8f5; }
.notif-list a.unread:hover { background: #eaf2ec; }

.notif-icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--c);
  opacity: .35;
}

.unread .notif-icon,
.notif-pop .notif-icon { opacity: 1; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }

.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-body strong { font-size: 15px; }
.notif-body span { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.notif-body small { font-size: 12px; color: var(--muted); }

.notif-pop {
  position: fixed;
  top: calc(var(--frame-t) + 84px);
  right: calc(var(--frame-r) + 24px);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border-left: 5px solid var(--c);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 16px 40px rgba(40, 25, 5, .22);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .3s, transform .3s;
}

.notif-pop.in { opacity: 1; transform: none; }
.notif-pop .notif-body { flex: 1; }

.notif-view {
  align-self: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-700);
  text-decoration: none;
}

.notif-x {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

/* Dismiss button (menu + notifications page) */

.notif-item { position: relative; }
.notif-item a { padding-right: 40px; }

.notif-dismiss {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.notif-item .notif-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: .45;
}

.notif-item:hover .notif-dismiss,
.notif-dismiss:focus-visible { opacity: 1; }
.notif-dismiss:hover { background: #efe8dc; color: var(--ink); }

.notif-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.notif-empty.big { padding: 48px 16px; font-size: 16px; }

/* All notifications page */

.notif-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.notif-filters .chips { margin-top: 0; }
.notif-filters .pill-select { margin-left: auto; }

.pill-select {
  padding: 7px 10px;
  border: 1px solid #d8d0c2;
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.notif-page { padding: 4px 0 8px; }

.notif-group {
  margin: 0;
  padding: 16px 20px 6px;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.notif-rows { margin: 0; padding: 0; list-style: none; }

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.notif-row.unread { background: #f4f8f5; }
.notif-row.dismissed { opacity: .6; }
.notif-row .notif-body { flex: 1; text-decoration: none; color: inherit; }
.notif-row .notif-body:hover strong { color: var(--green-700); text-decoration: underline; }

.notif-cat {
  font-weight: 700;
  color: color-mix(in srgb, var(--c) 80%, black);
}

.notif-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .notif-row { flex-wrap: wrap; }
  .notif-row-actions { width: 100%; justify-content: flex-end; }
  .notif-filters .pill-select { margin-left: 0; }
}
