/* Admin Custom Theme (clean, professional)
   Uses Inter font and soft palette, unobtrusive cards, and consistent spacing */
:root {
  --primary-black: #1c1c1f;
  --soft-black: #2a2a2e;
  --light-gray: #f7f7f8;
  --border: rgba(28, 28, 31, 0.08);
  --hover: rgba(28, 28, 31, 0.04);
  --brand: #f83065;
  --accent: #b4113c;
  --white: #fff;
  --muted: #6b6f76;
  --shadow: 0 8px 24px rgba(28, 28, 31, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--light-gray);
  color: var(--primary-black);
  max-width: 100%;
  overflow-x: hidden !important;
}
/* Ensure links are visible */
a { color: var(--primary-black); text-decoration: none; }
a:hover { color: var(--accent); }

/* Header */
#header {
  background: var(--white) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow: visible !important;
}
#header h1, #header #site-name a { color: var(--primary-black) !important; font-weight: 800; letter-spacing: -0.2px; }
#user-tools { color: var(--primary-black) !important; display: flex !important; align-items: center !important; gap: 8px !important; flex-wrap: wrap !important; position: relative !important; z-index: 1001 !important; visibility: visible !important; opacity: 1 !important; }
#user-tools a { display: inline-block !important; background: #efeff2 !important; border: 1px solid var(--primary-black) !important; color: #111827 !important; border-radius: 999px !important; padding: 6px 12px !important; margin-left: 0 !important; text-decoration: none !important; line-height: 1 !important; box-shadow: none !important; pointer-events: auto !important; }
/* Force 'Log out' button to be highly visible and interactable */
#header #user-tools a[href*="logout"], #header #user-tools a[href$="/logout/"], #header #user-tools a[href*="/logout"],
#header #user-tools a.logout-link {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--brand) !important;
  color: #ffffff !important;
  border: 2px solid var(--brand) !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-weight: 700 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 1002 !important;
}
#header #user-tools a[href*="logout"]:hover, #header #user-tools a[href$="/logout/"]:hover, #header #user-tools a[href*="/logout"]:hover,
#header #user-tools a.logout-link:hover {
  background: var(--accent) !important; border-color: var(--accent) !important; color: #ffffff !important;
}
/* Ensure header links stay readable */
#user-tools a, #user-tools a:link, #user-tools a:visited, #user-tools a:hover, #user-tools a:active { color: #111827 !important; text-decoration: none !important; }

/* Content wrapper */
#content {
  background: transparent !important;
  padding: 16px clamp(8px, 2vw, 16px) 16px !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: hidden !important;
  position: relative !important;
}
#content h1, #content h2, #content h3 { color: var(--primary-black) !important; }
#container { display: block !important; }
.breadcrumbs { background: transparent !important; color: var(--primary-black) !important; padding: 0 0 4px; margin: 0 0 6px !important; font-weight: 600; }
.breadcrumbs a { color: var(--primary-black) !important; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* Professional left sidebar */
:root { --admin-sidebar-width: 260px; }
nav#nav-sidebar, #nav-sidebar { 
  display: block !important;
  position: fixed !important;
  top: 0; left: 0; bottom: 0;
  width: var(--admin-sidebar-width) !important;
  background: var(--white) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  padding-top: 64px !important; /* space for header */
  overflow-y: auto !important;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999; /* under header */
}
/* Content shifts to the right of the sidebar */
#content, #content-main { margin-left: var(--admin-sidebar-width) !important; }
/* Force visible even if admin sets collapsed state */
body.toggle-nav-collapsed nav#nav-sidebar,
body.toggle-nav-collapsed #nav-sidebar { transform: none !important; }
body.toggle-nav-collapsed #content,
body.toggle-nav-collapsed #content-main { margin-left: var(--admin-sidebar-width) !important; }
/* Hide default toggle button; sidebar is always visible on desktop */
.toggle-nav-sidebar { display: none !important; }
body, html { overflow-y: auto; }

