/* ============================================
   Mechanical Marauders Team 271 — Brand CSS
   ============================================ */

/* --- Font Face --- */
@font-face {
  font-family: 'BankGothic Md BT';
  src: url('/fonts/BankGothicMdBT.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- Custom Properties --- */
:root {
  --mm-black: #272B2D;
  --mm-yellow: #FFDA29;
  --mm-maroon: #7F1F26;
  --mm-white: #FFFFFF;
  --mm-periscope: #46444C;
  --mm-green-essence: #E9EAC8;
  --mm-blue-atoll: #00B1D2;
  --mm-mid-gray: #6B7280;
  --mm-light-gray: #F3F4F6;
  --mm-border-gray: #E5E7EB;
  --mm-yellow-soft: #FFF4BF;

  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-warning-bg: var(--mm-yellow-soft);
  --color-danger: var(--mm-maroon);
  --color-danger-bg: #fce4e4;

  --font-heading: 'BankGothic Md BT', 'Arial Black', Impact, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);

  --sidebar-width: 220px;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--mm-periscope);
  background: var(--mm-light-gray);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--mm-black);
  letter-spacing: 0.02em;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.25rem; margin-bottom: 0.5rem; }

a { color: var(--mm-blue-atoll); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  background: var(--mm-black);
  color: var(--mm-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
}

.header-accent {
  height: 4px;
  background: var(--mm-yellow);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.brand-team {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--mm-yellow);
  margin-left: 0.75rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

a.user-display {
  color: inherit;
  text-decoration: none;
}

a.user-display:hover {
  text-decoration: underline;
}

.user-role {
  color: var(--mm-mid-gray);
  text-transform: capitalize;
}

/* --- Layout --- */
.app-container {
  display: flex;
  min-height: calc(100vh - 60px);
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1600px;
  width: 100%;
}

/* --- Sidebar Nav --- */
.sidebar-nav {
  width: var(--sidebar-width);
  background: var(--mm-white);
  border-right: 1px solid var(--mm-border-gray);
  padding: 1rem 0;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  background: var(--mm-black);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-md);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--mm-yellow);
  border-radius: 1px;
}

.nav-list {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--mm-periscope);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--mm-light-gray);
  color: var(--mm-black);
  text-decoration: none;
}

.nav-divider {
  height: 1px;
  background: var(--mm-border-gray);
  margin: 0.5rem 1.25rem;
}
.nav-section-label {
  padding: 0.25rem 1.25rem 0.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mm-mid-gray);
  list-style: none;
}
.role-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.role-badges .badge { font-size: 0.75rem; }

/* --- Flash Messages --- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  transition: opacity 0.3s;
  position: relative;
  padding-right: 2.5rem;
}

.flash-close {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0 0.25rem;
  line-height: 1;
}

.flash-close:hover { opacity: 1; }

.flash-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.flash-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.flash-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* --- Cards --- */
.card {
  background: var(--mm-white);
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card > h2:first-child,
.card > div:first-child:has(> h2:first-child) {
  background: var(--mm-maroon);
  color: var(--mm-white);
  margin: -1.25rem -1.25rem 1rem -1.25rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 1.3rem;
}

.card > div:first-child:has(> h2:first-child) h2 {
  color: var(--mm-white);
  margin: 0;
  font-size: 1.3rem;
}

.card > h2:first-child .btn,
.card > div:first-child:has(> h2:first-child) .btn {
  background: transparent;
  color: var(--mm-white);
  border: 1px solid rgba(255,255,255,0.4);
}

.card > h2:first-child .btn:hover,
.card > div:first-child:has(> h2:first-child) .btn:hover {
  background: rgba(255,255,255,0.15);
}

.card > h2:first-child .badge,
.card > div:first-child:has(> h2:first-child) .badge {
  font-size: 0.7rem;
  line-height: 1.2;
}

.card > h2:first-child .badge-success { color: var(--color-success); }
.card > h2:first-child .badge-warning { color: #92400e; }
.card > h2:first-child .badge-danger { color: var(--color-danger); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* --- Form Tabs --- */
.form-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--mm-border-gray);
  margin-bottom: 1rem;
}
.form-tabs button {
  padding: 0.5rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--mm-mid-gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.form-tabs button:hover { color: var(--mm-black); }
.form-tabs button.active {
  color: var(--mm-maroon);
  border-bottom-color: var(--mm-maroon);
  font-weight: 600;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.summary-card {
  background: var(--mm-white);
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--mm-mid-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--mm-black);
  margin-bottom: 0.5rem;
}

.summary-link {
  font-size: 0.85rem;
}

/* --- Box Cards (Fundraising) --- */
.box-card {
  padding: 0;
  overflow: hidden;
}

.box-card-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--mm-light-gray);
  border-bottom: 1px solid var(--mm-border-gray);
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.box-card-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.box-card-title strong {
  font-size: 0.95rem;
  color: var(--mm-black);
}

.box-card-stats-inline {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--mm-periscope);
  margin-left: auto;
}

