.swal2-button {
  min-width: 120px;
  margin: 0 5px;
}

.typeTitle {
  font-size: 1.1rem;
}

.fa-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor; /* allows Bootstrap text-* to apply */
}

button,
input[type="submit"] {
  border-radius: 0 !important;
}

/* generic read-only look */
input[type="date"]:read-only,
input[type="date"][readonly] {
  color: var(--bs-secondary-color, #6c757d);      /* lighter text */
  background-color: var(--bs-tertiary-bg, #e9ecef);
  cursor: not-allowed;
}

/* dim the calendar icon in Chromium/WebKit */
input[type="date"]:read-only::-webkit-calendar-picker-indicator,
input[type="date"][readonly]::-webkit-calendar-picker-indicator {
  opacity: .5;
}

/* also lighten the inner text wrapper in Chromium/WebKit */
input[type="date"]:read-only::-webkit-datetime-edit,
input[type="date"][readonly]::-webkit-datetime-edit {
  color: var(--bs-secondary-color, #6c757d);
}

.pg-schedule-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.pg-schedule-table th,
.pg-schedule-table td {
  text-align: center;
  font-size: 0.75rem;
  padding: 0.35rem;
  user-select: none;
}

.pg-schedule-table th {
  background: #f3f5f7;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pg-schedule-cell {
  cursor: pointer;
  background: #e6e9ed;
  transition: background-color 0.15s ease;
}

.pg-schedule-cell.active {
  background: #7dd87d;
  color: #0f3d0f;
}

.pg-schedule-cell:hover {
  background: #b8e4b8;
}

.pg-schedule-day,
.pg-schedule-hour,
.pg-schedule-all {
  cursor: pointer;
}

.pg-schedule-chip {
  width: 18px;
  height: 10px;
  border-radius: 4px;
  display: inline-block;
}

.pg-schedule-chip--active {
  background: #7dd87d;
}

.pg-schedule-chip--inactive {
  background: #e6e9ed;
  border: 1px solid #c9d0d7;
}



.limits-subtitle {
  grid-column: 1 / -1;   /* span both columns */
  margin: .75rem 0 .25rem;
}

.limits-layout {
  display: grid;
  grid-template-columns: 1fr;      /* stack by default (mobile) */
  gap: 1rem;
  align-items: start;
}

.limits-card { background:#fff; border:1px solid #dee2e6; border-radius:.5rem; padding:1rem; }

.limits-grid {
  display: grid;
  grid-template-columns: max-content 1fr; /* adjust 9ch to your desired input width */
  column-gap: .75rem;
  row-gap: .5rem;
  align-items: center;
  grid-auto-flow: row;
}


/* keep your small numeric fields tight */
.input-fixed--small{ width: 9ch; }

/* date field width */
.input-fixed--date{ width: 15ch; }

.limits-grid .grid-label  { grid-column: 1; }
.limits-grid .grid-field  { grid-column: 2; }

.limits-grid .form-label { margin: 0; font-weight: 400; }

.area-box{
  border:1px solid #cfd4da;
  border-radius:3px;
  padding:.25rem .5rem .5rem;
  background:#fff;
  margin-top: 1rem;
}
.area-box__legend{
  font-size:.95rem;
  padding:0 .25rem;
  width:auto;
  margin:0 0 .25rem;
}
.area-table{

  table-layout:fixed;
}
.area-table th, .area-table td{
  border-color:#e9ecef;
  vertical-align:middle;
}
.area-table td{ height:2rem; }
.properties-modal {
    --bs-modal-width: 1000px;
}

/* force an item to sit in the first column only */
.grid-col-1{ grid-column:1 / 2; }

input[type="text"][inputmode="numeric"] {
  width: 6ch;
}

/* date row WITH time: [ (radio+label) | date | time ] */
.date-row--with-time {
  display: grid;
  grid-template-columns: auto max-content max-content;
  grid-template-columns: auto 16ch 10ch;
  column-gap: .5rem;
  align-items: center;
}

.is-readonly { background-color:#e9ecef; cursor:not-allowed; }

#area {
	width: 60%;
}

#limit {
	width: 40%
}

#endHours, #delHours {
	width: 6ch;
}

.date-row--with-time .radio-wrap {
  display: inline-flex;
  align-items: center;
  gap: .5rem; /* space between radio and its label */
}

/* 3 fixed columns: [radio+label] [date] [time-or-spacer] */
.date-row-unified {
  display: grid;
  grid-template-columns: auto 16ch 10ch; /* label | date | time */
  column-gap: .5rem;
  align-items: center;
}

/* inputs can shrink if needed */
.limits-card .form-control { min-width: 0; max-width: 100%; }

/* hidden time placeholder for the bottom card */
.time-spacer {
  width: 7.5ch;
  height: 0;                /* no height impact */
  visibility: hidden;       /* keeps column width without showing anything */
}

/* date row WITHOUT time: [ (radio+label) | date ] */
.date-row--date-only {
  display: grid;
  grid-template-columns: auto max-content;
  column-gap: .5rem;
  align-items: center;
}

.date-input { width: 16ch; }          /* adjust to 14–18ch as you like */

/* compact time field for HH:MM only */
.time-input {
  flex: 0 0 10ch;
  min-width: 10ch;
  width: 10ch;
}        /* fits “23:59” */


/* allow controls to shrink so nothing overflows */
.limits-card .form-control { min-width: 0; max-width: 100%; }

.w-ch-4 {
	flex: 0 0 6ch;
	min-width: 6ch;
	width: 5.2ch;
}

/* Keep labels on one line (or use text-truncate if you want ellipsis) */
.limits-grid .form-check-label { white-space: nowrap; }

/* Fixed-width input that won't shrink */
.input-fixed { flex: 0 0 9ch; min-width: 9ch; }

/* Gray the unit when the input is disabled */
.unit { color: var(--bs-body-color); }
.limits-grid input:disabled + .unit { color: var(--bs-secondary-color); }

.limit-row {
  display: grid;
  grid-template-columns: 1fr 6.2ch; /* ≈ 4 digits + padding */
  align-items: center;
  column-gap: .5rem;                /* space between columns */
}

#limits-pane .limits-layout {                /* your outer 2-col layout */
  display: grid !important;
  column-gap: 1rem;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 380px; /* left grows, right fixed */
  row-gap: 1rem;
  align-items: start;
}

/* 2) Inside the right cards, let inputs shrink and align nicely */
#limits-pane .limits-card .form-control {
  min-width: 0;            /* important: allows shrinking in flex/grid rows */
  max-width: 100%;
}