/* Sidebar links */
#nav-sidebar a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--primary-black); text-decoration: none; }
#nav-sidebar a:hover { background: var(--hover); color: var(--primary-black); }
#nav-sidebar .current-app a, #nav-sidebar .current-model a { background: rgba(248,48,101,0.08); color: var(--primary-black); }

/* Sidebar headings (fallback) */
#nav-sidebar h2, #nav-sidebar h3, #nav-sidebar .section { padding: 8px 14px; margin: 8px 0 4px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* Sidebar brand */
#nav-sidebar .sidebar-brand {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(248,48,101,0.06), rgba(255,255,255,0));
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
#nav-sidebar .brand-logo { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(248,48,101,0.12); }
#nav-sidebar .brand-text { font-weight: 800; letter-spacing: -0.2px; color: var(--primary-black); }

/* Collapsible sections */
#nav-sidebar h2, #nav-sidebar h3 { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
#nav-sidebar h2 .caret, #nav-sidebar h3 .caret { margin-left: 8px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid var(--muted); transition: transform 0.2s ease; }
#nav-sidebar h2.collapsed .caret, #nav-sidebar h3.collapsed .caret { transform: rotate(-90deg); }
#nav-sidebar ul.collapsed, #nav-sidebar .model-list.collapsed { display: none !important; }

/* Search */
#nav-sidebar .sidebar-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
#nav-sidebar .sidebar-search input[type="search"] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

/* Link rows */
#nav-sidebar li { list-style: none; }
#nav-sidebar ul { padding: 0 8px 8px; margin: 0; }
#nav-sidebar .model-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
#nav-sidebar .model-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--primary-black); text-decoration: none; }
#nav-sidebar .model-link:hover { background: var(--hover); }
#nav-sidebar .model-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); display: inline-block; }
#nav-sidebar .model-actions { display: inline-flex; gap: 6px; }
#nav-sidebar .model-actions .pill { padding: 4px 8px; font-size: 11px; }

/* Mobile: collapse sidebar */
@media (max-width: 768px) {
  :root { --admin-sidebar-width: 0px; }
  #nav-sidebar { display: none !important; }
  #content { margin-left: 0 !important; }
}

/* Disable sidebar entirely */
nav#nav-sidebar, #nav-sidebar, .nav-sidebar, .toggle-nav-sidebar { display: none !important; }
#content, #content-main { margin-left: 0 !important; }

/* Buttons */
.btn, .button, input[type=submit], .submit-row input, .object-tools a.addlink, .object-tools a {
  background: var(--brand) !important;
  border: 1px solid var(--brand) !important;
  color: var(--white) !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
}
.btn:hover, .button:hover, input[type=submit]:hover, .submit-row input:hover, .object-tools a.addlink:hover {
  background: var(--accent) !important; border-color: var(--accent) !important;
}

/* Admin delete confirmation: force visible Cancel button (scoped to delete pages only) */
.delete-confirmation .submit-row a,
.delete-confirmation .submit-row a:link,
.delete-confirmation .submit-row a:visited,
.delete-confirmation .submit-row a:active,
.delete-selected-confirmation .submit-row a,
.delete-selected-confirmation .submit-row a:link,
.delete-selected-confirmation .submit-row a:visited,
.delete-selected-confirmation .submit-row a:active,
body[class*="delete"] .submit-row a,
body[class*="delete"] .submit-row a:link,
body[class*="delete"] .submit-row a:visited,
body[class*="delete"] .submit-row a:active,
.delete-confirmation .deletelink-box a,
.delete-selected-confirmation .deletelink-box a,
body[class*="delete"] .deletelink-box a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  color: var(--primary-black) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  height: 44px !important;
  padding: 0 16px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.delete-confirmation .submit-row a:hover,