.box-card-stats-inline span {
  white-space: nowrap;
}

.box-card-actions {
  padding: 0.4rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  border-top: 1px solid var(--mm-border-gray);
}

/* Compact inline form for box actions: label + input(s) + button on one line */
.box-inline-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.box-field-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mm-mid-gray);
  white-space: nowrap;
}

.box-field-input {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--mm-periscope);
  background: var(--mm-white);
  min-width: 0;
  width: auto;
}

select.box-field-input {
  max-width: 180px;
}

.box-field-narrow {
  width: 80px;
}

.box-field-input:focus {
  outline: none;
  border-color: var(--mm-blue-atoll);
  box-shadow: 0 0 0 2px rgba(0, 177, 210, 0.15);
}

.box-labeled-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.box-field-hint {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--mm-mid-gray);
  line-height: 1;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--mm-black);
  color: var(--mm-white);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius) 0 0; }

thead th[data-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
}

thead th[data-sort]::after {
  content: '⇅';
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.4;
}

thead th[data-sort].sort-asc::after {
  content: '▲';
  opacity: 0.9;
}

thead th[data-sort].sort-desc::after {
  content: '▼';
  opacity: 0.9;
}

tbody tr { border-bottom: 1px solid var(--mm-border-gray); }
tbody tr:nth-child(even) { background: var(--mm-light-gray); }
tbody tr:hover { background: var(--mm-yellow-soft); }
tr[onclick] { cursor: pointer; }

tbody td,
tfoot td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
}

td.nowrap, th.nowrap { white-space: nowrap; }
table.table-compact { font-size: 0.82rem; }
table.table-compact thead th { font-size: 0.72rem; padding: 0.5rem 0.5rem; }
table.table-compact tbody td, table.table-compact tfoot td { padding: 0.45rem 0.5rem; }

.past-due { color: var(--mm-red); font-weight: 600; }
.due-soon { color: #b45309; font-weight: 600; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  gap: 0.4rem;
}

.btn:hover { opacity: 0.9; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--mm-blue-atoll); outline-offset: 2px; }

.btn-primary {
  background: var(--mm-yellow);
  color: var(--mm-black);
}

.btn-secondary {
  background: var(--mm-light-gray);
  color: var(--mm-periscope);
  border: 1px solid var(--mm-border-gray);
}

.btn-danger {
  background: var(--mm-maroon);
  color: var(--mm-white);
}

.btn-warning {
  background: var(--mm-yellow);
  color: var(--mm-black);
}

.btn-success {
  background: var(--color-success);
  color: var(--mm-white);
}

.btn-ghost {
  background: transparent;
  color: var(--mm-white);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

.btn-block { width: 100%; }

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--mm-black);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--mm-periscope);
  background: var(--mm-white);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--mm-blue-atoll);
  box-shadow: 0 0 0 3px rgba(0, 177, 210, 0.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.inline-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.inline-form-row .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 120px;
}
.inline-form-row .btn {
  align-self: flex-end;
  margin-bottom: 0;
  white-space: nowrap;
  /* force buttons to exactly match input height:
     input = 0.5rem pad + 1px border + 0.9rem font * 1.5 line-height
     so button needs same padding, border, font-size, line-height */
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
/* preserve visible border on secondary buttons */
.inline-form-row .btn-secondary {
  border-color: var(--mm-border-gray);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.inline-form { display: inline; margin: 0; padding: 0; }

.form-fieldset {
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.25rem;
  margin-bottom: 1rem;
  background: var(--mm-white);
}

.form-fieldset legend {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--mm-blue-atoll);
  padding: 0 0.5rem;
  letter-spacing: 0.01em;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--mm-light-gray);
  border-radius: var(--radius);
  border: 1px solid var(--mm-border-gray);
}

.checkbox-group--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row .inline-select {
  margin-left: 0.25rem;
}

.inline-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius);
  font-size: 0.85rem;
  width: auto;
  background: var(--mm-white);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.badge-warning {
  background: var(--color-warning-bg);
  color: #92400e;
}

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

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-muted {
  background: var(--mm-light-gray);
  color: var(--mm-mid-gray);
}

.badge-neutral {
  background: var(--mm-light-gray);
  color: var(--mm-mid-gray);
}

