/*
 * This is a manifest file that'll be compiled into application.css.
 */

@import url("/app-assets/sidebar-cd6adad1.css");

:root {
  --app-header-height: 3.5rem;
  --app-page-gutter: 1.5rem;
  --app-control-height: 2.25rem;
  --app-surface: #ffffff;
  --app-border-soft: #e5e7eb;
  --app-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --app-transition-fast: 160ms ease;
}

/* =============================================
   PAGE CHROME
   Shared page header pattern used before the wider UI refresh.
   ============================================= */
.page-shell {
  padding: 1rem;
}

@media (min-width: 768px) {
  .page-shell {
    padding: 2rem;
  }
}

.page-sticky-header {
  position: sticky;
  z-index: 80;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #f3f4f6;
  backdrop-filter: blur(8px);
  transition:
    background-color var(--app-transition-fast),
    border-color var(--app-transition-fast),
    box-shadow var(--app-transition-fast);
}

.app-layout--document-scroll .page-sticky-header {
  top: var(--app-header-height);
  margin-left: calc(var(--app-page-gutter) * -1);
  margin-right: calc(var(--app-page-gutter) * -1);
  padding: 1rem var(--app-page-gutter);
}

.app-layout--contained-scroll .page-sticky-header {
  top: 0;
  margin-left: -1rem;
  margin-right: -1rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .app-layout--contained-scroll .page-sticky-header {
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 1rem 2rem;
  }
}

.page-sticky-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: var(--app-border-soft);
  box-shadow: var(--app-shadow-soft);
}

.page-sticky-header--flush {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

.table-scroll {
  max-height: min(70vh, 44rem);
  overflow: auto;
}

.table-sticky-header thead {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 var(--app-border-soft);
}

.table-sticky-header thead th {
  background: #f9fafb;
}

/* =============================================
   FORM SYSTEM
   ============================================= */
.form-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.form-card--spacious {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.form-page {
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .form-page {
    padding: 2rem;
  }
}

.form-page-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-page-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  color: #4b5563;
  border-radius: 0.75rem;
  transition:
    background-color var(--app-transition-fast),
    color var(--app-transition-fast);
}

.form-page-header__back:hover {
  background: #f3f4f6;
  color: #111827;
}

.form-section {
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea,
.form-file,
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form input[type="datetime-local"],
form input[type="url"],
form input[type="tel"],
form input[type="search"],
form input[type="file"],
form select,
form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  background: #ffffff;
  color: #111827;
  font-size: 0.875rem;
  transition:
    border-color var(--app-transition-fast),
    box-shadow var(--app-transition-fast),
    background-color var(--app-transition-fast);
}

.form-input,
.form-select,
.form-file,
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form input[type="datetime-local"],
form input[type="url"],
form input[type="tel"],
form input[type="search"],
form input[type="file"],
form select {
  min-height: var(--app-control-height);
  padding: 0.625rem 0.75rem;
}

.form-input.form-input--with-icon,
form input.form-input--with-icon {
  padding-left: 3rem;
}

.form-textarea {
  min-height: 6rem;
  padding: 0.625rem 0.75rem;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-file:focus,
form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.form-file:hover,
form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):hover,
form select:hover,
form textarea:hover {
  border-color: #9ca3af;
}

form label:not(.flex):not(.inline-flex):not(.filter-choice) {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #374151;
}

form input[type="file"]::file-selector-button {
  margin-right: 0.875rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f3f4f6;
  color: #374151;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

form input[type="file"]::file-selector-button:hover {
  background: #e5e7eb;
}

form input[type="color"] {
  width: 3.5rem;
  height: 2.75rem;
  padding: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  background: #ffffff;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border-soft);
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions > * {
    width: 100%;
  }
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--app-border-soft);
  border-radius: 0.75rem;
  background: #f9fafb;
  padding: 0.125rem;
  min-height: calc(var(--app-control-height) + 0.25rem);
  gap: 0.125rem;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--app-control-height);
  min-height: var(--app-control-height);
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  border: 0;
  color: #6b7280;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 700;
  transition:
    background-color var(--app-transition-fast),
    color var(--app-transition-fast),
    box-shadow var(--app-transition-fast);
}

.view-btn:hover {
  color: #111827;
  background: #ffffff;
}

.view-btn.active-view {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: none;
}

.filter-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--app-control-height);
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  background: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition:
    border-color var(--app-transition-fast),
    background-color var(--app-transition-fast),
    color var(--app-transition-fast);
}

