*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #B45F06;
  --primary-dark:  #7A4004;
  --primary-light: #F5E6D3;
  --primary-wash:  #FDF6EF;
  --black:         #000000;
  --dark:          #333333;
  --mid:           #666666;
  --light:         #CCCCCC;
  --border:        #E8D5C0;
  --white:         #FFFFFF;
  --page-bg:       #FAF7F4;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }


/* ── TOPBAR ─────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1.5px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 10px 1rem;
  min-height: 58px;
  height: auto; /* Allows height to grow when items stack */
  user-select: none;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* Allows stacking */
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.logo-mark svg { width: 16px; height: 16px; fill: var(--white); }

.logo-text {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--black);
  letter-spacing: -0.2px;
}

.logo-text em {
  font-style: normal;
  color: var(--primary);
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  min-width: 140px;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--mid);
  stroke-width: 2;
  pointer-events: none; /* Allows you to click "through" the icon into the input */
}

.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark);
  background: var(--primary-wash);
  outline: none;
  transition: border-color 0.15s;
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: var(--white);
}

.topbar-search input::placeholder { color: var(--mid); }

@media (max-width: 450px) {
  .topbar-search { display: none; }
  .topbar-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
    margin-top: 10px;
  }

  .topbar-right .btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  /* Adjust topbar-inner to handle the extra height */
  .topbar-inner {
      flex-direction: row;
      flex-wrap: wrap;
  }
  .logo-text {
    font-size: 1.1rem;
  }
}
/* Update the existing container */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* New group for the buttons */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px; /* Standard spacing between buttons */
}

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.btn:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--dark);
}