.badge-toggle {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

/* --- Detail Grid (profile/show pages) --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0;
}

.detail-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--mm-border-gray);
}

.detail-item:nth-last-child(-n+2) { border-bottom: none; }
.detail-item--full:last-child { border-bottom: none; }

.detail-item--full {
  grid-column: 1 / -1;
}

.detail-item dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mm-mid-gray);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.detail-item dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--mm-black);
}

@media (max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-last-child(2) { border-bottom: 1px solid var(--mm-border-gray); }
}

/* --- Utility --- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--mm-mid-gray); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

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

.section { margin-bottom: 2rem; }

/* --- Login Page --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-card {
  background: var(--mm-white);
  border: 1px solid var(--mm-border-gray);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--mm-black);
  margin-bottom: 0;
}

.login-subtitle {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--mm-yellow);
  background: var(--mm-black);
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.login-form { text-align: left; }
.login-form .btn { margin-top: 0.5rem; }

/* --- Error Pages --- */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 4rem;
  color: var(--mm-maroon);
  margin-bottom: 0.5rem;
}

.error-page p {
  font-size: 1.1rem;
  color: var(--mm-mid-gray);
  margin-bottom: 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100vh;
    z-index: 150;
    transition: left 0.25s ease;
    padding-top: 4rem;
    box-shadow: var(--shadow-md);
  }

  .sidebar-nav.open {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .main-content {
    padding: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .header-bar {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }

  .header-user {
    font-size: 0.75rem;
  }

  .inline-form-row {
    flex-direction: column;
  }

  .box-card-stats-inline {
    margin-left: 0;
    width: 100%;
  }

  .box-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .box-inline-form {
    width: 100%;
  }

  select.box-field-input {
    max-width: 100%;
    flex: 1;
  }

  .inline-form-row .form-group {
    min-width: 100%;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
}

/* --- Large screens (1920px+) --- */
@media (min-width: 1920px) {
  .main-content {
    max-width: 1800px;
    padding: 2rem;
  }

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

  .detail-item:nth-last-child(-n+3) { border-bottom: none; }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .form-row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* --- 4K / Ultra-wide (2560px+) --- */
@media (min-width: 2560px) {
  .main-content {
    max-width: 2200px;
    padding: 2.5rem;
  }

  html { font-size: 18px; }

  .detail-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .detail-item:nth-last-child(-n+4) { border-bottom: none; }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .card { padding: 1.75rem; }

  table { font-size: 1rem; }
  thead th { font-size: 0.85rem; padding: 0.75rem 1rem; }
  tbody td, tfoot td { padding: 0.75rem 1rem; }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  /* Hide non-essential UI */
  .sidebar-nav,
  .nav-toggle,
  .flash-messages,
  .btn,
  button,
  form,
  .page-header .flex,
  .no-print {
    display: none !important;
  }

  /* Show all tab panes when printing, hide tab bar */
  .form-tabs { display: none !important; }
  .tab-pane { display: block !important; }

  /* Full-width content */
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 11pt !important;
  }

  /* Show page header title */
  .page-header {
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }

  .page-header h1 {
    color: black !important;
    font-size: 18pt !important;
  }

  /* Tables */
  .table-wrapper {
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
  }

  thead th {
    background: #eee !important;
    color: black !important;
    border: 1px solid #999 !important;
    padding: 4px 6px !important;
    font-size: 8pt !important;
  }

  tbody td,
  tfoot td {
    border: 1px solid #ccc !important;
    padding: 3px 6px !important;
  }

  tbody tr:nth-child(even) {
    background: #f5f5f5 !important;
  }

  /* Badges — simplify to bordered text */
  .badge, .status-badge {
    background: transparent !important;
    color: black !important;
    border: 1px solid #999 !important;
    padding: 1px 4px !important;
    font-size: 8pt !important;
  }

  /* Summary cards (report/dashboard cards) */
  .card-grid {
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
  }

  .summary-card {
    border: 1px solid #999 !important;
    background: white !important;
    padding: 0.5rem !important;
    flex: 1 !important;
    box-shadow: none !important;
  }

  .summary-value {
    color: black !important;
    font-size: 14pt !important;
  }

  .summary-label {
    color: #333 !important;
    font-size: 9pt !important;
  }

  /* Detail grids */
  .detail-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .detail-item {
    border-color: #ccc !important;
  }

  /* Cards */
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: white !important;
    page-break-inside: avoid;
  }

  /* Box cards — hide actions, show info only */
  .box-card-actions { display: none !important; }
  .box-card-header { background: #f5f5f5 !important; }

  /* Page break hints */
  h2, h3 { page-break-after: avoid; }
  tr { page-break-inside: avoid; }

  /* Links — show URL for external, plain for internal */
  a { color: black !important; text-decoration: none !important; }

  .text-danger { color: #c00 !important; }
}