.filter-choice input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.filter-choice:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.table-card {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.action-link {
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 700;
}

.action-link:hover {
  color: #111827;
}

.modal-card {
  width: min(100%, 28rem);
  overflow: hidden;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.header-icon-button,
.header-user-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border-radius: 0.625rem;
  color: #4b5563;
  transition:
    background-color var(--app-transition-fast),
    color var(--app-transition-fast);
}

.header-icon-button {
  width: 2.25rem;
}

.header-user-button {
  gap: 0.5rem;
  padding: 0 0.75rem 0 0.5rem;
}

.header-icon-button:hover,
.header-user-button:hover {
  background: #f3f4f6;
  color: #111827;
}

.header-icon-button.is-active {
  background: #1f2937;
  color: white;
}
.header-icon-button.is-active:hover {
  background: #374151;
  color: white;
}

.map-style-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: #1f2937;
  color: white;
  transition: background 0.15s;
  flex-shrink: 0;
}
.map-style-btn:hover {
  background: #374151;
}
.map-style-btn.is-active {
  background: #374151;
  box-shadow: 0 0 0 2px #1f2937, 0 0 0 3.5px white;
}

.dropdown-card {
  overflow: hidden;
  border: 1px solid var(--app-border-soft);
  border-radius: 0.875rem;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.dropdown-item,
.dropdown-item-danger {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition:
    background-color var(--app-transition-fast),
    color var(--app-transition-fast);
}

.dropdown-item {
  color: #374151;
}

.dropdown-item:hover {
  background: #f9fafb;
  color: #111827;
}

.dropdown-item-danger {
  color: #be123c;
}

.dropdown-item-danger:hover {
  background: #fff1f2;
  color: #9f1239;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-help {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.form-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #dc2626;
}

.event-form-card {
  border-radius: 1rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.event-form-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--app-border-soft);
}

.event-form-heading-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.875rem;
}

.event-form-card input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.event-form-card select,
.event-form-card textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  background: #ffffff;
  color: #111827;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  transition:
    border-color var(--app-transition-fast),
    box-shadow var(--app-transition-fast),
    background-color var(--app-transition-fast);
}

.event-form-card input:not([type="hidden"]):focus,
.event-form-card select:focus,
.event-form-card textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.event-form-card trix-editor {
  border-radius: 0 0 0.625rem 0.625rem !important;
  border-width: 1px !important;
  border-color: #d1d5db !important;
}

.event-form-card trix-toolbar {
  border-width: 1px !important;
  border-color: #d1d5db !important;
  border-radius: 0.625rem 0.625rem 0 0 !important;
}

/* Compact Trix editor for log-entry panel/page */
.log-entry-trix trix-toolbar {
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  border-radius: 0 !important;
  padding: 0.25rem 0.5rem !important;
}
.log-entry-trix trix-toolbar .trix-button-row {
  flex-wrap: wrap;
  gap: 0;
}
.log-entry-trix trix-editor {
  border: none !important;
  border-radius: 0 !important;
  padding: 0.5rem 0.75rem !important;
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.event-map-frame {
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 0.875rem;
}

.event-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-border-soft);
}

.event-form-actions .btn-primary,
.event-form-actions .btn-secondary {
  min-width: min(14rem, 100%);
}

.event-detail-card {
  overflow: hidden;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid var(--app-border-soft);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.event-detail-hero {
  padding: 1.5rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 9%, #ffffff), #ffffff);
  border-bottom: 1px solid var(--app-border-soft);
}

.event-detail-block {
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  background: #f9fafb;
  padding: 1rem;
}

@media (max-width: 640px) {
  .event-form-heading {
    gap: 0.75rem;
  }

  .event-form-actions {
    flex-direction: column-reverse;
  }

  .event-form-actions > * {
    width: 100%;
  }
}

.field-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-warning,
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: var(--app-control-height);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--app-transition-fast),
    border-color var(--app-transition-fast),
    box-shadow var(--app-transition-fast),
    color var(--app-transition-fast),
    transform var(--app-transition-fast);
}

.btn-sm {
  min-height: 1.875rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.btn-xs {
  min-height: 1.625rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
}

.btn-icon {
  width: 2.5rem;
  padding-left: 0;
  padding-right: 0;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 12px 24px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-warning:focus-visible,
.btn-success:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-ghost {
  color: #4b5563;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

.btn-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.btn-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.btn-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.btn-warning:hover {
  background: #fef3c7;
  border-color: #fcd34d;
}

.btn-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #15803d;
}

.btn-success:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled,
.btn-warning:disabled,
.btn-success:disabled,
.btn-primary[aria-disabled="true"],
.btn-secondary[aria-disabled="true"],
.btn-ghost[aria-disabled="true"],
.btn-danger[aria-disabled="true"],
.btn-warning[aria-disabled="true"],
.btn-success[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--color-primary) 13%, transparent), transparent 28rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 45%, #f9fafb 100%);
  padding: 2rem 1rem;
}

.auth-shell--split {
  align-items: stretch;
  padding: clamp(1rem, 3vw, 2rem);
}

.auth-panel {
  width: min(100%, 72rem);
  min-height: min(44rem, calc(100vh - 4rem));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(26rem, 1fr);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 1rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.auth-feature-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  color: #ffffff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 92%, #111827) 0%, color-mix(in srgb, var(--color-primary) 62%, #0f172a) 100%),
    #111827;
}

