/* =============================================
   Arterra — Shared Portal Dashboard Styles
   ============================================= */

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

:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --text-primary: #1C1C1C;
  --text-secondary: #6B6560;
  --text-muted: #9E9892;
  --border: #E8E2DC;
  --sidebar-bg: #161614;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-text: rgba(255, 255, 255, 0.55);
  --sidebar-text-active: #FFFFFF;
  --sidebar-width: 248px;
  --accent: #8B6F47; /* overridden per portal via inline style */
  --accent-light: color-mix(in srgb, var(--accent) 12%, transparent);
  --shadow-card: 0 1px 12px rgba(0, 0, 0, 0.05);
  --radius: 10px;
  --radius-sm: 7px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transition: width 0.2s ease;
}

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

.sidebar-top {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 8px;
}

.sidebar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
}

.sidebar-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-section {
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
  padding: 12px 8px 5px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.sidebar-icon {
  font-size: 0.9375rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.sidebar-link.active .sidebar-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.sidebar-user {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-signout {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
  padding: 2px;
}

.sidebar-signout:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── MAIN ── */
.portal-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

/* ── HEADER ── */
.portal-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-heading {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.12s;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
}

.notif-btn:hover { background: var(--bg); }

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--surface);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.12s;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text-primary);
}

/* ── CONTENT ── */
.portal-content {
  padding: 28px;
  flex: 1;
}

.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.content-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.content-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin: 4px 0 5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-change.up { color: #2D8A4E; }
.stat-change.down { color: #C0392B; }
.stat-change.neutral { color: var(--text-muted); }

/* ── GRID LAYOUTS ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── SECTION CARDS ── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── LIST ITEMS ── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #FAFAF8; }

.list-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

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

.list-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-end {
  text-align: right;
  flex-shrink: 0;
}

.list-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.list-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── TAGS ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-green  { background: #ECFDF4; color: #166534; }
.tag-amber  { background: #FFFBEB; color: #92400E; }
.tag-blue   { background: #EFF6FF; color: #1E40AF; }
.tag-red    { background: #FEF2F2; color: #991B1B; }
.tag-muted  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.tag-accent {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── QUICK ACTIONS PANEL ── */
.quick-actions {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.quick-action:hover { background: var(--bg); }

.qa-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  margin-top: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── CALENDAR STRIP ── */
.cal-strip {
  display: flex;
  gap: 6px;
  padding: 14px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.cal-strip::-webkit-scrollbar { display: none; }

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  border: 1px solid transparent;
}

.cal-day:hover { background: var(--bg); }

.cal-day.active {
  background: var(--accent);
  border-color: var(--accent);
}

.cal-dow {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cal-day.active .cal-dow { color: rgba(255,255,255,0.7); }

.cal-date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.cal-day.active .cal-date { color: #FFFFFF; }

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day.active .cal-dot { background: rgba(255,255,255,0.6); }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: repeat(2, 1fr); }
}

/* ── SIDEBAR COLLAPSE BUTTON ─────────────────────────────────────────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  background: none;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}
.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
}

/* ── HAMBURGER (mobile, injected by sidebar.js) ─────────────────────── */
.sidebar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 1.125rem;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 6px;
}
.sidebar-hamburger:hover { background: var(--bg); }

/* ── COLLAPSED SIDEBAR STATE ─────────────────────────────────────────── */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .sidebar-top { padding: 16px 6px 12px; }
body.sidebar-collapsed .sidebar-logo { display: none; }
body.sidebar-collapsed .sidebar-portal-badge { display: none; }
body.sidebar-collapsed .sidebar-section { padding: 0 6px; }
body.sidebar-collapsed .sidebar-section-label { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 9px 0; }
body.sidebar-collapsed .sidebar-icon { font-size: 1.125rem; }
body.sidebar-collapsed .sidebar-label { display: none; }
body.sidebar-collapsed .sidebar-badge { display: none; }
body.sidebar-collapsed .sidebar-user { padding: 10px 6px; justify-content: center; }
body.sidebar-collapsed .sidebar-user-info { display: none; }
body.sidebar-collapsed .sidebar-signout { display: none; }
body.sidebar-collapsed .sidebar-avatar { margin: 0 auto; }

/* Shift main content when sidebar is collapsed */
body.sidebar-collapsed .portal-main,
body.sidebar-collapsed .messages-layout { margin-left: 60px; }

/* ── MOBILE SIDEBAR ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  /* Sidebar open via body class (set by sidebar.js) */
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
  }
  /* Never use icon-only mode on mobile — always full width when open */
  body.sidebar-collapsed .sidebar { width: var(--sidebar-width); }

  .portal-main,
  .messages-layout { margin-left: 0 !important; }

  .portal-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: 1fr; }
}