.btn-ghost:hover { background: var(--primary-wash); border-color: var(--primary); color: var(--primary-dark); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-dark {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-dark:hover { background: var(--dark); }

/* MOBILE FIX */
@media (max-width: 768px) {
  .topbar {
      position: relative; /* Context for avatar positioning */
      padding-right: 60px; /* Make room for the pinned avatar */
  }

  .topbar-inner {
      gap: 0.5rem;
  }

  /* Force the button group to its own line below logo/search */
  .topbar-right {
      flex-basis: 100%; 
      order: 3; /* Ensures it sits below logo (1) and search (2) */
      overflow-x: auto; 
      padding-bottom: 4px;
      justify-content: flex-start;
  }



  /* Pin Avatar to the top right corner so it doesn't move when buttons stack */
  .avatar {
      position: absolute;
      right: 1rem;
      top: 10px;
  }
}

.avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  border: 2px solid var(--border);

  /* NEW: Centers the text perfectly both vertically and horizontally */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* NEW: Makes the initials look like a clean graphic */
  font-family: var(--font-body);
  font-weight: bold;
  font-size: 15px;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

.avatar:hover {
  transform: scale(1.05);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ── USER DROPDOWN (Matches Brand Palette) ── */
.user-profile-container {
  position: absolute;
  right: 2px;
  top:0;
  min-height: 58px;
}

.avatar-wrapper {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.avatar-wrapper:hover {
  border-color: var(--primary); /* */
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--white); /* */
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(180, 95, 6, 0.15); /* Tinted with --primary */
  border-radius: var(--radius-md); /* */
  border: 1px solid var(--border); /* */
  z-index: 1000;
  padding: 12px 0;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-header {
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
}

.d-name { 
  font-weight: 600; 
  color: var(--black); /* */
  font-size: 15px; 
}

.d-role { 
  color: var(--primary); /* */
  font-size: 11px; 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
  font-weight: 700;
  margin-top: 4px; 
}

.d-dept { 
  color: var(--mid); /* */
  font-size: 13px; 
  margin-top: 2px;
}

.user-dropdown hr { 
  border: 0; 
  border-top: 1px solid var(--border); /* */
  margin: 10px 0; 
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--dark); /* */
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.logout-link svg {
  color: var(--mid); /* */
}

.logout-link:hover { 
  background: var(--primary-wash); /* */
  color: var(--primary); /* */
}

.logout-link:hover svg {
  color: var(--primary); /* */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Admin mode toggle chip */
.admin-mode-chip {
  background: transparent;
  border-color: var(--border);
  color: var(--dark);
}

.admin-mode-chip.active {
  background-color: var(--primary);
  border-color: var(--border);
  color: var(--white);
}

/* ── HERO BANNER ────────────────────────────────────── */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 2.5rem 2rem;
  border-bottom: 3px solid var(--primary);
  user-select: none;
}

.hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 10px;
}

.hero-title em {
  font-style: italic;
  color: var(--primary);
}

.hero-sub {
  font-size: 14px;
  color: #aaa;
  max-width: 480px;
  line-height: 1.6;
}

.hero-stats {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  padding-bottom: 4px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--primary);
  line-height: 1;
  text-align: center;
}

.hero-stat-label {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #888;
  margin-top: 4px;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.page-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2rem;
  flex: 1;
  width: 100%;
}

/* ── TOOLBAR ────────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 1.5rem;
  }

.toolbar-left { display: flex; row-gap: 6px; column-gap: 6px;flex-wrap: wrap; flex: 1; }

.filter-pill {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.filter-pill:hover { border-color: var(--primary); color: var(--primary-dark); }

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.sort-select {
  font-size: 12px; padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--dark);
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  margin-left: auto;
}

.sort-select:focus { border-color: var(--primary); }

/* ── ISSUE CARD ─────────────────────────────────────── */
.issue-list { display: flex; flex-direction: column; gap: 0; user-select: none; }

.issue-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex; gap: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
  animation: cardIn 0.3s ease both;
  position: relative;
}

.disclaimer {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--dark);
  text-align: right;
  margin-top: 8px;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.issue-card:hover { border-color: var(--primary); z-index: 10;}

.issue-card.is-escalated { border-left: 3px solid var(--primary-dark); }

.issue-card.is-resolved { background-color: rgba(255, 255, 255, 0.7);}

/* King of the Hill — #1 ranked card */
.issue-card.is-koth {
  border: 2px solid var(--primary);
  background: var(--primary-wash);
}

.koth-crown {
  position: absolute;
  top: -11px; left: 16px;
  background: var(--primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 99px;
}

.issue-card.is-koth .vote-score {
  color: var(--primary);
  font-size: 20px;
}

.issue-card.is-koth .issue-title { font-size: 17px; }

/* ── INTENSITY HEAT SCALE ──────────────────────────── */
.badge-intensity {
  font-weight: 700;
  border: 1px solid var(--border);
}

/* Level 1-2: Minor/Occasional (Greyscale) */
.intensity-1, .intensity-2 { 
  background: var(--primary-wash); 
  color: var(--mid); 
}

/* Level 3: Significant (Amber/Gold) */
.intensity-3 { 
  background: #FEF3C7; 
  color: #92400E; 
  border-color: #F59E0B; 
}

/* Level 4: Instructional Blocker (Brand Orange) */
.intensity-4 { 
  background: var(--primary-light); 
  color: var(--primary-dark); 
  border-color: var(--primary); 
}

/* Level 5: Immediate Crisis (Black) */
.intensity-5 { 
  background: var(--black); 
  color: var(--white); 
  border-color: var(--black);
}

/* ── VOTE COLUMN ────────────────────────────────────── */
.vote-col {
  display: flex; 
  flex-direction: column;
  align-items: center; 
  gap: 5px;
  min-width: 38px; 
  padding-top: 2px;
}

.vote-btn {
  /* THE CRITICAL FIX: Anchor the tooltip to this button */
  position: relative; 
  width: 26px; 
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 11px;
  color: var(--mid);
  transition: all 0.12s;
  font-family: var(--font-body);
}

/* 1. Common Tooltip Styles (Applies to both Up and Down) */
.vote-btn:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  
  /* Matches the badges perfectly now */
  background-color: var(--primary);
  color: var(--white);
  padding: 8px 12px; 
  border-radius: var(--radius-sm); 
  font-size: 12px;    
  line-height: 1.4;
  
  white-space: normal;
  width: 120px;
  text-align: center; 
  z-index: 10000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3); /* Matches the badge shadow */
  pointer-events: none;
}

/* 2. Common Arrow (Triangle) Styles */
.vote-btn:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-style: solid;
  z-index: 10000;
}