.delete-selected-confirmation .submit-row a:hover,
body[class*="delete"] .submit-row a:hover,
.delete-confirmation .deletelink-box a:hover,
.delete-selected-confirmation .deletelink-box a:hover,
body[class*="delete"] .deletelink-box a:hover {
  background: #efeff2 !important;
  border-color: var(--border) !important;
  color: var(--primary-black) !important;
}
/* Explicit cancel link selectors (slightly stronger border for emphasis) */
.delete-confirmation a.cancel-link,
.delete-selected-confirmation a.cancel-link,
body[class*="delete"] a.cancel-link {
  border: 1.5px solid #4b5563 !important;
}
/* Layout for submit row on delete confirmation pages */
.delete-confirmation .submit-row,
.delete-selected-confirmation .submit-row,
body[class*="delete"] .submit-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  justify-content: flex-start !important;
}
/* Keep the primary destructive action prominent */
.delete-confirmation .submit-row input[type=submit],
.delete-selected-confirmation .submit-row input[type=submit],
body[class*="delete"] .submit-row input[type=submit] {
  background: #dc2626 !important; /* red */
  border-color: #dc2626 !important;
  color: #ffffff !important;
  height: 44px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
.delete-confirmation .submit-row input[type=submit]:hover,
.delete-selected-confirmation .submit-row input[type=submit]:hover,
body[class*="delete"] .submit-row input[type=submit]:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

/* Dashboard styles */
.dash { max-width: 100%; width: 100%; margin: 0; padding: 0 12px 12px; }
.dash__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dash__title { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.3px; color: var(--primary-black); }
.dash__actions { display: flex; gap: 10px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--brand); color: var(--white); border: 1px solid var(--brand); border-radius: 10px; padding: 8px 14px; }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--secondary { background: var(--white); color: var(--primary-black); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; }
.btn--secondary:hover { background: var(--hover); }

.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: stretch; grid-auto-rows: auto; width: 100%; }
.app-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; height: 100%; min-height: 0; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.app-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(28,28,31,0.12); }
.app-card__header { padding: 12px 12px 8px; border-bottom: 1px solid var(--border); background: #fafbfc; display:flex; align-items:center; justify-content: space-between; }
.app-card__title-left { display:flex; align-items:center; gap: 10px; }
.app-card__icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(248,48,101,0.12); color: var(--brand); display:flex; align-items:center; justify-content:center; font-weight: 800; }
.app-card__title { margin: 0; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.2px; }