/* Backdrop overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 90;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Legal footer ────────────────────────────────────────────────────── */
.legal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 24px 120px; /* large bottom padding clears the fixed dock */
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legal-footer a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s;
}

.legal-footer a:hover { opacity: 0.7; text-decoration: underline; }

/* ── Tier badges ─────────────────────────────────────────────────────── */
/* Use inline on sidebar links, card headers, or section titles */
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 20px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1.6;
}

.tier-badge-premium {
  background: #FEF3EB;
  color: #C05621;
  border: 1px solid #F0C4A3;
}

.tier-badge-pro {
  background: #3B2314;
  color: #E8936A;
}

/* Upgrade nudge banner — appears inside a section-card or content-card */
.upgrade-nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FEF3EB 0%, #FFF9F5 100%);
  border-top: 1px solid #F0C4A3;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.upgrade-nudge-icon { font-size: 1rem; flex-shrink: 0; }

.upgrade-nudge-text { flex: 1; }
.upgrade-nudge-text strong { color: #C05621; font-weight: 600; }

.upgrade-nudge-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: #C05621;
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 12px;
  border: 1px solid #C05621;
  border-radius: 20px;
  transition: background 0.12s;
}

/* ── Notification badge ─────────────────────────────────────────── */
/* Red counter bubble on the bell icon. Hidden when count = 0.     */
.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--surface, #FFFFFF);
  pointer-events: none;
  letter-spacing: 0;
}

.notif-badge[data-count="0"],
.notif-badge:empty {
  display: none;
}

/* Active bell state when dropdown is open */
.notif-btn.nd-active {
  background: rgba(192, 86, 33, 0.08);
  border-radius: 6px;
}

/* ── Notification dropdown panel ────────────────────────────────── */
.notif-dropdown {
  position: absolute;
  width: 320px;
  max-height: 480px;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 10px 24px -4px rgba(0,0,0,0.14);
  border: 1px solid rgba(0,0,0,0.07);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

.notif-dropdown.nd-open {
  display: flex;
}

/* Triangle caret pointing up */
.nd-caret {
  position: absolute;
  top: -7px;
  right: 14px;
  width: 14px;
  height: 7px;
  overflow: visible;
}

.nd-caret::before,
.nd-caret::after {
  content: '';
  position: absolute;
  left: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.nd-caret::before {
  top: -1px;
  border-bottom: 8px solid rgba(0,0,0,0.10);
}

.nd-caret::after {
  top: 1px;
  border-bottom: 7px solid #FFFFFF;
}

/* Header */
.nd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F1EDE8;
  flex-shrink: 0;
}

.nd-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1A1208;
}

.nd-mark-read {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #C05621;
  letter-spacing: 0.01em;
}

