@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Raleway:wght@600;700;800&display=swap');

:root {
  --nca-blue: #0a3f85;
  --nca-red: #c8102e;
  --nca-blue-light: #2a5298;
  --nca-red-light: #e8233f;
  --nca-navy: #0f2544;
  --nca-gray: #f4f6f9;
  --nca-border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 37, 68, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 37, 68, 0.08);
  --shadow-lg: 0 8px 32px rgba(15, 37, 68, 0.12);
  --shadow-card: 0 1px 3px rgba(15, 37, 68, 0.06), 0 8px 24px rgba(15, 37, 68, 0.06);
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: #334155;
  background: #f0f3f8;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: 'Raleway', system-ui, sans-serif;
}

/* ── Layout ── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: 17rem;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 17rem;
  background: #143157;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100%;
  z-index: 10;
  box-shadow: 4px 0 24px rgba(15, 37, 68, 0.15);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-close-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ── Mobile nav ── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 3.5rem;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--nca-border);
  box-shadow: 0 1px 8px rgba(15, 37, 68, 0.06);
}

.mobile-topbar-logo {
  height: 2rem;
  width: auto;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--nca-blue);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.mobile-menu-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.mobile-menu-btn svg {
  width: 1.375rem;
  height: 1.375rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 37, 68, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.menu-open {
  overflow: hidden;
}

.sidebar-logo {
  height: 2.5rem;
  width: auto;
  display: block;
  filter: brightness(51.05);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--nca-red), #e8233f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

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

.sidebar-profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-profile-meta {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.875rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow-y: auto;
}

.sidebar-nav-spacer {
  flex: 1;
  min-height: 0.5rem;
}

.sidebar-nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.625rem 0.75rem 0.25rem;
}

.sidebar-nav-label:first-child {
  padding-top: 0.25rem;
}

/* Hide admin-only nav before JS runs (sub members) */
body.role-sub [data-admin-only] {
  display: none !important;
}

body.role-admin [data-admin-only].sidebar-link {
  display: flex !important;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-link svg {
  width: 1.125rem;
  height: 1.125rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--nca-red);
}

.sidebar-link.active svg {
  opacity: 1;
  color: #fff;
}

.sidebar-footer {
  padding: 1rem 0.875rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-link.logout {
  color: rgba(255, 180, 180, 0.85);
}

.sidebar-link.logout:hover {
  background: rgba(200, 16, 46, 0.2);
  color: #ffb4b4;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.page-header-text h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--nca-blue);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-header-text p {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.page-header-accent {
  width: 2.5rem;
  height: 3px;
  background: linear-gradient(90deg, var(--nca-red), var(--nca-blue));
  border-radius: 2px;
  margin-bottom: 0.625rem;
}

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-body {
  padding: 1.75rem 2rem;
}

/* ── Form ── */
.form-card .card-body {
  padding: 0;
}

.form-section {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #f1f5f9;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-family: 'Raleway', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--nca-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #e2e8f0, transparent);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.form-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e8edf3;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.form-input:focus {
  outline: none;
  border-color: var(--nca-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(27, 58, 107, 0.1);
}

.form-input::placeholder {
  color: #b0bec9;
}

.password-field {
  position: relative;
}

.password-field .form-input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s;
  line-height: 0;
}

.password-toggle:hover {
  color: var(--nca-blue);
}

.password-toggle .eye-off {
  display: none;
}

.password-toggle.visible .eye-on {
  display: none;
}

.password-toggle.visible .eye-off {
  display: block;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
  border-top: 1px solid #f1f5f9;
}

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed #d1dae6;
  border-radius: 0.875rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(180deg, #fafbfc 0%, #f6f8fb 100%);
  position: relative;
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--nca-blue);
  background: linear-gradient(180deg, #f0f5fc 0%, #e8f0fa 100%);
  box-shadow: 0 0 0 4px rgba(27, 58, 107, 0.06);
}

.upload-zone.has-image {
  padding: 1rem;
  min-height: auto;
  border-style: solid;
  border-color: #e2e8f0;
  background: #fff;
}

.upload-zone-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--nca-blue), var(--nca-blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.25);
}

.upload-zone-icon svg {
  width: 1.375rem;
  height: 1.375rem;
  color: #fff;
}

.upload-zone-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.upload-zone-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

.upload-zone img {
  max-width: 8rem;
  max-height: 6rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8edf3;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--nca-blue) 0%, var(--nca-blue-light) 100%);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: 'Raleway', sans-serif;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(27, 58, 107, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.9;
  cursor: wait;
}

.btn-primary.loading:hover {
  transform: none;
}

.btn-spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  padding: 0.7rem 1.25rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--nca-blue);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
}

.btn-icon.edit {
  color: var(--nca-blue);
  background: rgba(27, 58, 107, 0.06);
}

.btn-icon.edit:hover {
  background: rgba(27, 58, 107, 0.12);
}

.btn-icon.delete {
  color: var(--nca-red);
  background: rgba(200, 16, 46, 0.06);
}

.btn-icon.delete:hover {
  background: rgba(200, 16, 46, 0.12);
}

