/* Portfolio Endure — Hashmi brand palette
   Designed for principals 60+, ME-region, English-second-language readers.
   Priorities: bold weights, large type, high contrast, generous spacing. */

:root {
  --ink:        #10120C;   /* primary text — near-black */
  --ink-soft:   #3a3d33;   /* secondary text */
  --ink-mute:   #6a6d60;   /* tertiary / labels */

  --sage:       #8E9E6E;   /* primary accent — sage green */
  --sage-dark:  #5e6e44;   /* sage hover / on-cream text */
  --sage-soft:  #D6DDC6;   /* surface accent */
  --cream:      #F4E0AC;   /* warm highlight */
  --cream-soft: #faf2dc;   /* lighter cream wash */

  --bg:         #faf8f0;   /* page background */
  --card:       #ffffff;   /* surface */
  --line:       #e4e3d4;   /* dividers */
  --line-strong:#cfcebd;

  --green:      #4f7a35;
  --green-bg:   #e6efd4;
  --amber:      #b07717;
  --amber-bg:   #fbeed0;
  --red:        #a83321;
  --red-bg:     #f7dcd5;
  --blue:       #2e5a83;
  --blue-bg:    #d9e6f1;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(16,18,12,.04), 0 6px 18px rgba(16,18,12,.06);
  --shadow-strong: 0 4px 10px rgba(16,18,12,.08), 0 14px 36px rgba(16,18,12,.14);

  --sidebar-w:  280px;
  --topbar-h:   72px;
}

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

body {
  font-family: 'Urbanist', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--sage-dark); text-decoration: none; font-weight: 600; }
a:hover { color: var(--ink); text-decoration: underline; }

button { font-family: inherit; cursor: pointer; font-weight: 600; }
input, select, textarea { font-family: inherit; font-size: 15px; font-weight: 500; color: var(--ink); }

[hidden] { display: none !important; }

/* ========== Sidebar ========== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: #f4f1e6;
  display: flex; flex-direction: column;
  padding: 24px 16px 18px;
  z-index: 50;
  border-right: 0;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 4px 8px 26px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  display: grid; place-items: center;
  font-family: 'Urbanist', sans-serif;
  font-weight: 800;
  font-size: 22px;
}
.brand-name {
  font-family: 'Urbanist', sans-serif;
  font-size: 19px; font-weight: 800;
  color: #fff; letter-spacing: -0.2px;
}
.brand-sub {
  font-size: 11px; color: var(--cream); letter-spacing: 1.6px;
  text-transform: uppercase; font-weight: 700;
}

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #c8c6b9;
  font-weight: 600; font-size: 15px;
  position: relative;
  letter-spacing: -0.1px;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav-item.active {
  background: var(--sage);
  color: #fff;
}
.nav-item.active svg { color: #fff; }
.nav-item svg { color: #8c8d7e; flex: 0 0 20px; }
.nav-item.active svg { color: #fff; }

.nav-badge {
  margin-left: auto;
  background: var(--cream);
  color: var(--ink);
  font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
.nav-badge[data-count="0"] { display: none; }

.sidebar-footer { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card { display: flex; align-items: center; gap: 12px; padding: 8px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
}
.user-name { color: #fff; font-size: 15px; font-weight: 700; }
.user-role { color: #a8a89a; font-size: 12px; font-weight: 500; }
.powered { font-size: 11px; color: #8c8d7e; padding: 14px 8px 0; font-weight: 600; }
.powered a { color: var(--cream); }

/* ========== Topbar ========== */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  z-index: 40;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  background: none; border: none; padding: 10px; border-radius: 8px;
  color: var(--ink);
}
.menu-toggle:hover { background: var(--sage-soft); }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1.5px solid var(--line);
  padding: 10px 16px; border-radius: 12px; min-width: 360px;
  color: var(--ink-soft);
}
.search:focus-within { border-color: var(--sage); }
.search input {
  border: none; background: transparent; outline: none;
  flex: 1; font-size: 15px; font-weight: 500; color: var(--ink);
}

