:root {
  --bg: #f4f7f5;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --text: #18201b;
  --muted: #647067;
  --line: #dfe7e1;
  --green: #168a4a;
  --green-dark: #0f6c39;
  --green-soft: #e6f5ec;
  --amber: #f59e0b;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 16px 35px rgba(24, 32, 27, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-width: 260px;
  --topbar-height: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.12);
}

button {
  cursor: pointer;
  border: 0;
}

/* =========================================================
   LANDING PAGE
========================================================= */

.landing-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 138, 74, 0.14), transparent 34%),
    linear-gradient(135deg, #f8fbf9 0%, #eef5f0 100%);
}

.landing-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-brand,
.sidebar-brand,
.active-cup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.cup-badge,
.cup-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.landing-brand strong,
.sidebar-brand strong,
.active-cup strong {
  display: block;
  font-size: 15px;
}

.landing-brand span,
.sidebar-brand span,
.active-cup span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.nav-button {
  color: #fff;
  background: var(--green);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.landing-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 60px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 30px;
  align-items: center;
  padding: 56px 0 38px;
}

.eyebrow {
  display: inline-flex;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid rgba(22, 138, 74, 0.14);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.94;
  margin: 20px 0 18px;
  letter-spacing: -0.07em;
}

.hero-copy p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 690px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-primary-button,
.danger-outline-button {
  border-radius: 12px;
  padding: 11px 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px rgba(22, 138, 74, 0.22);
}

.primary-button:hover,
.small-primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  background: #fff;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.ghost-button {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.small-primary-button {
  background: var(--green);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.danger-outline-button {
  background: #fff;
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--red);
}

