/* Wrapper for all checkboxes */
.checkbox-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

/* Each checkbox row */
.checkbox-container div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fafafa;
  transition: background-color 0.2s ease;
}

.checkbox-container div:hover {
  background-color: #f0f0f0;
}

/* Checkbox styling */
.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0077cc; /* modern blue tone */
  cursor: pointer;
}

/* Label styling */
.checkbox-container label {
  font-size: 15px;
  color: #333;
  font-weight: 500;
  cursor: pointer;
}


/* === NEW: User Management List Styles === */

/* Main container for the entire user list */
.user-management-container {
  width: 95%;
  max-width: 700px; /* A sensible max-width for desktops */
  margin: 20px auto;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden; /* Ensures child elements respect the border radius */
}

/* A single "card" for each user in the list */
.user-card {
  display: flex;
  flex-wrap: wrap; /* CRITICAL: Allows items to wrap onto the next line on small screens */
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  gap: 15px; /* Provides consistent spacing between items */
}

.user-card:last-child {
  border-bottom: none; /* Remove the border from the last item */
}

/* Container for the user's name and congregation */
.user-info {
  flex-grow: 1; /* Allows this element to take up any available space */
  min-width: 180px; /* Prevents it from getting too squished */
}

.user-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
  word-break: break-all; /* Prevents long names from overflowing */
}

.user-congregation {
  font-size: 0.9em;
  color: #666;
  margin-top: 2px;
}

/* Container for all the permission checkboxes */
.user-permissions {
  display: flex;
  justify-content: center; /* Centers the entire row of checkboxes */
  gap: 5px; /* Small gap between permission groups */
  flex-shrink: 0; /* Prevents this container from shrinking */
  flex-wrap: wrap; /* Allows checkboxes to wrap on very small screens */
}

/* A single permission group (label + checkbox) */
.permission-group {
  display: flex;
  flex-direction: column; /* Stack the label on top of the checkbox */
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 65px; /* Give each group a consistent width */
  padding: 5px;
  border-radius: 4px;
}

.permission-label {
  font-size: 0.75em;
  font-weight: 500;
  color: #555;
  margin-bottom: 5px;
  text-align: center; /* Ensures label text is centered */
}

.checkbox-only {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0 auto; /* Centers the checkbox within its container */
  display: block; /* Ensures margin auto works properly */
}

/* Mild styles for approved and campaign (non-admin) */
.permission-group.approved {
  background-color: rgba(76, 175, 80, 0.12);  /* Gentle green */
}

.permission-group.campaign {
  background-color: rgba(173, 216, 230, 0.18);  /* Soft light blue */
}

/* More vivid styles for admin roles with strong left borders and bold text */
.permission-group.admin-campaign {
  background-color: rgba(0, 123, 255, 0.25);  /* Brighter blue */
  border-left: 5px solid rgba(0, 70, 140, 1);  /* Dark navy blue */
  font-weight: bold;
}

.permission-group.admin-cong {
  background-color: rgba(255, 193, 7, 0.3);  /* Brighter amber */
  border-left: 5px solid rgba(255, 160, 0, 1);  /* Strong orange */
  font-weight: bold;
}

.permission-group.admin-full {
  background-color: rgba(156, 39, 176, 0.25);  /* Brighter purple */
  border-left: 5px solid rgba(94, 53, 177, 1);  /* Deep violet */
  font-weight: bold;
}


/* Responsive adjustments for mobile phones */
@media (max-width: 480px) {
  .user-card {
    flex-direction: column; /* Stack user info and permissions vertically */
    align-items: flex-start; /* Align everything to the left */
  }

  .user-permissions {
    width: 100%; /* Make the permissions container take full width */
    justify-content: flex-start; /* Align checkboxes to the left */
    gap: 2px;
  }
}



#assignee-list {
  max-width: 700px;
  width: 90%;
  margin: 0 auto;
}

/* --- STANDARDIZED CARD STYLES --- */
/* Base card structure - applies to all card types */
.dashboard-card,
.filter-card,
.card,
#filter-section,
.filter-container,
#new-year-card {
  width: 90%;
  max-width: 600px;
  margin: 20px auto;
  box-sizing: border-box;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

/* Hover effect for interactive cards */
.dashboard-card:hover,
.filter-card:hover,
.card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- STANDARDIZED CARD HEADERS --- */
.card-header,
.dashboard-card .card-header,
.filter-card .card-header {
  margin: 0;
  padding: 16px 20px;
  background-color: #f7f9fc;
  border-bottom: 1px solid #e0e0e0;
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
  word-wrap: break-word;
  overflow-wrap: break-word;
}


/* --- STANDARDIZED CARD CONTENT --- */
.card-content,
.filter-card-content,
.dashboard-card .card-content .filter-card-content {
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  margin: auto 0;
}
.card-content,
.filter-card-content,
.dashboard-card .card-content .filter-card-content {
  padding: 20px;
  box-sizing: border-box;
  width: 90%;
  margin: auto;
}

/* Special layout for filter cards */
.filter-card-content {
  display: block;  
  gap: 15px;
}

.filter-card-content .filter-group {
  min-width: 200px;
  box-sizing: border-box;
}

/* --- STANDARDIZED FORM CONTROLS --- */
/* All form inputs and selects follow the same styling */
.filter-card-content select,
.filter-card-content input,
.card-content select,
.card-content input,
.dashboard-card select,
.dashboard-card input,
#new-year-card select,
#new-year-card input,
.standardized-input,
.standardized-select {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fdfdfd;
  box-sizing: border-box;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus states for form controls */
.filter-card-content select:focus,
.filter-card-content input:focus,
.card-content select:focus,
.card-content input:focus,
.dashboard-card select:focus,
.dashboard-card input:focus,
#new-year-card select:focus,
#new-year-card input:focus,
.standardized-input:focus,
.standardized-select:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* --- STANDARDIZED LABELS --- */
.filter-card-content label,
.card-content label,
.dashboard-card label,
#new-year-card label,
.standardized-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #555;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* --- STANDARDIZED BUTTONS --- */
.card-button,
.filter-card button,
.card-content button,
.dashboard-card button,
#new-year-card button {
  padding: 12px 24px;
  font-size: 1em;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.card-button:hover,
.filter-card button:hover,
.card-content button:hover,
.dashboard-card button:hover,
#new-year-card button:hover {
  background-color: #45a049;
  transform: translateY(-1px);
}

.card-button:active,
.filter-card button:active,
.card-content button:active,
.dashboard-card button:active,
#new-year-card button:active {
  transform: translateY(0);
}

/* Secondary button style */
.card-button.secondary,
.filter-card button.secondary,
.card-content button.secondary,
.dashboard-card button.secondary,
#new-year-card button.secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.card-button.secondary:hover,
.filter-card button.secondary:hover,
.card-content button.secondary:hover,
.dashboard-card button.secondary:hover,
#new-year-card button.secondary:hover {
  background-color: #e8e8e8;
}

/* --- CONTENT AREA LAYOUT --- */
#dynamic-content-area {
  display: block;
    margin: 20px auto;
  gap: 25px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