.topbar-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  border: 2px solid var(--ink);
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  position: relative;
  text-decoration: none;
}
.topbar-btn:hover { background: var(--sage-dark); border-color: var(--sage-dark); }
.topbar-btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.topbar-btn.ghost:hover { background: var(--sage-soft); border-color: var(--sage); }
.topbar-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cream); box-shadow: 0 0 0 2px #fff;
  display: none;
}
.topbar-btn .dot.show { display: block; }

/* ========== Main ========== */
.main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 32px) 32px 80px;
  min-height: 100vh;
}

.route { animation: fadeIn .25s ease; }
.route[hidden] { display: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.route-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 28px; gap: 20px; flex-wrap: wrap;
}
.eyebrow {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sage-dark); font-weight: 800;
}
.page-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 38px; font-weight: 800;
  color: var(--ink);
  margin: 6px 0 6px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.page-sub {
  color: var(--ink-soft); margin: 0;
  max-width: 760px;
  font-size: 16px; font-weight: 500;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--ink);
  border: 2px solid var(--line-strong);
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: var(--sage-soft); border-color: var(--sage); }
.btn-primary {
  background: var(--sage); color: #fff; border-color: var(--sage);
}
.btn-primary:hover { background: var(--sage-dark); border-color: var(--sage-dark); }
.btn-dark {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.btn-dark:hover { background: var(--sage-dark); border-color: var(--sage-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn:focus-visible, .btn-primary:focus-visible {
  outline: 3px solid var(--cream); outline-offset: 2px;
}

/* ========== KPIs ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at center, var(--cream-soft), transparent 70%);
  pointer-events: none;
}
.kpi-label {
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 800;
}
.kpi-value {
  font-family: 'Urbanist', sans-serif;
  font-size: 32px; font-weight: 800;
  color: var(--ink);
  margin-top: 6px; line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi-meta {
  font-size: 14px; color: var(--ink-soft);
  margin-top: 8px; font-weight: 600;
}
.kpi-meta .pos { color: var(--green); font-weight: 800; }
.kpi-meta .neg { color: var(--red); font-weight: 800; }

/* ========== Cards ========== */
.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h2 {
  font-family: 'Urbanist', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.3px;
}
.card-sub {
  font-size: 13px; color: var(--ink-mute); font-weight: 600;
}
.card-link {
  font-size: 14px; color: var(--sage-dark); font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

/* ========== Health pills ========== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-red   { background: var(--red-bg); color: var(--red); }
.pill-blue  { background: var(--blue-bg); color: var(--blue); }
.pill-mute  { background: var(--bg); color: var(--ink-soft); }
.pill-cream { background: var(--cream); color: var(--ink); }
.pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

/* ========== Alerts list ========== */
.alert-list, .suggestion-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.alert {
  border: 2px solid var(--line);
  border-left: 4px solid var(--ink-mute);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff;
}
.alert.high   { border-left-color: var(--red); background: #fdf5f3; }
.alert.medium { border-left-color: var(--amber); background: #fef9ec; }
.alert.low    { border-left-color: var(--blue); }
.alert-title { font-weight: 800; color: var(--ink); font-size: 16px; }
.alert-detail { color: var(--ink-soft); font-size: 14px; margin-top: 4px; font-weight: 500; }
.alert-time { font-size: 12px; color: var(--ink-mute); margin-top: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }

.suggestion {
  display: flex; gap: 14px; align-items: flex-start;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; background: #fff;
}
.suggestion-icon {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
  background: var(--sage-soft); color: var(--sage-dark);
  display: grid; place-items: center;
}
.suggestion-title { font-weight: 800; color: var(--ink); font-size: 15px; }
.suggestion-detail { color: var(--ink-soft); font-size: 14px; margin-top: 4px; font-weight: 500; }
.suggestion-actions { margin-top: 10px; display: flex; gap: 8px; }
.suggestion-actions .btn { padding: 8px 14px; font-size: 13px; }

/* ========== Asset cards ========== */
.asset-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.asset-card.health-red    { border-top: 4px solid var(--red); }
.asset-card.health-amber  { border-top: 4px solid var(--amber); }
.asset-card.health-green  { border-top: 4px solid var(--green); }
.asset-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
}
.asset-name {
  font-family: 'Urbanist', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--ink);
  line-height: 1.25; letter-spacing: -0.2px;
}
.asset-meta {
  font-size: 13px; color: var(--ink-mute); font-weight: 600;
}
.asset-row {
  display: flex; justify-content: space-between;
  font-size: 14px; gap: 12px;
}
.asset-row .lbl { color: var(--ink-mute); font-weight: 600; }
.asset-row .val { color: var(--ink); font-weight: 700; text-align: right; }
.asset-row .val.pos { color: var(--green); }
.asset-row .val.neg { color: var(--red); }
.asset-issue {
  font-size: 13.5px; color: var(--red); background: var(--red-bg);
  border-radius: 8px; padding: 10px 12px; margin-top: 8px;
  font-weight: 600;
}
.asset-actions {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.asset-actions .btn { padding: 8px 12px; font-size: 13px; }

/* ========== Mini rows ========== */
.mini-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  gap: 12px;
}
.mini-row:last-child { border-bottom: none; }
.mini-row .left { display: flex; flex-direction: column; gap: 3px; }
.mini-row .name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.mini-row .meta { font-size: 12.5px; color: var(--ink-mute); font-weight: 500; }
.mini-row .right { text-align: right; font-size: 14px; }
.mini-row .right .v { font-weight: 800; color: var(--ink); }

/* ========== Messages ========== */
.message-list { display: flex; flex-direction: column; gap: 10px; }
.message {
  display: flex; gap: 16px; padding: 16px 20px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm);
  align-items: flex-start;
}
.message.unread { border-left: 4px solid var(--sage); background: #fafdf3; }
.message.urgent { border-left: 4px solid var(--red); background: #fdf5f3; }
.msg-channel {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
  background: var(--bg); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.msg-channel.whatsapp { background: var(--sage-soft); color: var(--sage-dark); }
.msg-channel.email { background: var(--blue-bg); color: var(--blue); }
.msg-channel.sms { background: var(--cream); color: var(--ink); }
.msg-body { flex: 1; min-width: 0; }
.msg-from { font-weight: 800; color: var(--ink); font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-subject { color: var(--ink); font-size: 14px; margin-top: 3px; font-weight: 600; }
.msg-preview { color: var(--ink-soft); font-size: 13.5px; margin-top: 5px; line-height: 1.5; }
.msg-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--ink-mute); margin-top: 8px; font-weight: 600; }

/* ========== Will section ========== */
.will-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.will-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.will-meta-cell {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.will-meta-cell .lbl {
  font-size: 11.5px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800;
}
.will-meta-cell .val {
  font-family: 'Urbanist', sans-serif;
  font-size: 22px; color: var(--ink); font-weight: 800;
  margin-top: 4px; letter-spacing: -0.3px;
}

.dep-table, .ch-table, .audit-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.dep-table th, .ch-table th, .audit-table th {
  text-align: left; color: var(--ink-mute); font-weight: 800;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 14px; border-bottom: 2px solid var(--line);
}
.dep-table td, .ch-table td, .audit-table td {
  padding: 14px; border-bottom: 1px solid var(--line); font-weight: 600;
}
.dep-table tr:last-child td, .ch-table tr:last-child td { border-bottom: none; }
.dep-table strong, .ch-table strong { font-weight: 800; }

.proj-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 14px; }
.proj-cell {
  background: linear-gradient(180deg, #fff, var(--cream-soft));
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; text-align: center;
}
.proj-cell .y { font-size: 12px; letter-spacing: 1.2px; color: var(--sage-dark); font-weight: 800; }
.proj-cell .n {
  font-family: 'Urbanist', sans-serif;
  font-size: 20px; color: var(--ink); font-weight: 800;
  margin-top: 4px;
}
.proj-cell .r { font-size: 12px; color: var(--ink-mute); font-weight: 600; }

.will-card-stat { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; }
.will-card-stat .stat-num {
  font-family: 'Urbanist', sans-serif;
  font-size: 40px; font-weight: 800; color: var(--ink);
  line-height: 1; letter-spacing: -1px;
}
.will-card-stat .stat-lbl {
  font-size: 13px; color: var(--ink-mute); font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
}
.will-card-stat.warn .stat-num { color: var(--amber); }
.will-card-stat.danger .stat-num { color: var(--red); }

/* ========== Letter of Wishes (dated list) ========== */
.wishes-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.wish {
  display: grid; grid-template-columns: 116px 1fr;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.wish-date {
  background: var(--cream-soft);
  border-right: 2px solid var(--line);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-start; justify-content: center;
}
.wish-date .day {
  font-family: 'Urbanist', sans-serif;
  font-size: 24px; font-weight: 800; color: var(--ink);
  line-height: 1;
}
.wish-date .mon-yr {
  font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: 1.2px; font-weight: 800; text-transform: uppercase;
}
.wish-text {
  padding: 14px 18px;
  font-size: 15px; color: var(--ink); font-weight: 500;
  line-height: 1.55;
}
.wishes-actions {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}

/* ========== News & Journal cards ========== */
.news-list, .journal-list { display: flex; flex-direction: column; gap: 14px; }

.news-item {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  align-items: start;
}
.news-source {
  font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--sage-dark); font-weight: 800;
}
.news-headline {
  font-family: 'Urbanist', sans-serif;
  font-size: 19px; font-weight: 800; color: var(--ink);
  margin-top: 4px; line-height: 1.3; letter-spacing: -0.2px;
}
.news-snippet { color: var(--ink-soft); font-size: 14px; margin-top: 8px; font-weight: 500; line-height: 1.55; }
.news-ai {
  background: var(--sage-soft); border-radius: 10px;
  padding: 12px 14px; margin-top: 12px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.5;
  border-left: 4px solid var(--sage);
}
.news-ai strong { font-weight: 800; color: var(--sage-dark); }
.news-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: var(--ink-mute); margin-top: 10px; font-weight: 700;
  flex-wrap: wrap;
}

.journal-entry {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px;
  position: relative;
}
.journal-entry::before {
  content: ''; position: absolute; left: -2px; top: 26px; bottom: 26px;
  width: 4px; background: var(--cream); border-radius: 2px;
}
.journal-date {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--sage-dark); font-weight: 800;
}
.journal-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--ink);
  margin-top: 4px; line-height: 1.25; letter-spacing: -0.3px;
}
.journal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.journal-body {
  margin-top: 14px; color: var(--ink); font-size: 15.5px; font-weight: 500;
  line-height: 1.7; white-space: pre-line;
}

/* ========== Filter row ========== */
.filter-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.filter-chip {
  background: #fff; border: 2px solid var(--line);
  padding: 8px 18px; border-radius: 999px;
  font-size: 13.5px; color: var(--ink-soft);
  font-weight: 700;
  text-transform: capitalize;
}
.filter-chip:hover { border-color: var(--sage); color: var(--ink); }
.filter-chip.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

/* ========== Modal ========== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(16,18,12,.45); backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 64px); overflow: auto;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  display: flex; flex-direction: column;
  animation: modalIn .2s ease;
  border: 2px solid var(--line);
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px; border-bottom: 2px solid var(--line);
}
.modal-header h3 {
  margin: 0; font-family: 'Urbanist', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px;
}
.modal-close {
  background: none; border: none; font-size: 28px; line-height: 1;
  color: var(--ink-mute); cursor: pointer; padding: 4px 10px; font-weight: 700;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 16px 26px; border-top: 2px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label {
  font-size: 13px; color: var(--ink); font-weight: 700;
  letter-spacing: .2px;
}
.field input, .field select, .field textarea {
  padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: 10px;
  background: #fff;
  font-size: 15px; font-weight: 500;
}
.field textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(142,158,110,.18);
}

/* ========== Toasts ========== */
.toast-stack {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 12px; z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #f4f1e6;
  border-left: 4px solid var(--sage);
  padding: 14px 18px; border-radius: 10px;
  box-shadow: var(--shadow-strong);
  min-width: 300px; max-width: 380px;
  pointer-events: auto;
  animation: toastIn .25s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast-title { font-weight: 800; font-size: 15px; }
.toast-body { font-size: 13.5px; color: #c8c6b9; margin-top: 4px; font-weight: 500; line-height: 1.5; }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ========== Responsive ========== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .will-grid { grid-template-columns: 1fr; }
  .will-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .topbar { left: 0; padding: 0 18px; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .main { margin-left: 0; padding: calc(var(--topbar-h) + 20px) 18px 60px; }
  .search { min-width: 0; flex: 1; }
  .page-title { font-size: 30px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .will-meta-grid { grid-template-columns: 1fr 1fr; }
  .news-item { grid-template-columns: 1fr; }
  .wish { grid-template-columns: 88px 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ========== Projection tabs ========== */
.proj-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-tab {
  background: #fff; border: 2px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.proj-tab:hover { border-color: var(--sage); color: var(--ink); }
.proj-tab.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.proj-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 6px;
}
.proj-summary-cell {
  background: var(--cream-soft); border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.proj-summary-cell .lbl {
  font-size: 11px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800;
}
.proj-summary-cell .val {
  font-family: 'Urbanist', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--ink);
  margin-top: 4px; letter-spacing: -0.3px;
}

/* ========== Journal blog layout ========== */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}
.journal-editor {
  padding: 0;
  display: flex; flex-direction: column;
  min-height: 600px;
}
.journal-toolbar {
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.journal-title-input {
  border: none; outline: none;
  font-family: 'Urbanist', sans-serif;
  font-size: 26px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.4px; padding: 0;
  background: transparent;
}
.journal-title-input::placeholder { color: var(--ink-mute); font-weight: 700; }
.journal-format-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fmt-btn {
  width: 34px; height: 34px;
  border: 2px solid var(--line); background: #fff; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--ink);
}
.fmt-btn:hover { background: var(--sage-soft); border-color: var(--sage); }
.fmt-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.journal-tags-input {
  flex: 1; min-width: 180px;
  border: 2px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.journal-tags-input:focus { outline: none; border-color: var(--sage); }
.journal-body-edit {
  flex: 1;
  padding: 22px 26px;
  font-family: 'Urbanist', sans-serif;
  font-size: 17px; line-height: 1.75; color: var(--ink); font-weight: 500;
  outline: none;
  min-height: 380px;
}
.journal-body-edit:empty:before {
  content: attr(data-placeholder);
  color: var(--ink-mute); font-weight: 500;
}
.journal-body-edit h2 { font-size: 26px; font-weight: 800; margin: 18px 0 8px; letter-spacing: -0.3px; }
.journal-body-edit b, .journal-body-edit strong { font-weight: 800; }
.journal-body-edit i, .journal-body-edit em { font-style: italic; }
.journal-body-edit blockquote {
  border-left: 4px solid var(--sage);
  margin: 14px 0; padding: 6px 14px;
  background: var(--sage-soft);
  font-weight: 600; color: var(--ink);
  border-radius: 0 8px 8px 0;
}
.journal-body-edit ul, .journal-body-edit ol { padding-left: 24px; margin: 12px 0; }
.journal-body-edit img {
  max-width: 100%; border-radius: 10px;
  margin: 14px 0;
  display: block;
  border: 2px solid var(--line);
}
.journal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.journal-status {
  font-size: 12px; color: var(--ink-mute); font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}

.journal-sidebar {
  background: #fff; border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: calc(var(--topbar-h) + 28px);
  max-height: calc(100vh - var(--topbar-h) - 60px);
  overflow: hidden;
}
.journal-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 2px solid var(--line);
  padding: 8px 12px; border-radius: 10px;
  color: var(--ink-soft);
}
.journal-search input {
  border: none; background: transparent; outline: none;
  flex: 1; font-size: 14px; font-weight: 500; color: var(--ink);
}
.journal-dates-header {
  font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: 1.3px; text-transform: uppercase; font-weight: 800;
  padding: 6px 4px;
}
.journal-dates {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 -8px; padding: 0 8px 8px;
}
.journal-date-item {
  background: transparent; border: none; cursor: pointer;
  text-align: left;
  padding: 10px 12px; border-radius: 8px;
  display: flex; flex-direction: column; gap: 2px;
  font-family: inherit;
}
.journal-date-item:hover { background: var(--sage-soft); }
.journal-date-item.active { background: var(--cream); }
.journal-date-item .jd-date {
  font-size: 11px; color: var(--ink-mute);
  letter-spacing: 1px; text-transform: uppercase; font-weight: 800;
}
.journal-date-item .jd-title {
  font-size: 14px; color: var(--ink); font-weight: 700;
  line-height: 1.3;
}

/* ========== Ask AInaya layout ========== */
.ainaya-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}
.ainaya-chat {
  display: flex; flex-direction: column;
  padding: 0;
  min-height: 380px;
}
.ainaya-thread {
  flex: 1; padding: 22px 26px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 480px; overflow-y: auto;
}
.ainaya-greeting {
  display: flex; gap: 16px; align-items: center;
  padding: 24px 4px;
}
.ainaya-greeting-mark {
  width: 56px; height: 56px; flex: 0 0 56px;
  border-radius: 16px;
  background: var(--ink); color: var(--cream);
  display: grid; place-items: center;
  font-family: 'Urbanist', sans-serif;
  font-weight: 800; font-size: 26px;
}
.ainaya-greeting-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 24px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.3px;
}
.ainaya-greeting-sub {
  font-size: 14.5px; color: var(--ink-soft); font-weight: 600;
  margin-top: 2px;
}
.chat-msg {
  display: flex; gap: 12px; align-items: flex-start;
}
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%;
  padding: 12px 16px; border-radius: 14px;
  font-size: 15px; line-height: 1.55; font-weight: 500;
}
.chat-msg.user .chat-bubble {
  background: var(--ink); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai .chat-bubble {
  background: var(--sage-soft); color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-msg .chat-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  flex: 0 0 34px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.chat-msg.ai .chat-avatar { background: var(--ink); color: var(--cream); }
.chat-msg.user .chat-avatar { background: var(--cream); color: var(--ink); }

.ainaya-input-row {
  border-top: 2px solid var(--line);
  padding: 14px 18px;
  display: flex; gap: 10px; align-items: flex-end;
}
.ainaya-input-row textarea {
  flex: 1;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px; font-weight: 500;
  resize: none;
  min-height: 56px; max-height: 180px;
  font-family: inherit; color: var(--ink);
}
.ainaya-input-row textarea:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(142,158,110,.18);
}
.ainaya-input-row .btn { padding: 14px 22px; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.agent-card {
  background: #fff; border: 2px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  text-align: left; cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.agent-card:hover { border-color: var(--sage); background: var(--sage-soft); }
.agent-card .ag-name {
  font-size: 14.5px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.1px;
}
.agent-card .ag-meta {
  font-size: 12px; color: var(--ink-mute); font-weight: 600;
}

.ainaya-amna-band {
  margin-top: 18px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.amna-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 19px; font-weight: 800; color: var(--cream);
}
.amna-sub {
  font-size: 14px; color: #c8c6b9; font-weight: 500;
  margin-top: 4px; max-width: 560px;
}

.ainaya-sidebar {
  background: #fff; border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky; top: calc(var(--topbar-h) + 28px);
  max-height: calc(100vh - var(--topbar-h) - 60px);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
}
.ainaya-side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: 1.3px; text-transform: uppercase; font-weight: 800;
  padding: 4px 4px 0;
}
.ainaya-side-head .btn { padding: 6px 12px; font-size: 12px; }
.ainaya-sessions {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 -6px; padding: 0 6px;
}
.ainaya-session {
  background: transparent; border: none; cursor: pointer; text-align: left;
  padding: 10px 12px; border-radius: 8px; font-family: inherit;
  display: flex; flex-direction: column; gap: 3px;
}
.ainaya-session:hover { background: var(--sage-soft); }
.ainaya-session.active { background: var(--cream); }
.ainaya-session .ses-title {
  font-size: 13.5px; color: var(--ink); font-weight: 700;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ainaya-session .ses-meta {
  font-size: 11px; color: var(--ink-mute); font-weight: 700;
}
.ainaya-empty {
  font-size: 13px; color: var(--ink-mute); font-weight: 500;
  padding: 14px; text-align: center;
}

@media (max-width: 1100px) {
  .journal-grid, .ainaya-grid { grid-template-columns: 1fr; }
  .journal-sidebar, .ainaya-sidebar { position: relative; top: auto; max-height: 380px; }
  .proj-summary { grid-template-columns: 1fr; }
}

/* ========== Skeleton ========== */
.skeleton {
  background: linear-gradient(90deg, #ebe9dc 0%, #faf8f0 50%, #ebe9dc 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
  height: 16px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