.auth-feature-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.2), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 45%);
  pointer-events: none;
}

.auth-feature-panel > * {
  position: relative;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.auth-form-panel > .auth-form-inner {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 0.75rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(16px);
}

.auth-logo-frame {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-feature-panel {
    padding: 2rem;
  }

  .auth-feature-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .auth-feature-list p {
    display: none;
  }

  .auth-form-panel {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  .auth-shell--split {
    padding: 0;
    background: #ffffff;
  }

  .auth-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-feature-panel {
    padding: 1.5rem;
  }

  .auth-feature-list {
    grid-template-columns: 1fr;
  }

  .auth-form-panel {
    padding: 1.5rem;
  }
}

@media (max-width: 767px) {
  .page-sticky-header {
    z-index: 70;
  }

  .table-scroll {
    max-height: 65vh;
  }
}

/* =============================================
   LOGIN REDESIGN — split screen + carousel
   ============================================= */

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f3f4f6;
}

/* Left panel */
.login-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
  background: #f3f4f6;
  position: relative;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 3.5rem;
}

.login-brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.login-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.login-carousel {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 16rem;
}

.carousel-slide {
  width: 100%;
  position: absolute;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.carousel-slide--active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.carousel-slide--inactive {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.carousel-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.carousel-title {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.carousel-desc {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #6b7280;
  max-width: 34rem;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.carousel-dot--active {
  background: var(--color-primary, #9333ea);
  width: 1.5rem;
}

.login-left-footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Right panel */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: #eaecf0;
}

.login-card {
  width: 100%;
  max-width: 26rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

/* Responsive */
@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    background: #eaecf0;
  }
  .login-left {
    display: none;
  }
  .login-right {
    min-height: 100vh;
    background: #eaecf0;
  }
}

/* =============================================
   NAV SIDEBAR
   ============================================= */
#nav-sidebar {
  width: 16rem;
  transition: width 0.2s ease;
  overflow: hidden;
}
#nav-sidebar.collapsed {
  width: 4rem;
}
#nav-sidebar.collapsed .nav-brand {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  cursor: pointer;
}
#nav-sidebar.collapsed .nav-toggle {
  display: none;
}
#nav-sidebar.collapsed .nav-brand-logo-btn {
  cursor: pointer;
}
#nav-sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
#nav-sidebar.collapsed .nav-text {
  display: none;
}
#nav-sidebar .nav-item-active {
  font-weight: 500;
  border-right: 2px solid var(--color-primary);
}
#main-content {
  transition: padding-left 0.2s ease;
}

@media (max-width: 767px) {
  #app-header {
    left: 0 !important;
  }

  #nav-sidebar {
    width: auto;
    height: 4rem;
    top: auto;
    right: 0;
    bottom: 0;
    border-right: 0;
    border-top: 1px solid #e5e7eb;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #nav-sidebar.collapsed {
    width: auto;
  }

  #nav-sidebar .nav-brand,
  #nav-sidebar > .nav-item:last-child,
  #nav-sidebar > .border-t:last-child {
    display: none;
  }

  #nav-sidebar .nav-main,
  #nav-sidebar .nav-admin-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    padding: 0;
    overflow: visible;
    border-top: 0;
  }

  #nav-sidebar .nav-admin-actions {
    margin-left: auto;
  }

  #nav-sidebar .nav-item {
    min-width: 4rem;
    justify-content: center;
    padding: 0.75rem;
  }

  #nav-sidebar .nav-text {
    display: none;
  }

  #nav-sidebar .nav-item-active {
    border-right: 0;
    border-top: 2px solid var(--color-primary);
  }

  #main-content {
    padding-left: 0 !important;
    padding-bottom: 4rem;
  }
}
@import url("/app-assets/admin_events-bef9ab24.css");
@import url("/app-assets/events_list-39cfbcde.css");
@import url("/app-assets/public_events-8089bdeb.css");
@import url("/app-assets/multiselect-e524c8d3.css");

/* ============================================================
   Rich Editor (custom Trix toolbar via Stimulus)
   ============================================================ */

[data-controller="rich-editor"] trix-toolbar {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.rich-editor-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  background: #f9fafb;
  border: 2px solid #d1d5db;
  border-bottom: none;
  padding: 4px 6px;
}

.rich-editor-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.rich-editor-group--end {
  margin-left: auto;
}

.rich-editor-sep {
  width: 1px;
  height: 20px;
  background: #d1d5db;
  margin: 0 3px;
}

.rich-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  padding: 0;
}

.rich-editor-btn:hover {
  background: #e5e7eb;
}

.rich-editor-btn.trix-active {
  background: #e5e7eb;
  color: #111827;
}

.rich-editor-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.rich-editor-select:focus {
  border-color: #6b7280;
}

[data-controller="rich-editor"] trix-editor {
  border-radius: 0 !important;
}

/* Dark mode */
html.dark .rich-editor-bar {
  background: #161b22 !important;
  border-color: #30363d !important;
}

