/* ============================================================
   Fortress Elevator — Brand theme (matches fortresselevator.com)
   Black headers, gold CTAs, Roboto, pill buttons with 4px gold border
   Loaded globally via base_site.html + Tailwind CDN
   ============================================================ */

/* Native CAT test date inputs in unit inlines */
input.fe-cat-date-input[type="date"],
input[data-fe-cat-date][type="date"] {
  min-width: 10.5rem;
  max-width: 100%;
}

/* Hide browser contact/credential autofill decorations on CAT inspection date fields */
input.fe-cat-date-input[type="date"]::-webkit-contacts-auto-fill-button,
input.fe-cat-date-input[type="date"]::-webkit-credentials-auto-fill-button,
input[data-fe-cat-date]::-webkit-contacts-auto-fill-button,
input[data-fe-cat-date]::-webkit-credentials-auto-fill-button,
input.vDateField[name*="last_cat1_test"]::-webkit-contacts-auto-fill-button,
input.vDateField[name*="last_cat5_test"]::-webkit-contacts-auto-fill-button,
input.vDateField[name*="last_cat1_test"]::-webkit-credentials-auto-fill-button,
input.vDateField[name*="last_cat5_test"]::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

/* --- Fortress brand tokens (from Elementor kit on fortresselevator.com) --- */
:root {
  --fe-black: #000000;
  --fe-white: #FFFFFF;
  --fe-gold: #FABE01;
  --fe-gold-hover: #E5AB00;
  --fe-primary: #6EC1E4;
  --fe-secondary: #54595F;
  --fe-text: #7A7A7A;
  --fe-accent-green: #61CE70;
  --fe-border: #BBBBBB;
  --fe-bg-light: #F5F5F5;
  --fe-orange: #FFBC7D;
  --primary: var(--fe-bg-light);
  --accent: var(--fe-primary);
  --success: var(--fe-accent-green);
  --warning: #f59e0b;
  --danger: #ef4444;
  --muted: var(--fe-text);
  --secondary: var(--fe-secondary);
  --header-bg: var(--fe-black);
  --header-color: var(--fe-white);
  --darkened-bg: var(--fe-bg-light);
  --body-bg: var(--fe-white);
  --body-fg: var(--fe-text);
}

