/* ==========================================================================
   Home Plumbing Care – Leak & Maintenance Planner
   Premium SaaS Style Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-navy-dark: #090e17;
  --color-navy-900: #0f172a;
  --color-navy-800: #1e293b;
  --color-navy-700: #334155;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-light: #eff6ff;
  --color-primary-border: #bfdbfe;
  --color-cyan: #0284c7;
  --color-cyan-light: #e0f2fe;

  --color-bg-app: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f1f5f9;

  --color-border: #e2e8f0;
  --color-border-subtle: #cbd5e1;
  --color-border-dark: #475569;

  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-text-white: #ffffff;

  /* Status Colors */
  --color-success: #10b981;
  --color-success-dark: #047857;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-warning: #f59e0b;
  --color-warning-dark: #b45309;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #ef4444;
  --color-danger-dark: #b91c1c;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  --color-emergency: #be123c;
  --color-emergency-bg: #fff1f2;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  --max-content-width: 1240px;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-app);
  color: var(--color-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-danger {
  color: var(--color-danger);
}

.w-100 {
  width: 100%;
}

.mb-4 {
  margin-bottom: 1rem;
}

.d-none {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.header-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-wrapper {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy-900);
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Nav Tabs */
.nav-tabs-wrapper {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.nav-tabs {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--color-navy-900);
  background-color: var(--color-bg-subtle);
}

.nav-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.nav-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-subtle);
  color: var(--color-text-muted);
}

.nav-badge.alert {
  background-color: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

.nav-badge.warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning-dark);
}

/* --------------------------------------------------------------------------
   Safety Alert Banner
   -------------------------------------------------------------------------- */
.safety-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fef08a;
  color: #92400e;
  font-size: 0.825rem;
  padding: 0.65rem 1.25rem;
}

.safety-banner-content {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.safety-icon-box {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #d97706;
}

.safety-icon-box svg {
  width: 100%;
  height: 100%;
}

.safety-text {
  flex: 1;
  line-height: 1.45;
}

.safety-dismiss-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #92400e;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.safety-dismiss-btn:hover {
  background-color: #fef08a;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.app-main-content {
  flex: 1;
  max-width: var(--max-content-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem 1.25rem;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 200ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-bg-subtle);
  color: var(--color-navy-900);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: #ffffff;
  color: var(--color-navy-800);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background-color: var(--color-bg-subtle);
  border-color: var(--color-border-subtle);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background-color: var(--color-bg-subtle);
  color: var(--color-navy-900);
}

.btn-light {
  background-color: #ffffff;
  color: var(--color-navy-900);
  font-weight: 600;
}

.btn-light:hover {
  background-color: #f8fafc;
}

.btn-outline-white {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--color-danger-dark);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-large {
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Dashboard View Styles
   -------------------------------------------------------------------------- */
.dashboard-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
}

.hero-heading {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.hero-subtext {
  color: #bfdbfe;
  font-size: 0.95rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-border);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.bg-blue-subtle {
  background-color: #eff6ff;
  color: #2563eb;
}

.bg-cyan-subtle {
  background-color: #ecfeff;
  color: #0891b2;
}

.bg-amber-subtle {
  background-color: #fffbeb;
  color: #d97706;
}

.bg-emerald-subtle {
  background-color: #ecfdf5;
  color: #059669;
}

.bg-purple-subtle {
  background-color: #faf5ff;
  color: #9333ea;
}

.bg-rose-subtle {
  background-color: #fff1f2;
  color: #e11d48;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-navy-900);
  line-height: 1.1;
}

.metric-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}

.metric-pill.alert {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

.metric-pill.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
}

.metric-pill.success {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 0.5rem 0 0.4rem 0;
}

.progress-bar-container.full {
  height: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: var(--radius-pill);
  transition: width 400ms ease;
}

.metric-meta-stats {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.metric-caption {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: auto;
}

/* Dashboard Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.content-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header-flex {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy-900);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.card-body {
  padding: 1.25rem;
}

/* Urgent Alerts in Dashboard */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-danger);
  background: var(--color-danger-bg);
  gap: 0.75rem;
}

.alert-item-card.warning-item {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.alert-item-info h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy-900);
}

.alert-item-info p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Quick Checklist in Dashboard */
.quick-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-subtle);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.quick-check-item:hover {
  background-color: #e2e8f0;
}

.quick-check-item.completed {
  text-decoration: line-through;
  color: var(--color-text-light);
  background-color: #f8fafc;
}

/* Professional Partner Callout Card */
.pro-callout-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.pro-callout-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: #16a34a;
}