/* --- RESPONSIVE DESIGN --- */
/* Tablet breakpoint */
@media (max-width: 768px) {
  #interactive-area {
    width: 98%;
    margin: 10px auto;
    padding: 0 5px;
  }
  
  .dashboard-card,
  .filter-card,
  .card,
  #filter-section,
  .filter-container,
  #new-year-card {
    width: 98%;
    margin: 15px auto;
  }
  
  .card-header,
  .dashboard-card .card-header,
  .filter-card .card-header {
    padding: 12px 15px;
    font-size: 1em;
  }
  
  .card-content,
  .filter-card-content,
  .dashboard-card .card-content .filter-card-content  {
    padding: 15px;
  }
  

  
  .filter-card-content .filter-group {
    min-width: 150px;
  }
  
  #hero-image-banner {
    height: 150px;
    margin-bottom: 20px;
  }
  
  #hero-image-banner h1 {
    font-size: 2.2em;
    padding: 0 15px;
  }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
  .dashboard-card,
  .filter-card,
  .card,
  #filter-section,
  .filter-container,
  #new-year-card {
    width: 100%;
    margin: 10px auto;
    border-radius: 4px;
  }
  
  .card-header,
  .dashboard-card .card-header,
  .filter-card .card-header {
    padding: 10px 12px;
    font-size: 0.95em;
  }
  
  .card-content,
  .filter-card-content,
  .dashboard-card .card-content .filter-card-content  {
    padding: 12px;
  }
  

  
  .card-button,
  .filter-card button,
  .card-content button,
  .dashboard-card button,
  #new-year-card button {
    padding: 10px 20px;
    font-size: 0.95em;
  }
  
  #hero-image-banner h1 {
    font-size: 1.8em;
  }
  
  #dynamic-content-area {
    gap: 20px;
    padding: 0 5px;
  }
}

/* Very small mobile devices */
@media (max-width: 320px) {
  
  .card-header,
  .dashboard-card .card-header,

  
  .filter-card-content select,
  .filter-card-content input,
  .card-content select,
  .card-content input,
  .dashboard-card select,
  .dashboard-card input,
  #new-year-card select,
  #new-year-card input {
    font-size: 0.9em;
  }
}


/* --- DASHBOARD STYLES --- */
/* The main container for the dashboard after login */
#interactive-area {
  width: 90%;
  max-width: 600px;
  margin: 10px auto;
  display: none;
  box-sizing: border-box;
  padding: 0 10px;
}

/* The banner image at the top */
#hero-image-banner {
  height: 200px;
  border-radius: 12px;
  background-color: #333;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  width: 100%;
  box-sizing: border-box;
}

/* Dark overlay on the banner to make text readable */
#hero-image-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
}

#hero-image-banner h1 {
  position: relative;
  font-size: 2.8em;
  font-weight: 600;
  text-align: center;
  margin: 0;
  padding: 0 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}


#start-process-btn {
  padding: 12px 10px;
   background-color: #1976d2; /* solid color fallback */
  background-image: linear-gradient(135deg, #2196f3, #1565c0);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: all 0.25s ease;
  margin: 16px auto;
  display: block; /* when shown */
}

#start-process-btn:hover {
  background: linear-gradient(135deg, #1976d2, #0b3c91);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#start-process-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#confirm_cong_btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

#confirm_cong_btn {
  display: none; /* shown later by JS */
  padding: 12px 24px;
  background: linear-gradient(135deg, #2196f3, #0d47a1);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.25s ease;
  margin: 16px auto;
  display: block; /* when shown */
}

#confirm_cong_btn:hover {
  background: linear-gradient(135deg, #1976d2, #0b3c91);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#confirm_cong_btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#confirm_cong_btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.filter-group {
  display: block;
  justify-content: center;
  margin-top: 20px;
}



.service-year-content {
    text-align: center;
}



.action-button {
    justify-content: center;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.action-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}


/* Loading Overlay Styling */
#loading-overlay {
    /* Covers the entire screen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Centering content inside */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Modern look with semi-transparent background */
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 1000;

    /* Hidden by default, with a smooth transition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

/* Class to make the overlay visible */
#loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: 2.5em;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.loading-content p {
    font-size: 1.2em;
    letter-spacing: 2px;
}

/* Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


  .special-row {
    font-weight: bold;
    background-color: #fdf5e6; /* light warm yellow background */
  }

/* ==================== */
/* PARENT TERRITORY ROWS (ter_full = true) */
/* ==================== */

/* Row 1 - Parent Territory Header */
.parent-map-row.line1-row > td {
  font-weight: bold;
  background-color: #d4e6ff; /* Deep blue background */
  border-top: 3px solid #0052a3 !important;
  border-right: 3px solid #0052a3 !important;
  border-left: 3px solid #0052a3 !important;
  border-bottom: 3px solid #0052a3 !important;
  color: #002966; /* Darkest blue text */
}

/* Row 2 - Parent Territory Secondary */
.parent-map-row.line2-row > td {
  background-color: #e6f2ff; /* Medium blue */
  border-right: 3px solid #0052a3 !important;
  border-left: 3px solid #0052a3 !important;
  border-top: none !important;
  border-bottom: 3px solid #0052a3 !important;
  color: #003d99;
  font-weight: 600;
}

/* ==================== */
/* CHILD TERRITORY ROWS (ter_full = false) */
/* ==================== */

/* Row 1 - Child Territory Header */
.subdivided-map-row.line1-row > td {
  font-weight: normal;
  background-color: #e5e5e5; /* Light grey background */
  border-top: 3px solid #666666 !important;
  border-right: 3px solid #666666 !important;
  border-left: 3px solid #666666 !important;
  border-bottom: 3px solid #666666 !important;
  color: #333333; /* Dark grey text */
}

/* Row 2 - Child Territory Secondary */
.subdivided-map-row.line2-row > td {
  background-color: #f0f0f0; /* Lighter grey */
  border-right: 3px solid #666666 !important;
  border-left: 3px solid #666666 !important;
  border-top: none !important;
  border-bottom: 3px solid #666666 !important;
  color: #555555;
  font-weight: normal;
}

/* ==================== */
/* BASE TABLE STYLES */
/* ==================== */
.subdivided-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.subdivided-table td {
  border: 1px solid #e0e0e0;
  padding: 6px;
  text-align: center;
}

/* Special Cells */
.territory-name-cell {
  font-weight: bold;
  text-align: left;
  padding-left: 8px !important;
}

.date-cell {
  font-family: monospace;
  font-size: 0.9em;
  padding: 4px !important;
}

/* Hover Effects */
.subdivided-table tr:hover > td {
  background-color: #e6ffe6 !important;
}

/* ==================== */
/* STANDARDIZED DROPDOWN CONTROLS */
/* ==================== */
/* Base dropdown styling - applies to all dropdowns */
.admin-style-dropdown {
  width: 90%;
  margin: 0 auto;
  padding: 12px 36px 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: #eef2f6;
  color: #1a202c;
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.05),
    0 1px 1px rgba(0,0,0,0.03);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
  height: 44px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* Focus state - standardized across all dropdowns */
.admin-style-dropdown:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
  outline: none;
  background-color: #ffffff;
}