/* 3) Make each radio row a 3-column grid: [label] [date/hours field] [time] */
#limits-pane .date-row {
  display: grid;
  grid-template-columns: auto 1fr auto;   /* text | main input | optional time */
  column-gap: .5rem;
  align-items: center;
}

/* 4) Reasonable widths for the fields */
#limits-pane .hours-input   { width: 6ch; }          /* 0-999999 ok */
#limits-pane .date-input    { max-width: 12rem; }    /* avoids overflow */
#limits-pane .time-input    { width: 8ch; }          /* --:-- -- */

/* ensure the input doesn't try to stretch */
.limit-row .form-control {
  width: 100%;
  min-width: 0;
}

/* default */
.unit { color: var(--bs-body-color); }              /* Bootstrap var, or use #212529 */

/* gray the unit when the input is disabled */
input:disabled + .unit { color: var(--bs-secondary-color); } /* or #6c757d */

.w-ch-8 { width: 9ch; }

.input-fixed {
  flex: 0 0 9ch;   /* fixed column width */
  min-width: 9ch;  /* prevents flex shrink */
}

.text-flag {
  height: 1em;
  vertical-align: middle;
  margin-right: 0.5em;
}

.tooltip .tooltip-inner {
  text-align: left;
  white-space: pre-wrap; /* respects \n line breaks */
}

