/* ============================================================
   DMR Platform - Custom Styles
   Daily Management Report | A-1 Garage / Authority Brands
   ============================================================
   Brand Colors (Pantone – mirrors tailwind.config):
     Mr. Sparky           : #C8102E (Pantone 186 C – red)
     One Hour Heating&Air : #FFC72C (Pantone 123 C – yellow)
     Benjamin Franklin    : #003DA5 (Pantone 287 C – blue)
     Platform Navy        : #1e3a5f
     Platform Gold        : #d69e2e
   ============================================================ */

/* ---------------------------------------------------------
   0. CSS Custom Properties
   --------------------------------------------------------- */
:root {
  /* Platform palette */
  --dmr-navy:          #1e3a5f;
  --dmr-navy-light:    #2c5282;
  --dmr-gold:          #d69e2e;
  --dmr-gold-light:    #ecc94b;
  --dmr-green:         #38a169;
  --dmr-red:           #e53e3e;
  --dmr-orange:        #dd6b20;

  /* Brand palette (Pantone) */
  --sparky-red:        #C8102E;
  --sparky-red-light:  #E8637A;
  --onehour-yellow:    #FFC72C;
  --onehour-yellow-light:#FFE08A;
  --bfp-blue:          #003DA5;
  --bfp-blue-light:    #6699D0;

  /* Surfaces */
  --surface-primary:   #ffffff;
  --surface-secondary: #f7fafc;
  --surface-muted:     #edf2f7;
  --border-default:    #e2e8f0;
  --border-strong:     #cbd5e0;

  /* Text */
  --text-primary:      #1a202c;
  --text-secondary:    #4a5568;
  --text-muted:        #a0aec0;

  /* Rank badges */
  --rank-gold:         #d69e2e;
  --rank-gold-bg:      #fefcbf;
  --rank-silver:       #a0aec0;
  --rank-silver-bg:    #edf2f7;
  --rank-bronze:       #c05621;
  --rank-bronze-bg:    #feebc8;

  /* Shadows */
  --shadow-sm:         0 1px 2px rgba(0,0,0,.05);
  --shadow-md:         0 4px 6px rgba(0,0,0,.07);
  --shadow-lg:         0 10px 15px rgba(0,0,0,.1);
  --shadow-xl:         0 20px 25px rgba(0,0,0,.12);

  /* Transitions */
  --ease-out:          cubic-bezier(.25,.46,.45,.94);
  --ease-spring:       cubic-bezier(.34,1.56,.64,1);

  /* Layout */
  --nav-height:        4rem;
  --sidebar-width:     16rem;
  --container-max:     80rem;
}

/* ---------------------------------------------------------
   1. Base / Reset Augments
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--surface-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------
   2. Login Page
   --------------------------------------------------------- */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dmr-navy) 0%, #0f2440 60%, #0a1628 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(214,158,46,.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(44,82,130,.08) 0%, transparent 50%);
  animation: loginBgPulse 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes loginBgPulse {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-3%, -3%) scale(1.06); }
}

.login-card {
  background: var(--surface-primary);
  border-radius: .75rem;
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 28rem;
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 1;
  animation: loginSlideUp .5s var(--ease-out) both;
}

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(1.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  font-size: 2.5rem;
  color: var(--dmr-gold);
  margin-bottom: .75rem;
  display: block;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dmr-navy);
  margin: 0;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: .875rem;
  margin-top: .25rem;
}

/* Brand selection cards on login */
.brand-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
  .brand-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.brand-card {
  border: 2px solid var(--border-default);
  border-radius: .5rem;
  padding: 1rem .75rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s var(--ease-out);
  background: var(--surface-primary);
  position: relative;
  overflow: hidden;
}

.brand-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background .2s var(--ease-out);
}

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

.brand-card.active,
.brand-card.selected {
  border-color: var(--dmr-gold);
  box-shadow: 0 0 0 1px var(--dmr-gold), var(--shadow-md);
}

.brand-card.active::after,
.brand-card.selected::after {
  background: var(--dmr-gold);
}