/* Hover state - standardized across all dropdowns */
.admin-style-dropdown:hover {
  border-color: #cbd5e0;
  background-color: #f9fafb;
}

/* Option styling - standardized across all dropdowns */
.admin-style-dropdown option {
  padding: 10px 14px;
  background: #ffffff;
  color: #1a202c;
}

.admin-style-dropdown option:hover {
  background: #edf2f7 !important;
}

.admin-style-dropdown option:checked {
  background: #ebf4ff !important;
  font-weight: 500;
  position: relative;
}

.admin-style-dropdown option:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background-color: #4299e1;
  border-radius: 50%;
}

/* ==================== */
/* SPECIFIC DROPDOWN CONTAINERS */
/* ==================== */

/* Assignee dropdown container */
#assignee-dropdown {
  display: none;
}

#assignee-dropdown.assignee-filter {
  display: none;
}

/* Congregation dropdown */
#cong-dropdown {
  display: none;
}

/* ==================== */
/* CONTAINER LAYOUTS */
/* ==================== */

/* Subdivided container - maintains original layout */
.subdivided-container {
  display: none;
}

#res-dropdown.filter-row {
  display: none;
}


/* ==================== */
/* RESPONSIVE ADJUSTMENTS */
/* ==================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
  .subdivided-row,
  .dropdown-row {
    width: 95%;
    gap: 12px;
  }
  
  .subdivided-group,
  #res-dropdown .filter-group {
    min-width: 150px;
  }
  
  #assignee-dropdown,
  #cong-dropdown {
    min-width: 150px;
  }
  
.res-dropdown-container {
  width: 90%;
  max-width: 600px;  /* Changed from 800px */
  margin: 0 auto;
}
}

/* Mobile breakpoint */
@media (max-width: 480px) {
  .subdivided-dropdown,
  .modernized-dropdown,
  .territory-type-dropdown,
  .calm-dropdown,
  #publisher-filter {
    max-width: 100%;
    font-size: 14px;
  }
  
.dropdown-row {
  display: block;
  justify-content: center;
  gap: 16px;
  width: 90%;
  max-width: 700px;  /* Changed from 800px */
  margin: 0 auto;
}
  
  .subdivided-group,
  #res-dropdown .filter-group,
  #assignee-dropdown,
  #cong-dropdown {
    width: 100%;
    min-width: unset;
    max-width: 100%;
  }
  
  .res-dropdown-container {
    width: 100%;
  }
  
  #res-dropdown.filter-row {
    gap: 10px;
  }
  
  .button-group {
    gap: 8px;
  }
}

/* Touch device adjustments */
@media (hover: none) and (pointer: coarse) {
  .subdivided-dropdown,
  .modernized-dropdown,
  .territory-type-dropdown,
  .calm-dropdown,
  #publisher-filter {
    padding: 14px 40px 14px 16px;
    height: 46px;
    font-size: 16px;
  }
  
  .subdivided-dropdown option,
  .modernized-dropdown option,
  .territory-type-dropdown option,
  .calm-dropdown option,
  #publisher-filter option {
    padding: 12px 16px;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .subdivided-dropdown,
  .modernized-dropdown,
  .territory-type-dropdown,
  .calm-dropdown,
  #publisher-filter {
    padding: 12px 32px 12px 12px;
    font-size: 14px;
  }
  
  .subdivided-container {
    margin-bottom: 12px;
  }
  
  .subdivided-row,
  .dropdown-row {
    gap: 8px;
  }
}

/* --- Mild Copper Themed Form Container --- */
.copper-container {
  /* Layout */
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 95%;
  max-width: 600px;
  margin: 16px auto;
  padding: 24px;
  box-sizing: border-box;
  
  /* The Mild Copper Look */
  background-color: #f7f2f0; /* A very light, warm off-white base */
  border: 1px solid #d1c0b8; /* A soft, dusty copper-like border */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* A simple grouping for a label and its input */
.form-group {
  text-align: center;
}

/* --- Mild Copper Themed Form Label --- */
.copper-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #8B4513; /* 'SaddleBrown' - a rich, dark brown for text */
  text-shadow: 0 1px 1px rgba(255, 250, 245, 0.7);
}

/* --- Mild Copper Themed Form Input Field --- */
.copper-input {
  /* Sizing and Layout */
  width: 90%;
  max-width: 600px;
  padding: 10px;
  box-sizing: border-box;

  /* Look & Feel */
  background-color: #FFFFFF;
  border: 1px solid #d1c0b8; /* A soft, dusty copper-like border */
  border-radius: 4px;
  font-size: 1em;
  color: #333;
  
  /* Smooth transition for the focus effect */
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- The "Focus" State (When you click in the input) --- */
.copper-input:focus {
  /* A warm copper/orange glow */
  border-color: #B87333; /* A richer, solid copper color */
  box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.25);
  outline: none; /* Remove the default browser outline */
}

/* --- Mild Copper Themed Checkbox Area --- */
.copper-checkbox-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.copper-checkbox-group label {
  font-size: 0.9em;
  color: #8B4513;
  cursor: pointer;
}

.copper-checkbox-group input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #B87333; /* Styles the checkmark color in modern browsers */
}