/* ── Table ── */
.data-table {
  width: 100%;
  font-size: 0.875rem;
}

.data-table thead {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.data-table th {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--nca-blue);
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #e8edf3;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.member-logo-cell {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.625rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.member-logo-cell img {
  max-width: 2.25rem;
  max-height: 2.25rem;
  object-fit: contain;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(27, 58, 107, 0.08);
  color: var(--nca-blue);
}

.badge-red {
  background: rgba(200, 16, 46, 0.08);
  color: var(--nca-red);
}

/* ── Logo grid ── */
.logo-grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  aspect-ratio: 1;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.logo-grid-item:hover {
  transform: translateY(-3px);
}

.logo-grid-item img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

/* ── Map ── */
#member-logos-map {
  width: 100%;
  height: 500px;
  min-height: 500px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #e8edf3;
}

.map-error {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 0.75rem;
}

.map-error svg {
  color: #94a3b8;
  margin-bottom: 1rem;
}

.map-error-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--nca-blue);
  margin-bottom: 0.5rem;
}

.map-error-text {
  font-size: 0.8125rem;
  max-width: 28rem;
  line-height: 1.5;
}

/* Leaflet map markers & popups */
.nca-marker-wrap {
  background: none !important;
  border: none !important;
}

.nca-marker {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 37, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-sizing: border-box;
}

.nca-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.leaflet-container {
  font-family: 'Inter', sans-serif;
  border-radius: 0.75rem;
  z-index: 1;
}

.nca-popup .leaflet-popup-content-wrapper {
  border-radius: 0.625rem;
  box-shadow: 0 4px 16px rgba(15, 37, 68, 0.15);
  padding: 0;
}

.nca-popup .leaflet-popup-content {
  margin: 0;
}

.map-popup {
  display: block;
  text-align: center;
  font-family: 'Inter', sans-serif;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

a.map-popup:hover {
  background: rgba(27, 58, 107, 0.04);
}

.map-popup img {
  max-width: 56px;
  max-height: 44px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.5rem;
  padding: 0.375rem;
  box-sizing: content-box;
}

.map-popup strong {
  font-family: 'Raleway', sans-serif;
  font-size: 0.875rem;
  color: var(--nca-blue);
  display: block;
  margin-bottom: 0.25rem;
}

.map-popup-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nca-red);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(27, 58, 107, 0.15);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: var(--nca-blue);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
}

.map-card {
  padding: 0.375rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 1rem;
}

/* ── Category heading ── */
.category-heading {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--nca-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.category-empty-message {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9375rem;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 0.75rem;
}

.col-sort-hint {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: #94a3b8;
}

.empty-state-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--nca-navy) 0%, var(--nca-blue) 50%, #1e4478 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 16, 46, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 26rem;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 2.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.1);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand img {
  height: 4rem;
  margin: 0 auto 1.25rem;
}

.login-brand h1 {
  font-family: 'Raleway', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--nca-blue);
  letter-spacing: -0.02em;
}

.login-brand p {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.375rem;
}

.login-error {
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.2);
  color: var(--nca-red);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
}

.login-tabs {
  display: flex;
  gap: 0.375rem;
  padding: 0.25rem;
  background: #f1f5f9;
  border-radius: 0.625rem;
  margin-bottom: 1.5rem;
}

.login-tab {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.login-tab.active {
  background: #fff;
  color: var(--nca-blue);
  box-shadow: 0 1px 4px rgba(15, 37, 68, 0.1);
}

.login-panel-form {
  display: none;
}

.login-panel-form.active {
  display: block;
}

.passkey-input {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.passkey-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f0f5fc 0%, #e8f0fa 100%);
  border: 1.5px solid #d4e0f0;
  border-radius: 0.625rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--nca-blue);
}

.passkey-display code {
  flex: 1;
}

.btn-copy {
  padding: 0.375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nca-blue);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.btn-copy:hover {
  background: var(--nca-blue);
  color: #fff;
  border-color: var(--nca-blue);
}

.user-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--nca-blue), var(--nca-blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.25);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

.info-row-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.role-badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge.admin {
  background: rgba(27, 58, 107, 0.1);
  color: var(--nca-blue);
}