/* Brand utility classes (used in portal + admin templates) */
.text-fe-black { color: var(--fe-black) !important; }
.text-fe-muted { color: var(--fe-text) !important; }
.text-fe-secondary { color: var(--fe-secondary) !important; }
.text-fe-gold { color: var(--fe-gold) !important; }
.text-fe-primary { color: var(--fe-primary) !important; }
.bg-fe-light { background-color: var(--fe-bg-light) !important; }
.bg-fe-header { background-color: var(--fe-black) !important; }
.bg-fe-gold-light { background-color: #FFF8E1 !important; }
.border-fe-border { border-color: var(--fe-border) !important; }
.border-fe-light { border-color: #E5E5E5 !important; }
.hover\:bg-fe-light:hover { background-color: var(--fe-bg-light) !important; }

/* Fortress website CTA button pattern */
.fe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: "Roboto", ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
  text-decoration: none;
  border-style: solid;
  border-width: 4px;
  border-radius: 25px;
  padding: 0.5rem 1.25rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
}

.fe-btn-primary {
  background-color: var(--fe-black);
  color: var(--fe-gold);
  border-color: var(--fe-gold);
}

.fe-btn-primary:hover {
  background-color: var(--fe-gold);
  color: var(--fe-black);
  border-color: var(--fe-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(250, 190, 1, 0.35);
}

.fe-btn-secondary {
  background-color: var(--fe-white);
  color: var(--fe-black);
  border-color: var(--fe-border);
  font-weight: 700;
}

.fe-btn-secondary:hover {
  background-color: var(--fe-bg-light);
  border-color: var(--fe-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fe-btn-accent {
  background-color: var(--fe-gold);
  color: var(--fe-black);
  border-color: var(--fe-black);
}

.fe-btn-accent:hover {
  background-color: var(--fe-black);
  color: var(--fe-gold);
  border-color: var(--fe-gold);
  transform: translateY(-2px);
}

body {
  font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fe-text) !important;
  background: var(--fe-white) !important;
}

/* Force dark text on white/light module and form areas in admin (prevents invisible lettering) */
#content,
#content-main,
.module,
form,
form *,
label,
.form-row label,
.help,
span.help,
.helptext,
p.help,
#changelist,
.results,
td,
th,
.kpi-card,
.chart-container,
.px-4,
.text-xs,
.kpi-label {
  color: var(--fe-secondary) !important;
}
/* Module headers — black bar with gold title text */
.module h2,
.module caption {
  color: var(--fe-gold) !important;
}

/* Make the main content area breathe more like a modern dashboard */
#content, #content-main {
  background: #ffffff;
}

/* Card-like styling for modules on changelist / dashboard */
.module {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.module h2, .module caption {
  background: var(--fe-black) !important;
  color: var(--fe-gold) !important;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  padding: 14px 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Cleaner table styling */
#result_list, .results {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

#result_list thead th {
  background: #F5F5F5;
  color: #000000;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid #BBBBBB;
}

#result_list tbody tr:hover {
  background: #ffffff;
}

/* Modern status badges (used via format_html in admin.py) */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.status-badge.pending   { background: #fef3c7; color: #92400e; }
.status-badge.in_progress { background: #E8F7FC; color: #2B7A9B; }
.status-badge.completed { background: #d1fae5; color: #065f46; }

.inspection-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.inspection-badge.overdue   { background: #fee2e2; color: #991b1b; }
.inspection-badge.due-soon  { background: #fef3c7; color: #92400e; }
.inspection-badge.good      { background: #d1fae5; color: #065f46; }
.inspection-badge.unknown   { background: #F5F5F5; color: #000000; }

/* KPI cards on the custom dashboard */
.kpi-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  display: block; /* ensures proper block behavior when used as <a> */
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(250, 190, 1, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  border-color: #FABE01;
}

.kpi-card:active {
  transform: translateY(0) scale(0.985);
}

.kpi-card:focus-visible {
  outline: 2px solid #6EC1E4;
  outline-offset: 2px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: #000000;
  margin: 6px 0 2px;
}

.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: #000000;  /* bright for readability on white cards */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Attention table */
.attention-table td, .attention-table th {
  padding: 10px 12px;
  vertical-align: middle;
}

/* Chart containers */
.chart-container {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
}

.chart-container h3 {
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  margin: 0 0 12px 4px;
}

/* Recent activity table polish */
.recent-table a {
  color: #6EC1E4;
  text-decoration: none;
}

.recent-table a:hover {
  text-decoration: underline;
}

/* Logo on black admin header */
#header img {
  filter: none;
  background: transparent;
  padding: 3px;
  border-radius: 4px;
}

/* Logo treatment for the custom dashboard header (on light bg) */
.px-4 img[alt="Fortress Elevator"] {
  background: rgba(255,255,255,0.5) !important;
  padding: 2px !important;
  border-radius: 4px !important;
}

/* Improve changelist / list views to feel more modern (less "plain list") */
#changelist {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 8px;
}

#changelist .results {
  border-radius: 8px;
  overflow: hidden;
}

#changelist table {
  width: 100%;
}

#changelist thead th {
  background: #F5F5F5;
  font-weight: 600;
  color: #000000;
}

#changelist tbody tr:hover {
  background: #ffffff;
}

.module {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

#header a:link, #header a:visited {
  color: #000000 !important;
}

#branding h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Sidebar (nav) */
#nav-sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 12px 0;
}

#nav-sidebar a {
  color: #000000;
}

/* Gap between the filter box and the list below it */
#nav-sidebar #nav-filter {
  margin: 6px 12px 18px;
  width: calc(100% - 24px);
}

/* The app group card ("Records", with every model listed underneath) —
   separated from the sidebar background with a shadow + gold accent bar. */
#nav-sidebar .module {
  margin: 0 10px 12px;
  border: 1px solid var(--fe-border);
  border-left: 3px solid var(--fe-gold);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

#nav-sidebar .module caption {
  background: var(--fe-black);
  padding: 12px 22px;
  text-align: center;
}

#nav-sidebar .module caption a.section {
  color: var(--fe-gold) !important;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#nav-sidebar .module table {
  width: 100%;
}

/* Each model row ("01 Customers", "02 Buildings", ...) as a flex row so the
   Add link is reliably pinned to the right with breathing room, regardless
   of model name length, instead of trailing the text on the left. */
#nav-sidebar .module tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--fe-bg-light);
  padding: 4px 0;
}

#nav-sidebar .module tr:first-of-type {
  border-top: none;
}

#nav-sidebar .module tr:last-of-type {
  padding-bottom: 8px;
}

#nav-sidebar .module th {
  flex: 1;
  min-width: 0;
  padding: 6px 8px 6px 16px;
  font-weight: 500;
}

#nav-sidebar .module td {
  flex-shrink: 0;
  padding: 6px 16px 6px 8px;
}

#nav-sidebar .module tr.current-model,
#nav-sidebar .module tr:hover {
  background: var(--fe-bg-light);
  box-shadow: inset 3px 0 0 var(--fe-primary);
}

#nav-sidebar a:hover {
  background: #F5F5F5;
  color: #000000;
}

#nav-sidebar .addlink {
  color: var(--fe-accent-green) !important;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

#nav-sidebar .addlink::before {
  content: "+ ";
}

/* Breadcrumbs */
.breadcrumbs {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  color: #000000;  /* bright for readability */
  padding: 10px 16px;
}

/* Dashboard buttons — Fortress pill CTA style */
.dashboard .button,
.dashboard input[type=submit],
.dashboard button,
.dashboard a.button {
  border-radius: 25px;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  border-width: 3px;
  border-style: solid;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.dashboard .button:hover,
.dashboard input[type=submit]:hover,
.dashboard button:hover,
.dashboard a.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(250, 190, 1, 0.25);
}