html.dark .rich-editor-sep {
  background: #30363d !important;
}

html.dark .rich-editor-btn {
  color: #8b949e !important;
}

html.dark .rich-editor-btn:hover {
  background: #21262d !important;
  color: #e6edf3 !important;
}

html.dark .rich-editor-btn.trix-active {
  background: #30363d !important;
  color: #e6edf3 !important;
}

html.dark .rich-editor-select {
  background: #0d1117 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}

/* ============================================================
   Trix / ActionText — FLAT DESIGN
   ============================================================ */

trix-toolbar .trix-button-group {
  border: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}

trix-toolbar .trix-button {
  border-radius: 0 !important;
  border: none !important;
  padding: 4px 8px !important;
  color: #374151 !important;
}

trix-toolbar .trix-button:hover {
  background: #f3f4f6 !important;
}

trix-toolbar .trix-button.trix-active {
  background: #e5e7eb !important;
  color: #111827 !important;
}

trix-toolbar {
  background: #f9fafb !important;
  border: 2px solid #d1d5db !important;
  border-bottom: none !important;
  padding: 6px 8px !important;
}

trix-editor {
  border: 2px solid #d1d5db !important;
  border-radius: 0 !important;
  min-height: 140px !important;
  padding: 10px 12px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  color: #111827 !important;
  background: #fff !important;
  outline: none !important;
}

trix-editor:focus {
  border-color: #6b7280 !important;
}

.trix-content figure.attachment {
  margin: 8px 0;
}

.trix-content figure.attachment figcaption {
  font-size: 12px;
  color: #6b7280;
}

.trix-content ul,
trix-editor ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.trix-content ol,
trix-editor ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.trix-content li,
trix-editor li {
  margin: 0.125rem 0;
}

/* Custom Leaflet Pin Markers */
.custom-pin-marker {
  background: transparent !important;
  border: none !important;
}

.pin-marker {
  position: relative;
  width: 36px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pin-marker:hover {
  transform: scale(1.1);
}

/* Event Hover Tooltip - FLAT DESIGN - Simple Name Only */
.leaflet-tooltip.event-hover-tooltip {
  background: white !important;
  border: 2px solid #374151 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  padding: 8px 12px !important;
  border-radius: 0 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  white-space: nowrap !important;
  max-width: 250px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 1 !important;
}

.leaflet-tooltip.event-hover-tooltip:before {
  border-top-color: #374151 !important;
}

.leaflet-tooltip-top.event-hover-tooltip:before {
  border-top-color: #374151 !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-top: 8px solid #374151 !important;
}

.leaflet-tooltip-bottom.event-hover-tooltip:before {
  border-bottom-color: #374151 !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-bottom: 8px solid #374151 !important;
}

/* Event Hover Tooltip - ENHANCED with name, type, and coordinates */
.leaflet-tooltip.event-hover-tooltip-enhanced {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  opacity: 1 !important;
  min-width: 180px !important;
  max-width: 280px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow: hidden !important;
}

.leaflet-tooltip.event-hover-tooltip-enhanced:before {
  border-top-color: #e5e7eb !important;
}

.leaflet-tooltip-top.event-hover-tooltip-enhanced:before {
  border-top-color: #e5e7eb !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-top: 8px solid #e5e7eb !important;
}

.leaflet-tooltip-bottom.event-hover-tooltip-enhanced:before {
  border-bottom-color: #e5e7eb !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-bottom: 8px solid #e5e7eb !important;
}

/* Enhanced tooltip content structure */
.event-tooltip-content {
  padding: 10px 14px;
  max-width: 276px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Map hover card tooltip */
.leaflet-tooltip.map-hover-tooltip {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
  padding: 0 !important;
  border-radius: 10px !important;
  font-family: inherit !important;
  opacity: 1 !important;
  min-width: 180px !important;
  max-width: 260px !important;
  white-space: normal !important;
  overflow: hidden !important;
}
.leaflet-tooltip.map-hover-tooltip::before { display: none !important; }

.map-hover-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}
.map-hover-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.map-hover-body {
  flex: 1;
  min-width: 0;
}
.map-hover-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-hover-type {
  font-size: 11px;
  color: #6b7280;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-hover-coords {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 3px;
}

.event-tooltip-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

.event-tooltip-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #9333ea;
  background: rgba(147, 51, 234, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.event-tooltip-coords {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Leaflet Popup Styling */
.leaflet-popup-content {
  margin: 0;
  padding: 0;
  min-width: 240px;
}

.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Map layer browser */
.map-layer-row {
  position: relative;
}

.map-layer-row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0);
  transition: background-color 160ms ease;
}

.map-layer-row.map-layer-row--active {
  background: rgba(147, 51, 234, 0.08);
  box-shadow: inset 2px 0 0 var(--color-primary);
}

.map-layer-row.map-layer-row--muted::after {
  background: rgba(255, 255, 255, 0.64);
}

.map-layer-row.map-layer-row--muted .map-layer-visibility {
  opacity: 0.55;
}

.map-layer-cluster {
  border-radius: 9999px;
  background: var(--cluster-color, var(--color-primary));
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.custom-event-popup-flat .leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.event-popup-card-flat {
  min-width: 300px;
  max-width: 340px;
}

.event-popup-card-flat .line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Layer Control */
.leaflet-control-layers {
  border: 2px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  background: white !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-control-layers-toggle {
  background-image: none !important;
  width: 40px !important;
  height: 40px !important;
  background: #9333ea !important; /* Primary color */
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.leaflet-control-layers-toggle::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.leaflet-control-layers-expanded {
  padding: 16px !important;
  min-width: 200px !important;
}

.leaflet-control-layers-base,
.leaflet-control-layers-overlays {
  margin-bottom: 8px;
}

.leaflet-control-layers-base:last-child,
.leaflet-control-layers-overlays:last-child {
  margin-bottom: 0;
}

.leaflet-control-layers-separator {
  height: 2px !important;
  background: #e5e7eb !important;
  margin: 12px 0 !important;
  border: none !important;
}

.leaflet-control-layers label {
  display: flex !important;
  align-items: center !important;
  padding: 8px 10px !important;
  margin: 2px 0 !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #374151 !important;
}

.leaflet-control-layers label:hover {
  background: #f3f4f6 !important;
  transform: translateX(2px);
}

.leaflet-control-layers-base label {
  background: rgba(147, 51, 234, 0.03);
}

.leaflet-control-layers-base label:hover {
  background: rgba(147, 51, 234, 0.08) !important;
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  margin-right: 8px !important;
  cursor: pointer !important;
  accent-color: #9333ea !important;
}

.leaflet-control-layers span {
  flex: 1;
}

/* Leaflet container z-index (lower than modal) */
.leaflet-container {
  font-family: inherit;
  cursor: default;
  z-index: 1 !important;
}

.leaflet-pane {
  z-index: auto !important;
}

.leaflet-dixinn-zones-pane {
  z-index: 320 !important;
}

.leaflet-dixinn-markers-pane {
  z-index: 640 !important;
}

.leaflet-tooltip-pane {
  z-index: 900 !important;
}

.leaflet-popup-pane {
  z-index: 2200 !important;
}

.leaflet-popup {
  z-index: 2200 !important;
}

/* Pulsing animation for active events on PINS */
@keyframes pulse-pin {
  0% {
    filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0.7));
  }
  70% {
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0));
  }
}

.marker-pulse-pin {
  animation: pulse-pin 2s infinite;
}

/* Draggable polygon points cursor */
.leaflet-interactive {
  cursor: pointer !important;
}

/* Polygon editing mode */
[data-controller*="map-draw"] .leaflet-container {
  cursor: crosshair;
}

/* GPS mode cursor */
[data-controller*="map-draw"][data-map-draw-mode-value="gps"] .leaflet-container {
  cursor: pointer;
}

/* Sidebar transitions */
.sidebar-transition {
  transition: width 0.3s ease-in-out;
}

/* Events panel transitions */
.events-panel-transition {
  transition: all 0.3s ease-in-out;
}

/* Modal backdrop - HIGHEST z-index */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Modal container - HIGHEST z-index */
#event-modal {
  z-index: 9999 !important;
}

