@font-face {
  font-family: "CairoLocal";
  src: url("../../../assets/webfonts/Cairo-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "CairoLocal";
  src: url("../../../assets/webfonts/Cairo-Bold.ttf") format("truetype");
  font-weight: 700;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d9e2ec;
  --text: #1f2937;
  --muted: #667085;
  --teal: #0f766e;
  --emerald: #15803d;
  --amber: #b7791f;
  --rose: #be123c;
  --indigo: #4338ca;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "CairoLocal", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.public-top {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f6f3;
  color: var(--teal);
}

.hero-band {
  min-height: 72vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .88), rgba(67, 56, 202, .62)),
    url("../../../assets/images/world-map.jpg");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero-band h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.hero-band p {
  max-width: 760px;
  color: rgba(255, 255, 255, .88);
  font-size: 1.05rem;
}

.page-wrap {
  width: min(1240px, calc(100% - 28px));
  margin-inline: auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-band {
  padding: 32px 0;
}

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

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 118px;
}

.stat-tile .icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.stat-tile .num {
  font-size: 1.7rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.btn-main {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-main:hover,
.btn-main:focus {
  background: #115e59;
  border-color: #115e59;
  color: #fff;
}

.btn-soft {
  background: #eef8f6;
  border: 1px solid #cce9e4;
  color: #115e59;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef3f8;
  color: var(--muted);
  font-size: .82rem;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.admin-sidebar {
  background: #ffffff;
  border-left: 1px solid var(--line);
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-main {
  min-width: 0;
  padding: 22px;
}

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

.topbar-title span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.topbar-title strong {
  display: block;
  font-size: 1.08rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-chip,
.topbar-icon,
.admin-user-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.topbar-chip {
  position: relative;
  padding: 0 12px;
  color: #115e59;
  background: #eef8f6;
  border-color: #cce9e4;
}

.topbar-message-link .topbar-badge {
  top: -8px;
  inset-inline-start: -8px;
}

.topbar-chip:hover,
.topbar-icon:hover,
.admin-user-button:hover {
  color: var(--teal);
  border-color: #cce9e4;
}

.topbar-icon {
  width: 42px;
  padding: 0;
  position: relative;
}

.topbar-badge {
  position: absolute;
  top: -7px;
  inset-inline-start: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  padding: 0 5px;
  border: 2px solid #fff;
}

.admin-user-button {
  padding: 5px 9px 5px 12px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: #e8f6f3;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-user-text {
  display: grid;
  line-height: 1.2;
  text-align: right;
}

.admin-user-text small {
  color: var(--muted);
}

.admin-alert-menu {
  width: min(360px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.alert-menu-head {
  padding: 13px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-menu-head span {
  color: var(--muted);
  font-size: .82rem;
}

.alert-menu-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #edf2f7;
}

.alert-menu-item:hover {
  background: #f8fbfb;
  color: var(--teal);
}

.alert-menu-item strong {
  font-size: .9rem;
}

.alert-menu-empty {
  padding: 18px 14px;
  color: var(--muted);
  text-align: center;
}

.admin-user-menu {
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nav-link-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 5px;
}

.nav-link-admin:hover,
.nav-link-admin.active {
  background: #eef8f6;
  color: var(--teal);
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-title h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.data-table td {
  vertical-align: middle;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table-toolbar .tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.table-toolbar .form-control,
.table-toolbar .form-select {
  min-height: 36px;
}

.table-toolbar .table-search {
  width: min(280px, 100%);
}

.table-toolbar .form-select {
  width: auto;
}

.table-toolbar .btn {
  min-height: 36px;
  padding: 6px 10px;
}

.table-meta {
  color: var(--muted);
  font-size: .84rem;
}

.table-empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 18px !important;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.row-actions .btn {
  width: 34px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-alert-panel,
.dashboard-work-panel,
.dashboard-health-panel {
  overflow: hidden;
}

.dashboard-alert-list,
.health-list {
  display: grid;
  gap: 9px;
}

.dashboard-alert-item,
.health-item,
.quick-action {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.dashboard-alert-item:hover,
.health-item:hover,
.quick-action:hover {
  color: var(--teal);
  border-color: #cce9e4;
  background: #f8fbfb;
}

.dashboard-alert-item {
  min-height: 64px;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
}

.dashboard-alert-item b {
  min-width: 52px;
  text-align: center;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: #f1f5f9;
  color: var(--text);
}

.alert-dot,
.dashboard-panel-icon,
.health-icon,
.quick-action span {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef8f6;
  color: var(--teal);
}

.alert-dot.is-hot {
  background: #fff7ed;
  color: var(--amber);
}

.alert-text {
  min-width: 0;
  display: grid;
  line-height: 1.35;
}

.alert-text strong,
.health-item strong,
.quick-action strong {
  white-space: normal;
}

.alert-text small,
.health-item small {
  color: var(--muted);
  margin-top: 3px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-action {
  min-height: 86px;
  padding: 12px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 9px;
  background: #f8fafc;
}

.health-item {
  min-height: 62px;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
}

.health-item > span:last-child {
  min-width: 0;
  display: grid;
}

.health-icon {
  background: #fff1f2;
  color: var(--rose);
}

.facebook-status-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 12px;
}

.facebook-config-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

.facebook-config-line:last-child {
  border-bottom: 0;
}

.facebook-config-line span {
  color: var(--muted);
  text-align: left;
  direction: ltr;
  overflow-wrap: anywhere;
}

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

.gap-summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
}

.gap-summary-card:hover {
  color: var(--teal);
  border-color: #cce9e4;
}

.gap-summary-card .icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef8f6;
  color: var(--teal);
}

.gap-summary-card small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}

.gap-summary-card b {
  font-size: 1.25rem;
}

.gap-accordion {
  display: grid;
  gap: 12px;
}

.gap-group {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gap-group .accordion-button {
  gap: 12px;
  justify-content: space-between;
}

.gap-group .accordion-button::after {
  margin-right: auto;
  margin-left: 0;
}

.gap-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.gap-check-card {
  padding: 14px;
  box-shadow: none;
}

.gap-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gap-card-head strong {
  font-size: 1.3rem;
}

.gap-check-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.gap-check-card p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.gap-tone-rose {
  background: #fff1f2;
  color: var(--rose);
}

.gap-tone-amber {
  background: #fff7ed;
  color: var(--amber);
}

.gap-tone-teal {
  background: #eef8f6;
  color: var(--teal);
}

.gap-done {
  padding: 18px;
  border: 1px dashed #cce9e4;
  border-radius: var(--radius);
  color: var(--teal);
  background: #f3fbf9;
  text-align: center;
}

.portal-value-cell {
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

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

.committee-admin-grid p {
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.7;
}

.form-control,
.form-select,
.btn {
  border-radius: var(--radius);
}

.tabs-clean .nav-link {
  color: var(--muted);
  border-radius: var(--radius);
}

.tabs-clean .nav-link.active {
  color: var(--teal);
  background: #eef8f6;
  border-color: #cce9e4;
}

.profile-photo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.print-only {
  display: none;
}

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

  .admin-sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-main {
    padding: 14px;
  }

  .admin-topbar {
    position: static;
  }

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

  .gap-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions-grid,
  .facebook-status-grid,
  .committee-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .page-title {
    display: block;
  }

  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .admin-user-button {
    width: 100%;
    justify-content: flex-start;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar .tool-group,
  .table-toolbar .table-search,
  .table-toolbar .form-select {
    width: 100%;
  }

  .gap-overview {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid,
  .facebook-status-grid,
  .committee-admin-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-alert-item {
    grid-template-columns: 36px 1fr auto;
  }
}

@media print {
  .admin-sidebar,
  .public-top,
  .no-print,
  .btn,
  .nav {
    display: none !important;
  }

  .admin-layout {
    display: block;
  }

  .admin-main {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border-color: #aaa;
  }

  .print-only {
    display: block;
  }
}
