/* ============================================
   AT PEACE REALTY — AGENT PORTAL STYLES
   Shared stylesheet for all portal pages.
   Loads AFTER tokens.css + base.css on every portal page.
   Primary accent: Hampton Blue (--accent).
   Warm accent: Maroon (--warm) — reserved for role labels
   and other "soul" elements. Status colors and icon-tile
   colors are portal-specific and declared in :root below.
   ============================================ */

:root {
  /* ----- Portal-specific status colors (not in tokens.css) ----- */
  --portal-success: #2E7D4F;
  --portal-warning: #C9963B;   /* matches public --warm-gold for cross-brand consistency */
  --portal-error:   #B92D2D;

  /* ----- Portal-specific icon-tile backgrounds ----- */
  --portal-icon-doc:   #2B5797;  /* blue  — .resource-icon.doc  */
  --portal-icon-img:   #2E7D4F;  /* green — .resource-icon.img  */
  --portal-icon-video: #C4841D;  /* gold  — .resource-icon.video */

  /* ----- Sidebar geometry ----- */
  --sidebar-width: 260px;

  /* ----- Sidebar active-state tints (Hampton Blue at sidebar intensity) ----- */
  --sidebar-active-bg:  rgba(44,74,110,0.18);
  --sidebar-hover-bg:   rgba(255,255,255,0.05);
  --sidebar-avatar-bg:  rgba(44,74,110,0.35);

  /* ----- Portal-local card geometry helpers ----- */
  --card-padding:    28px;
  --card-padding-sm: 20px;
}

/* ============================================
   BASE — reset + page chrome.
   (Public site loads base.css globally; portal pages
   may not yet, so we keep a minimal reset here too.)
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text-body);
  line-height: 1.7;
  background: var(--light-gray);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============================================
   LAYOUT — sidebar + main shell
   ============================================ */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--charcoal);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--t-base) var(--ease-soft);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  height: 36px;
}

.sidebar-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-top: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-section-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  transition: background var(--t-fast) var(--ease-soft),
              color var(--t-base) var(--ease-soft);
  cursor: pointer;
}

.sidebar-link:hover {
  color: var(--white);
  background: var(--sidebar-hover-bg);
}

/* Active state: Hampton-Blue tinted background + 3px accent rail */
.sidebar-link.active {
  color: var(--white);
  background: var(--sidebar-active-bg);
  border-right: 3px solid var(--accent);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  min-width: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-circle);
  background: var(--sidebar-avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
}

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

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-logout {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255,255,255,0.3);
  transition: color var(--t-base) var(--ease-soft);
}

/* Destructive affordance — warm (maroon) reads as "caution" against the
   cool Hampton-Blue active state. */
.sidebar-logout:hover {
  color: var(--warm);
}

.sidebar-logout svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-header {
  background: var(--white);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--charcoal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--black);
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--accent);
  transition: color var(--t-base) var(--ease-soft);
}

.breadcrumb a:hover {
  color: var(--accent-hover);
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.portal-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light-gray);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  width: 300px;
  transition: box-shadow var(--t-base) var(--ease-soft);
}

.portal-search:focus-within {
  box-shadow: var(--shadow-focus);
}

.portal-search svg {
  width: 16px;
  height: 16px;
  stroke: var(--silver);
  fill: none;
  stroke-width: 2;
  min-width: 16px;
}

.portal-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-body);
  width: 100%;
}

.portal-search input::placeholder {
  color: var(--silver);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
  padding: 32px;
}

/* ============================================
   PAGE HERO / INTRO
   ============================================ */
.portal-hero {
  /* Was a maroon-tinted dark gradient; now blends charcoal into a
     Hampton-Blue depth tint so the hero matches the new accent. */
  background: linear-gradient(135deg, var(--charcoal) 0%, #1f3550 100%);
  color: var(--white);
  border-radius: var(--r-md);
  padding: 48px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.portal-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 50%, var(--white) 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, var(--white) 1px, transparent 1px);
  background-size: 50px 50px, 70px 70px;
}

.portal-hero-content {
  position: relative;
  z-index: 2;
}

.portal-hero h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 12px;
}

.portal-hero h1 strong {
  font-weight: 700;
}

.portal-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  max-width: 600px;
}

/* ============================================
   QUICK LINKS GRID
   ============================================ */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.quick-link {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--card-padding) var(--card-padding-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
  cursor: pointer;
  display: block;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.quick-link-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-link-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icon-tile color variants. `.red` legacy name preserved (still
   used by JS/HTML); the swatch is now Hampton Blue per brand. */
.quick-link-icon.red       { background: var(--accent); }
.quick-link-icon.charcoal  { background: var(--charcoal); }
.quick-link-icon.silver    { background: var(--silver); }
.quick-link-icon.success   { background: var(--portal-success); }

.quick-link h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}

.quick-link p {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ============================================
   CONTENT CARDS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--black);
}

.section-header a {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--t-base) var(--ease-soft);
}

.section-header a:hover {
  color: var(--accent-hover);
}

.card {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ============================================
   RESOURCE GRID
   ============================================ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--card-padding-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.resource-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icon-tile types. `.pdf` switches from maroon to Hampton Blue
   (per the brand inversion); the others keep their semantic
   color, declared in :root as portal-specific tokens. */
.resource-icon.pdf   { background: var(--accent); }
.resource-icon.img   { background: var(--portal-icon-img); }
.resource-icon.doc   { background: var(--portal-icon-doc); }
.resource-icon.link  { background: var(--charcoal); }
.resource-icon.video { background: var(--portal-icon-video); }

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

.resource-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-meta {
  font-size: 0.78rem;
  color: var(--text-light);
}

.resource-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
  transition: color var(--t-base) var(--ease-soft);
}

