.form-row label,
.aligned label {
  font-weight: 500 !important;
  color: #000 !important;
}

/*
    DJANGO Admin styles
*/

/* VARIABLE DEFINITIONS */
html[data-theme="light"],
:root {
  --primary: #2a5bd7;
  --secondary: #234fad;
}

/* Remove default trailing colons on admin form labels */
#content-main .form-row label::after,
#content-main .aligned label::after,
.form-row label::after,
.aligned label::after,
.form-row .required label::after,
.aligned .required label::after {
  content: "" !important;
  display: none !important;
}

/* Emphasize key assessor totals on Parcel detail */
label[for="id_assessor_total_market_value"],
label[for="id_assessor_total_assessed_value_display"] {
  font-weight: 700 !important;
}

/* Light shading + alignment for Assessor Values block */
fieldset.assessor-values .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

fieldset.assessor-values label {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: inline;
}

fieldset.assessor-values .readonly {
  background: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  padding: 6px 8px;
  display: inline-block;
}

/* Keep the parcel filing action button from wrapping */
.results td.field-create_appeal_link a.button {
  white-space: nowrap;
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
}

/* Admin index hero card */
.hero-card {
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(120deg, #f0f4ff 0%, #e6f0ff 100%);
}

.hero-card h2 {
  margin: 0 0 8px 0;
}

.hero-card p {
  margin: 0 0 12px 0;
}

.hero-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.hero-row .hero-card {
  margin-bottom: 0;
}

.hero-button {
  display: inline-block;
  padding: 8px 14px;
  background: #2a5bd7 !important; /* match Create Ticket button */
  color: #fff !important;         /* match Create Ticket button */
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.hero-button:hover {
  background: #234fad;
}

.ai-assistant-card {
  display: none !important;
}

.ai-assistant-card .ai-chatlog {
  height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  background: #fff;
  margin: 8px 0 12px;
}

.ai-assistant-card .ai-chatform {
  display: flex;
  gap: 8px;
}

.ai-assistant-card .ai-chatform .ai-msg {
  flex: 1;
  padding: 8px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
}

.ai-assistant-card .ai-chatform .button {
  background: #2a5bd7 !important;
  color: #fff !important;
}

.issue-tickets-card table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.issue-tickets-card th,
.issue-tickets-card td {
  padding: 6px;
  border: 1px solid #e0e0e0;
  font-size: 12px;
}

.issue-tickets-card .issue-actions {
  text-align: right;
}

.app-quicklinks {
  display: none !important; /* hide admin quick links section */
}

.parameter-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  table-layout: fixed;
}

.parameter-table th,
.parameter-table td {
  border: 1px solid #e0e0e0;
  padding: 8px;
  text-align: left;
}

.parameter-table thead th {
  background: #f6f8fb;
}

.parameter-table .slot-col {
  width: 60px;
  text-align: center;
}

.parameter-table .nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-button-danger {
  background: #c62828;
}

.hero-button-danger:hover {
  background: #a31f1f;
}

/* Dashboard layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-side .module {
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.issue-tickets h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.issue-tickets .helptext {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #555;
}

.issue-tickets table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.issue-tickets th,
.issue-tickets td {
  padding: 6px;
  border: 1px solid #e0e0e0;
  font-size: 12px;
}

.issue-actions {
  text-align: right;
}

.issue-actions .create-ticket {
  display: inline-block;
  padding: 6px 10px;
  background: #2a5bd7;
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.issue-actions .create-ticket:hover {
  background: #234fad;
}

/* Hearing notice actions - uniform button sizing */
.hearing-notice-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hearing-notice-actions .button {
  min-width: 190px;
  text-align: center;
  display: inline-block;
}

/* Allow appeal column wrap on Hearing list */
.results td.field-display_appeal {
  white-space: normal;
}

/* Appeals list: make OWNER column narrower */
.results th.column-display_owner_name,
.results td.field-display_owner_name {
  width: 100px;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Parcel changelist: stabilize column distribution */
#changelist-form .results {
  table-layout: fixed;
}

#changelist-form .results th.column-account,
#changelist-form .results td.field-account {
  width: 120px;
  white-space: nowrap;
}