/* --- Classic Copper Button --- */
.copper-button-small,
.copper-button {
  /* Sizing and Layout */
  display: inline-block;
  
  /* Typography */
  color: #6B4F43; /* A dark, brownish-copper for text */
  font-weight: bold;
  text-align: center;
  text-shadow: 0 1px 1px rgba(255, 245, 238, 0.8);

  /* The Mild Copper Look & Feel */
  border: 1px solid #b39a8f; /* A darker version of the gradient's end */
  border-radius: 6px;
  /* A very soft copper gradient */
  background-image: linear-gradient(to bottom, #f0e1d9, #e0d0c8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  
  /* Interactivity */
  cursor: pointer;
  transition: all 0.2s ease-out;
}

/* Specifics for the LARGE button */
.copper-button {
  max-width: 350px;
  width: 100%;
  padding: 12px 20px;
  font-size: 1.1em;
}

/* Specifics for the SMALL button */
.copper-button-small {
  width: 120px; 
  padding: 4px 16px; 
  font-size: 0.8em;
}

/* --- Hover State --- */
.copper-button-small:hover,
.copper-button:hover {
  background-image: linear-gradient(to bottom, #e9d6cc, #d9c5bd);
  border-color: #a98f84;
}

/* --- Active (Pressed) State --- */
.copper-button-small:active,
.copper-button:active {
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
  background-image: linear-gradient(to bottom, #d9c5bd, #e9d6cc);
  transform: translateY(1px);
}

/* --- Silver Themed Form Container --- */
.silver-container {
  /* Layout */
  display: flex;
  flex-direction: column;
  gap: 16px; /* Modern way to add space between elements, replaces <br> */
  width: 95%;
  max-width: 600px;
  margin: 16px auto;
  padding: 24px;
  box-sizing: border-box;
  
  /* The Silver Look */
  background-color: #F5F5F5; /* Light part of the silver gradient for the base */
  border: 1px solid #999;
  border-radius: 8px; /* Slightly larger radius for the main container */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* A simple grouping for a label and its input */
.form-group {
  text-align: center;
}

/* --- Silver Themed Form Label --- */
.silver-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #111;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* --- Silver Themed Form Input Field --- */
.silver-input {
  /* Sizing and Layout */
  width: 90%;
  max-width: 350px;
  padding: 10px;
  box-sizing: border-box;

  /* Look & Feel */
  background-color: #FFFFFF;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 1em;
  color: #333;
  
  /* Smooth transition for the focus effect */
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- The "Focus" State (When you click in the input) --- */
.silver-input:focus {
  /* A blue border and glow is a standard, clear indicator of focus */
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
  outline: none; /* Remove the default browser outline */
}

/* --- Silver Themed Checkbox Area --- */
.silver-checkbox-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* Space between checkbox and label */
  margin-top: 4px;
}

.silver-checkbox-group label {
  font-size: 0.9em;
  color: #555;
  cursor: pointer;
}

.silver-checkbox-group input[type="checkbox"] {
  /* Make the checkbox slightly larger and easier to click */
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #555; /* Styles the checkmark color in modern browsers */
}

/* --- Classic Silver Button --- */

/* --- NEW: Small Silver Button Modifier --- */
/* This class is used WITH the base .silver-button class */

.silver-button-small {
  display: inline-block;
  width: 120px; 
  padding: 4px 16px; 
  
  /* Smaller font for secondary actions */
  font-size: 0.7em;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

  color: #555; /* Dark text for high contrast on silver */
  font-size: .8em;
  font-weight: bold;
  text-align: center;
  /* Subtle embossed text effect */
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);

  border: 1px solid #999; /* A solid medium-grey border */
  border-radius: 6px; /* A slightly more rounded 'classic' feel */
  /* The silver metallic gradient */
  background-image: linear-gradient(to bottom, #F5F5F5, #D1D1D1);
  /* A soft shadow to lift it off the page */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  
  /* Interactivity */
  cursor: pointer;
  transition: all 0.2s ease-out; /* Smooth transitions for all effects */
}

.silver-button {
  /* Sizing and Layout */
  display: inline-block; /* Behaves like text but can have width/height */
  max-width: 350px;
  width: 100%;
  padding: 12px 20px;
  
  /* Typography */
  color: #333; /* Dark text for high contrast on silver */
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  /* Subtle embossed text effect */
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);

  /* The Silver Look & Feel */
  border: 1px solid #999; /* A solid medium-grey border */
  border-radius: 6px; /* A slightly more rounded 'classic' feel */
  /* The silver metallic gradient */
  background-image: linear-gradient(to bottom, #F5F5F5, #D1D1D1);
  /* A soft shadow to lift it off the page */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  
  /* Interactivity */
  cursor: pointer;
  transition: all 0.2s ease-out; /* Smooth transitions for all effects */
}

/* --- Hover State --- */
/* When the mouse is over the button, the gradient gets slightly darker */
.silver-button-small:hover {
  background-image: linear-gradient(to bottom, #EAEAEA, #C8C8C8);
  border-color: #777; /* Darker border on hover */
}

/* --- Active (Pressed) State --- */
/* When the button is being clicked, it looks pushed in */
.silver-button-small:active {
  /* A dark inset shadow simulates being pressed */
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.25);
  /* The gradient reverses and darkens */
  background-image: linear-gradient(to bottom, #C8C8C8, #D1D1D1);
  border-color: #666;
  /* Physically push the button down slightly */
  transform: translateY(1px);
}

/* --- Hover State --- */
/* When the mouse is over the button, the gradient gets slightly darker */
.silver-button:hover {
  background-image: linear-gradient(to bottom, #EAEAEA, #C8C8C8);
  border-color: #777; /* Darker border on hover */
}

/* --- Active (Pressed) State --- */
/* When the button is being clicked, it looks pushed in */
.silver-button:active {
  /* A dark inset shadow simulates being pressed */
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.25);
  /* The gradient reverses and darkens */
  background-image: linear-gradient(to bottom, #C8C8C8, #D1D1D1);
  border-color: #666;
  /* Physically push the button down slightly */
  transform: translateY(1px);
}

/* Keep the themed error text for consistency */
.themed-error-text {
  color: #e57373;
  margin-top: 10px;
  font-weight: 500;
  display: none;
}
  /* Added basic styles for password dialog and confirmation dialog boxes */
  .dialog-box, #confirmation-dialog {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: white;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 5px 15px rgba(0,0,0,0.3);
      z-index: 1000;
      min-width: 300px;
      text-align: center;
  }
   #password-dialog-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
  .dialog-title {
      margin-top: 0;
      margin-bottom: 15px;
      font-size: 18px;
      color: #333;
  }
  .password-input {
      width: calc(100% - 16px); /* Adjust width for padding */
      padding: 8px;
      margin-bottom: 10px;
      border: 1px solid #ccc;
      border-radius: 4px;
  }
  .password-error {
      color: red;
      font-size: 14px;
      margin-top: 5px;
      margin-bottom: 15px;
  }
  .dialog-buttons, .confirmation-buttons {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 10px;
  }
  .submit-btn, .cancel-btn, #confirm-cancel, #confirm-ok {
      padding: 6px 12px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
  }
  .submit-btn {
      background: #007bff;
      color: white;
  }
  .cancel-btn, #confirm-cancel {
      background: #adb5bd;
      color: #fff;
  }
  #confirm-ok {
      background: #c86b6b;
      color: #fff;
  }
    #confirm-cancel:hover { background: #979fa7; }
    #confirm-ok:hover { background: #b35a5a; }


  /* Existing styles for interactive elements - Adjusting layout properties */
  .filter-group {
    display: flex; /* Keep flex */
    flex-direction: column; /* Keep flex-direction */
    width: 100%; /* Make it fill the parent container */
    box-sizing: border-box;
    justify-content: center;
  }

  .filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
  }

.full-admin-dropdown {
  padding: 7px 36px 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: #eef2f6;
  color: #1f2937;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  appearance: none;
  transition: all 0.2s ease;
  display: none; /* Keeping this as required */
  box-sizing: border-box;
  cursor: pointer;
  height: 44px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px 50%;
  background-size: 16px;
}

#full-admin-dropdown:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
  background-color: #ffffff; /* Brighter background on focus */
}

#full-admin-dropdown:hover {
  border-color: #9ca3af;
  background-color: #f0f0f0;
}

/* Modern option styling */
#full-admin-dropdown option {
  padding: 10px 16px; /* Slightly more padding */
  background: #ffffff;
  color: #1f2937;
  font-size: 14px; /* Slightly smaller font for options */
  transition: all 0.15s ease;
}

#full-admin-dropdown option:hover {
  background: #f3f4f6 !important;
  color: #111827; /* Slightly darker text on hover */
}

#full-admin-dropdown option:checked {
  background: #f8fafc !important; /* Match dropdown background */
  color: #1f2937;
  font-weight: 500; /* Normal weight with subtle background */
  position: relative;
}

/* Add a subtle indicator for selected option */
#full-admin-dropdown option:checked::before {
  content: "•";
  color: #3b82f6;
  position: absolute;
  left: 8px;
}

.filter-group {
  position: relative;
  width: 100%;
}
 .filter-group {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap; /* ensures wrapping on small screens */
  justify-content: center;
}