/* 3. Specific UP ARROW Logic */
.vote-btn.up:hover::after {
  bottom: 140%; /* Position box above */
}
.vote-btn.up:hover::before {
  bottom: 120%; /* Position triangle above */
  border-width: 6px 6px 0 6px;
  border-color: var(--primary) transparent transparent transparent;
}

/* 4. Specific DOWN ARROW Logic */
.vote-btn.down:hover::after {
  top: 140%; /* Position box below */
}
.vote-btn.down:hover::before {
  content: ''; /* Ensure it generates */
  position: absolute; /* Force absolute positioning */
  top: 120%; /* Position triangle below */
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent var(--primary) transparent;
}

/* Button States */
.vote-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-wash); }
.vote-btn.up.active   { background: var(--primary); border-color: var(--primary); color: var(--white); }
.vote-btn.down.active { background: var(--black); border-color: var(--black); color: var(--white); }

.vote-score {
  font-size: 16px; font-weight: 500;
  color: var(--black);
  line-height: 1;
}

/* ── ISSUE BODY ─────────────────────────────────────── */
.issue-body { flex: 1; min-width: 0; }

.issue-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--primary-dark);
  cursor: pointer;
  line-height: 1.3;
  margin-bottom: 6px;
  transition: color 0.12s;
}

.issue-title:hover { color: var(--primary); }

.issue-excerpt {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.55;
  margin-bottom: 10px;
}