.pro-callout-icon svg {
  width: 100%;
  height: 100%;
}

.pro-callout-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 0.2rem;
}

.pro-callout-text p {
  font-size: 0.85rem;
  color: #166534;
  line-height: 1.45;
}

.pro-partner-link {
  color: #15803d;
  font-weight: 700;
  text-decoration: underline;
}

.pro-callout-btn {
  flex-shrink: 0;
  background-color: #15803d;
  border-color: #15803d;
}

.pro-callout-btn:hover {
  background-color: #166534;
  border-color: #166534;
}

/* --------------------------------------------------------------------------
   Section Common Headers & Toolbars
   -------------------------------------------------------------------------- */
.section-header-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-navy-900);
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  max-width: 720px;
}

.section-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-light);
  pointer-events: none;
}

.search-input-group input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  font-family: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-text-main);
  transition: all var(--transition-fast);
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.toolbar-selects {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-wrapper select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--color-navy-900);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* --------------------------------------------------------------------------
   Checklist Section Styles
   -------------------------------------------------------------------------- */
.checklist-progress-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.checklist-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.progress-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-navy-900);
  margin-right: 0.5rem;
}

.progress-detail {
  font-size: 0.825rem;
  color: var(--color-text-muted);
}

.checklist-filter-pills {
  display: flex;
  gap: 0.25rem;
  background: var(--color-bg-subtle);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.filter-pill {
  border: none;
  background: transparent;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
}

.custom-checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #ffffff;
  transition: all var(--transition-fast);
}

.checklist-item:hover {
  border-color: var(--color-primary-border);
  background-color: #fafbfc;
}

.checklist-item.checked {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.checklist-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-subtle);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #ffffff;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.checklist-item.checked .custom-checkbox {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}

.custom-checkbox svg {
  width: 14px;
  height: 14px;
  display: none;
}

.checklist-item.checked .custom-checkbox svg {
  display: block;
}

.checklist-item-title {
  font-size: 0.925rem;
  color: var(--color-navy-900);
  font-weight: 500;
  line-height: 1.4;
}

.checklist-item.checked .checklist-item-title {
  text-decoration: line-through;
  color: var(--color-text-light);
}

.checklist-item-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-weight: 600;
  margin-left: 0.5rem;
}

.checklist-item-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.checklist-item:hover .checklist-item-actions {
  opacity: 1;
}

.action-icon-btn {
  background: transparent;
  border: none;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-icon-btn:hover {
  background: var(--color-bg-subtle);
  color: var(--color-navy-900);
}

.action-icon-btn.delete:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.action-icon-btn svg {
  width: 16px;
  height: 16px;
}

.checklist-footer-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Issues Tracker Section Styles
   -------------------------------------------------------------------------- */
.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.issue-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  position: relative;
  border-top: 4px solid var(--color-primary);
  transition: all var(--transition-fast);
}

.issue-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.issue-card.severity-Low {
  border-top-color: #38bdf8;
}

.issue-card.severity-Medium {
  border-top-color: var(--color-warning);
}

.issue-card.severity-High {
  border-top-color: var(--color-danger);
}

.issue-card.severity-Emergency {
  border-top-color: var(--color-emergency);
  background: linear-gradient(180deg, #fff1f2 0%, #ffffff 40px);
}

.issue-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.issue-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy-900);
  line-height: 1.3;
}

.issue-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.badge-tag {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  color: var(--color-navy-800);
}

.badge-status {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-status.pending {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

.badge-status.in-progress {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
}

.badge-status.resolved {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
}

.issue-card-notes {
  font-size: 0.85rem;
  color: var(--color-navy-700);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  flex: 1;
  white-space: pre-wrap;
  line-height: 1.45;
}

.issue-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  gap: 0.5rem;
}

.issue-date-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.issue-actions {
  display: flex;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   Reminders Planner Section Styles
   -------------------------------------------------------------------------- */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.reminder-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: all var(--transition-fast);
}

.reminder-card:hover {
  border-color: var(--color-primary-border);
}

.reminder-card.overdue {
  border-left: 4px solid var(--color-danger);
  background-color: #fef2f2;
}

.reminder-card.due-today {
  border-left: 4px solid var(--color-warning);
  background-color: #fffbeb;
}

.reminder-card.completed {
  opacity: 0.65;
  background-color: #f8fafc;
}

.reminder-left-col {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.reminder-check-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border-subtle);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: #ffffff;
}

.reminder-card.completed .reminder-check-btn {
  background: var(--color-success);
  border-color: var(--color-success);
}