/* JIRA-like card styling */
.event-card {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  border-radius: 8px;
}

.event-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateX(2px);
}

/* Fullscreen map layout */
.map-fullscreen {
  height: calc(100vh - 64px);
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Events panel overlay */
.events-panel-overlay {
  position: absolute;
  background: white;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.events-panel-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Text sizes */
.text-2xs {
  font-size: 0.625rem;
  line-height: 0.75rem;
}

/* Sticky header for lists */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  border-bottom: 2px solid #e5e7eb;
}

/* Map page body overflow control */
.map-page-body {
  overflow: hidden;
}

/* Search results hover effect with dynamic border color */
[data-action*="selectEvent"]:hover,
[data-action*="selectAddress"]:hover {
  border-left-color: var(--hover-border-color, #9333ea) !important;
}

/* ============================================================
   DARK MODE
   ============================================================ */

/* Icon toggle: moon visible in light, sun visible in dark */
.dark-icon-sun { display: none; }
html.dark .dark-icon-moon { display: none; }
html.dark .dark-icon-sun  { display: inline; }

html.dark {
  color-scheme: dark;
}

/* Page background */
html.dark body,
html.dark .bg-gray-50 {
  background-color: #0d1117 !important;
}

/* ── Sidebar ── */
html.dark #nav-sidebar {
  background-color: #161b22;
  border-color: #30363d;
}
html.dark .nav-brand {
  border-color: #30363d;
}
html.dark .nav-toggle {
  color: #6e7781;
}
html.dark .nav-toggle:hover {
  background-color: #21262d;
  color: #e6edf3;
}
html.dark .nav-item {
  color: #8b949e;
}
html.dark .nav-item:hover {
  background-color: #21262d !important;
  color: #e6edf3 !important;
}
html.dark .nav-item.nav-item-active {
  color: var(--color-primary) !important;
  background-color: color-mix(in srgb, var(--color-primary) 12%, transparent) !important;
}
html.dark #nav-sidebar .border-t {
  border-color: #30363d;
}
html.dark #nav-sidebar .text-gray-900 { color: #e6edf3 !important; }
html.dark #nav-sidebar .text-gray-400 { color: #6e7781 !important; }