.tabulator-cell.overflow-visible-cell {
  overflow: visible !important;
}

.dropdown-menu {
  z-index: 9999;
}

.dropdown-menu .dropdown-item:active {
  background-color: transparent; /* optional visual tweak */
}

/* Nested dropdown support */
.dropdown-menu .dropend {
  position: relative;
}

.dropdown-menu .dropend > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 0.1rem;
}

.dropdown-menu .dropdown.show > .dropdown-menu {
  display: block;
}

.btn.dropdown-toggle::after {
  display: none !important;
}

html, body {
  height: 100%;
  margin: 0;
}

/* set min-height, otherwise the drop down menu is not accessible when there is 4 rows or less */
#searchResultsTable {
  min-height: 400px;
}

#searchResultsTable .tabulator-cell {
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow: visible;
}

/* --- Events & Permits Tabulators --- */
#eventTable .tabulator-cell,
#permitTable .tabulator-cell {
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible;

}

#eventTable .tabulator-cell.wrap,
#permitTable .tabulator-cell.wrap {
  white-space: normal !important;
  word-break: break-word !important;
}

/* Kill the tiny inner scrollbar on exactly-one-page views */
#eventTable .tabulator-tableholder,
#permitTable .tabulator-tableholder {
  overflow-y: hidden !important;
}

/* Avoid clipping the last row border after hiding overflow */
#eventTable .tabulator-table,
#permitTable .tabulator-table {
  padding-bottom: 1px;
  min-height: 300px;
}

.access-decision-timestamp span {
  white-space: nowrap;
}

.access-decision-icon {
  cursor: pointer;
}

.access-decision-icon:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}


/* Section cards inside modals */
.modal .section-card {
  border: 0;
  box-shadow: 0 0.25rem 0.6rem rgba(0,0,0,.06);
  border-radius: 0.75rem;
}


.modal .section-title {
  font-size: .9rem;
  letter-spacing: .02em;
}

/* Search Summary chips */
#searchSummary .chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.1);
  background: var(--bs-body-bg);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#searchSummary .chip .k { color: var(--bs-gray-700); }
#searchSummary .chip .v { font-weight: 600; }

/* Make selected items in the multi-select appear with Bootstrap primary blue */
#checkpointMultiSelect.form-select option:checked {
  color: #fff !important;
  background: var(--bs-primary) !important;
}

/* Make selected items in the multi-select appear with Bootstrap primary blue */
#checkpointMultiSelect.form-select option:checked{
  color: #fff !important;
  background: var(--bs-primary) !important; /* works in most browsers */
}

/* (optional) nicer focus ring on the control itself */
#checkpointMultiSelect.form-select:focus{
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

/* Thumbnails */
#eventThumbsDialog #eventGallery a { display:block; }
#eventThumbsDialog #eventGallery img { max-width:100%; height:auto; display:block; border-radius:.25rem; }
#thumbsGrid img { display:block; width:100%; height:auto; border-radius:.25rem; }

/* Use dynamic viewport on mobile; fall back to vh elsewhere */
#previewImg {
  max-height: 40vh;
  max-height: 40dvh;   /* better on iOS/Android when bars show/hide */
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;  /* keep aspect ratio if container gets tight */
  cursor: zoom-in;
}

/* For admin notes */
.note-card .note-message {
  max-height: 7rem;        /* limit height */
  overflow: auto;          /* scroll if too long */
}

.note-card .note-author {
  max-width: 50%;
}

/* --- Area Monitoring Tabulator --- */
#amTable .tabulator-cell {
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible;
}

#amTable .tabulator-tableholder {
  overflow-y: hidden !important;
}

#amTable .tabulator-table {
  padding-bottom: 1px;
  min-height: 300px;
}

/* Ensure close icon is visible on primary modal headers */
.modal-header.bg-primary .btn-close {
  filter: invert(1) grayscale(100%);
}