.issue-meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Department badges */
.badge-athletics   { background: #FDE8CC; color: #7A4004; }
.badge-campus      { background: #E3F2FD; color: #0D47A1; }
.badge-cte         { background: #FFF3E0; color: #E65100; }
.badge-english     { background: #EDE7F6; color: #4527A0; }
.badge-fineArts    { background: #FCE4EC; color: #880E4F; }
.badge-lote        { background: #E8F5E9; color: #1B5E20; }
.badge-math        { background: #E1F5FE; color: #01579B; }
.badge-science     { background: #DCEDC8; color: #33691E; }
.badge-socialStudies { background: #FFF8E1; color: #F57F17; }

/* Status badges */
/* Base badge styling is already in your overflow.css */

.badge-open { 
    background: var(--primary-wash); 
    color: var(--color-open); 
    border: 1px solid var(--border); 
}

.badge-prioritizing { 
    background: var(--primary-light); 
    color: var(--primary-dark); 
    border: 1px solid var(--primary); 
}

.badge-in-discussion { 
    background: var(--white); 
    color: var(--primary-dark); 
    border: 1.5px dashed var(--primary); /* Dashed implies 'in-work' */
}

.badge-on-hold { 
    background: var(--bg-on-hold); 
    color: #92400E; /* Deep brown-orange for readability */
    border: 1px solid #F59E0B;
}

.badge-escalated { 
    background: var(--primary-dark); 
    color: var(--white); 
}

.badge-resolved { 
    background: #DCEDC8; 
    color: var(--color-resolved); 
}

/* Meta badges — dept and term (from DB fields) */
.badge-dept {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

.badge-term {
  background: #F3E5F5;
  color: #4A148C;
}

.issue-comments {
  font-size: 12px; color: var(--mid);
  display: flex; align-items: center; gap: 4px;
}

.issue-comments svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.issue-byline {
  font-size: 11px; color: var(--light);
  margin-left: auto;
}

/* ── ADMIN BAR ──────────────────────────────────────── */
.admin-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

.admin-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--light);
  margin-right: 2px;
}

.admin-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.12s;
}

.admin-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-wash); }
.admin-btn.danger:hover { border-color: #c0392b; color: #c0392b; background: #fdf0ef; }

.issue-card:has(.is-open) {
    position: relative;
    z-index: 9999;
  }

/* 1. Stop it from stretching to 100% width! */
.custom-select.admin-status-custom {
    width: auto;
    min-width: 100px;
    position: relative; /* REQUIRED for z-index to work! */
  }

  /* POP THE PARENT FORWARD WHEN OPEN */
  .admin-status-custom.is-open {
    z-index: 999;
  }
  
  /* 2. Force your exact dimensions and colors, overriding the global select-trigger */
  .admin-status-custom .admin-status-trigger {
    font-size: 11px;
    padding: 3px 20px 3px 8px; 
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--dark);
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
    user-select: none;
    position: relative;
    transition: all 0.15s;
  }
  
  /* 3. Your exact hover effect */
  .admin-status-custom .admin-status-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--white); 
  }
  
  /* 4. Your exact focus effect (also applies when the menu is actively open) */
  .admin-status-custom.is-open .admin-status-trigger,
  .admin-status-custom .admin-status-trigger:focus {
    box-shadow: 0 0 0 2px var(--primary-light);
  }
  
  /* 5. The tiny custom dropdown arrow */
  .admin-status-custom .admin-status-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 6px;
    margin-top: -5px; 
    width: 10px;
    height: 10px;
    /* Default Gray Arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666666' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform: rotate(0deg);
    transform-origin: center center;
    transition: transform 0.2s ease;
  }

  .admin-status-custom .admin-status-trigger:hover::after,
  .admin-status-custom.is-open .admin-status-trigger::after {
    /* Orange Arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B45F06' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  }
  
  .admin-status-custom.is-open .admin-status-trigger::after {
    transform: rotate(180deg);
  }
  
  /* 6. Shrink the actual popup menu options to match the tiny 11px aesthetic */
  .admin-status-custom .select-options {
    top: calc(100% + 1px);
    border-color: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1000; /* FORCES THE DROPDOWN MENU ABOVE THE NEXT CARD */
  }
  
  .admin-status-custom .option {
    font-size: 11px;
    padding: 6px 10px;
    color: var(--primary-dark);
  }
  
  /* Subtle hover for the options so it doesn't overwhelm the small bar */
  .admin-status-custom .option:hover {
    background: var(--primary-wash);
    color: var(--primary);
  }

/* Admin Bar */
.admin-actions-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Updated to stack vertically for the larger textarea */
.admin-input-group {
  display: flex;
  flex-direction: column; 
  gap: 10px;
}

/* Updated from input to textarea style */
.admin-quick-input {
  width: 100%;
  min-height: 100px; /* Gives the 'much larger' space you requested */
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit; /* Ensures it doesn't default to monospace */
  background: var(--page-bg);
  resize: vertical; /* Allows admins to manually stretch it even further */
}

.admin-quick-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-quick-add {
  align-self: flex-end; /* Moves the button to the bottom-right of the textarea */
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px; /* Made slightly larger to match the bigger box */
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-quick-add:hover {
  filter: brightness(0.9);
}

.admin-quick-cancel {
  align-self: flex-end; /* Moves the button to the bottom-right of the textarea */
  background: var(--mid);
  color: white;
  border: none;
  padding: 10px 20px; /* Made slightly larger to match the bigger box */
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-quick-cancel:hover {
  filter: brightness(0.9);
}

.edited-tag{
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  margin-left: 2px;
  font-style: italic;
  opacity: 0.8;
}

.admin-utility-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.admin-btn-sm {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--mid);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-btn-sm.danger:hover {
  color: #DC2626;
}

.admin-id-badge {
  background-color: var(--primary-wash);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: monospace; /* Makes numbers easier to read */
  font-size: 0.85em;
  margin-right: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
}

/* Chair's note */
.chairs-note {
  margin-top: 8px;
  background: #fffbf5;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--dark);
  line-height: 1.5;
  display: none;
}

.chairs-note.visible { display: block; }

.chairs-note-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 3px;
}

.chairs-note-input {
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  display: none;
}

.chairs-note-input.visible { display: block; }

/* ── NEW ISSUE FORM ──────────────────────────────────── */
.post-form {
  background: var(--white);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: none;
  user-select: none;
}

.post-form.open { display: block; animation: formIn 0.2s ease; }

@keyframes formIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-form h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--black);
  margin-bottom: 1rem;
}

.form-field { margin-bottom: 10px; }

.form-field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mid);
  margin-bottom: 5px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark);
  background: var(--primary-wash);
  outline: none;
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--primary);
  background: var(--white);
}

.form-field textarea { height: 80px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1rem; }

/* ── DropDownHack ────────────────────────────────────── */
.custom-select { position: relative; width: 100%; overflow: visible !important; }