.resource-action:hover {
  color: var(--accent-hover);
}

.resource-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-soft),
              border-color var(--t-base) var(--ease-soft),
              color var(--t-base) var(--ease-soft),
              transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ============================================
   VENDOR CARDS
   ============================================ */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.vendor-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
  display: block;
}

.vendor-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vendor-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 8px;
}

.vendor-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.vendor-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--t-base) var(--ease-soft);
}

.vendor-link:hover {
  color: var(--accent-hover);
}

.vendor-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   VIDEO GRID
   ============================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.video-card {
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm);
}

.video-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.video-thumb {
  position: relative;
  padding-top: 56.25%;
  background: var(--charcoal);
}

.video-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-thumb-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.video-thumb-placeholder svg {
  width: 48px;
  height: 48px;
  stroke: rgba(255,255,255,0.6);
  fill: none;
  stroke-width: 1.5;
}

.video-info {
  padding: 20px;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}

.video-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ============================================
   ADMIN — UPLOAD AREA
   ============================================ */
.upload-area {
  border: 2px dashed var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 60px 32px;
  text-align: center;
  background: var(--white);
  transition: background var(--t-base) var(--ease-soft),
              border-color var(--t-base) var(--ease-soft);
  cursor: pointer;
  margin-bottom: 32px;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.upload-area svg {
  width: 48px;
  height: 48px;
  stroke: var(--silver);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
}

.upload-area h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.upload-area p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.upload-area input[type="file"] {
  display: none;
}

.upload-category {
  margin-bottom: 24px;
}

.upload-category label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: 8px;
}

.upload-category select {
  width: 100%;
  max-width: 400px;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--white);
  transition: border-color var(--t-base) var(--ease-soft),
              box-shadow var(--t-base) var(--ease-soft);
}

.upload-category select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

/* ============================================
   UPLOAD PROGRESS
   ============================================ */
.upload-queue {
  margin-top: 24px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.upload-item-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
}

.upload-item-info {
  flex: 1;
}

.upload-item-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--black);
}

.upload-item-size {
  font-size: 0.75rem;
  color: var(--text-light);
}

.upload-progress-bar {
  height: 4px;
  background: var(--light-gray);
  border-radius: var(--r-pill);
  margin-top: 8px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--t-base) var(--ease-soft);
  width: 0%;
}

.upload-item-status {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.upload-item-status.uploading { color: var(--portal-warning); }
.upload-item-status.complete  { color: var(--portal-success); }
.upload-item-status.error     { color: var(--portal-error); }

/* ============================================
   BUTTONS — pill, match public-site pattern
   ============================================ */
.btn {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 40px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid transparent;
  transition: background var(--t-fast) var(--ease-soft),
              transform var(--t-base) var(--ease-calm),
              box-shadow var(--t-base) var(--ease-calm),
              color var(--t-base) var(--ease-soft),
              border-color var(--t-base) var(--ease-soft);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(44,74,110,0.22), 0 1px 3px rgba(44,74,110,0.10);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(44,74,110,0.32), 0 3px 8px rgba(44,74,110,0.18);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(44,74,110,0.22);
  transition-duration: var(--t-fast);
}

/* Ghost variant — switched from maroon to Hampton Blue to keep
   the primary action language unified across the portal. */
.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 440px;
  animation: slideIn var(--t-base) var(--ease-soft);
  border-left: 4px solid var(--charcoal);
}

.toast.success { border-left-color: var(--portal-success); }
.toast.error   { border-left-color: var(--portal-error); }
.toast.warning { border-left-color: var(--portal-warning); }

.toast-message {
  flex: 1;
  font-size: 0.88rem;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--silver);
  padding: 2px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--accent);
  border-radius: var(--r-circle);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  stroke: var(--silver);
  fill: none;
  stroke-width: 1.2;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ============================================
   FORMS — visual parity with public forms.css
   (Portal HTML uses class names like .profile-field
   and .upload-category; this is the generic .form-group
   pattern for any future use, matching the public site.)
   ============================================ */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--white);
  transition: border-color var(--t-base) var(--ease-soft),
              box-shadow var(--t-base) var(--ease-soft);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--silver);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

/* ============================================
   PROFILE BADGES — role labels (warm-accent territory)
   Most profile-* styles live inline in profile.html;
   the badges are placed here so the brand-correct
   role-label color is centralised.
   ============================================ */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* Admin = warm (maroon) tint — this is a role label, the
   exact "soul element" use case for the warm accent. */
.profile-badge.admin {
  background: var(--warm-tint-2);
  color: var(--warm);
}

/* Agent = warm-green status tint. */
.profile-badge.agent {
  background: var(--warm-green-light);
  color: var(--warm-green);
}

/* ============================================
   ADMIN-ONLY VISIBILITY
   ============================================ */
.admin-only {
  display: none;
}

body.is-admin .admin-only {
  display: block;
}

body.is-admin .sidebar-link.admin-only {
  display: flex;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .quick-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .page-content {
    padding: 20px;
  }

  .portal-hero {
    padding: 32px 24px;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .vendor-grid {
    grid-template-columns: 1fr;
  }

  .portal-search {
    width: 100%;
  }

  .main-header {
    padding: 16px 20px;
  }

  .main-header-right {
    display: none;
  }
}

@media (max-width: 480px) {
  .portal-hero h1 {
    font-size: 1.4rem;
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 0.7rem;
  }

  .btn {
    padding: 12px 28px;
  }
}