/* Per-brand accent overrides */
.brand-card.brand-sparky.active,
.brand-card.brand-sparky.selected {
  border-color: var(--sparky-red);
  box-shadow: 0 0 0 1px var(--sparky-red), var(--shadow-md);
}
.brand-card.brand-sparky.active::after,
.brand-card.brand-sparky.selected::after {
  background: var(--sparky-red);
}

.brand-card.brand-onehour.active,
.brand-card.brand-onehour.selected {
  border-color: var(--onehour-yellow);
  box-shadow: 0 0 0 1px var(--onehour-yellow), var(--shadow-md);
}
.brand-card.brand-onehour.active::after,
.brand-card.brand-onehour.selected::after {
  background: var(--onehour-yellow);
}

.brand-card.brand-bfp.active,
.brand-card.brand-bfp.selected {
  border-color: var(--bfp-blue);
  box-shadow: 0 0 0 1px var(--bfp-blue), var(--shadow-md);
}
.brand-card.brand-bfp.active::after,
.brand-card.brand-bfp.selected::after {
  background: var(--bfp-blue);
}

.brand-card-icon {
  font-size: 1.75rem;
  margin-bottom: .5rem;
  display: block;
}

.brand-card-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ---------------------------------------------------------
   3. Dashboard Cards & Stat Boxes
   --------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--surface-primary);
  border-radius: .5rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-default);
  transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
  position: relative;
  overflow: hidden;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--dmr-navy);
}

.stat-card.stat-green::before  { background: var(--dmr-green); }
.stat-card.stat-red::before    { background: var(--dmr-red); }
.stat-card.stat-gold::before   { background: var(--dmr-gold); }
.stat-card.stat-orange::before { background: var(--dmr-orange); }

/* Brand-specific card accents */
.stat-card.brand-sparky::before  { background: var(--sparky-red); }
.stat-card.brand-onehour::before { background: var(--onehour-yellow); }
.stat-card.brand-bfp::before     { background: var(--bfp-blue); }

.stat-card-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-delta {
  font-size: .8rem;
  font-weight: 500;
  margin-top: .25rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.stat-card-delta.positive { color: var(--dmr-green); }
.stat-card-delta.negative { color: var(--dmr-red); }
.stat-card-delta.neutral  { color: var(--text-muted); }

.stat-card-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--border-default);
  opacity: .6;
}

/* Summary / KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.kpi-item {
  text-align: center;
  padding: 1rem .5rem;
  background: var(--surface-primary);
  border-radius: .5rem;
  border: 1px solid var(--border-default);
}

.kpi-item-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dmr-navy);
}

.kpi-item-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-top: .125rem;
}

/* Content panel wrapper */
.panel {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

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

.panel-header h2,
.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.panel-body {
  padding: 1.25rem;
}

/* ---------------------------------------------------------
   4. Table Styling for Data Grids
   --------------------------------------------------------- */
.dmr-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: .5rem;
  border: 1px solid var(--border-default);
}

.dmr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  white-space: nowrap;
}

.dmr-table thead {
  background: var(--dmr-navy);
  color: #fff;
}