/* Merged Styling: This matches your exact .form-field select rules */
.select-trigger {
    width: 100%;
    position: relative;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--dark);
    background: var(--primary-wash);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
/* 2. Universal Dropdown Arrow (Orange) */
.select-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -6px; 
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B45F06' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    
    /* THE FIX: Anchor the starting point */
    transform: rotate(0deg);
    transform-origin: center center;
    
    /* IMPORTANT: Ensure this says 'transform', not 'all' */
    transition: transform 0.2s ease;
  }

/* Focus state matches your existing input:focus */
.custom-select.is-open .select-trigger {
  border-color: var(--primary);
  background: var(--white);
}

/* The Popup: This is the part we are 'fixing' */
.select-options {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none; 
  z-index: 500;
/*  overflow: hidden;*/
  user-select: none;
}

.custom-select.is-open .select-options { display: block; }

.option {
  position: relative;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--dark);
}

.option:hover {
  background: var(--primary-light); 
  color: var(--primary-dark);
}

.trigger-label {
  pointer-events: none;
}

.toolbar-sort {
    display: inline-block;
    position: relative;
    max-width: 108px;
    flex-shrink: 0;
  }
  
  .select-trigger.pill-style {
    font-size: 12px;
    padding: 5px 28px 5px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
    user-select: none;
  }
  
  .select-trigger.pill-style::after {
    right: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666666' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  }
  

  .select-trigger.pill-style:hover,
  .toolbar-sort.is-open .select-trigger.pill-style {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--white); 
  }

  .select-trigger.pill-style:hover::after,
  .toolbar-sort.is-open .select-trigger.pill-style::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B45F06' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  }
  
  .custom-select.is-open .select-trigger::after {
    transform: rotate(180deg);
  }
  
  .toolbar-sort .select-options {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    max-width: 108px;
    background: var(--white);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(180, 95, 6, 0.1);
    z-index: 1000;
    overflow: hidden;
    display: none;
    user-select: none;
  }
  
  .toolbar-sort.is-open .select-options {
    display: block;
  }
  
  .toolbar-sort .option {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--dark);
    cursor: pointer;
    transition: background 0.1s;
  }
  
  /* The "Inside the menu" hover */
  .toolbar-sort .option:hover {
    background: var(--primary-wash);
    color: var(--primary);
  }

/* ── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--mid);
}

.empty-state-icon {
  width: 48px; height: 48px;
  margin: 0 auto 1rem;
  border: 2px dashed var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.empty-state p { font-size: 14px; }

/* ── EXPANDABLE CARDS ──────────────────────────────── */
.issue-card {
    position: relative; 
    cursor: pointer;
  }

.issue-card::after {
    content: '';
    position: absolute;
    top: 18px;
    right: 18px;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B45F06' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
  }
  
  .issue-card.is-expanded::after {
    transform: rotate(180deg);
  }
  
  /* Toggle Logic */
  .issue-full-body { display: none; margin-bottom: 12px; }
  .issue-card.is-expanded .issue-excerpt { display: none; }
  .issue-card.is-expanded .issue-full-body { display: block; }
  
  /* Expanded Content Styling */
  .issue-full-text {
    font-size: 14px;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 14px;
    margin-top: 4px;
    
    /* NEW: Limit height and add scrolling only to the description */
    max-height: 250px; /* You can adjust this to show more/less text */
    overflow-y: auto;
    white-space: pre-wrap; /* Preserves paragraphs and line breaks */
    padding-right: 8px; /* Keeps text from bumping into the scrollbar */
}

/* Update the sleek scrollbar to target the full text area instead */
.issue-full-text::-webkit-scrollbar {
    width: 6px;
}

.issue-full-text::-webkit-scrollbar-track {
    background: transparent; 
}

.issue-full-text::-webkit-scrollbar-thumb {
    background-color: var(--border, #ccc); 
    border-radius: 10px;
}

.issue-full-text::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted, #999);
}
  
  .issue-expanded-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--primary-wash);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--mid);
    margin-bottom: 12px;
  }
  
  .issue-expanded-details strong { color: var(--primary-dark); }
  