/* ── Header ── */
html.dark #app-header {
  background-color: #161b22;
  border-color: #30363d;
}
html.dark .header-icon-button,
html.dark .header-user-button {
  color: #8b949e;
}
html.dark .header-icon-button:hover,
html.dark .header-user-button:hover {
  background: #21262d;
  color: #e6edf3;
}
html.dark .header-user-button .text-gray-700 { color: #c9d1d9 !important; }
html.dark .header-user-button .text-gray-400 { color: #6e7781 !important; }
html.dark .map-style-btn {
  background: #374151;
}
html.dark .map-style-btn:hover {
  background: #4b5563;
}
html.dark .map-style-btn.is-active {
  background: #4b5563;
  box-shadow: 0 0 0 2px #374151, 0 0 0 3.5px #6b7280;
}

/* ── Dropdown ── */
html.dark .dropdown-card {
  background: #1c2128;
  border-color: #30363d;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
html.dark .dropdown-item { color: #c9d1d9; }
html.dark .dropdown-item:hover {
  background: #21262d;
  color: #e6edf3;
}
html.dark .dropdown-item-danger { color: #f87171; }
html.dark .dropdown-item-danger:hover { background: #2d1515; }
html.dark .dropdown-card .border-b,
html.dark .dropdown-card .border-t { border-color: #30363d; }
html.dark .dropdown-card .text-gray-500 { color: #6e7781 !important; }
html.dark .dropdown-card .text-gray-900 { color: #e6edf3 !important; }

/* ── Cards / panels ── */
html.dark .form-card,
html.dark .event-form-card,
html.dark .bg-white {
  background-color: #161b22 !important;
  border-color: #30363d !important;
}
html.dark .event-detail-card {
  background-color: #161b22 !important;
  border-color: #30363d !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4) !important;
}
html.dark .event-detail-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 12%, #161b22), #161b22) !important;
  border-color: #30363d !important;
}
html.dark .event-detail-block {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
}
html.dark .bg-gray-100 { background-color: #21262d !important; }

/* ── Text ── */
html.dark .text-gray-900 { color: #e6edf3 !important; }
html.dark .text-gray-800 { color: #c9d1d9 !important; }
html.dark .text-gray-700 { color: #b1bac4 !important; }
html.dark .text-gray-600 { color: #8b949e !important; }
html.dark .text-gray-500 { color: #6e7781 !important; }
html.dark .text-gray-400 { color: #484f58 !important; }

/* ── Borders ── */
html.dark .border-gray-100 { border-color: #21262d !important; }
html.dark .border-gray-200 { border-color: #30363d !important; }
html.dark .border-gray-300 { border-color: #30363d !important; }
html.dark .divide-gray-100 > * + * { border-color: #21262d !important; }
html.dark .divide-gray-200 > * + * { border-color: #30363d !important; }
html.dark .border-t,
html.dark .border-b { border-color: #30363d; }
html.dark .h-px { background-color: #30363d; }

/* ── Form elements ── */
html.dark .form-label { color: #6e7781; }
html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea,
html.dark .form-file,
html.dark form input[type="text"],
html.dark form input[type="email"],
html.dark form input[type="password"],
html.dark form input[type="number"],
html.dark form input[type="date"],
html.dark form input[type="datetime-local"],
html.dark form input[type="url"],
html.dark form input[type="tel"],
html.dark form input[type="search"],
html.dark form input[type="file"],
html.dark form select,
html.dark form textarea {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
html.dark .form-input::placeholder,
html.dark form input::placeholder,
html.dark form textarea::placeholder { color: #484f58 !important; }
html.dark .form-input:focus,
html.dark .form-select:focus,
html.dark form input:focus,
html.dark form select:focus,
html.dark form textarea:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
}
html.dark .form-section { border-color: #30363d; }
html.dark .form-section-title { color: #e6edf3; }

/* ── Leaflet pop-ins ── */
html.dark .dixinn-popin-wrap .leaflet-popup-content-wrapper,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .leaflet-popup-content-wrapper,
html.dark .dixinn-popin-wrap .leaflet-popup-tip,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .leaflet-popup-tip {
  background: #161b22 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52) !important;
}

html.dark .dixinn-popin-wrap .leaflet-popup-content-wrapper,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .leaflet-popup-content-wrapper {
  overflow: hidden;
}

html.dark .dixinn-popin-wrap .leaflet-popup-content,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .leaflet-popup-content {
  background: #161b22 !important;
  color: #e6edf3 !important;
}

html.dark .dixinn-popin-wrap .divide-gray-50 > * + *,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .divide-gray-50 > * + * {
  border-color: #30363d !important;
}

html.dark .dixinn-popin-wrap .bg-gray-50,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .bg-gray-50 {
  background-color: #0d1117 !important;
}

html.dark .dixinn-popin-wrap .hover\:bg-gray-50:hover,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .hover\:bg-gray-50:hover {
  background-color: #21262d !important;
}

html.dark .dixinn-popin-wrap .text-gray-900,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .text-gray-900 {
  color: #e6edf3 !important;
}

html.dark .dixinn-popin-wrap .text-gray-800,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .text-gray-800,
html.dark .dixinn-popin-wrap .text-gray-700,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .text-gray-700 {
  color: #c9d1d9 !important;
}

html.dark .dixinn-popin-wrap .text-gray-500,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .text-gray-500,
html.dark .dixinn-popin-wrap .text-gray-400,
.dixinn-popin-wrap.dixinn-popin-wrap--dark .text-gray-400 {
  color: #8b949e !important;
}
html.dark .event-form-heading { border-color: #30363d; }

/* Trix editor */
html.dark trix-editor {
  background: #0d1117 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
html.dark trix-toolbar {
  background: #161b22 !important;
  border-color: #30363d !important;
}
html.dark trix-toolbar .trix-button { color: #8b949e !important; }
html.dark trix-toolbar .trix-button:hover { background: #21262d !important; }
html.dark trix-toolbar .trix-button.trix-active {
  background: #30363d !important;
  color: #e6edf3 !important;
}

/* ── Buttons ── */
html.dark .btn-secondary {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}
html.dark .btn-secondary:hover {
  background: #2d333b;
  border-color: #484f58;
  color: #e6edf3;
}
html.dark .btn-ghost { color: #8b949e; }
html.dark .btn-ghost:hover {
  background: #21262d;
  color: #e6edf3;
}
html.dark .btn-danger {
  background: #2d1515;
  border-color: #7f1d1d;
  color: #f87171;
}

/* ── Tables ── */
html.dark table thead,
html.dark thead.bg-gray-50 { background-color: #161b22 !important; }
html.dark thead th { color: #6e7781 !important; }
html.dark tbody tr { border-color: #21262d !important; }
html.dark tbody tr:hover { background-color: #1c2128 !important; }
html.dark .bg-orange-50  { background-color: #2d1a0a !important; }
html.dark .bg-purple-50  { background-color: #1a1230 !important; }
html.dark .border-purple-200 { border-color: #3d2060 !important; }
html.dark .text-purple-800   { color: #c4b5fd !important; }

/* ── Badges / status ── */
html.dark .bg-blue-100   { background-color: #1e3a5f !important; color: #93c5fd !important; }
html.dark .bg-green-100  { background-color: #14401f !important; color: #86efac !important; }
html.dark .bg-yellow-100 { background-color: #3d2e00 !important; color: #fde68a !important; }
html.dark .bg-red-50     { background-color: #2d0f0f !important; }
html.dark .bg-red-100    { background-color: #2d0f0f !important; }
html.dark .bg-purple-100 { background-color: #2d1b4e !important; color: #c4b5fd !important; }
html.dark .bg-gray-100   { background-color: #21262d !important; color: #8b949e !important; }
html.dark .text-blue-800  { color: #93c5fd !important; }
html.dark .text-green-800 { color: #86efac !important; }
html.dark .text-yellow-800 { color: #fde68a !important; }
html.dark .text-red-800   { color: #f87171 !important; }
html.dark .text-purple-800 { color: #c4b5fd !important; }
html.dark .text-gray-800  { color: #8b949e !important; }
html.dark .text-yellow-600 { color: #fbbf24 !important; }
html.dark .text-red-500   { color: #f87171 !important; }
html.dark .text-orange-500 { color: #fb923c !important; }

/* ── Alerts / notices ── */
html.dark .bg-red-50    { background-color: #2d0f0f !important; }
html.dark .border-red-200 { border-color: #7f1d1d !important; }
html.dark .text-red-800  { color: #f87171 !important; }
html.dark .text-red-700  { color: #fca5a5 !important; }
html.dark .bg-green-50  { background-color: #0f2d1a !important; }
html.dark .border-green-200 { border-color: #14532d !important; }
html.dark .text-green-800  { color: #86efac !important; }
html.dark .bg-yellow-50  { background-color: #2d2000 !important; }
html.dark .border-yellow-200 { border-color: #854d0e !important; }
html.dark .bg-blue-50   { background-color: #0f1e35 !important; }
html.dark .border-blue-200 { border-color: #1e3a5f !important; }
html.dark .text-blue-800  { color: #93c5fd !important; }

/* ── Map (Leaflet) ── */
html.dark .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(0.85) contrast(1.1);
}
html.dark .leaflet-container {
  background: #0d1117;
}

/* ── Misc ── */
html.dark .hover\:bg-gray-50:hover { background-color: #1c2128 !important; }
html.dark .hover\:bg-gray-100:hover { background-color: #21262d !important; }
html.dark .shadow-lg { box-shadow: 0 16px 40px rgba(0,0,0,0.5) !important; }
html.dark .form-card { box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important; }
html.dark select option { background-color: #161b22; color: #e6edf3; }
html.dark .border-gray-100 { border-color: #30363d !important; }
html.dark .border-gray-200 { border-color: #30363d !important; }
html.dark .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3) !important; }

/* ── Dark mode — éléments restants ── */

/* Sticky page header */
html.dark .page-sticky-header {
  background: rgba(13, 17, 23, 0.94);
}
html.dark .page-sticky-header .bg-white,
html.dark .page-sticky-header--flush .bg-white {
  background-color: #161b22 !important;
  border-color: #30363d !important;
}
html.dark .page-shell.bg-gray-50,
html.dark .min-h-full.bg-gray-50 {
  background-color: #0d1117 !important;
}
html.dark .page-sticky-header.is-scrolled {
  background: rgba(22, 27, 34, 0.98);
  border-bottom-color: #30363d;
  box-shadow: 0 1px 0 #30363d;
}

/* Table sticky header */
html.dark .table-sticky-header thead th {
  background: #161b22;
}

/* Segmented control (switcher Cartes / Liste) */
html.dark .segmented-control {
  background: #21262d;
  border-color: #30363d;
}
html.dark .view-btn {
  color: #8b949e;
}
html.dark .view-btn:hover {
  background: #2d333b;
  color: #e6edf3;
}

/* Filter choice (Conflits / Archives) */
html.dark .filter-choice {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}
html.dark .filter-choice:hover {
  background: #2d333b;
  border-color: #484f58;
}

/* =============================================
   MAP POP-IN
   Leaflet popup card anchored to markers
   ============================================= */

/* Strip Leaflet default popup chrome — !important needed because Leaflet CDN CSS loads after ours */
.dixinn-popin-wrap .leaflet-popup-content-wrapper {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.dixinn-popin-wrap .leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
}
.dixinn-popin-wrap .leaflet-popup-tip {
  background: white !important;
  box-shadow: none !important;
}
[data-dark-map="1"] .leaflet-popup-tip {
  background: #1e293b !important;
}

/* Card */
.map-popin {
  width: 300px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
}
[data-dark-map="1"] .map-popin {
  background: #1e293b;
  color: #e2e8f0;
}

/* Colored top bar */
.map-popin-top-bar { height: 3px; }

/* Header */
.map-popin-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 10px;
}
.map-popin-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.map-popin-title { flex: 1; min-width: 0; }
.map-popin-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-dark-map="1"] .map-popin-name { color: #f1f5f9; }
.map-popin-sub { font-size: 11px; color: #6b7280; margin-top: 2px; }
[data-dark-map="1"] .map-popin-sub { color: #94a3b8; }
.map-popin-loc {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #9ca3af;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
[data-dark-map="1"] .map-popin-loc { color: #64748b; }

/* Controls (navigate + close) */
.map-popin-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-top: -2px;
}
.map-popin-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #9ca3af;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
.map-popin-btn:hover { background: rgba(0,0,0,0.06); color: #374151; }
[data-dark-map="1"] .map-popin-btn { color: #64748b; }
[data-dark-map="1"] .map-popin-btn:hover { background: rgba(255,255,255,0.08); color: #cbd5e1; }

/* Body rows */
.map-popin-body { padding: 0 12px 10px; }
.map-popin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}
[data-dark-map="1"] .map-popin-row { border-bottom-color: rgba(255,255,255,0.06); }
.map-popin-row:last-child { border-bottom: none; }
.map-popin-label { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.map-popin-value { font-size: 12px; font-weight: 500; color: #374151; text-align: right; }
[data-dark-map="1"] .map-popin-value { color: #cbd5e1; }

/* Footer CTA */
.map-popin-footer {
  border-top: 1px solid #f3f4f6;
  padding: 10px 12px;
}
[data-dark-map="1"] .map-popin-footer { border-top-color: rgba(255,255,255,0.06); }
.map-popin-cta {
  display: block;
  text-align: center;
  padding: 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white !important;
  text-decoration: none;
  transition: opacity 0.15s;
}
.map-popin-cta:hover { opacity: 0.88; }

/* ============================================================
   Status filter chips (sidebar carte)
   ============================================================ */
.status-chip {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}
.status-chip--active {
  background: var(--color-primary, #9333ea);
  border-color: var(--color-primary, #9333ea);
  color: white;
}
.status-chip[data-chip-status="conflict"].status-chip--active {
  background: #f97316;
  border-color: #f97316;
  color: white;
}