.dmr-table thead th {
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.dmr-table thead th:first-child { border-radius: .375rem 0 0 0; }
.dmr-table thead th:last-child  { border-radius: 0 .375rem 0 0; }

.dmr-table tbody tr {
  border-bottom: 1px solid var(--border-default);
  transition: background .15s;
}

.dmr-table tbody tr:last-child { border-bottom: none; }
.dmr-table tbody tr:hover      { background: #f0f5ff; }

.dmr-table tbody tr:nth-child(even) {
  background: var(--surface-secondary);
}
.dmr-table tbody tr:nth-child(even):hover {
  background: #f0f5ff;
}

.dmr-table td {
  padding: .6rem 1rem;
  color: var(--text-secondary);
}

.dmr-table td.text-right,
.dmr-table th.text-right {
  text-align: right;
}

.dmr-table td.text-center,
.dmr-table th.text-center {
  text-align: center;
}

.dmr-table td.font-semibold {
  font-weight: 600;
  color: var(--text-primary);
}

/* Sortable column header */
.dmr-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
}

.dmr-table th.sortable::after {
  content: '\f0dc'; /* fa-sort */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: .4;
  font-size: .65rem;
}

.dmr-table th.sortable.asc::after {
  content: '\f0de'; /* fa-sort-up */
  opacity: 1;
}

.dmr-table th.sortable.desc::after {
  content: '\f0dd'; /* fa-sort-down */
  opacity: 1;
}

/* Brand-themed table headers */
.dmr-table.brand-sparky thead   { background: var(--sparky-red); }
.dmr-table.brand-onehour thead  { background: var(--onehour-yellow); }
.dmr-table.brand-bfp thead      { background: var(--bfp-blue); }

/* Inline status badges in tables */
.table-badge {
  display: inline-block;
  padding: .125rem .5rem;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.table-badge.badge-green  { background: #c6f6d5; color: #276749; }
.table-badge.badge-red    { background: #fed7d7; color: #9b2c2c; }
.table-badge.badge-yellow { background: #fefcbf; color: #975a16; }
.table-badge.badge-blue   { background: #bee3f8; color: #2a4365; }
.table-badge.badge-gray   { background: #e2e8f0; color: #4a5568; }

/* ---------------------------------------------------------
   5. Chart Containers
   --------------------------------------------------------- */
.chart-container {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  margin-bottom: 1.5rem;
}

.chart-container-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-default);
}

.chart-container-header h3 {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.chart-container canvas {
  max-height: 22rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
  font-size: .75rem;
  color: var(--text-secondary);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.chart-legend-swatch {
  width: .75rem;
  height: .75rem;
  border-radius: .125rem;
  flex-shrink: 0;
}

/* Chart size variants */
.chart-sm canvas { max-height: 12rem; }
.chart-lg canvas { max-height: 30rem; }

/* Charts grid layout */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .chart-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------
   6. Scoreboard / Leaderboard
   --------------------------------------------------------- */
.scoreboard {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.scoreboard-header {
  background: var(--dmr-navy);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scoreboard-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.scoreboard-row {
  display: flex;
  align-items: center;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  transition: background .15s;
}

.scoreboard-row:last-child { border-bottom: none; }
.scoreboard-row:hover      { background: var(--surface-muted); }

/* Top 3 highlight rows */
.scoreboard-row.rank-1 { background: linear-gradient(90deg, var(--rank-gold-bg) 0%, var(--surface-primary) 60%); }
.scoreboard-row.rank-2 { background: linear-gradient(90deg, var(--rank-silver-bg) 0%, var(--surface-primary) 60%); }
.scoreboard-row.rank-3 { background: linear-gradient(90deg, var(--rank-bronze-bg) 0%, var(--surface-primary) 60%); }

/* Rank badge */
.rank-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: .75rem;
  border: 2px solid transparent;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #f6e05e, #d69e2e);
  color: #744210;
  border-color: #d69e2e;
  box-shadow: 0 0 8px rgba(214,158,46,.35);
}

.rank-badge.silver {
  background: linear-gradient(135deg, #e2e8f0, #a0aec0);
  color: #2d3748;
  border-color: #a0aec0;
  box-shadow: 0 0 8px rgba(160,174,192,.35);
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #fbd38d, #c05621);
  color: #fff;
  border-color: #c05621;
  box-shadow: 0 0 8px rgba(192,86,33,.3);
}

.rank-badge.default {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.scoreboard-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard-name small {
  display: block;
  font-weight: 400;
  font-size: .75rem;
  color: var(--text-muted);
}

.scoreboard-stat {
  text-align: right;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--dmr-navy);
  white-space: nowrap;
  margin-left: 1rem;
}

.scoreboard-stat small {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
}

/* Podium display (optional hero view) */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: .75rem;
  padding: 2rem 1rem 1rem;
}

.podium-place {
  text-align: center;
  flex: 0 1 8rem;
}

.podium-bar {
  border-radius: .375rem .375rem 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: .75rem;
  font-weight: 700;
  font-size: 1.5rem;
}

.podium-place.first  .podium-bar { height: 8rem;  background: linear-gradient(180deg, #f6e05e, #d69e2e); color: #744210; }
.podium-place.second .podium-bar { height: 6rem;  background: linear-gradient(180deg, #e2e8f0, #a0aec0); color: #2d3748; }
.podium-place.third  .podium-bar { height: 4.5rem; background: linear-gradient(180deg, #fbd38d, #c05621); color: #fff; }

.podium-name {
  margin-top: .5rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   7. Form Styling - Daily Entry
   --------------------------------------------------------- */
.dmr-form {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-default);
}

.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--dmr-navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-section-title i {
  color: var(--dmr-gold);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .form-grid { grid-template-columns: repeat(3, 1fr); }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label,
.form-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-secondary);
  margin-bottom: .3rem;
}

.form-group input,
.form-group select,
.form-group textarea,
.dmr-input {
  width: 100%;
  padding: .5rem .75rem;
  font-size: .875rem;
  border: 1px solid var(--border-default);
  border-radius: .375rem;
  background: var(--surface-primary);
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.dmr-input:focus {
  border-color: var(--dmr-navy-light);
  box-shadow: 0 0 0 3px rgba(44,82,130,.12);
}

.form-group input:disabled,
.form-group select:disabled,
.dmr-input:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-group input.error,
.dmr-input.error {
  border-color: var(--dmr-red);
  box-shadow: 0 0 0 3px rgba(229,62,62,.1);
}

.form-error {
  font-size: .75rem;
  color: var(--dmr-red);
  margin-top: .2rem;
}

.form-hint {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Currency / numeric input prefix */
.input-currency-wrap {
  position: relative;
}

.input-currency-wrap::before {
  content: '$';
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .875rem;
  pointer-events: none;
}

.input-currency-wrap input {
  padding-left: 1.5rem;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: .375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--dmr-navy);
  color: #fff;
}
.btn-primary:hover { background: var(--dmr-navy-light); }

.btn-gold {
  background: var(--dmr-gold);
  color: #fff;
}
.btn-gold:hover { background: var(--dmr-gold-light); color: #744210; }

.btn-success {
  background: var(--dmr-green);
  color: #fff;
}
.btn-success:hover { background: #2f855a; }

.btn-danger {
  background: var(--dmr-red);
  color: #fff;
}
.btn-danger:hover { background: #c53030; }  /* platform danger red, not brand */

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--surface-muted); color: var(--text-primary); }

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.75rem; font-size: 1rem; }

.btn-block { display: flex; width: 100%; }

/* Brand accent buttons */
.btn-sparky   { background: var(--sparky-red);   color: #fff; }
.btn-sparky:hover { background: #9B0C22; }

.btn-onehour  { background: var(--onehour-yellow);  color: #1a202c; }
.btn-onehour:hover { background: #E6B327; }

.btn-bfp      { background: var(--bfp-blue);      color: #fff; }
.btn-bfp:hover { background: #002B75; }

/* ---------------------------------------------------------
   8. Modal Overlays
   --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.modal-overlay.active,
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface-primary);
  border-radius: .5rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(.95) translateY(.5rem);
  transition: transform .25s var(--ease-spring);
  overflow: hidden;
}

.modal-overlay.active .modal,
.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 48rem; }
.modal-sm { max-width: 24rem; }

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  transition: color .15s;
}

.modal-close:hover { color: var(--dmr-red); }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-default);
  background: var(--surface-secondary);
}

/* Confirmation dialog */
.modal-confirm .modal-body {
  text-align: center;
  padding: 2rem 1.5rem;
}

.modal-confirm .modal-body i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--dmr-gold);
}

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

.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  background: var(--text-primary);
  color: #fff;
  border-radius: .5rem;
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  max-width: 24rem;
  pointer-events: auto;
  transform: translateY(1rem);
  opacity: 0;
  transition: all .3s var(--ease-out);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success { background: var(--dmr-green); }
.toast.toast-error   { background: var(--dmr-red); }
.toast.toast-warning { background: var(--dmr-orange); }
.toast.toast-info    { background: var(--dmr-navy); }

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: .25rem;
  margin-left: auto;
  font-size: .875rem;
  transition: color .15s;
}

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

/* Legacy single-toast support (from index.html #toast) */
#toast.show {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

/* ---------------------------------------------------------
   10. Navigation
   --------------------------------------------------------- */
/* Active nav link */
#nav-links a,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .75rem;
  border-radius: .375rem;
  font-size: .8125rem;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: color .15s, background .15s;
  cursor: pointer;
}

#nav-links a:hover,
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

#nav-links a.active,
.nav-link.active {
  color: var(--dmr-gold);
  background: rgba(214,158,46,.1);
}

/* Mobile nav */
#mobile-nav-links a,
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border-radius: .375rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s;
}

#mobile-nav-links a:hover,
.mobile-nav-link:hover {
  background: rgba(255,255,255,.08);
}

#mobile-nav-links a.active,
.mobile-nav-link.active {
  color: var(--dmr-gold);
  background: rgba(214,158,46,.1);
}

/* Mobile menu toggle animation */
#mobile-menu-btn {
  transition: transform .2s;
}

#mobile-menu-btn.open {
  transform: rotate(90deg);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--dmr-navy-light);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-sep::before {
  content: '/';
  margin: 0 .15rem;
}

/* ---------------------------------------------------------
   11. Loading Spinners
   --------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-default);
  border-top-color: var(--dmr-navy);
  border-radius: 50%;
  animation: spinRotate .7s linear infinite;
}

.spinner-sm { width: 1.25rem; height: 1.25rem; border-width: 2px; }
.spinner-lg { width: 3rem;    height: 3rem;    border-width: 4px; }

.spinner-gold  { border-top-color: var(--dmr-gold); }
.spinner-white { border-color: rgba(255,255,255,.25); border-top-color: #fff; }

@keyframes spinRotate {
  to { transform: rotate(360deg); }
}

/* Full page loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  gap: 1rem;
}

.loading-overlay .spinner {
  width: 3rem;
  height: 3rem;
  border-width: 4px;
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
}

/* Skeleton loading placeholders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, #e8ecf1 37%, var(--surface-muted) 63%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  border-radius: .25rem;
}

.skeleton-text {
  height: .875rem;
  margin-bottom: .5rem;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  height: 6rem;
  border-radius: .5rem;
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dot pulse loader */
.dot-pulse {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
}

.dot-pulse span {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--dmr-navy);
  animation: dotBounce .6s ease-in-out infinite alternate;
}

.dot-pulse span:nth-child(2) { animation-delay: .2s; }
.dot-pulse span:nth-child(3) { animation-delay: .4s; }

@keyframes dotBounce {
  from { opacity: .3; transform: translateY(0); }
  to   { opacity: 1;  transform: translateY(-.35rem); }
}

/* ---------------------------------------------------------
   12. Tab Navigation
   --------------------------------------------------------- */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-default);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.tab-nav-item {
  padding: .6rem 1.25rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.tab-nav-item:hover {
  color: var(--text-primary);
}

.tab-nav-item.active {
  color: var(--dmr-navy);
  border-bottom-color: var(--dmr-gold);
}

/* Pill-style tabs */
.tab-pills {
  display: inline-flex;
  background: var(--surface-muted);
  border-radius: .5rem;
  padding: .2rem;
  gap: .15rem;
  margin-bottom: 1.25rem;
}

.tab-pill {
  padding: .4rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  border-radius: .375rem;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}

.tab-pill:hover { color: var(--text-primary); }

.tab-pill.active {
  background: var(--surface-primary);
  color: var(--dmr-navy);
  box-shadow: var(--shadow-sm);
}

/* Tab content panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn .25s var(--ease-out);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(.35rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   13. Animated Transitions
   --------------------------------------------------------- */
/* Page transition wrapper */
.page-enter {
  animation: pageEnter .35s var(--ease-out) both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-exit {
  animation: pageExit .2s var(--ease-out) both;
}

@keyframes pageExit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-.5rem); }
}

/* Fade */
.fade-in  { animation: fadeIn .3s var(--ease-out) both; }
.fade-out { animation: fadeOut .2s var(--ease-out) both; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Slide variants */
.slide-up    { animation: slideUp .3s var(--ease-out) both; }
.slide-down  { animation: slideDown .3s var(--ease-out) both; }
.slide-left  { animation: slideLeft .3s var(--ease-out) both; }
.slide-right { animation: slideRight .3s var(--ease-out) both; }

@keyframes slideUp    { from { opacity: 0; transform: translateY(1rem); }  to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown  { from { opacity: 0; transform: translateY(-1rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft  { from { opacity: 0; transform: translateX(1rem); }  to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-1rem); } to { opacity: 1; transform: translateX(0); } }

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  animation: slideUp .35s var(--ease-out) forwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: .03s; }
.stagger-children > *:nth-child(2)  { animation-delay: .06s; }
.stagger-children > *:nth-child(3)  { animation-delay: .09s; }
.stagger-children > *:nth-child(4)  { animation-delay: .12s; }
.stagger-children > *:nth-child(5)  { animation-delay: .15s; }
.stagger-children > *:nth-child(6)  { animation-delay: .18s; }
.stagger-children > *:nth-child(7)  { animation-delay: .21s; }
.stagger-children > *:nth-child(8)  { animation-delay: .24s; }
.stagger-children > *:nth-child(9)  { animation-delay: .27s; }
.stagger-children > *:nth-child(10) { animation-delay: .30s; }
.stagger-children > *:nth-child(11) { animation-delay: .33s; }
.stagger-children > *:nth-child(12) { animation-delay: .36s; }

/* Pulse highlight (use on newly updated values) */
.pulse-highlight {
  animation: pulseHighlight .8s ease-out;
}

@keyframes pulseHighlight {
  0%   { background-color: rgba(214,158,46,.25); }
  100% { background-color: transparent; }
}

/* Scale pop (use on click feedback) */
.scale-pop {
  animation: scalePop .3s var(--ease-spring);
}

@keyframes scalePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Number count-up visual hint */
.count-up {
  display: inline-block;
  animation: countUpReveal .4s var(--ease-out) both;
}

@keyframes countUpReveal {
  from { opacity: 0; transform: translateY(.3rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   14. Custom Scrollbars
   --------------------------------------------------------- */
/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: .5rem;
  height: .5rem;
}

::-webkit-scrollbar-track {
  background: var(--surface-muted);
  border-radius: .25rem;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: .25rem;
  border: 1px solid var(--surface-muted);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--surface-muted);
}

/* Thin scrollbar for table wraps and tab navs */
.dmr-table-wrap::-webkit-scrollbar,
.tab-nav::-webkit-scrollbar {
  height: .35rem;
}

/* ---------------------------------------------------------
   15. Brand Color Accent Utilities
   --------------------------------------------------------- */
/* Border-left accent bars */
.accent-sparky   { border-left: 4px solid var(--sparky-red) !important; }
.accent-onehour  { border-left: 4px solid var(--onehour-yellow) !important; }
.accent-bfp      { border-left: 4px solid var(--bfp-blue) !important; }
.accent-gold     { border-left: 4px solid var(--dmr-gold) !important; }

/* Background tints */
.bg-sparky-tint   { background-color: #FDE8EC; }
.bg-onehour-tint  { background-color: #FFF8E1; }
.bg-bfp-tint      { background-color: #E3EDFA; }

/* Text brand colors */
.text-sparky   { color: var(--sparky-red); }
.text-onehour  { color: var(--onehour-yellow); }
.text-bfp      { color: var(--bfp-blue); }
.text-gold     { color: var(--dmr-gold); }
.text-green    { color: var(--dmr-green); }
.text-red      { color: var(--dmr-red); }

/* Brand dot indicators */
.brand-dot {
  display: inline-block;
  width: .625rem;
  height: .625rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-dot.sparky   { background: var(--sparky-red); }
.brand-dot.onehour  { background: var(--onehour-yellow); }
.brand-dot.bfp      { background: var(--bfp-blue); }

/* Brand header stripe (full-width thin bar) */
.brand-stripe {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

.brand-stripe.sparky  { background: var(--sparky-red); }
.brand-stripe.onehour { background: var(--onehour-yellow); }
.brand-stripe.bfp     { background: var(--bfp-blue); }

.brand-stripe.multi {
  background: linear-gradient(90deg,
    var(--sparky-red) 0%, var(--sparky-red) 33.33%,
    var(--onehour-yellow) 33.33%, var(--onehour-yellow) 66.66%,
    var(--bfp-blue) 66.66%, var(--bfp-blue) 100%
  );
}

/* ---------------------------------------------------------
   16. Utility Helpers
   --------------------------------------------------------- */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.cursor-pointer { cursor: pointer; }

.divider {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: 1rem 0;
}

/* Responsive hide / show */
.hide-mobile  { display: none; }
.show-mobile  { display: block; }

@media (min-width: 768px) {
  .hide-mobile  { display: block; }
  .show-mobile  { display: none; }
  .hide-desktop { display: none; }
}

/* ---------------------------------------------------------
   17. Progress Bar
   --------------------------------------------------------- */
.progress-bar {
  width: 100%;
  height: .5rem;
  background: var(--surface-muted);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--dmr-navy);
  transition: width .4s var(--ease-out);
}

.progress-bar-fill.green  { background: var(--dmr-green); }
.progress-bar-fill.gold   { background: var(--dmr-gold); }
.progress-bar-fill.red    { background: var(--dmr-red); }
.progress-bar-fill.orange { background: var(--dmr-orange); }

.progress-bar.lg { height: .75rem; }

/* Gauge / target tracker */
.target-gauge {
  position: relative;
  padding: .75rem 0;
}

.target-gauge-label {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.target-gauge-value {
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   18. Tooltip
   --------------------------------------------------------- */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  z-index: 50;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + .5rem);
  transform: translateX(-50%) translateY(.25rem);
  padding: .35rem .65rem;
  font-size: .75rem;
  font-weight: 500;
  color: #fff;
  background: var(--text-primary);
  border-radius: .25rem;
  white-space: nowrap;
  max-width: 16rem;
}

[data-tooltip]::after {
  content: '';
  bottom: calc(100% + .2rem);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
}

[data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------
   19. Avatar / User Initials
   --------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  background: var(--dmr-navy);
  color: #fff;
  font-size: .75rem;
  width: 2rem;
  height: 2rem;
}

.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: .625rem; }
.avatar-lg { width: 2.75rem; height: 2.75rem; font-size: 1rem; }

.avatar.sparky  { background: var(--sparky-red); }
.avatar.onehour { background: var(--onehour-yellow); }
.avatar.bfp     { background: var(--bfp-blue); }

/* ---------------------------------------------------------
   20. Empty / Zero State
   --------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}

.empty-state p {
  font-size: .875rem;
  max-width: 24rem;
  margin: 0 auto;
}

/* ---------------------------------------------------------
   21. Print Styles
   --------------------------------------------------------- */
@media print {
  /* Reset layout */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
    line-height: 1.4;
  }

  /* Hide interactive / non-print elements */
  #main-nav,
  #mobile-menu,
  #mobile-menu-btn,
  .toast-container,
  #toast,
  .modal-overlay,
  .loading-overlay,
  .btn,
  .tab-nav,
  .tab-pills,
  button,
  .no-print {
    display: none !important;
  }

  /* Full width */
  #app,
  .max-w-7xl {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Cards flatten */
  .stat-card,
  .panel,
  .chart-container,
  .dmr-form,
  .scoreboard {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Table styles for print */
  .dmr-table thead {
    background: #1e3a5f !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .dmr-table tbody tr:nth-child(even) {
    background: #f7fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .dmr-table {
    font-size: 9pt;
  }

  /* Charts - show at reasonable size */
  .chart-container canvas {
    max-height: 18rem;
  }

  /* Rank badges keep color */
  .rank-badge.gold,
  .rank-badge.silver,
  .rank-badge.bronze {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Brand stripe keep color */
  .brand-stripe {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Report header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #1e3a5f;
  }

  .print-header h1 {
    font-size: 16pt;
    color: #1e3a5f;
    margin: 0;
  }

  .print-header p {
    font-size: 9pt;
    color: #666;
  }

  /* Page breaks */
  .page-break {
    page-break-before: always;
    break-before: page;
  }

  .no-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Links show URL */
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 8pt;
    color: #666;
  }

  a.no-print-url::after {
    content: none;
  }

  /* Print footer */
  @page {
    margin: 1.5cm;
    size: landscape;
  }

  /* Scoreboard rows stay visible */
  .scoreboard-row {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------------------------------------------------------
   22. Responsive Breakpoint Adjustments
   --------------------------------------------------------- */

/* Small (max 639px) - mobile-first base is handled by defaults above */
@media (max-width: 639px) {
  .stat-card-value {
    font-size: 1.5rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }

  .scoreboard-row {
    padding: .6rem .75rem;
  }

  .scoreboard-stat {
    font-size: 1rem;
  }

  .modal {
    margin: .5rem;
    max-height: 95vh;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .podium {
    padding: 1.5rem .5rem .5rem;
  }

  .podium-place.first  .podium-bar { height: 5rem; }
  .podium-place.second .podium-bar { height: 4rem; }
  .podium-place.third  .podium-bar { height: 3rem; }

  .chart-container canvas {
    max-height: 16rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    max-width: 100%;
  }
}

/* Medium (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large (1024px+) */
@media (min-width: 1024px) {
  .form-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .chart-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------
   23. Service Titan Integration Status
   --------------------------------------------------------- */
.integration-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
}

.integration-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.integration-dot.connected    { background: var(--dmr-green);  box-shadow: 0 0 6px rgba(56,161,105,.5); }
.integration-dot.disconnected { background: var(--dmr-red);    box-shadow: 0 0 6px rgba(229,62,62,.4); }
.integration-dot.syncing      { background: var(--dmr-gold);   animation: syncPulse 1s ease-in-out infinite; }

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ---------------------------------------------------------
   24. Date Picker & Filter Bar
   --------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
}

.filter-bar label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.filter-bar select,
.filter-bar input[type="date"] {
  padding: .35rem .6rem;
  font-size: .8125rem;
  border: 1px solid var(--border-default);
  border-radius: .375rem;
  background: var(--surface-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s;
}

.filter-bar select:focus,
.filter-bar input[type="date"]:focus {
  border-color: var(--dmr-navy-light);
  box-shadow: 0 0 0 2px rgba(44,82,130,.1);
}

/* ---------------------------------------------------------
   25. Technician Portal Cards
   --------------------------------------------------------- */
.tech-card {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: .5rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .15s, transform .15s;
}

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

.tech-card-info {
  flex: 1;
  min-width: 0;
}

.tech-card-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: .9375rem;
}

.tech-card-role {
  font-size: .75rem;
  color: var(--text-muted);
}

.tech-card-stats {
  display: flex;
  gap: 1rem;
  margin-top: .5rem;
}

.tech-card-stat {
  font-size: .75rem;
  color: var(--text-secondary);
}

.tech-card-stat strong {
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   26. Notification Badge (nav)
   --------------------------------------------------------- */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 .3rem;
  font-size: .625rem;
  font-weight: 700;
  color: #fff;
  background: var(--dmr-red);
  border-radius: 9999px;
  line-height: 1;
}

/* ---------------------------------------------------------
   27. Drag Handle / Sortable Rows
   --------------------------------------------------------- */
.drag-handle {
  cursor: grab;
  color: var(--border-strong);
  padding: .25rem;
  transition: color .15s;
}

.drag-handle:hover { color: var(--text-secondary); }
.drag-handle:active { cursor: grabbing; }

.dragging {
  opacity: .5;
  outline: 2px dashed var(--dmr-gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   28. Focus Visible (accessibility)
   --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--dmr-gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* High-contrast link underlines on focus */
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