.model-list { list-style: none; margin: 0; padding: 8px 12px 10px; display: grid; gap: 8px; }
.model-list { list-style: none; margin: 0; padding: 8px 12px 14px; display: grid; gap: 8px; }
.model-list__item { display: flex; justify-content: space-between; align-items: center; background: #fbfbfc; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; transition: background .15s ease, border-color .15s ease; }
.model-list__item:hover { background: #f7f7f8; border-color: rgba(28,28,31,0.12); }
.model-list__name { font-weight: 600; color: var(--primary-black); letter-spacing: -0.1px; }
.model-list__links { display: inline-flex; gap: 8px; }
.model-list__links a { opacity: 1 !important; visibility: visible !important; }

.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none; }
.pill--primary { background: var(--brand); color: var(--white) !important; }
.pill--light { background: #efeff2; color: var(--primary-black) !important; border: 1px solid var(--border); }
.model-list__links a { opacity: 1 !important; visibility: visible !important; color: var(--primary-black) !important; }

.muted { color: var(--muted); }

.sys { margin-top: 20px; }
.sys__card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }

/* Change list (tables) — hard visible styles */
.change-list #content h1 { color: #111827 !important; margin-bottom: 12px !important; padding: 4px 0 !important; }
.change-list #changelist { background: #ffffff !important; border: 1px solid #d1d5db !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; padding: 14px !important; position: relative; }
.change-list #toolbar { padding-bottom: 8px !important; margin-bottom: 6px !important; border-bottom: 1px solid #e5e7eb !important; display: flex; align-items: center; gap: 12px; flex-wrap: nowrap !important; justify-content: flex-start; padding-right: 150px !important; }
.change-list #changelist-search { display: flex !important; align-items: center !important; gap: 8px !important; margin: 0 !important; padding: 0 !important; flex-wrap: nowrap !important; width: auto !important; max-width: none !important; flex: 1 1 auto !important; }
.change-list #changelist-search > div { display: flex !important; align-items: center !important; gap: 8px !important; width: 100% !important; flex: 1 1 auto !important; white-space: nowrap !important; }
.change-list #changelist-search label { display: none !important; }
.change-list #changelist-search input[type="text"] {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 46px !important;
  padding: 12px 16px 12px 42px !important;
  border: 2px solid #4b5563 !important;
  border-radius: 12px !important;
  color: #111827 !important;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center !important;
  background-size: 18px 18px !important;
  font-size: 1rem !important;
}
.change-list #changelist-search input[type="text"]::placeholder { color: #4b5563 !important; opacity: 1 !important; }
.change-list #changelist-search input[type="submit"],
.change-list #changelist-search button {
  height: 46px !important;
  padding: 0 18px !important;
  border-radius: 12px !important;
  border: 1px solid var(--brand) !important;
  background: var(--brand) !important;
  color: #fff !important;
  line-height: 1 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  white-space: nowrap !important;
}
.change-list .object-tools { position: absolute !important; top: 10px !important; right: 14px !important; float: none !important; display: flex !important; gap: 8px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; z-index: 2 !important; }
.change-list .object-tools a.addlink { background: var(--brand) !important; border-radius: 10px !important; padding: 8px 14px !important; color: #fff !important; }
.change-list .object-tools a.addlink { background: var(--brand) !important; border-radius: 10px !important; padding: 8px 14px !important; color: #fff !important; }
.change-list .paginator { border-top: 1px solid #e5e7eb !important; padding-top: 10px !important; }
.change-list table { border-collapse: separate !important; border-spacing: 0; width: 100%; }
.change-list thead th { background: #e5e7eb !important; color: #111827 !important; border-bottom: 1px solid #cbd5e1 !important; padding: 12px 16px !important; position: static; font-weight: 800; letter-spacing: 0.2px; }
.change-list thead th a { color: #111827 !important; }
.change-list tbody tr:nth-child(odd) { background: #fcfcfd !important; }
.change-list tbody tr:nth-child(even) { background: #f9fafb !important; }
.change-list tbody tr:hover { background: #eef2f7 !important; }
.change-list tbody td { padding: 12px 16px !important; border-bottom: 1px solid #e5e7eb !important; font-size: 0.95rem; color: #111827 !important; }
.change-list tbody td a { color: #111827 !important; }

/******** Forms and inputs ********/
.module, .inline-group, .change-list .module, .change-form .module { background: var(--white) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; }
.module h2 { background: transparent !important; color: var(--primary-black) !important; font-weight: 800 !important; border-bottom: 1px solid var(--border) !important; padding: 12px 14px !important; }

label { font-weight: 600; color: var(--soft-black); margin-bottom: 6px; display: inline-block; }
/* Always-visible minimal borders and clear inputs */
.change-form input[type="text"],
.change-form input[type="email"],
.change-form input[type="url"],
.change-form input[type="number"],
.change-form input[type="password"],
.change-form input[type="search"],
.change-form input[type="date"],
.change-form input[type="time"],
.change-form input[type="datetime-local"],
.change-form select,
.change-form textarea,
.change-form .vTextField,
.change-form .vURLField,
.change-form .vLargeTextField {
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important; /* stronger neutral border so visible even when not focused */
  border-radius: 8px !important;
  padding: 8px 10px !important;
  color: var(--primary-black) !important;
  box-shadow: none !important;
}
/* Compact width for small numeric fields like Order: */
.change-form input[type="number"], .change-form .vIntegerField, .change-form .vSmallIntegerField {
  width: 200px !important;
  max-width: 100% !important;
}
/* Focus state */
.change-form input:focus,
.change-form select:focus,
.change-form textarea:focus {
  outline: none !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(248,48,101,0.15) !important;
}

.help, .helptext { color: var(--muted) !important; }
.errornote, .errorlist { border-radius: 10px; }
.errornote { background: #ffe8ed; border: 1px solid #ffb8c7; color: #6b1b2c; padding: 10px 12px; }
.errorlist li { background: transparent !important; color: #6b1b2c !important; }

.submit-row { background: transparent !important; border-top: 1px solid var(--border) !important; padding: 12px 14px !important; }
.submit-row input { margin-right: 8px !important; }

/* Actions bar */
.change-list .actions { background: #fbfbfc; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.change-list .actions select, .change-list .actions input[type="submit"] { margin: 0; }

/* Filters (right sidebar) */
#changelist-filter, .changelist-filter {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
}
#changelist-filter h2, .changelist-filter h2 { font-size: 0.95rem; font-weight: 800; color: var(--primary-black); }
#changelist-filter a, .changelist-filter a { color: var(--soft-black); text-decoration: none; }
#changelist-filter a:hover, .changelist-filter a:hover { text-decoration: underline; }

.selector, .selector-available, .selector-chosen { border-radius: 10px !important; }

/* Login page */
.login #container { border-radius: 16px !important; box-shadow: var(--shadow) !important; border: 1px solid var(--border) !important; }

/* General friendly spacing */
.change-form #content, .change-list #content { padding-top: 12px !important; }
/* Dashboard top spacing tighter */
#content { padding-top: 12px !important; }
.dash { margin-top: 0 !important; padding-top: 0 !important; }
.app-grid { margin-top: 0 !important; }

/* Responsive */
@media (max-width: 640px) {
  .dash__header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash__actions { width: 100%; }
  .dash { padding: 0 8px 12px; }
  #content { padding-left: 8px !important; padding-right: 8px !important; }
  .app-grid { grid-template-columns: 1fr; gap: 12px; }
  .change-list .object-tools { position: static !important; float: none !important; margin-left: auto !important; margin-top: 8px !important; }
  .change-list #changelist-search { width: 100% !important; }
  .change-list #changelist-search input[type="text"] { width: 100% !important; }
  .change-list #content h1 { padding-right: 0 !important; }
}
.change-form .inline-group,
.change-form .inline-related {
  color: #d043a6 !important;
}
.change-form .inline-group *,
.change-form .inline-related * { color: #d043a6 !important; }
.change-form .inline-group a,
.change-form .inline-related a { color: #d043a6 !important; }
.change-form .inline-group a:hover,
.change-form .inline-related a:hover { color: #d043a6 !important; text-decoration: underline !important; }
/* Inputs inside inline sections: light background with colored text */
.change-form .inline-group input,
.change-form .inline-group select,
.change-form .inline-group textarea,
.change-form .inline-related input,
.change-form .inline-related select,
.change-form .inline-related textarea {
  background: #ffffff !important;
  color: #d043a6 !important;
  border: 1.6px solid #9aa3af !important;
}
.change-form .inline-group ::placeholder,
.change-form .inline-related ::placeholder { color: #cbd5e1 !important; opacity: 1 !important; }
  .change-list #changelist-search input[type="text"] { width: 100%; }
}

/* Final overrides: neutralize hover and enforce black text & borders on list pages */
.change-list a, .change-list a:link, .change-list a:visited, .change-list a:hover, .change-list a:active {
  color: #111827 !important;
  text-decoration: none !important;
}
/* Hard placement of Add button at top-right of content header */
.change-list #content { position: relative !important; }
.change-list .object-tools { position: absolute !important; top: 0 !important; right: clamp(8px, 2vw, 16px) !important; margin: 0 !important; padding: 0 !important; gap: 8px !important; display: flex !important; }
.change-list #content h1 { padding-right: 200px !important; margin-bottom: 22px !important; }

.change-list #changelist table {
  border-collapse: collapse !important;
  border: 1px solid #000 !important;
  width: 100% !important;
}
.change-list #changelist table thead th,
.change-list #changelist table tbody td {
  border: 1px solid #000 !important;
}
/* Disable hover backgrounds and effects inside result list completely */
.change-list #changelist * { transition: none !important; }
.change-list #changelist tr:hover,
.change-list #changelist th:hover,
.change-list #changelist td:hover,
.change-list #changelist a:hover,
.change-list #changelist tr:hover > th,
.change-list #changelist tr:hover > td {
  background: inherit !important;
  color: #111827 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
.change-list thead th a:hover {
  color: #111827 !important;
  text-decoration: none !important;
}

/* Final light theme enforcement for list and form pages */
.change-list, .change-list #content, .change-form, .change-form #content { background: #ffffff !important; }
.change-list #changelist, .change-form .module, .change-form fieldset.module, .change-form .inline-group .module {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}
/* Force inline (add members) sections to light background and dark text */
.change-form .inline-group, .change-form .inline-related,
.change-form .inline-group .module, .change-form .inline-related .module {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
}
.change-form .inline-group label, .change-form .inline-related label,
.change-form .inline-group h2, .change-form .inline-related h2,
.change-form .inline-group legend, .change-form .inline-related legend,
.change-form .inline-group th, .change-form .inline-related th,
.change-form .inline-group td, .change-form .inline-related td,
.change-form .inline-group a, .change-form .inline-related a { color: #d043a6 !important; }
.change-form .inline-group input, .change-form .inline-group select, .change-form .inline-group textarea,
.change-form .inline-related input, .change-form .inline-related select, .change-form .inline-related textarea {
  background: #ffffff !important;
  border: 1.6px solid #9aa3af !important;
  color: #d043a6 !important;
}
.change-list #content h1, .change-form #content h1 { color: #111827 !important; }
.change-list thead th { background: #f7f7f8 !important; color: #111827 !important; border-bottom: 1px solid #e5e7eb !important; }
.change-list thead th a { color: #111827 !important; }
.change-list thead th a:hover { color: #111827 !important; text-decoration: none !important; }
.change-list thead th:hover { background: #f7f7f8 !important; }
.change-list tbody tr:nth-child(odd) { background: #ffffff !important; }
.change-list tbody tr:nth-child(even) { background: #fbfbfd !important; }
.change-list tbody tr:hover { background: inherit !important; }
.change-list tbody td, .change-list tbody td a { color: #111827 !important; }
.change-list a:hover { color: #111827 !important; text-decoration: none !important; }

/* Inputs: visible darker borders + dark text */
.change-form input[type="text"],
.change-form input[type="email"],
.change-form input[type="url"],
.change-form input[type="number"],
.change-form input[type="password"],
.change-form input[type="search"],
.change-form input[type="date"],
.change-form input[type="time"],
.change-form input[type="datetime-local"],
.change-form input[type="file"],
.change-form select,
.change-form textarea,
.change-form .vTextField,
.change-form .vURLField,
.change-form .vLargeTextField {
  background: #ffffff !important;
  border: 1.6px solid #9aa3af !important;
  color: #111827 !important;
}
/* Labels and help */
.change-form label, .change-form .aligned label, .change-form .form-row label { color: #111827 !important; }
.change-form .help, .change-form .helptext { color: #374151 !important; }


/* Hard visibility overrides for add/edit pages */
.change-form, .change-form * { color: #1f2937 !important; }
/* Override for inline sections */
.change-form .inline-group *, .change-form .inline-related * { color: #d043a6 !important; }
.change-form a { color: #111827 !important; }
.change-form .module, .change-form fieldset.module, .change-form .inline-group .module {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
}
.change-form fieldset.module > h2, .change-form legend, .change-form .inline-group h2 {
  color: #111827 !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
}
.change-form label, .change-form .aligned label, .change-form .form-row label {
  color: #111827 !important;
  font-weight: 600 !important;
}
.change-form .help, .change-form .helptext { color: #374151 !important; }

/* Inputs: darker borders always visible */
.change-form input[type="text"],
.change-form input[type="email"],
.change-form input[type="url"],
.change-form input[type="number"],
.change-form input[type="password"],
.change-form input[type="search"],
.change-form input[type="date"],
.change-form input[type="time"],
.change-form input[type="datetime-local"],
.change-form input[type="file"],
.change-form select,
.change-form textarea,
.change-form .vTextField,
.change-form .vURLField,
.change-form .vLargeTextField {
  background: #ffffff !important;
  border: 1.5px solid #6b7280 !important; /* darker neutral border */
  border-radius: 8px !important;
  padding: 9px 12px !important;
  color: #111827 !important;
  box-shadow: none !important;
}
/* Compact numeric inputs like Order */
.change-form input[type="number"], .change-form .vIntegerField, .change-form .vSmallIntegerField {
  width: 220px !important;
  max-width: 100% !important;
}
/* Focus ring */
.change-form input:focus, .change-form select:focus, .change-form textarea:focus {
  outline: none !important;
  border-color: #f83065 !important;
  box-shadow: 0 0 0 3px rgba(248,48,101,0.15) !important;
}
/* Submit row visible */
.change-form .submit-row {
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
}

/* Final hard height enforcement for delete confirmation controls */
/* Inputs (primary action) */
.delete-confirmation .submit-row input[type="submit"],
.delete-selected-confirmation .submit-row input[type="submit"],
body[class*="delete"] .submit-row input[type="submit"] {
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 22px !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  line-height: 52px !important;
}
/* Anchors (Cancel) */
.delete-confirmation .submit-row a,
.delete-selected-confirmation .submit-row a,
body[class*="delete"] .submit-row a,
.delete-confirmation .submit-row a.button,
.delete-selected-confirmation .submit-row a.button,
body[class*="delete"] .submit-row a.button,
.delete-confirmation .submit-row a.cancel-link,
.delete-selected-confirmation .submit-row a.cancel-link,
body[class*="delete"] .submit-row a.cancel-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 22px !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

/* Absolute final overrides site-wide (only for submit rows) */
/* Make every submit and cancel button share the same compact height */
.submit-row input[type="submit"],
.submit-row input[type="submit"] + a,
.submit-row a.cancel-link,
.deletelink-box a {
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
/* Global catch-all for any cancel-link buttons anywhere */
a.button.cancel-link,
 a.cancel-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
}

/* FINAL OVERRIDE - Force inline field colors to be #d043a6 */
.change-form .inline-group *,
.change-form .inline-related *,
.change-form .inline-group label,
.change-form .inline-related label,
.change-form .inline-group a,
.change-form .inline-related a,
.change-form .inline-group h2,
.change-form .inline-related h2,
.change-form .inline-group h3,
.change-form .inline-related h3,
.change-form .inline-group th,
.change-form .inline-related th,
.change-form .inline-group td,
.change-form .inline-related td,
.change-form .inline-group legend,
.change-form .inline-related legend,
.change-form .inline-group .help,
.change-form .inline-related .help {
    color: #d043a6 !important;
}

/* Force inline inputs to have the new color too */
.change-form .inline-group input,
.change-form .inline-related input,
.change-form .inline-group select,
.change-form .inline-related select,
.change-form .inline-group textarea,
.change-form .inline-related textarea {
    color: #d043a6 !important;
    background: #ffffff !important;
}

/* =======================
   Fix: Admin selects look broken (pill-like)
   Reset selects to native appearance and compact spacing.
   ======================= */
.change-form select,
.change-list select {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  background: #ffffff !important;
  padding: 3px 6px !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 4px !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  color: #111827 !important;
}
/* Remove the heavy pink focus ring from selects specifically */
.change-form select:focus,
.change-list select:focus {
  box-shadow: none !important;
  border-color: #2684ff !important; /* subtle blue focus */
  outline: none !important;
}
/* Ensure related-widget-wrapper (FK/M2M) selects stay tidy */
.related-widget-wrapper select {
  max-width: 100% !important;
}
/* If Select2 is active, keep its default admin look */
.select2-container .select2-selection {
  border-radius: 4px !important;
  box-shadow: none !important;
}