#changelist-form .results th.column-display_owner_name,
#changelist-form .results td.field-display_owner_name {
  width: 240px;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#changelist-form .results th.column-display_address,
#changelist-form .results td.field-display_address {
  width: 320px;
  white-space: normal;
}

#changelist-form .results th.column-create_appeal_link,
#changelist-form .results td.field-create_appeal_link {
  width: 150px;
  white-space: nowrap;
}

/* Hearing changelist: add breathing room between actions bar and Session Slot ID input */
#changelist-form .actions label[for="id_session_slot_id"],
#changelist-form .actions input[name="session_slot_id"] {
  display: inline-block;
  margin-top: 6px;
}

.bedbug-button {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #b71c1c;
  color: #fff !important;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 1200;
}

.bedbug-button:hover {
  background: #8e1616;
}

/* Override legacy admin palette (#417690 -> #2a5bd7, #264b5d -> #e8f1ff) */
#header {
  background: #363636 !important;
}

#header h1 a:link,
#header h1 a:visited {
  color: #fff !important;
}

#user-tools,
#user-tools a:link,
#user-tools a:visited {
  color: #e7f1ff !important;
}

/* Hide default theme toggle (sun/moon icon) */
.theme-toggle {
  display: none !important;
}

/* Breadcrumb color override */
.breadcrumbs {
  color: #333 !important;
  background: #eaf2ff !important;
}

.breadcrumbs a {
  color: #121212 !important;
  text-decoration: none !important;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus,
.breadcrumbs a:active {
  text-decoration: none !important;
}

/* AuditLog detail view: uppercase field labels */
.model-auditlog .form-row label {
  text-transform: uppercase;
}

#content-main .module h2,
#content-main .module caption,
#content-main .inline-group h2,
.module h2,
.module caption,
.inline-group h2 {
  background: #747474 !important;
  color: #fff !important;
}

#nav-sidebar a[href="/admin/appeals/meeting/"],
#content-main a[href="/admin/appeals/meeting/"] {
  color: #282828 !important;
}

#nav-sidebar .app-appeals li {
  display: none !important;
}

#nav-filter {
  display: none !important;
}

.dark-theme,
html[data-theme="light"],
:root {
  --link-fg: #333 !important;
}

/* Admin dashboard cleanup */
.dashboard th.addlink,
.dashboard td.addlink,
.dashboard th.changelink,
.dashboard td.changelink,
.dashboard a.addlink,
.dashboard a.changelink {
  display: none !important;
}

.dashboard #recent-actions-module,
.dashboard #content-related {
  display: none !important;
}

.dashboard #content-main {
  width: 100%;
}

/* Slightly wider nav sidebar */
#nav-sidebar {
  flex: 0 0 220px;
  left: -221px;
  margin-left: -221px;
}

[dir="rtl"] #nav-sidebar {
  right: -221px;
  margin-right: -221px;
}

.main.shifted > #nav-sidebar + .content {
  max-width: calc(100% - 244px);
}

/* Replace Django action icons with text-only badges */
.related-widget-wrapper-link,
.related-widget-wrapper-link:link,
.related-widget-wrapper-link:visited,
.related-widget-wrapper-link:hover,
.related-widget-wrapper-link:focus {
  text-decoration: none !important;
}

.related-widget-wrapper-link img,
.related-widget-wrapper-link svg {
  display: none !important;
}

.changelink,
.inlinechangelink,
.change-related,
.addlink,
.add-related,
.deletelink,
.inline-deletelink,
.delete-related,
.viewlink,
.inlineviewlink,
.view-related {
  background: none !important;
  padding-left: 0 !important;
  text-indent: 0 !important;
  width: auto !important;
  height: auto !important;
  font-size: 0;
  line-height: 0;
}

.changelink::before,
.inlinechangelink::before,
.change-related::before {
  content: "Edit";
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: #d9d9d9;
  color: #333333;
  letter-spacing: 0.02em;
}

.deletelink::before,
.inline-deletelink::before,
.delete-related::before {
  content: "Delete";
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: #f2c7c7;
  color: #8a1f11;
  letter-spacing: 0.02em;
}