.primary-button.small,
.secondary-button.small {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.hero-note {
  color: var(--muted);
  font-size: 13px;
}

.hero-panel,
.section-block,
.panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(223, 231, 225, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
}

.panel-topline {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-kpi-grid div {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.mini-kpi-grid strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.mini-kpi-grid span {
  color: var(--muted);
  font-size: 13px;
}

.hero-flow {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.hero-flow div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.hero-flow b {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-size: 13px;
}

.section-block {
  padding: 28px;
  margin-top: 24px;
}

.section-heading span {
  color: var(--green-dark);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-heading h2 {
  margin: 8px 0;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.6;
  max-width: 760px;
}

.cup-card-grid,
.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.cup-card-grid {
  grid-template-columns: repeat(3, 1fr);
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.cup-card,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 18px;
}

.cup-card {
  display: flex;
  gap: 14px;
  align-items: center;
}

.cup-card.active {
  border-color: rgba(22, 138, 74, 0.32);
  background: var(--green-soft);
}

.cup-logo.muted {
  background: #dbe5df;
  color: #405047;
}

.cup-card h3,
.feature-card h3 {
  margin: 0 0 6px;
}

.cup-card p,
.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.cup-card span {
  display: inline-block;
  margin-top: 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.landing-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 40px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

/* =========================================================
   ADMIN SHELL
========================================================= */

.admin-body {
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: #101812;
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sidebar .brand-mark {
  background: var(--green);
}

.sidebar-brand span,
.sidebar-footer small {
  color: rgba(255, 255, 255, 0.58);
}

.sidebar-nav {
  margin-top: 28px;
  display: grid;
  gap: 5px;
}

.sidebar-nav a {
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: transparent;
}

.sidebar-footer span,
.sidebar-footer small {
  display: block;
}

.admin-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 18px;
}

.admin-topbar {
  min-height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 14px;
  z-index: 15;
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions select {
  min-width: 180px;
}

.user-pill {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-menu-button {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.mobile-quick-tabs {
  display: none;
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
}

.kpi-card {
  flex: 1 1 200px; /* grow + shrink + minimum size */
  min-width: 200px;

  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(24, 32, 27, 0.05);
  padding: 18px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi-card strong {
  display: block;
  font-size: 32px;
  margin: 6px 0 4px;
  letter-spacing: -0.05em;
}

.kpi-card small {
  color: var(--muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

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

.panel-header h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
}

.queue-item.active {
  border-color: rgba(22, 138, 74, 0.32);
  background: var(--green-soft);
}

.queue-item strong,
.queue-item span,
.queue-item small {
  display: block;
}

.queue-item strong {
  margin-bottom: 4px;
}

.queue-item span,
.queue-item small {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px !important;
  font-weight: 900;
  margin-bottom: 5px;
}

.status-pill.open {
  background: #e8f1ff;
  color: var(--blue);
}

.status-pill.muni {
  background: #fff7e6;
  color: #b45309;
}

.status-pill.progress {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-pill.transfer {
  background: #fef2f2;
  color: var(--red);
}

.issue-editor {
  padding-bottom: 0;
}

.sticky-editor-header {
  position: sticky;
  top: 106px;
  background: rgba(255, 255, 255, 0.96);
  padding-bottom: 14px;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}

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

.editor-grid {
  display: grid;
  gap: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel-soft);
}

.form-section h3 {
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  gap: 7px;
}

label.wide,
.wide {
  grid-column: 1 / -1;
}

.map-placeholder,
.funding-summary,
.compliance-note,
.transfer-warning {
  border: 1px dashed rgba(22, 138, 74, 0.35);
  background: #fff;
  color: var(--muted);
  border-radius: 14px;
  padding: 16px;
}

.map-placeholder {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
}

.funding-summary {
  display: grid;
  gap: 9px;
}

.funding-summary div:first-child {
  display: flex;
  justify-content: space-between;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e4ebe6;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.compliance-note {
  margin-bottom: 13px;
  border-style: solid;
  background: #f2fbf5;
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.photo-drop {
  min-height: 120px;
  border: 1px dashed rgba(100, 112, 103, 0.4);
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
}

.photo-drop strong,
.photo-drop span {
  display: block;
}

.photo-drop > span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 0;
}

.transfer-warning {
  margin: 12px 0;
  border-color: rgba(245, 158, 11, 0.5);
  color: #92400e;
  background: #fff7ed;
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.timeline summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.timeline summary strong,
.timeline summary span {
  display: block;
}

.timeline summary span {
  color: var(--muted);
  font-size: 12px;
}

.timeline p {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 14px;
}

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  margin: 18px -18px 0;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 var(--radius) var(--radius);
  backdrop-filter: blur(12px);
}

.sticky-save-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sticky-save-bar div {
  display: flex;
  gap: 10px;
}

.directory-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wide-directory {
  grid-column: 1 / -1;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.municipal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 7px;
}

.directory-card strong {
  letter-spacing: -0.02em;
}

.directory-card span,
.directory-card small {
  color: var(--muted);
}

.directory-card .ghost-button {
  justify-self: start;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1180px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .work-queue {
    order: 1;
  }

  .issue-editor {
    order: 2;
  }

  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .directory-layout {
    grid-template-columns: 1fr;
  }

  .municipal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .cup-card-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .landing-header,
  .landing-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar {
    display: none;
  }

  .admin-shell {
    margin-left: 0;
    padding: 12px;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .admin-topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-topbar,
  .topbar-actions {
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions select,
  .user-pill {
    width: 100%;
  }

  .mobile-quick-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 2px;
  }

  .mobile-quick-tabs button {
    white-space: nowrap;
    padding: 9px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
  }

  .mobile-quick-tabs button.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .sticky-editor-header {
    position: static;
  }

  .panel-header {
    flex-direction: column;
  }

  .editor-actions,
  .editor-actions button,
  .button-row button {
    width: 100%;
  }

  .form-grid,
  .photo-grid,
  .directory-grid,
  .municipal-grid {
    grid-template-columns: 1fr;
  }

  .sticky-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .sticky-save-bar div {
    width: 100%;
  }

  .sticky-save-bar button {
    flex: 1;
  }

  .directory-layout {
    display: none;
  }

/* TEST
  .form-section:nth-of-type(5),
  .form-section:nth-of-type(6),
  .form-section:nth-of-type(10),
  .form-section:nth-of-type(11) {
    display: none;
  }
  */
}

@media (max-width: 560px) {
  .landing-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .hero-actions a {
    width: 100%;
  }

  .mini-kpi-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .panel,
  .form-section,
  .section-block {
    padding: 14px;
  }

  .queue-item {
    flex-direction: column;
  }

  .active-cup {
    align-items: flex-start;
  }

  .active-cup .cup-badge {
    width: 40px;
    height: 40px;
  }
}

/* =========================================================
   CUP ADMIN LOGIN PAGE
========================================================= */

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 138, 74, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(22, 138, 74, 0.08), transparent 32%),
    linear-gradient(135deg, #f7fbf8 0%, #eef5f0 100%);
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.login-hero-card {
  width: min(1040px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 231, 225, 0.95);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(24, 32, 27, 0.12);
  padding: clamp(22px, 4vw, 44px);
}

.login-intro {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 28px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid rgba(22, 138, 74, 0.16);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 16px;
}

.login-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.login-intro p {
  margin: 0 auto;
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.coalition-section {
  margin-top: 28px;
  padding: 22px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.coalition-heading {
  text-align: center;
  margin-bottom: 18px;
}

.coalition-heading span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coalition-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.04em;
}

.coalition-logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.coalition-cup-card {
  flex: 1 1 210px;
  max-width: 280px;
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.coalition-cup-card.active {
  border-color: rgba(22, 138, 74, 0.32);
  background: #f3fbf6;
}

.coalition-cup-card.future {
  opacity: 0.76;
}

.coalition-logo-wrap,
.coalition-logo-placeholder {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  overflow: hidden;
}

.coalition-logo-wrap {
  background: #fff;
  border: 1px solid var(--line);
}

.coalition-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.coalition-logo-placeholder {
  background: var(--green);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.coalition-cup-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.coalition-cup-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 800;
}

.coalition-brief {
  max-width: 820px;
  margin: 28px auto 0;
  text-align: center;
}

.coalition-brief h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.05em;
}

.coalition-brief p {
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

.login-panel {
  max-width: 460px;
  margin: 30px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(24, 32, 27, 0.08);
  padding: 24px;
}

.login-panel-heading {
  text-align: center;
  margin-bottom: 18px;
}

.login-panel-heading h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.login-panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form label {
  text-align: left;
}

.login-primary-button,
.google-login-button {
  width: 100%;
  min-height: 46px;
  border-radius: 13px;
  font-weight: 900;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.login-primary-button {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px rgba(22, 138, 74, 0.22);
}

.login-primary-button:hover {
  background: var(--green-dark);
}

.google-login-button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.google-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f2f4f3;
  color: var(--green-dark);
  font-weight: 900;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0;
}

.login-divider span {
  height: 1px;
  background: var(--line);
}

.login-help-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

.login-footer {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.login-footer img {
  width: 22px;
  height: 22px;
}

.login-footer strong {
  color: var(--text);
}

/* Keep CUP logos next to each other on mobile until they genuinely need a new row */
@media (max-width: 700px) {
  .login-page {
    padding: 14px;
    align-items: start;
  }

  .login-hero-card {
    border-radius: 22px;
    padding: 18px;
  }

  .login-intro {
    margin-bottom: 20px;
  }

  .login-intro h1 {
    font-size: 40px;
  }

  .login-intro p {
    font-size: 15px;
  }

  .coalition-section {
    padding: 15px;
  }

  .coalition-logo-grid {
    justify-content: center;
    gap: 10px;
  }

  .coalition-cup-card {
    flex: 1 1 145px;
    min-width: 135px;
    max-width: none;
    padding: 11px;
    gap: 9px;
  }

  .coalition-logo-wrap,
  .coalition-logo-placeholder {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    flex-basis: 58px;
  }

  .coalition-cup-card strong {
    font-size: 13px;
  }

  .coalition-cup-card span {
    font-size: 11px;
  }

  .coalition-brief {
    text-align: left;
  }

  .login-panel {
    padding: 18px;
  }

  .login-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .coalition-cup-card {
    flex: 1 1 130px;
    min-width: 128px;
  }

  .coalition-cup-card strong {
    font-size: 12.5px;
  }
}

.coalition-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cup-dashboard-button {
  margin-top: 8px;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #fff !important;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.cup-dashboard-button:hover {
  background: var(--green-dark);
}

.cup-dashboard-button.disabled {
  background: #e7eee9;
  color: #6d7a70 !important;
  pointer-events: none;
  box-shadow: none;
}

@media (max-width: 700px) {
  .cup-dashboard-button {
    padding: 6px 8px;
    font-size: 10.5px;
  }
}

/* =========================================================
   ADMIN PAGE REWORK: SIDEBAR-FIRST LAYOUT
========================================================= */

.no-topbar {
  padding-top: 18px;
}

.sidebar .brand-mark {
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.sidebar-user-panel {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}

.sidebar-user-panel label {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-user-panel select {
  background: rgba(255, 255, 255, 0.96);
  border: 0;
}

.signed-in-box {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.signed-in-box span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.signed-in-box strong {
  color: #fff;
  font-size: 13px;
  word-break: break-word;
}

.signed-in-box small {
  color: rgba(255, 255, 255, 0.54);
}

.sidebar-nav button {
  width: 100%;
  text-align: left;
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  background: transparent;
}

.sidebar-nav button:hover,
.sidebar-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-signout {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;

  background: #f1f5f9;
  color: var(--text);

  transition: 0.2s ease;
}

.sidebar-signout:hover {
  background: #e2e8f0;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 6px 0 18px;
}

.section-title-row h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.06em;
}

.section-title-row p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.timeline.compact details {
  padding: 14px;
}

.attention-list {
  display: grid;
  gap: 10px;
}

.attention-list button {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--text);
  font-weight: 800;
}

.attention-list button:hover {
  border-color: rgba(22, 138, 74, 0.35);
  background: var(--green-soft);
}

.directory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  margin-bottom: 16px;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.report-card h3 {
  margin: 0;
}

.report-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.mobile-admin-bar {
  display: none;
}

.mobile-cup-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-cup-strip img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.mobile-cup-strip strong,
.mobile-cup-strip span {
  display: block;
}

.mobile-cup-strip span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .report-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .mobile-admin-bar {
    display: grid;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
  }

  .section-title-row {
    flex-direction: column;
  }

  .directory-toolbar {
    grid-template-columns: 1fr;
  }
}

.queue-loading,
.queue-error,
.empty-editor-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  line-height: 1.5;
}

.queue-error strong,
.queue-error span {
  display: block;
}

.queue-error strong {
  color: var(--red);
  margin-bottom: 6px;
}

input[readonly],
textarea[readonly] {
  background: #f7faf8;
  color: #344039;
}

#saveStatus[data-type="success"] {
  color: var(--green-dark);
}

#saveStatus[data-type="error"] {
  color: var(--red);
}

#saveStatus[data-type="saving"] {
  color: #b45309;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select[data-field],
input[data-field],
textarea[data-field] {
  background: #fff;
  border-color: rgba(22, 138, 74, 0.22);
}

.kpi-card strong[id] {
  transition: 0.2s ease;
}

#saveStatus[data-type="success"]::before {
  content: "✓ ";
}

#saveStatus[data-type="error"]::before {
  content: "⚠ ";
}

#saveStatus[data-type="saving"]::before {
  content: "⏳ ";
}

.audit-change-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.audit-change-row {
  display: grid;
  grid-template-columns: 120px 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.audit-change-row strong {
  color: var(--text);
}

@media (max-width: 700px) {
  .audit-change-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .audit-change-row span:nth-child(3) {
    display: none;
  }
}

.directory-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.directory-form {
  display: grid;
  gap: 14px;
}

.directory-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.directory-status.success {
  color: var(--green-dark);
}

.directory-status.error {
  color: var(--red);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-line input {
  width: auto;
}

.directory-card.inactive {
  opacity: 0.55;
}

.directory-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.directory-card .mini-tag {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
}

.directory-card .mini-tag.muted {
  background: #eef2ef;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .directory-admin-grid {
    grid-template-columns: 1fr;
  }
}

.form-section select[data-field="contractorId"],
.form-section select[data-field="supplierId"],
.form-section select[data-field="municipalContactId"] {
  border-color: rgba(22, 138, 74, 0.35);
  background: #ffffff;
  font-weight: 800;
}

.attention-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.attention-list button strong {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 14px;
}

.attention-list button span {
  flex: 1;
}

.attention-list .attention-warn strong {
  background: #fff7ed;
  color: #b45309;
}

.attention-list .attention-blue strong {
  background: #e8f1ff;
  color: var(--blue);
}

.attention-list .attention-danger strong {
  background: #fef2f2;
  color: var(--red);
}

.attention-list .attention-muted strong {
  background: #eef2ef;
  color: var(--muted);
}

.attention-list .attention-clear {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: rgba(22, 138, 74, 0.25);
}

details.collapsible-section {
  padding: 0;
  overflow: hidden;
}

details.collapsible-section>summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

details.collapsible-section>summary::-webkit-details-marker {
  display: none;
}

details.collapsible-section>summary h3 {
  margin: 0;
}

.collapse-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: 0.2s ease;
}

details.collapsible-section[open] .collapse-icon {
  transform: rotate(180deg);
  color: var(--green-dark);
  border-color: rgba(22, 138, 74, 0.28);
}

.collapsible-content {
  border-top: 1px solid var(--line);
  padding: 18px;
}

.queue-filter-panel,
.queue-results-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 14px;
}

.queue-filter-panel {
  margin-bottom: 14px;
}

.queue-filter-header,
.queue-results-header {
  margin-bottom: 12px;
}

.queue-filter-header strong,
.queue-filter-header span,
.queue-results-header strong,
.queue-results-header span {
  display: block;
}

.queue-filter-header strong,
.queue-results-header strong {
  color: var(--text);
  font-size: 14px;
}

.queue-filter-header span,
.queue-results-header span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.queue-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-ticket {
  cursor: pointer;
  transition: 0.18s ease;
}

.queue-ticket:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 138, 74, 0.34);
  box-shadow: 0 10px 22px rgba(24, 32, 27, 0.06);
}

.queue-ticket-main {
  min-width: 0;
  flex: 1;
}

.queue-ticket-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-ticket-title {
  margin-top: 6px;
  color: var(--muted);
}

.queue-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.queue-ticket-meta span {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.queue-ticket-side {
  text-align: right;
  min-width: 90px;
}

.queue-ticket-side small,
.queue-ticket-side strong,
.queue-ticket-side span {
  display: block;
}

.queue-ticket-side small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.queue-ticket-side strong {
  margin-top: 4px;
  font-size: 14px;
}

.queue-ticket-side span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.recent-open-issue {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

@media (max-width: 700px) {
  .queue-ticket {
    flex-direction: column;
  }

  .queue-ticket-side {
    text-align: left;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
}

.admin-map-box {
  display: grid;
  gap: 8px;
}

.admin-issue-map {
  height: 260px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #eef2ef;
}

.admin-map-box small {
  color: var(--muted);
  font-size: 12px;
}

.admin-photo-box {
  gap: 12px;
}

.admin-photo-upload {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.admin-photo-upload input {
  font-size: 12px;
}

.admin-photo-upload small {
  color: var(--muted);
  font-size: 12px;
  min-height: 16px;
}

.admin-photo-box .small-primary-button {
  width: 100%;
}

.photo-drop.has-photos {
  place-items: stretch;
}

.admin-photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  width: 100%;
}

.admin-photo-thumbs a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-photo-thumbs img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
}

.report-helper-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-helper-text[data-type="success"] {
  color: var(--green-dark);
}

.report-helper-text[data-type="error"] {
  color: var(--red);
}

.report-helper-text[data-type="saving"] {
  color: #b45309;
}

#issueReportBody {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.report-log-list {
  display: grid;
  gap: 12px;
}

.report-log-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.report-log-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.report-log-top strong,
.report-log-top span,
.report-log-top small {
  display: block;
}

.report-log-top strong {
  color: var(--text);
}

.report-log-top span,
.report-log-top small {
  color: var(--muted);
  font-size: 12px;
}

.report-log-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.report-log-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.report-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-log-meta span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .report-log-top {
    flex-direction: column;
  }
}

.audit-log-list {
  display: grid;
  gap: 12px;
}

.audit-log-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.audit-log-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.audit-log-top strong,
.audit-log-top span,
.audit-log-top small {
  display: block;
}

.audit-log-top strong {
  color: var(--text);
}

.audit-log-top span,
.audit-log-top small {
  color: var(--muted);
  font-size: 12px;
}

.audit-log-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.audit-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-log-meta span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .audit-log-top {
    flex-direction: column;
  }
}

.transfer-admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.transfer-preview {
  display: grid;
  gap: 12px;
}

.transfer-preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.transfer-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.transfer-preview-top strong,
.transfer-preview-top span {
  display: block;
}

.transfer-preview-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.transfer-preview-card h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.transfer-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.transfer-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.transfer-preview-meta span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.transfer-history-note {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: #fff7ed;
  color: #92400e;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1000px) {
  .transfer-admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-photo-thumb-wrap {
  position: relative;
  display: grid;
  gap: 6px;
}

.photo-remove-button {
  width: 100%;
  border-radius: 10px;
  padding: 7px 8px;
  background: #fff;
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.28);
  font-size: 11px;
  font-weight: 900;
}

.photo-remove-button:hover {
  background: #fef2f2;
}

.photo-remove-button:disabled {
  opacity: 0.65;
}

.login-status {
  margin: 8px 0 0;
  min-height: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
}

.login-status[data-type="success"] {
  color: var(--green-dark);
}

.login-status[data-type="error"] {
  color: var(--red);
}

.login-status[data-type="saving"] {
  color: #b45309;
}

.login-support-links {
  margin-top: 12px;
  text-align: center;
}

.login-support-links a {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-support-links a:hover {
  color: var(--green);
}

.help-content {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
}

.help-content p {
  margin: 0 0 14px;
}

.help-content ol {
  margin: 14px 0 18px;
  padding-left: 22px;
}

.help-content li {
  margin-bottom: 9px;
}

.help-content strong {
  color: var(--text);
}

.directory-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.directory-stats-row span {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 12px;
  padding: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.directory-stats-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .directory-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.directory-stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.directory-stats-row span {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 12px;
  padding: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.directory-stats-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .directory-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-status-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dashboard-lane {
  min-height: 360px;
}

.dashboard-lane-list {
  display: grid;
  gap: 10px;
}

.dashboard-lane-item {
  width: 100%;
  display: grid;
  gap: 7px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.34);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
}

.dashboard-lane-item:hover {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(15, 23, 42, 0.52);
}

.dashboard-lane-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.dashboard-lane-top strong {
  font-size: 13px;
}

.dashboard-lane-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.dashboard-lane-item small {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-lane-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-lane-badges b {
  font-size: 10px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.24);
  color: #fde68a;
}

.dashboard-attention-panel {
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .dashboard-status-lanes {
    grid-template-columns: 1fr;
  }
}

.audit-log-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
}

.audit-log-summary {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  background: #f9fafb;
  border: none;
  cursor: pointer;
}

.audit-log-summary:hover {
  background: #f1f5f9;
}

.audit-log-details {
  display: none;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.audit-log-item.open .audit-log-details {
  display: block;
}

.audit-log-changes {
  margin: 10px 0;
  font-size: 13px;
}

.report-log-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
}

.report-log-summary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  background: #f9fafb;
  border: none;
  cursor: pointer;
}

.report-log-summary:hover {
  background: #f1f5f9;
}

.report-log-summary span,
.report-log-summary strong,
.report-log-summary small {
  display: block;
}

.report-log-summary span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-log-summary strong {
  color: var(--text);
  margin-bottom: 3px;
}

.report-log-summary small {
  color: var(--muted);
  white-space: nowrap;
}

.report-log-details {
  display: none;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.report-log-item.open .report-log-details {
  display: block;
}

.report-log-details p {
  white-space: pre-line;
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0 0;
}

.queue-badge-photo {
  background: #fff7ed !important;
  color: #b45309 !important;
}

.queue-badge-transfer {
  background: #fef2f2 !important;
  color: var(--red) !important;
}

.settings-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-info-grid article {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}

.settings-info-grid strong,
.settings-info-grid span {
  display: block;
}

.settings-info-grid strong {
  font-size: 13px;
  margin-bottom: 5px;
}

.settings-info-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .settings-info-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   DESKTOP UI POLISH: CLEANER ADMIN COLOURS
========================================================= */

:root {
  --bg: #eef2f0;
  --panel: #ffffff;
  --panel-soft: #f6f8f7;
  --section-soft: #f1f5f3;
  --section-head: #e9efec;
  --text: #17211b;
  --muted: #5f6f66;
  --line: #d4ded8;
  --green-soft: #dff3e8;
}

/* Main panels clearer against page background */
.panel {
  background: #ffffff;
  border: 1px solid #d7e1dc;
}

/* Editor sections now have proper separation */
.form-section {
  background: #f7f9f8;
  border: 1px solid #d4ded8;
  box-shadow: 0 8px 20px rgba(24, 32, 27, 0.035);
}

/* Collapsible editor headers */
details.collapsible-section > summary {
  background: #eef3f0;
  border-bottom: 1px solid transparent;
}

details.collapsible-section[open] > summary {
  background: #e7eee9;
  border-bottom-color: #d4ded8;
}

.collapsible-content {
  background: #ffffff;
}

/* First open Issue Summary block */
.issue-editor .form-section:not(.collapsible-section) {
  background: #ffffff;
  border-left: 4px solid var(--green);
}

/* Inputs: less green everywhere */
select[data-field],
input[data-field],
textarea[data-field] {
  border-color: #cfdad4;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #168a4a;
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.10);
}

/* Read-only fields clearly different */
input[readonly],
textarea[readonly] {
  background: #eef2f0;
  color: #526159;
  border-color: #d7e1dc;
}

/* Funding/map/compliance blocks less washed out */
.map-placeholder,
.funding-summary,
.compliance-note,
.transfer-warning {
  background: #ffffff;
  border-color: #d0ddd6;
}

/* Queue selected item: clearer but not neon */
.queue-item.active {
  border-color: #168a4a;
  background: #edf8f2;
}

/* Status colours clearer */
.status-pill.open {
  background: #e8f1ff;
  color: #1d4ed8;
}

.status-pill.muni {
  background: #fff3d6;
  color: #a16207;
}

.status-pill.progress {
  background: #dcfce7;
  color: #166534;
}

.status-pill.transfer {
  background: #fee2e2;
  color: #b91c1c;
}

/* Dashboard lanes lighter and cleaner */
.dashboard-lane-item {
  background: #ffffff;
  border-color: #d7e1dc;
}

.dashboard-lane-item:hover {
  background: #f6faf8;
  border-color: #168a4a;
}

/* Directory stats were too dark for white UI */
.directory-stats-row span {
  background: #f3f6f4;
  border-color: #d7e1dc;
  color: var(--muted);
}

.directory-stats-row strong {
  color: var(--text);
}

/* =========================================================
   STRONGER COLLAPSIBLE HEADERS (EDITOR)
========================================================= */

details.collapsible-section {
  border: 1px solid #cfdad4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

/* HEADER */
details.collapsible-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 16px;
  cursor: pointer;

  background: #e4ebe7; /* darker than before */
  border-bottom: 1px solid #cfdad4;

  transition: all 0.2s ease;
}

/* TITLE */
details.collapsible-section > summary h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #1f2a24;
}

/* HOVER = more interactive feel */
details.collapsible-section > summary:hover {
  background: #dbe5e0;
}

/* OPEN STATE = stronger separation */
details.collapsible-section[open] > summary {
  background: #168a4a;
  color: #ffffff;
}

details.collapsible-section[open] > summary h3 {
  color: #ffffff;
}

/* ARROW */
details.collapsible-section .collapse-icon {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  color: inherit;
}

details.collapsible-section[open] .collapse-icon {
  transform: rotate(180deg);
}

/* CONTENT AREA */
.collapsible-content {
  padding: 14px;
  background: #ffffff;
}

/* =========================================================
   DASHBOARD CARD STATUS TINTS
========================================================= */

.dashboard-lane-item {
  border-left: 4px solid transparent;
}

/* OPEN / NEW */
.dashboard-lane-item.status-open {
  background: #f0dbc7;
  border-left-color: #f6953b;
}

/* IN PROGRESS */
.dashboard-lane-item.status-progress {
  background: #c1e7cc;
  border-left-color: #16a34a;
}

/* MUNICIPAL / WAITING */
.dashboard-lane-item.status-muni {
  background: #ebe3c6;
  border-left-color: #d97706;
}

/* COMPLETED */
.dashboard-lane-item.status-completed {
  background: #c9dcf0;
  border-left-color: #64748b;
}

/* TRANSFER */
.dashboard-lane-item.status-transfer {
  background: #fef2f2;
  border-left-color: #dc2626;
}

/* =========================================================
   ATTENTION PANEL IMPROVEMENT
========================================================= */

.attention-list button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f1cfcf;

  background: #fef2f2;
  color: #7f1d1d;

  font-weight: 600;
  cursor: pointer;

  transition: 0.2s ease;
}

.attention-list button:hover {
  background: #fee2e2;
}

/* softer variant for non-critical */
.attention-list button.muted {
  background: #f8fafc;
  border-color: #d7e1dc;
  color: var(--muted);
}

.editor-subsection {
  padding: 14px;
  border: 1px solid #d7e1dc;        /* neutral, not green */
  border-radius: 14px;
  background: #f7f9f8;              /* very soft grey/green tint */
  margin-bottom: 14px;

  box-shadow: 0 4px 10px rgba(24, 32, 27, 0.03); /* subtle depth */
  border-left: 4px solid #168a4a;
}

.editor-subsection:last-child {
  margin-bottom: 0;
}

.editor-subsection h4 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: #3f4d45;
  border-bottom: 1px solid #e1e8e4;
  padding-bottom: 6px;
}

.editor-warning-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 768px) {

  .section-title-row {
    position: sticky;
    top: 0;
    z-index: 50;

    background: #ffffff;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);

    display: flex;
    align-items: center;
    gap: 10px;
  }

  .section-title-row h1,
  .section-title-row p {
    display: none;
  }

  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
  }

  .kpi-card {
    padding: 10px;
  }

  .kpi-card strong {
    font-size: 18px;
  }

  .kpi-card span,
  .kpi-card small {
    font-size: 10px;
  }

    .work-queue.panel {
    display: none;
  }

  .work-queue.panel.active {
    display: block;
  }

    .queue-item {
    padding: 10px;
  }

  .queue-item h3 {
    font-size: 14px;
  }

  .queue-ticket-meta span {
    font-size: 10px;
    padding: 2px 6px;
  }

    .directory-stats-row {
    display: block;
    font-size: 12px;
    color: var(--muted);
  }

  .directory-stats-row span {
    border: none;
    background: transparent;
    padding: 0;
    margin-right: 6px;
  }

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

  .editor-subsection {
    padding: 10px;
  }
}

.mobile-queue-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-queue-toggle {
    display: inline-flex;
    width: 100%;
    margin-bottom: 10px;
  }

  .work-queue.panel {
    display: none;
  }

  .work-queue.panel.active {
    display: block;
  }
}