/* ── ADMIN NOTES (TIMELINE) ─────────────────────────── */
.response-hint {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  font-style: italic;
  opacity: 0.8;
}

.admin-notes-container {
  display: block !important; /* Forces visibility */
  margin: 10px 0;
  padding: 10px;
  background: #fdf6ec; /* Slight tint so teachers notice the update */
  border-radius: var(--radius-md);
  border-left: 4px solid #e6a23c;
  }
  
  .chair-note {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
  }
  
  /* The new internal elements */
  .chair-note-content {
    flex: 1;
    padding-right: 8px;
    font-size: 14px;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 4px;
    margin-top: 4px;
  }
  
  .chair-note-actions {
    display: flex;
    gap: 5px;
  }
  
  .note-action-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    font-family: var(--font-body);
    font-weight: 500;
    color: #92400E; /* Matches the dark amber text */
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
  }
  
  .note-action-btn:hover {
    color: #B45F06; /* Changes to your brand orange on hover */
  }
  
  .note-action-btn.delete-note:hover {
    color: #DC2626; /* Warning Red for delete */
  }

/* ── FOOTER ─────────────────────────────────────────── */
footer {
  font-family: var(--font-display);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 12px;
  color: var(--light);
  user-select: none;
}

footer strong { color: var(--black); }
footer em { color: var(--primary);font-style: normal; }

/* Hover Popup */
/* Container for the tooltip logic */
.option {
  position: relative;
  cursor: pointer;
}


/* The Tooltip Box */
#intensity-select .option:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  
  /* Drops down directly over the options below it */
  top: 100%; 
  left: 5px;
  right: 5px; 
  
  /* Campus Overflow Brand Colors */
  background-color: var(--primary); 
  color: var(--white);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  
  /* Extreme z-index to beat the menu itself */
  z-index: 99999; 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* The Arrow (Pointing up at the hovered text) */
#intensity-select .option:hover::before {
  content: '';
  position: absolute;
  top: calc(100% - 6px); /* Sits right on the border */
  left: 20px;
  border-width: 0 6px 6px 6px; /* Points upwards */
  border-style: solid;
  border-color: transparent transparent var(--primary) transparent;
  z-index: 99999;
}

/* ── UNIFIED BADGE TOOLTIPS (Intensity & Status) ─────────────── */
.badge[data-tooltip] {
  position: relative;
  isolation: isolate;
}

/* The Tooltip Box */
.badge[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  opacity: 1 !important;
  visibility: visible;
  bottom: 130%; 
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary); 
  color: var(--white);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 400; 
  line-height: 1.4;
  text-transform: none; 
  white-space: normal;
  width: max-content; 
  max-width: 165px;
  hyphens: auto;
  line-height: 1.2;
  text-align: center;
  z-index: 100000; 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* The Arrow (Pointing down at the badge) */
.badge[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(130% - 6px); 
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px; 
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
  z-index: 99999;
}

.clickable-status {
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.clickable-status:hover {
  transform: scale(1.05);
}

/* ── MERGE OVERLAY ── */
.merge-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(122, 64, 4, 0.4); /* Primary-dark with transparency */
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.merge-modal {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 450px;
  border-top: 6px solid var(--primary);
}

.merge-modal h3 {
  font-family: var(--font-display);
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.merge-input-group {
  margin: 1.5rem 0;
}

.merge-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.5rem;
}

.merge-field {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--page-bg);
}

/* ── MERGE SUCCESS ANIMATION ────────────────────────── */
@keyframes highlight-merge {
  0% { 
    background-color: var(--primary-light); 
    transform: scale(1.02); 
    z-index: 20;
  }
  100% { 
    background-color: var(--white); 
    transform: scale(1); 
    z-index: 1;
  }
}

.merge-highlight {
  animation: highlight-merge 2s ease-out;
  border: 2px solid var(--primary-dark) !important;
  box-shadow: 0 4px 20px rgba(122, 64, 4, 0.2);
}

/* ── TOAST NOTIFICATIONS ───────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* Lets clicks pass through */
}

.toast {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(122, 64, 4, 0.3);
  
  /* Animation setup */
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.3s forwards, fadeOutToast 0.4s forwards 2.6s;
}

@keyframes slideInUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateY(-10px); }
}