/* Button styling (if not already handled globally) */
.button-group button {
  padding: 8px 16px;
  font-weight: 500;
  min-width: 120px;
  max-width: 200px;

  border-radius: 6px;
  color: #0d0d0d;
  cursor: pointer;
}

/* Specific colors */
.delete-btn {
  background-color: #f8e7e7;
  border: 1px solid #8b7e74;
}

.add-btn {
  background-color: #e6f1ec;
  border: 1px solid #91b4a3;
}

/* Optional: Slightly different color for the third button */
.add-btn:last-child {
  background-color: #e0ecf8;
  border: 1px solid #7a9dbb;
}

/* Responsive stacking for mobile */
@media (max-width: 600px) {
  .button-group {
    flex-direction: column;
    align-items: center;
  }

  .button-group button {
    width: 100%;
    max-width: 300px;
  }
}


  /* Table responsive container - kept existing centering */
  .table-responsive {
    max-width: 297mm; /* Keep print-specific max-width */
    overflow-x: auto;
    margin: 20px auto 0; /* Keep existing centering */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  /* Loading indicator - Kept existing centering/width, adjusted max-width */
  #loading-indicator {
    width: 100%; /* Keep width 100% for centering flex content */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto; /* Centered */
    max-width: 500px; /* Aligned with interactive area */
    box-sizing: border-box;
  }
   .loading-text {
    font-size: 1rem;
    font-style: italic;
    color: #333;
  }


  /* General form element styles */
  select,
  button {
    padding: 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s, border-color 0.3s;
    box-sizing: border-box; /* Add box-sizing */
  }

  select {
    border: 1px solid #ccc;
    background-color: white;
  }

  select:focus {
    border-color: var(--primary-color);
    outline: none;
  }

  button {
    border: none;
    /* Background/color handled by specific classes/inline styles */
    min-width: 100px;
    cursor: pointer;
  }

  button:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
  }

    /* Specific adjustments for elements inside #register-container to use 100% width */
  #register-container #assignee-form input[type="text"],
  #register-container #assignee-form select {
    width: 100%;
    box-sizing: border-box;
  }

#registration-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* vertical spacing between elements */
}

.lower-action-links {
  display: flex;
  justify-content: center;
  gap: 20px; /* horizontal space between links */
}





  /* Styles related to table content (not the container layout) - kept as is */
  /* ... (ter_desc, checked-out classes, table, th, td, etc.) ... */
    /* ========== ROOT VARIABLES ========== */
  :root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --disabled-color: #cccccc;
    --table-border: #000000;
    --header-border: #c0c0c0;
    --row-hover: #f5f5f5;
    --even-row: #f9f9f9;
    --territory-color: #d6f1ee;
    --date-color: #f0f8ff;
    --date-header-color: #f5f5f5;
    --date-header-text: #ffffff;
    --editable-color: #fff8e1;
    --editable-hover: #ffecb3;
    --error-bg: #f8d7da;
    --error-border: #f5c6cb;
    --error-text: #721c24;
    --success-bg: #d4edda;
    --success-border: #c3e6cb;
    --success-text: #155724;
    --lime-bg: #f2f29e;
    --header-color: #f5f5f5;
    --light-text-color: #888888;
  }


  /* ========== DESCRIPTION COLUMN ========== */
  td[data-column="ter_desc"],
  th.ter-desc-header {
    width: 50px; /* Base width */
    min-width: 200px; /* Minimum width */
    max-width: 200px; /* Maximum width */
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 65%;
  }

  /* ========== CHECKED OUT TABLE STYLES ========== */


/* Styling for the entire table */
.grouped-checkout-table {
    max-width: 600px; /* Total max width of the table */
    margin: 0 auto; /* Center the table */
    border-collapse: collapse; /* Clean borders */
    table-layout: fixed; /* Ensure consistent column widths */
    background-color: #ffffff; /* White background for the table */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    font-family: 'Arial', sans-serif; /* Clean, professional font */
}



/* General styling for table cells */
.grouped-checkout-table td {
    padding: 8px; /* Comfortable padding */
    border-bottom: 1px solid #e0e0e0; /* Subtle row separator */
    font-size: 14px; /* Readable font size */
}

/* Description row (spans all columns) */
.territory-description-cell {
    background-color: #d3e6f5; /* Light blue to match return button */
    font-weight: bold; /* Align with .checked-out-cong-name */
    padding: 10px; /* Slightly more padding for prominence */
    border-bottom: 2px solid #7da9c4; /* Blue border to match theme */
    text-align: left; /* Align content to the left */
    margin-left: 10px; /* Margin from the left side of the box */
}

/* Type column (Residential/Business) */
.grouped-checkout-table .territory-details-row td:nth-child(1) {
    text-align: center; /* Align with .checked-out-ter-type */
}

/* Map Type column (Full Map/Part Map) */
.grouped-checkout-table .territory-details-row td:nth-child(2) {
    text-align: center; /* Consistent with Type column */
}

/* Date column (dd/mm/yy) */
.grouped-checkout-table .territory-details-row td:nth-child(3) {
    background-color: #fff2cc; /* Light yellow from .checked-out-date */
    text-align: center; /* Align with .checked-out-date */
}

/* --- Styles for the "Personal Assignments" Table --- */

/* Main table layout */
.grouped-checkout-table {
    width: 600px;
    border-collapse: collapse;
    table-layout: fixed; /* CRUCIAL: This forces the table to obey the colgroup widths */
    margin-bottom: 25px; /* Space between congregation tables */
}

/* Column widths using colgroup */
.grouped-checkout-table col:nth-child(1) { /* Type (Residential/Business) */
    width: 25%;
}
.grouped-checkout-table col:nth-child(2) { /* Map Type (Full Map/Subdivision) */
    width: 25%;
}
.grouped-checkout-table col:nth-child(3) { /* Date (dd/mm/yy) */
    width: 20%;
}
.grouped-checkout-table col:nth-child(4) { /* Return Button */
    width: 30%;
}

/* Style for the description row that spans all columns */
.territory-description-cell {
    padding: 8px 5px;
    font-weight: 500;
    background-color: #f4f6f8;
    border-bottom: 1px solid #e1e5e9;
    background-color: #d3e6f5;
}

/* General styling for the detail cells */
.territory-details-row td {
    padding: 6px 5px;
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
}

/* --- Corrected Return Button Style --- */
.checked-out-return-btn {
    /* Basic Appearance (Keep these) */
    background-color: #d3e6f5;
    color: #274e13;
    border: 1px solid #93c47d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;

}

.checked-out-return-btn:hover {
  background-color: #93c47d;
  color: white;
}

/* Congregation header */
.cong-group-header {
    font-weight: bold; /* Align with .checked-out-cong-name */
    padding: 15px 15px 8px 15px; 
    margin: 10px auto 10px; /* Increased margin for more space outside */
    border-radius: 4px;
    max-width: 600px;
}

/* Territory number within description row */
.territory-description-cell strong {
    color: #134e7b; /* Darker blue to match theme */
    padding: 2px 5px; /* Subtle highlight */
    border-radius: 3px;
    margin-left: 10px; /* Align with description cell margin */
}