/* =========================================================
   MOBILE FINAL ADMIN CLEANUP
========================================================= */

@media (max-width: 768px) {

  /* Sticky top navigation only, not dashboard content */
  .section-title-row {
    position: sticky;
    top: 0;
    z-index: 80;
    background: #ffffff;
    margin: -2px -12px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(24, 32, 27, 0.06);
  }

  .section-title-row h1,
  .section-title-row p {
    display: none;
  }

  /* Keep ticket toggle OUT of sticky heading */
  .mobile-queue-toggle {
    position: static;
    display: inline-flex;
    width: 100%;
    margin: 0 0 10px;
  }

  /* Compact KPI cards: 2 per row */
  .kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 12px;
  }

  .kpi-card {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 12px;
    box-shadow: none;
  }

  .kpi-card span {
    font-size: 10px;
    line-height: 1.1;
  }

  .kpi-card strong {
    font-size: 18px;
    margin: 3px 0 1px;
    letter-spacing: -0.04em;
  }

  .kpi-card small {
    font-size: 9.5px;
    line-height: 1.2;
  }

  /* Issues: reduce panel noise */
  .work-queue.panel {
    display: none;
    margin-bottom: 12px;
  }

  .work-queue.panel.active {
    display: block;
  }

  .queue-filter-panel,
  .queue-results-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .queue-ticket {
    padding: 9px;
    gap: 8px;
  }

  .queue-ticket-title {
    font-size: 12px;
    margin-top: 4px;
  }

  .queue-ticket-side {
    display: none;
  }

  /* Sticky save bar must feel like a real app footer */
  .sticky-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 90;

    margin: 14px -14px -14px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));

    background: #ffffff;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 -10px 24px rgba(24, 32, 27, 0.10);
  }

  .sticky-save-bar span {
    font-size: 11px;
  }

  .sticky-save-bar div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sticky-save-bar button {
    width: 100%;
    min-height: 40px;
    padding: 9px;
    border-radius: 10px;
    font-size: 12px;
  }

  /* Contractor/Supplier cards: clean single-column mobile */
  .directory-card {
    padding: 12px;
    gap: 6px;
  }

  .directory-card strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .directory-card span,
  .directory-card small {
    font-size: 12px;
    line-height: 1.35;
  }

  .directory-card .tag-row {
    gap: 5px;
  }

  .directory-card .mini-tag {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* Directory stats: text-line instead of ugly grid */
  .directory-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    padding: 8px;
    border-radius: 10px;
    background: #f3f6f4;
    border: 1px solid #d7e1dc;
  }

  .directory-stats-row span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 11px;
    text-align: left;
    color: var(--muted);
  }

  .directory-stats-row strong {
    display: inline;
    font-size: 11px;
    margin: 0;
  }

  .directory-card .ghost-button {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }
}

