/* ── Home dashboard — premium «2026» language (indigo→violet accent, soft
   radii & shadows). Panels render from Auth.getHomeNav() — the sidebar's own
   groups/permission gates — as compact tiles; the creator team additionally
   gets the cross-org activity FEED below the groups.
   NOTE: no Google-Fonts @import — render-blocking and unreliable on Iranian
   networks; Vazirmatn is self-hosted via /vendor/fonts.css. ── */
:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e8ebf2;
  --border-soft: #f1f3f9;
  --accent: #5b5bef;
  --accent-2: #8b5cf6;
  --accent-soft: #eef0ff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 6px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .12);
}

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

body {
  font-family: "Vazir", "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  background:
    radial-gradient(1200px 480px at 85% -8%, #ede9fe 0%, rgba(237, 233, 254, 0) 60%),
    radial-gradient(900px 420px at 5% 0%, #e0f2fe 0%, rgba(224, 242, 254, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  overflow-y: scroll;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

/* ── Dashboard ── */
.dashboard {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
#homeGroups { display: flex; flex-direction: column; gap: 24px; }

/* ── «مناسبت‌ها» nudge banner (creator team, today's birthdays) ── */
.moment-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: #7a4a00;
  background: linear-gradient(90deg, #fff4dd 0%, #ffe9f1 100%);
  border: 1px solid #ffd79b;
  box-shadow: 0 6px 20px rgba(255, 178, 62, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.moment-banner:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255, 140, 90, 0.22); }
.moment-banner-emoji { font-size: 24px; line-height: 1; }
.moment-banner-text { font-size: 15px; font-weight: 500; }
.moment-banner-text b { font-weight: 800; }
.moment-banner-cta { margin-inline-start: auto; font-weight: 700; font-size: 14px; color: #c2410c; white-space: nowrap; }

/* ── Greeting — one hero band ── */
.greeting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  /* 240deg: the accent wash sits on the RIGHT — beside the avatar/title in RTL. */
  background:
    linear-gradient(240deg, var(--accent-soft), rgba(238, 240, 255, 0) 55%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Circular avatar — profile photo when set, gradient initial otherwise.
   Circle + pill chip share one fully-round language (radii no longer clash). */
.greeting-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(91, 91, 239, 0.28);
  user-select: none;
}

.greeting-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

.greeting-text { min-width: 0; }

.greeting-text h1 {
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.greeting-text .subtitle {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

.greeting-date {
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;
}

/* ── Group headers — same language as the sidebar's section chips ── */
.group { display: flex; flex-direction: column; gap: 12px; }
.group[hidden] { display: none; }

.group-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.group-title::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}
.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  /* to left: solid beside the title (right, RTL), fading toward the far end */
  background: linear-gradient(to left, var(--border), transparent);
}
.group-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--border-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ── Panel tiles — compact icon+label chips (replaces the old wide cards) ── */
.hg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr));
  gap: 10px;
  align-items: stretch;
}
.hg-tile {
  --tone-bg: var(--accent-soft);
  --tone-fg: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  min-width: 0;
}
.hg-tile[data-tone="blue"]   { --tone-bg: #e8f1ff; --tone-fg: #2f6df0; }
.hg-tile[data-tone="teal"]   { --tone-bg: #e6f7f3; --tone-fg: #0f9d8a; }
.hg-tile[data-tone="amber"]  { --tone-bg: #fff4e3; --tone-fg: #e08a08; }
.hg-tile[data-tone="violet"] { --tone-bg: #f1efff; --tone-fg: #6d5bef; }
.hg-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--tone-fg) 35%, var(--border));
}
.hg-tile:focus-visible { outline: 2px solid var(--tone-fg); outline-offset: 2px; }
.hg-tile-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tone-bg);
  color: var(--tone-fg);
  display: grid;
  place-items: center;
}
.hg-tile-icon svg { width: 17px; height: 17px; }
.hg-tile-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ── Cross-org activity — ONE merged, searchable, pageable feed ── */
.org-activity { display: flex; flex-direction: column; gap: 12px; }
.org-activity[hidden] { display: none; }
.oaf-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oaf-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.oaf-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fbfbfe;
  direction: rtl;
}
.oaf-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.oaf-summary { font-size: 12px; color: var(--muted); white-space: nowrap; }
.oaf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
}
.oaf-item {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border-soft);
}
.oaf-item:last-child { border-bottom: 0; }
.oaf-org {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: start;
}
.oaf-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.6;
  overflow-wrap: anywhere;
  min-width: 0;
}
.oaf-meta { font-size: 11px; color: var(--faint); white-space: nowrap; }
.oaf-empty { padding: 18px; text-align: center; color: var(--faint); font-size: 12.5px; }
.oaf-more {
  align-self: center;
  padding: 7px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.oaf-more:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.oaf-more[hidden] { display: none; }

/* ── Empty state ── */
.dashboard-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 0;
}
.dashboard-empty[hidden] { display: none; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .dashboard { padding: 20px 12px 64px; gap: 20px; }
  #homeGroups { gap: 20px; }
  .greeting { flex-wrap: wrap; }
  .greeting-date { margin-inline-start: 0; order: 3; width: 100%; text-align: center; }
  .hg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oaf-item { grid-template-columns: 1fr auto; }
  .oaf-item .oaf-text { grid-column: 1 / -1; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hg-tile, .moment-banner { transition: none; }
  .hg-tile:hover { transform: none; }
}