.nd-mark-read:hover { text-decoration: underline; }
.nd-mark-read:disabled { color: #999; cursor: default; text-decoration: none; }

/* Scrollable list */
.nd-list {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

/* Notification item */
.nd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.1s;
}

.nd-item:hover { background: #FAF7F4; }

.nd-item.unread {
  border-left-color: #C05621;
  background: #FEF9F5;
}

.nd-item.unread:hover { background: #FEEDE0; }

/* Icon bubble */
.nd-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: #F3EFE9;
}

.nd-icon-message  { background: #EBF2FF; }
.nd-icon-opp      { background: #FEF3EB; }
.nd-icon-collab   { background: #ECFDF5; }
.nd-icon-event    { background: #FFFBEB; }
.nd-icon-system   { background: #FEF3EB; }

/* Body */
.nd-body { flex: 1; min-width: 0; }

.nd-text {
  margin: 0 0 3px;
  font-size: 0.8125rem;
  color: #2D2015;
  line-height: 1.4;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nd-item.unread .nd-text { font-weight: 500; }

.nd-time {
  font-size: 0.6875rem;
  color: #9E8C7A;
}

/* Empty state */
.nd-empty {
  padding: 36px 16px;
  text-align: center;
  color: #9E8C7A;
  font-size: 0.875rem;
}

/* Footer */
.nd-footer {
  border-top: 1px solid #F1EDE8;
  padding: 10px 16px;
  flex-shrink: 0;
  text-align: center;
}

.nd-view-all {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #C05621;
  text-decoration: none;
}

.nd-view-all:hover { text-decoration: underline; }

/* Mobile: full width */
@media (max-width: 600px) {
  .notif-dropdown {
    width: calc(100vw - 16px);
    left: 8px !important;
    right: auto !important;
  }
}

.upgrade-nudge-link:hover { background: #FEF3EB; }

/* ═══════════════════════════════════════════════════════════════
   VENUE AVAILABILITY CALENDAR
   ═══════════════════════════════════════════════════════════════ */

/* Month navigation row */
.av-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.av-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.av-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: background 0.1s;
  font-family: 'Inter', sans-serif;
}

.av-nav-btn:hover { background: var(--bg); }

/* Status selector (venue manage mode only) */
.av-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.av-status-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.av-status-btns { display: flex; gap: 5px; flex-wrap: wrap; }

.av-status-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.4;
}

.av-status-btn.available       { background: #DCFCE7; color: #166534; border-color: #DCFCE7; }
.av-status-btn.available.active{ border-color: #16A34A; box-shadow: 0 0 0 2px rgba(22,163,74,0.2); }
.av-status-btn.booked          { background: #F1F5F9; color: #475569; border-color: #F1F5F9; }
.av-status-btn.booked.active   { border-color: #64748B; box-shadow: 0 0 0 2px rgba(100,116,139,0.2); }
.av-status-btn.hold            { background: #FEF9C3; color: #854D0E; border-color: #FEF9C3; }
.av-status-btn.hold.active     { border-color: #D97706; box-shadow: 0 0 0 2px rgba(217,119,6,0.2); }
.av-status-btn.closed          { background: #FEE2E2; color: #991B1B; border-color: #FEE2E2; }
.av-status-btn.closed.active   { border-color: #DC2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }
.av-status-btn.clear           { background: var(--surface); color: var(--text-muted); border-color: var(--border); }
.av-status-btn.clear.active    { border-color: var(--text-secondary); }

/* Calendar grid */
.av-cal-wrap { padding: 12px 16px 4px; }

.av-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.av-dow {
  text-align: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0 6px;
}

.av-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  transition: all 0.1s;
  font-family: 'Inter', sans-serif;
  min-height: 32px;
  user-select: none;
}

.av-day.past   { opacity: 0.35; }
.av-day.today  { border-color: var(--accent, #C0622C) !important; font-weight: 700; }

.av-day.available  { background: #DCFCE7; color: #166534; font-weight: 600; }
.av-day.booked     { background: #F1F5F9; color: #64748B; }
.av-day.hold       { background: #FEF9C3; color: #854D0E; font-weight: 600; }
.av-day.closed     { background: #FEE2E2; color: #991B1B; }
.av-day.unavailable{ background: #F1F5F9; color: #94A3B8; }

/* Clickable in manage mode */
.av-day.clickable  { cursor: pointer; }
.av-day.clickable:not(.past):hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 1;
  position: relative;
}

/* Requestable in public mode (available + performer) */
.av-day.requestable { cursor: pointer; }
.av-day.requestable:hover {
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
  transform: scale(1.1);
  z-index: 1;
  position: relative;
}

/* Legend */
.av-legend {
  display: flex;
  gap: 14px;
  padding: 6px 20px 14px;
  flex-wrap: wrap;
}

.av-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.av-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.av-dot.available  { background: #86EFAC; }
.av-dot.booked     { background: #CBD5E1; }
.av-dot.hold       { background: #FDE68A; }
.av-dot.closed     { background: #FCA5A5; }
.av-dot.unavailable{ background: #E2E8F0; }

/* iCal sync section */
.av-ical-section {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.av-ical-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.av-ical-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.av-ical-optional {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
}

.av-ical-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 10px;
}

.av-ical-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.av-ical-input {
  flex: 1;
  font-size: 0.8125rem !important;
  min-width: 0;
}

.av-ical-status-msg {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.av-ical-status-msg.ok { color: #16A34A; }

/* ═══════════════════════════════════════════════════════════════
   BOOKING REQUEST MODAL
   ═══════════════════════════════════════════════════════════════ */

.booking-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.booking-modal {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #FFFFFF;
  z-index: 1;
  border-radius: 16px 16px 0 0;
}

.bm-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bm-close {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

.bm-close:hover { background: var(--bg); color: var(--text-primary); }

.bm-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bm-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  color: #166534;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.bm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bm-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bm-label-note {
  font-weight: 400;
  color: var(--text-muted);
}

.bm-select, .bm-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface);
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.bm-select:focus, .bm-textarea:focus {
  outline: none;
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

.bm-textarea { resize: vertical; min-height: 80px; }

.bm-char-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: right;
}

.bm-char-count.warn  { color: #D97706; }
.bm-char-count.limit { color: #DC2626; }

.bm-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bm-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-primary);
}

.bm-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #16A34A;
  cursor: pointer;
  flex-shrink: 0;
}

.bm-radios { display: flex; flex-direction: column; gap: 8px; }

.bm-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s;
}

.bm-radio-item:has(input:checked) {
  border-color: #16A34A;
  background: #F0FDF4;
}

.bm-radio-item input[type="radio"] {
  margin-top: 3px;
  accent-color: #16A34A;
  cursor: pointer;
  flex-shrink: 0;
}

.bm-radio-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bm-radio-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.bm-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Success state */
.bm-success {
  padding: 36px 24px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bm-success-icon {
  width: 56px;
  height: 56px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  color: #16A34A;
  font-weight: 700;
}

.bm-success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bm-success-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   PERFORMER TOGGLE & TYPE SELECTOR
   ═══════════════════════════════════════════════════════════════ */

.performer-types-field {
  padding: 12px 14px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  margin-top: 10px;
  display: none;
}

.performer-types-field.visible { display: block; }

.performer-types-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #166534;
  margin-bottom: 8px;
}

.performer-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.performer-type-tag {
  padding: 4px 11px;
  border-radius: 20px;
  border: 1.5px solid #BBF7D0;
  background: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  color: #16A34A;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  font-family: 'Inter', sans-serif;
}

.performer-type-tag.selected {
  background: #16A34A;
  color: #FFFFFF;
  border-color: #16A34A;
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCED BOOKING ROWS (bookings.html)
   ═══════════════════════════════════════════════════════════════ */

.booking-row-detail {
  display: none;
  padding: 0 20px 16px 76px;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.booking-row-detail.open { display: flex; }
.booking-row.open { background: var(--bg); }

.brd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

.brd-field { display: flex; flex-direction: column; gap: 2px; }
.brd-label { font-size: 0.6875rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.brd-value { font-size: 0.8125rem; color: var(--text-primary); line-height: 1.4; }

.brd-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
}

.booking-actions-full {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.booking-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.booking-status-chip.accepted { background: #DCFCE7; color: #166534; }
.booking-status-chip.declined { background: #FEE2E2; color: #991B1B; }
.booking-status-chip.pending  { background: #FEF9C3; color: #854D0E; }