@media (max-width: 768px) {

  .mobile-admin-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -12px -12px 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: 0 8px 18px rgba(24, 32, 27, 0.08);
  }

  .section-title-row {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 0 12px;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
  }

  .section-title-row h1,
  .section-title-row p {
    display: none;
  }
}

/* Keep Leaflet map behind sticky admin UI */
.admin-issue-map,
.admin-issue-map .leaflet-container,
.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 1 !important;
}

.mobile-admin-bar {
  z-index: 200 !important;
}

.sticky-save-bar {
  z-index: 180 !important;
}

.sticky-editor-header,
.section-title-row {
  z-index: 160 !important;
}

.leaflet-control-container {
  z-index: 2 !important;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.photo-actions button {
  flex: 1 1 140px;
}

.selected-file-list {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.selected-file-list span {
  display: block;
  color: var(--text);
  word-break: break-word;
}

.selected-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;

  margin-top: 8px;
  padding: 8px 10px;

  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);

  font-size: 12px;
  color: var(--muted);

  max-height: 120px;   /* prevents infinite growth */
  overflow-y: auto;    /* scroll instead of overlap */
  word-break: break-word;
}

.selected-file-list span {
  display: block;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.admin-photo-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-photo-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-file-list span::before {
  content: "• ";
  color: var(--accentA);
}

.selected-file-list {
  width: 100%;
  display: grid;
  gap: 6px;
  align-items: start;

  margin-top: 6px;
  padding: 9px 10px;

  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faf8;

  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;

  height: auto;
  min-height: 36px;
  max-height: none;
  overflow: visible;
  white-space: normal;
  text-align: left;
}

.selected-file-list span {
  display: block;
  width: 100%;
  padding: 6px 8px;

  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;

  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-top: 0 !important;
}