.addlink::before,
.add-related::before {
  content: "New";
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: #cfead6;
  color: #1f7a3f;
  letter-spacing: 0.02em;
}

.viewlink::before,
.inlineviewlink::before,
.view-related::before {
  content: "View";
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: #e0e0e0;
  color: #111111;
  letter-spacing: 0.02em;
}

/* Hide navigation action badges/links in the sidebar */
#nav-sidebar .addlink,
#nav-sidebar .changelink,
#nav-sidebar .deletelink,
#nav-sidebar .viewlink,
#nav-sidebar .inlinechangelink,
#nav-sidebar .inlineviewlink,
#nav-sidebar .inline-deletelink,
#nav-sidebar .change-related,
#nav-sidebar .add-related,
#nav-sidebar .delete-related,
#nav-sidebar .view-related {
  display: none !important;
}

/* Hide navigation action badges/links in app navigation module */
#content-related .addlink,
#content-related .changelink,
#content-related .deletelink,
#content-related .viewlink,
#content-related .inlinechangelink,
#content-related .inlineviewlink,
#content-related .inline-deletelink,
#content-related .change-related,
#content-related .add-related,
#content-related .delete-related,
#content-related .view-related {
  display: none !important;
}

/* Ensure button-like links are not underlined */
a.button,
a.button:link,
a.button:visited,
.button {
  text-decoration: none !important;
}

/* Appeal change form: remove all underlines */
.model-appeal.change-form a,
.model-appeal.change-form a:link,
.model-appeal.change-form a:visited,
.model-appeal.change-form a:hover,
.model-appeal.change-form a:focus,
.model-appeal.change-form a:active,
.model-appeal.change-form u {
  text-decoration: none !important;
}

/* Appeal change form: show full "Add another..." text as one badge */
.model-appeal .inline-group div.add-row a,
.model-appeal .inline-group .tabular tr.add-row td a {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #cfead6;
  color: #1f7a3f !important;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.2 !important;
  text-decoration: none !important;
}

.model-appeal .inline-group div.add-row a::before,
.model-appeal .inline-group .tabular tr.add-row td a::before {
  content: none !important;
  display: none !important;
}

/* Appeal change form: keep spacing between Meetings and Board Actions */
.model-appeal #board-actions-inline {
  margin-top: 14px;
}

/* Appeal change form: Board Actions should visually match inline sections */
.model-appeal #board-actions-inline a,
.model-appeal #board-actions-inline a:link,
.model-appeal #board-actions-inline a:visited,
.model-appeal #board-actions-inline a:hover,
.model-appeal #board-actions-inline a:focus {
  text-decoration: none !important;
}

.model-appeal #board-actions-inline td p {
  margin: 0;
}

/* Appeal change form: normalize inline header weights */
.model-appeal #documents-group th,
.model-appeal #hearings-group th,
.model-appeal #admin_comments-group th,
.model-appeal #appealadmincomment_set-group th {
  font-weight: 400 !important;
}

/* Appeal change form: Schedule Slot placeholder styling */
.model-appeal #hearings-group select[name$='-schedule_slot'].schedule-slot-empty {
  font-style: italic;
  color: #6f6f6f;
}

.model-appeal #hearings-group select[name$='-schedule_slot'] option {
  font-style: normal;
}

.model-appeal #hearings-group select[name$='-schedule_slot'] option[value=''] {
  font-style: italic;
}

/* Date picker month/year header should not be bold */
.calendar caption,
.calendarbox h2 {
  font-weight: 400 !important;
}

/* Appeal change form: keep Property Account Key label styling consistent */
label[for='id_parcel'] {
  font-weight: 500 !important;
  color: #000 !important;
}

/* Appeal change form: normalize contact selector labels to match reporting labels */
.model-appeal .field-property_owner_contact label,
.model-appeal .field-authorized_agent_contact label,
.model-appeal .field-other_contact label,
.model-appeal .field-primary_contact_role label,
.model-appeal .field-primary_contact_role legend {
  font-weight: 700 !important;
  color: #000 !important;
}