/* Territory name and description (within description row) */
.territory-description-cell em {
    min-width: 50px; /* From .checked-out-ter-desc */
    max-width: 200px; /* From .checked-out-ter-desc */
    overflow: visible;         /* allow content to overflow naturally */
    text-overflow: unset;      /* disable ellipsis */
    white-space: normal;       /* allow line breaks */
    word-wrap: break-word;  
    margin-left: 10px; /* Margin from the left side of the box */
}

  /* ========== TABLE STYLES ========== */
  table {
    max-width 600px;
    border-collapse: collapse;
    font-size: 14px;
  }

  th,
  td {
    border: 1px solid var(--table-border) !important; /* Using !important to override potential conflicts */
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
  }

  th {
    font-weight: bold;
    // position: sticky;
    // top: 0;
    background-color: var(--header-color);
    border-bottom: 2px solid var(--header-border);
  }

  .name-header {
    position: left
  }

  .name-header,
  .description-header {
    background-color: var(--header-color);
    color: #666;
  }

  .editable-header {
    background-color: var(--editable-hover);
  }

  th.date-cell-header {
    background-color: var(--date-header-color);
  }

  tr:nth-child(even) {
    background-color: var(--even-row);
  }

  tr:hover {
    background-color: var(--row-hover);
  }

  /* ========== EDITABLE + DATE CELLS ========== */
  .date-cell,
  .editable-cell {
    cursor: pointer;
    background-color: var(--editable-color);
    position: relative;
    transition: background-color 0.2s;
  }

  .date-cell:hover {
    background-color: #e6f2ff;
  }

  .editable-cell:hover {
    background-color: var(--editable-hover);
  }

  .editable-cell:hover::after {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.7;
  }

  .editable-cell input,
  .date-cell input {
    padding: 5px;
    border: 1px solid #66afe9;
    border-radius: 3px;
    font: inherit;
    box-sizing: border-box;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.3);
    text-align: center;
  }

  td:empty::before {
    content: "\00a0";
  }

  /* ========== NOTIFICATION STYLES ========== */
  .notification {
    padding: 12px 15px;
    margin-bottom: 15px;
  }

#new-territory-form {
  max-width: 400px;
  margin: 30px auto;
  padding: 24px 30px;
  background: #f9f9fb;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-sizing: border-box;
}

/* --- Form Field Groups --- */
#new-territory-form .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

/* --- Labels --- */
#new-territory-form .form-group label {
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
}

/* --- Inputs and Dropdowns --- */
#new-territory-form .form-group input[type="text"],
#new-territory-form .form-group input[type="number"],
#new-territory-form .form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#new-territory-form .form-group input:focus,
#new-territory-form .form-group select:focus {
  border-color: #81c8ee;
  box-shadow: 0 0 0 3px rgba(129, 200, 238, 0.25);
  outline: none;
}

/* --- Submit Button --- */
#new-territory-form button[type="submit"] {
  background-color: #3367d6;
  color: white;
  font-weight: 600;
  font-size: 0.95em;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.25s ease;
  display: block;
  margin: 10px auto 0;
}

#new-territory-form button[type="submit"]:hover {
  background-color: #2a5cb8;
}

/* --- Cancel Button --- */
#new-territory-form button#cancel-new-territory-btn {
  background-color: #e0e0e0;
  color: #333;
  font-weight: 500;
  font-size: 0.95em;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.25s ease;
}

#new-territory-form button#cancel-new-territory-btn:hover {
  background-color: #d0d0d0;
}

/* --- Button Container --- */
#new-territory-form .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* --- Legal Notice --- */
.info-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  max-width: 400px;
  font-size: 10px;
  font-family: sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  z-index: 1000;
}


/* --- New Congregation Form --- */

/* Container */
#new-cong-form.form-container {
  max-width: 400px;
  margin: 20px auto;
  padding: 24px;
  background-color: #f9f9fb;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-sizing: border-box;
}

/* Title */
#new-cong-form .form-title {
  text-align: center;
  color: #3367d6;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.25em;
  font-weight: 600;
}

/* Label */
#new-cong-form .form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
}

/* Info Box */
#new-cong-form .info-box {
  margin-bottom: 20px;
  font-size: 13px;
  color: #2b4e72;
  background-color: #e6f2fa;
  padding: 10px 14px;
  border-left: 4px solid #81c8ee;
  border-radius: 6px;
}

#new-cong-form .info-box p {
  margin: 4px 0;
}

/* Input */
#new-cong-form .form-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#new-cong-form .form-input:focus {
  border-color: #81c8ee;
  box-shadow: 0 0 0 3px rgba(129, 200, 238, 0.25);
  outline: none;
}

/* Button */
#new-cong-form .form-button {
  width: 100%;
  padding: 12px;
  background-color: #3367d6;
  color: white;
  font-size: 1em;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

#new-cong-form .form-button:hover {
  background-color: #2a5cb8;
}

/* Message Box */
#new-cong-form .form-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  min-height: 1.2em;
  font-size: 14px;
  color: #333;
}

/* New Year Warning ?*
/* Warning Box Container */
.warning-box {
  background-color: #fefefe;
  border: 1px solid #f6c67a;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  width: 50%;
  margin: 30px auto;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
}

/* Warning Icon */
.warning-icon {
  font-size: 26px;
  margin-bottom: 10px;
}

/* Warning Title */
.warning-title {
  margin: 0 0 12px;
  font-size: 1.25em;
  color: #8a6d3b;
}

/* Button Group */
.warning-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Cancel Button */
.warning-buttons .btn-cancel {
  padding: 10px 20px;
  background-color: #e0e0e0;
  color: #333;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.warning-buttons .btn-cancel:hover {
  background-color: #d5d5d5;
}

/* Confirm Button */
.warning-buttons .btn-confirm {
  padding: 10px 20px;
  background-color: #d9534f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.warning-buttons .btn-confirm:hover {
  background-color: #c9302c;
}

/* --- Main Container --- */
/* This is the primary "box" for the form */
.copper-container {
  /* --- FIX ADDED HERE --- */
  margin: 5vh auto; /* Centers the box and adds space at the top */

  background-color: #ffffff;
  padding: 40px; } body { background-color: #f5f5dc; }

/*
=================================================================
== STYLES FOR THE LOGIN & REGISTRATION FORM                    ==
== This stylesheet provides a modern and professional design   ==
== for the main container, form inputs, buttons, and links.    ==
=================================================================
*/

/* --- 1. GLOBAL BACKGROUND (Grey on both) --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #d3d3d3; 
  color: #333;
  margin: 0;
  padding: 20px;
}

@media (max-width: 768px) {
    #hero-image-banner {
        height: 150px; /* Just make it shorter, don't hide it */
    }
    
    #hero-image-banner h1 {
        font-size: 1.8em; /* Make text slightly smaller */
        padding: 0 10px;
    }
}

/* --- Main Container --- */
/* This is the primary "box" for the form */
.copper-container {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
  border-top: 20px solid #b87333; /* Copper accent */
  margin: 40px auto; 
  box-sizing: border-box; /* Ensures padding doesn't break layout */
}

/* --- Form Group & Labels --- */
.form-group {
  margin-bottom: 20px;
}