.role-badge.sub {
  background: rgba(200, 16, 46, 0.08);
  color: var(--nca-red);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
  max-width: 22rem;
  width: calc(100vw - 2.5rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e8edf3;
  box-shadow: 0 8px 32px rgba(15, 37, 68, 0.14), 0 2px 8px rgba(15, 37, 68, 0.06);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
}

.toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast.toast-exit {
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.28s ease-in, opacity 0.28s ease-in;
}

.toast-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.toast-error .toast-icon {
  background: rgba(200, 16, 46, 0.1);
  color: var(--nca-red);
}

.toast-info .toast-icon {
  background: rgba(27, 58, 107, 0.1);
  color: var(--nca-blue);
}

.toast-warning .toast-icon {
  background: rgba(234, 179, 8, 0.12);
  color: #ca8a04;
}

.toast-content {
  flex: 1;
  min-width: 0;
  padding-top: 0.125rem;
}

.toast-title {
  font-family: 'Raleway', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.toast-close {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 0.25rem;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  line-height: 0;
}

.toast-close:hover {
  color: #475569;
  background: #f1f5f9;
}

.toast-success { border-left: 3px solid #16a34a; }
.toast-error { border-left: 3px solid var(--nca-red); }
.toast-info { border-left: 3px solid var(--nca-blue); }
.toast-warning { border-left: 3px solid #ca8a04; }

/* ── Confirm modal ── */
body.confirm-open {
  overflow: hidden;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 37, 68, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.confirm-overlay.confirm-visible {
  opacity: 1;
}

.confirm-modal {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 0.875rem;
  border: 1px solid #e8edf3;
  box-shadow: 0 20px 48px rgba(15, 37, 68, 0.2);
  padding: 1.5rem;
  text-align: center;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-overlay.confirm-visible .confirm-modal {
  transform: scale(1) translateY(0);
}

.confirm-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.confirm-icon-danger {
  background: rgba(200, 16, 46, 0.1);
  color: var(--nca-red);
}

.confirm-icon-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #ca8a04;
}

.confirm-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.confirm-message {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.confirm-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

.confirm-actions .btn-secondary,
.confirm-actions .btn-danger {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nca-red);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: 'Raleway', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn-danger:hover {
  background: #a30d25;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

/* ── Embed code ── */
.embed-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.embed-step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: rgba(27, 58, 107, 0.1);
  color: var(--nca-blue);
  font-family: 'Raleway', sans-serif;
  font-size: 0.8125rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

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

.embed-step-title {
  font-family: 'Raleway', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.375rem;
}

.embed-code {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 0.625rem;
}

.embed-code pre {
  flex: 1;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Skeleton loading ── */
.skeleton-wrap {
  animation: skeletonFadeIn 0.25s ease;
}

@keyframes skeletonFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.skeleton {
  background: linear-gradient(90deg, #e8edf3 0%, #f1f5f9 45%, #e8edf3 90%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 0.5rem;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-accent {
  width: 2.5rem;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 0.625rem;
}

.skeleton-title {
  height: 1.625rem;
  width: 12rem;
  max-width: 45%;
  margin-bottom: 0.5rem;
}

.skeleton-subtitle {
  height: 0.875rem;
  width: 20rem;
  max-width: 70%;
}

.skeleton-btn {
  height: 2.5rem;
  width: 8rem;
  border-radius: 0.625rem;
}

.skeleton-card {
  border-radius: 1rem;
  border: 1px solid #f1f5f9;
  background: #fff;
  overflow: hidden;
}

.skeleton-map {
  height: 500px;
  border-radius: 0.75rem;
}

.skeleton-row {
  height: 3.25rem;
  margin: 0 1.25rem;
}

.skeleton-row + .skeleton-row {
  margin-top: 0.5rem;
}

.skeleton-field {
  height: 2.75rem;
}

.skeleton-field-sm {
  height: 2.25rem;
}

.skeleton-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  flex-shrink: 0;
}

.skeleton-logo-cell {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.625rem;
}

.skeleton-grid-item {
  aspect-ratio: 1;
  border-radius: 0.75rem;
}

.skeleton-section-title {
  height: 0.75rem;
  width: 6rem;
  margin-bottom: 1rem;
}

tr.row-exit {
  animation: rowSlideOut 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes rowSlideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.btn-saving {
  pointer-events: none;
  opacity: 0.85;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfc 0%, #f6f8fb 100%);
}

.pagination-info {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.pagination-btn {
  min-width: 2.375rem;
  height: 2.375rem;
  padding: 0 0.625rem;
  border: 1.5px solid #e8edf3;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--nca-blue);
  color: var(--nca-blue);
  background: rgba(27, 58, 107, 0.04);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--nca-blue), var(--nca-blue-light));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 6px rgba(27, 58, 107, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-btn-text {
  min-width: auto;
  padding: 0 0.875rem;
  margin-left: 0.25rem;
  white-space: nowrap;
}

/* ── Misc ── */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(27, 58, 107, 0.06);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--nca-blue);
}

/* ── Responsive dashboard ── */
@media (max-width: 1023px) {
  .mobile-topbar {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    left: auto;
    right: 0;
    top: 0;
    width: min(17rem, 88vw);
    height: 100%;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -8px 0 32px rgba(15, 37, 68, 0.2);
  }

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

  .sidebar-close-btn {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem 1rem;
    padding-top: calc(3.5rem + 1.25rem);
    width: 100%;
    min-width: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .page-header-text h2 {
    font-size: 1.375rem;
  }

  .card-body {
    padding: 1.25rem 1rem;
  }

  .form-section {
    padding: 1.25rem 1rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
  }

  .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 36rem;
  }

  .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .embed-code {
    flex-direction: column;
  }

  .embed-code .btn-copy {
    align-self: flex-end;
  }

  #member-logos-map {
    height: 320px;
    min-height: 320px;
  }

  .map-error {
    min-height: 320px;
  }
}

@media (max-width: 639px) {
  .main-content {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .upload-zone {
    min-height: 8rem;
  }

  .passkey-display {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .passkey-display .btn-copy {
    align-self: flex-end;
  }
}