.dashboard .button.default,
.dashboard input[type=submit].default,
.dashboard button.default {
  background: var(--fe-black);
  border-color: var(--fe-gold);
  color: var(--fe-gold);
  font-weight: 900;
}

.dashboard .button.default:hover,
.dashboard input[type=submit].default:hover,
.dashboard button.default:hover {
  background: var(--fe-gold);
  border-color: var(--fe-gold);
  color: var(--fe-black);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(250, 190, 1, 0.35);
}

/* Form rows cleaner */
.form-row {
  margin-bottom: 14px;
}

/* Hide the default "Recent actions" on our custom dashboard if we want full control */
.dashboard #content-related {
  display: none;
}

/* Small utility (scoped to avoid conflicts) - now using global darker overrides below for readability */
.dashboard .text-slate-500 { color: #000000 !important; }
.dashboard .text-slate-600 { color: #000000 !important; }
.dashboard .text-slate-700 { color: #000000 !important; }
.dashboard .text-slate-800 { color: #000000 !important; }

/* 
   Protect standard Django admin buttons and forms on changelists/change forms 
   from any remaining custom styling that could clip text.
*/
.change-form .button,
.change-form input[type="submit"],
.change-form button,
#changelist .button,
#changelist input[type="submit"],
#changelist button,
#delete-confirmation .button,
#delete-confirmation input[type="submit"],
#delete-confirmation button {
  border-radius: 4px !important;
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
  line-height: normal !important;
  height: auto !important;
  padding: 6px 12px !important;
}

/* ============================================================
   Readability fixes: bump pale grays from Tailwind "modern" styling
   (text-slate-400 etc. had insufficient contrast on light backgrounds)
   ============================================================ */
.text-slate-400,
.text-slate-300 {
  color: #000000 !important; /* slate-600 for good contrast (~7:1) */
}
.text-slate-500 {
  color: #000000 !important; /* slightly darker than before for small text */
}
.text-slate-600 {
  color: #000000 !important;
}
.text-slate-700 {
  color: #000000 !important;
}
.text-slate-800 {
  color: #000000 !important;
}
.text-slate-900 {
  color: #000000 !important;
}

/* Override any remaining Django admin dark/light backgrounds with pastels/bright */
.breadcrumbs,
.submit-row,
.form-row,
.inline-related h3,
#changelist-filter,
.object-tools,
#changelist .actions,
.module,
#container {
  background: #ffffff !important;
  color: #000000 !important;
}

#changelist .actions {
  background: #F5F5F5 !important;
}
.text-red-400,
.text-red-300 {
  color: #b91c1c !important; /* darker red for "Never", warnings etc. */
}
.text-red-500 {
  color: #9f1239 !important;
}

/* Admin top bar — black header, white/gold text */
#header {
  background: var(--fe-black) !important;
  color: var(--fe-white) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#header a,
#header a:link,
#header a:visited,
#header a:hover,
#branding a,
#branding h1,
#user-tools a,
#user-tools a:link,
#user-tools a:visited {
  color: var(--fe-white) !important;
}

#header a:hover,
#branding a:hover {
  color: var(--fe-gold) !important;
}

/* Module / changelist section titles on black bar */
.module h2,
.module caption,
#changelist h2,
#changelist-filter h2,
.changelist h2,
.changelist-filter h2 {
  background: var(--fe-black) !important;
  color: var(--fe-gold) !important;
}

/* Customer portal header — matches public site nav */
.portal-header {
  background: var(--fe-black) !important;
  color: var(--fe-white) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.portal-header .font-semibold,
.portal-header span,
.portal-header .text-fe-primary {
  color: var(--fe-gold) !important;
}

.portal-header .text-fe-black {
  color: var(--fe-white) !important;
}

.portal-header .nav-link {
  color: var(--fe-white) !important;
  background: transparent !important;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.portal-header .nav-link:hover {
  color: var(--fe-gold) !important;
}

.portal-header .nav-link.active {
  color: var(--fe-gold) !important;
  font-weight: 700;
  border-bottom-color: var(--fe-gold);
}

.portal-header .border-fe-border,
.portal-header .border-t {
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.portal-header img {
  background: transparent !important;
  filter: brightness(1.05);
}

/* Headings in main content use black; body copy stays gray */
main h1, main h2, main h3,
#content h1, #content h2, #content h3,
.dashboard h1, .dashboard h2, .dashboard h3 {
  color: var(--fe-black) !important;
}

.text-fe-black {
  color: var(--fe-black) !important;
}

.kpi-value {
  color: var(--fe-black) !important;
}

.recent-table a,
.chart-container a {
  color: var(--fe-primary) !important;
}

.recent-table a:hover {
  color: var(--fe-gold) !important;
}

/* cache-bust-20260701-fortress-brand */