.silver-label {
  display: block;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
  font-size: 14px;
}

/* --- Input Fields --- */
.silver-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  background-color: #f9f9f9;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.silver-input:focus {
  outline: none;
  border-color: #b87333; /* Copper accent on focus */
  box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.2);
}

/* --- Checkbox Styling --- */
.silver-checkbox-group {
  display: flex;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.silver-checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #b87333; /* Modern way to color checkboxes */
}

/* --- Buttons --- */
.silver-button, .silver-button-small {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  font-size: 16px;
}

/*
/*
======================================================
== NEW METALLIC COPPER-TO-GOLD LOGIN BUTTON           ==
======================================================
*/

/* --- The Main Button Style --- */
.login-button {
  /* Sizing and Layout */
  display: inline-block;
  width: 100%;
  max-width: 350px;
  padding: 14px 24px;
  
  /* Typography: Silver text with a shadow for readability */
  color: #F0F0F0; /* A very light, clean silver */
  font-size: 1.2em;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6); /* Makes text pop */

  /* The Gradient: A rich, burnished copper to a bright gold */
  background: linear-gradient(
    125deg, 
    #a0652d, /* Dark Burnished Copper */
    #B87333 40%, /* Standard Copper */
    #DAA520 60%, /* Rich Gold */
    #B8860B  /* Dark Burnished Gold */
  );
  
  /* The "Metallic" Look */
  border: 1px solid #8B4513; /* A dark, framing copper border */
  border-radius: 8px;
  /* Outer shadow for lift, inner highlight for a 3D metal sheen */
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2), 
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
  
  /* Interactivity */
  cursor: pointer;
  /* Smooth transition for all interactive effects */
  transition: all 0.2s ease-out;
}

/* --- Hover State --- */
.login-button:hover {
  /* "Lifts" the button up and makes the shadow more prominent */
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3), 
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* --- Active (Pressed) State --- */
.login-button:active {
  /* Pushes the button "down" */
  transform: translateY(1px);
  /* A strong inner shadow simulates being pressed in */
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4);
  /* Make the click feedback feel instant */
  transition: transform 0.1s, box-shadow 0.1s;
}

/* --- Focus State for Accessibility --- */
.login-button:focus {
  outline: none;
  /* A "glow" that matches the gold color for keyboard users */
  box-shadow: 0 0 0 4px rgba(218, 165, 32, 0.5);
}

/* --- Containers & Wrappers --- */
.login-filter-group {
  text-align: center;
  margin-top: 24px;
}

/*
======================================================
== SILVER TEXT FOR LOGIN BUTTON            ==
======================================================
*/

/* --- The simple, solid text style inside the button --- */
.login-button-text {
  /* Typography */
  font-size: 1.2em;
  font-weight: 700;
  
  /* A solid, light silver color for the text */
  color: #EAEAEA; 

  /* A simple, dark shadow to make the text pop against the button's gradient */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.registration-wrapper {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0; /* A subtle separator */
}

.initial-action-buttons {
  display: inline-flex;
  gap: 20px;
}

/* --- Utility & State Classes --- */
.login-error {
  color: #d32f2f; /* A more standard error red */
  display: none;
  margin-top: 15px;
  font-weight: 500;
  font-size: 14px;
}

.lower-action-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

/* Shared link styles */
.legal-notice-link,
.middle-action-link {
  text-decoration: underline;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Light blue (Deregister + Legal Notice) */
.legal-notice-link {
  color: #666; /* was #777, now a little darker */
}

.legal-notice-link:hover {
  color: #444;
}

/* Darker middle link (New User) */
.middle-action-link {
  color: #222;
  font-weight: 600;
}

.middle-action-link:hover {
  color: #000;
}

/* This rule keeps the delete button hidden by default */
#delete-user-button {
  display: block;
}

/* --- MOBILE CARD STYLES --- */
.mobile-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 40px;
}