.reminder-check-btn:hover {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.reminder-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy-900);
}

.reminder-card.completed .reminder-info h4 {
  text-decoration: line-through;
}

.reminder-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.due-pill {
  font-weight: 700;
  font-size: 0.725rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.due-pill.overdue {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

.due-pill.today {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
}

.due-pill.normal {
  background: var(--color-bg-subtle);
  color: var(--color-navy-800);
}

.reminder-right-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   Repair History Section Styles
   -------------------------------------------------------------------------- */
.history-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-navy-900);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--color-bg-subtle);
  color: var(--color-navy-800);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #fafbfc;
}

/* --------------------------------------------------------------------------
   Helpful Resources & Partner Spotlight
   -------------------------------------------------------------------------- */
.resource-partner-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border-radius: var(--radius-lg);
  color: #ffffff;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid #3b82f6;
  position: relative;
  overflow: hidden;
}

.partner-card-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.4);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.partner-card-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.partner-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.partner-avatar svg {
  width: 36px;
  height: 36px;
}

.partner-details {
  flex: 1;
}

.partner-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.partner-description {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.external-partner-link {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.external-partner-link:hover {
  color: #7dd3fc;
}

.partner-perks {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.perk-tag {
  font-size: 0.8rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.partner-cta {
  flex-shrink: 0;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.resource-article {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.resource-article.danger-highlight {
  border-color: #fecaca;
  background: #fffafa;
}

.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.resource-icon svg {
  width: 24px;
  height: 24px;
}

.resource-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy-900);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.resource-body {
  font-size: 0.875rem;
  color: var(--color-navy-700);
  line-height: 1.6;
  margin-bottom: 1.15rem;
  flex: 1;
}

.resource-tip {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--color-navy-800);
  line-height: 1.45;
  border-left: 3px solid var(--color-primary);
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #ffffff;
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.85rem auto;
  color: var(--color-text-light);
}

.empty-state h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy-900);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 420px;
  margin: 0 auto 1.25rem auto;
}

/* --------------------------------------------------------------------------
   Modals & Dialogs
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-normal);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-dialog-sm {
  max-width: 420px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy-900);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  background-color: var(--color-bg-subtle);
  color: var(--color-navy-900);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background-color: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-navy-800);
  margin-bottom: 0.35rem;
}

.form-group label .required {
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-navy-900);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control.is-invalid {
  border-color: var(--color-danger);
}

.form-error {
  display: none;
  color: var(--color-danger);
  font-size: 0.75rem;
  margin-top: 0.3rem;
}

.form-control.is-invalid+.form-error {
  display: block;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Backup Dialog Grid */
.backup-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.backup-box {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.backup-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--color-navy-900);
}

.backup-box p {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--color-navy-900);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  animation: toastSlideUp 200ms ease-out;
  border-left: 4px solid var(--color-primary);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

.toast.danger {
  border-left-color: var(--color-danger);
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem;
}

.toast-close:hover {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Footer Styles
   -------------------------------------------------------------------------- */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem 1.25rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 2.5rem;
}

.brand-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.brand-icon-sm {
  width: 32px;
  height: 32px;
}

.footer-brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy-900);
}

.footer-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.footer-link-highlight {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-navy-900);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
  padding: 1.25rem;
}

.footer-bottom-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.775rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.disclaimer-text {
  max-width: 780px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Print Only Header & Print Stylesheet
   -------------------------------------------------------------------------- */
.print-only-header {
  display: none;
}

@media print {

  /* Hide non-printable UI components */
  .app-header,
  .safety-banner,
  .dashboard-hero .hero-actions,
  .filter-toolbar,
  .modal-backdrop,
  .toast-container,
  .app-footer,
  .btn,
  .action-icon-btn,
  .checklist-item-actions,
  .checklist-footer-actions,
  .header-actions {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-main-content {
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* Show All Views in Print Mode */
  .tab-view {
    display: block !important;
    page-break-after: always;
    margin-bottom: 2rem;
  }

  .print-only-header {
    display: block !important;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .print-header-top h2 {
    font-size: 18pt;
    margin-bottom: 2px;
  }

  .print-header-meta {
    display: flex;
    justify-content: space-between;
    font-size: 9pt;
    margin-top: 6px;
  }

  .metric-card,
  .content-card,
  .issue-card,
  .reminder-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #ddd !important;
    padding: 6px 8px !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .partner-card-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .form-row-2,
  .backup-actions-grid {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none;
  }

  .section-header-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-actions-row {
    width: 100%;
    justify-content: flex-start;
  }
}