.ter-card {
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Header: Blue bar with Territory # */
.ter-card-header {
  background: #007bff; /* Blue */
  color: white;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 1.2em;
}

/* Adds a strong line under the 'Last Done' row */
.ter-card-subheader {
  border-bottom: 2px solid #000000 !important; /* The line */
  background-color: #ffffff; /* Clean background */
  padding: 8px 15px;         /* Spacing */
  display: flex;
  justify-content: flex-end; /* Keeps text on the right */
  align-items: center;
}

/* Optional: Ensures the text inside is also black/bold to match */
.ter-card-subheader span, 
.ter-card-subheader .last-completed {
  color: #000000 !important;
  font-weight: 700 !important;
}

/* Slot Containers */
.slot-container {
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.slot-container:last-child { border-bottom: none; }

/* The Name Row */
.slot-name-row {
  font-size: 1.1em;
  font-weight: 500;
  margin-bottom: 8px;
  color: #000;
}

/* --- CHANGE: Hide the 1, 2, 3, 4 --- */
.slot-label {
  display: none; 
}

/* The Dates Row */
.slot-dates-row {
  display: flex;
  gap: 10px;
}
.date-box {
  flex: 1;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 6px;
  font-size: 0.9em;
}
.lbl-out { color: #007bff; font-weight: bold; font-size: 0.8em; display: block; }
.lbl-ret { color: #28a745; font-weight: bold; font-size: 0.8em; display: block; }

/* Hide empty slots on mobile to save space */
.slot-hidden { display: none; }

/* ========================================================= */
/* === UNIFIED MOBILE WIDTHS (Vertical Alignment Fix)    === */
/* ========================================================= */
@media (max-width: 768px) {
    
    /* 1. Reclaim screen space by reducing outer padding */
    body {
        padding: 5px !important;
    }

    /* 2. Reset the main wrapper to be a transparent container */
    #interactive-area {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Force all main "Blocks" to exact same width and center them */
    #hero-image-banner,          /* The Picture */
	margin-top: calc(env(safe-area-inset-top) + 20px) !important;
    .dashboard-card,             /* The Decision Box */
    .ter-card,                   /* The Territory Cards */
    #table-container {           /* The Wrapper for Search & Results */
        width: 96% !important;
        max-width: 500px !important; /* Cap width for larger phones/tablets */
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    /* 4. Fix the Sticky Search Bar to fit inside the aligned container */
    /* This targets the div created in JS with position: sticky */
    #table-container > div[style*="position: sticky"] {
        width: 100% !important; /* Fill the 96% parent exactly */
        border-radius: 8px !important; /* Match card rounded corners */
        top: 5px !important; /* Slight gap from top of screen */
    }

    /* 5. Ensure cards have consistent spacing */
    .ter-card {
        margin-bottom: 15px !important;
    }
    
    /* 6. Ensure the hero image text fits */
    #hero-image-banner h1 {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ========================================================= */
/* === DESKTOP ALIGNMENT (Centered & Framed)             === */
/* ========================================================= */
@media (min-width: 769px) {

    /* 1. Main Wrapper: Standard Block Centering (No Flex) */
    #interactive-area {
        
        width: 95% !important;
        max-width: 1100px !important;    /* Standard wide width */
        margin: 20px auto !important;    /* Centers the block on screen */
        padding: 0 !important;
    }

    /* 2. Hero Image: Natural Cover with White Frame */
    #hero-image-banner {
        width: 100% !important;
        height: 250px !important;        /* Fixed height for consistency */
        
        /* The White Banner/Frame Effect */
        border: 15px solid white !important; 
        background-color: white !important;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        margin-bottom: 30px !important;
        box-sizing: border-box;

        /* Image: Fills the frame naturally without stretching */
        background-size: cover !important; 
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }

    /* Restore overlay visibility so text is readable */
    #hero-image-banner::before {
        display: block !important;
        border-radius: 0 !important; /* Fits inside the border */
    }

    /* 3. Control Box & Table: Full width of the centered parent */
    .dashboard-card, 
    #table-container {
        width: 100% !important;
        max-width: 1100px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 25px !important;
        box-sizing: border-box;
    }

    /* 4. The "Paper" Sheets */
    .page-container {
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* Styling for empty input placeholders */
.input-placeholder {
    display: block;
    background-color: #f1f3f4; /* Light grey background */
    border: 1px solid #dadce0; /* Subtle border */
    border-radius: 4px;
    color: #5f6368;           /* Darker grey text */
    padding: 8px 12px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.input-placeholder:hover {
    background-color: #e8eaed;
    border-color: #b87333; /* Copper highlight on hover */
    color: #202124;
}

@media print {
  /* 1. Nuke the background and grey margins from the monitor view */
  body { 
    background: white !important; 
    padding: 0 !important; 
    margin: 0 !important; 
  }

  /* 2. Force the container to stop being a "Monitor Box" */
  #interactive-area, .copper-container, #table-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* 3. Ensure the "Paper" sheets take up the full width of the A4 */
  .page-container {
    width: 190mm !important; /* Standard A4 printable width */
    margin: 0 auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* 4. Hide monitor-only elements like the Search Bar or Hero Image */
  #hero-image-banner, [style*="position: sticky"], .login-button, button {
    display: none !important;
		}
	}


/* Full Screen Lock Overlay */
#offline-overlay {
    /* Hidden by default */
    display: none; 
    
    /* Force it to cover the WHOLE screen, not just the container */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;  /* 100% of Viewport Width */
    height: 100vh; /* 100% of Viewport Height */
    
    /* Maximum Z-Index to stay on top of everything */
    z-index: 2147483647; 
    
    /* Darken the screen behind the box (Visual Lock) */
    background-color: rgba(0, 0, 0, 0.6); 
    
    /* Centering Magic */
    align-items: center;
    justify-content: center;
    
    /* Stop all clicks from passing through */
    pointer-events: all;
    touch-action: none;
}

/* 1. The Parent: Covers screen and holds the child in the center */
#offline-overlay {
    /* Hidden by default, JS toggles this */
    display: none; 
    
    /* Force full viewport coverage */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647; /* Highest possible layer */
    
    /* Darken the background */
    background-color: rgba(0, 0, 0, 0.6);
    
    /* --- CENTERING MAGIC --- */
    /* This makes whatever is inside this div sit perfectly in the middle */
    justify-content: center; /* Horizontal Center */
    align-items: center;     /* Vertical Center */
}

/* 2. The Child: The white alert box */
.offline-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    
    /* SIZING FIX: 
       Use width 90% for mobile, but cap it at 400px for desktop 
       so it doesn't stretch across the whole monitor. */
    width: 90%;
    max-width: 600px; 
    
    /* Visuals */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid #cc0000;
}



/* Make the hero banner look clickable and add a hover effect */
#hero-image-banner {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

#hero-image-banner:hover {
  filter: brightness(1.1); /* Slightly brighten on hover */
}

#hero-image-banner:active {
  transform: scale(0.98); /* Slight shrink when tapped/clicked */
}

/* Optional: Add a "Logout" tooltip hint on desktop */
#hero-image-banner::after {
  content: 'Tap to Log Out';
  position: absolute;
  bottom: 10px;
  right: 20px;
  font-size: 10px;
  background: rgba(51,51,51,0.4);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  opacity: 0.9; /* Always visible */
  pointer-events: none;
  z-index: 10;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease; /* Keep smooth transition for potential hover effects */
}


/* Optional: Slightly brighter on hover for feedback */
#hero-image-banner:hover::after {
  opacity: 1;
  background: rgba(0,0,0,0.8);
}

/* --- Professional Hero Banner Styling --- */
#hero-image-banner {
  height: 250px;
  border-radius: 12px;
  background-color: #2c3e50; /* Solid base color during load */
  background-size: cover;
  background-position: center 30%; /* Focus on the upper-center of the photo */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: filter 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* Sophisticated Dark-to-Transparent Gradient Overlay */
#hero-image-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom, 
    rgba(0, 0, 0, 0.2) 0%, 
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 1;
}

/* Banner Title Styling */
#hero-image-banner h1 {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  margin: 0;
  padding: 0 20px;
}

/* Sub-text or context span inside the title */
#user-context-prefix {
  color: #FFD700; /* Subtle Gold for the Congregation Name */
  text-transform: uppercase;
  font-size: 1.5rem;
  display: block; /* Puts it on its own line above the main title */
  letter-spacing: 2px;
  margin-bottom: 4px;
}


html {
  scroll-behavior: auto !important; /* Prevents slow 'sliding' during redraws */
}

/* Limits the height of the results table so the page stays compact */
#table-container {
    max-height: 65vh; /* Takes up 65% of the screen height maximum */
    overflow-y: auto; /* Adds a vertical scrollbar if needed */
    border-bottom: 1px solid #ddd; /* Subtle line at the bottom of the scroll area */
}

/* This targets all dropdowns including the publisher filter */
.admin-style-dropdown, 
#publisher-filter {
    font-size: 16px !important;         /* Sets the text size */
    height: auto !important;            /* Removes the forced height that causes misalignment */
    padding-top: 10px !important;       /* Space above text */
    padding-bottom: 10px !important;    /* Space below text (keeps it centered) */
    line-height: 1.2 !important;        /* Ensures the text height is standard */
}
/* Target the select element or its dropdown container */
.admin-style-dropdown {
    max-height: 300px;    /* Limits the height */
    overflow-y: auto;     /* Adds vertical scrollbar if needed */
}

/* If you are using a custom list inside the dropdown */
.admin-style-dropdown option {
    padding: 10px;        /* Makes it easier to click */
}





/* This stops the mobile "double tap" requirement */
#publisher-filter, 
.admin-style-dropdown {
    font-size: 16px !important; 
    touch-action: manipulation; /* Removes the 300ms tap delay */
}

/* Styling for the immediate native dropdowns */
.mobile-native-select {
    width: 100%;
    max-width: 250px;
    height: 40px;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    appearance: auto !important; /* Forces the native mobile arrow */
    cursor: pointer;
    text-align: center;
}

/* Red border if the previous slot isn't finished (dependency) */
.mobile-native-select:disabled {
    background-color: #eee;
    color: #999;
    cursor: not-allowed;
    border: 1px dashed #ccc;
}

/* This ensures the blue header is visible after a jump */
.ter-card {
    scroll-margin-top: 95px; /* Adjust this value if your search bar is taller/shorter */
}