/*
 * AGRO MANAGER — Main Stylesheet
 * Professional dark theme with Bootstrap 5 customization
 */

/* ── Google Font ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ───────────────────────────────────────────────────────── */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --success: #16a34a;
  --success-light: #22c55e;
  --warning: #d97706;
  --warning-light: #f59e0b;
  --danger: #dc2626;
  --danger-light: #ef4444;
  --info: #0891b2;

  /* Dark sidebar */
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f1f5f9;
  --sidebar-active-bg: #1e3a5f;
  --sidebar-active-text: #60a5fa;
  --sidebar-width: 260px;

  /* Main content */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  /* Activity colors */
  --olives: #84cc16;
  --cars: #f97316;
  --grapes: #a855f7;
  --other: #06b6d4;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);

  --radius: 10px;
  --radius-lg: 16px;
  --transition: 200ms ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
  transition: transform var(--transition);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: .875rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.sidebar-logo-sub {
  font-size: .7rem;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-section {
  padding: 1rem 0 .5rem;
}
.sidebar-section-title {
  padding: 0 1rem .4rem;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-text);
  opacity: .6;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  margin: 1px .5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 7px;
  font-size: .825rem;
  font-weight: 450;
  transition: background var(--transition), color var(--transition);
}
.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: var(--sidebar-text-hover);
}
.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.sidebar-link .badge-count {
  margin-left: auto;
  font-size: .65rem;
  background: rgba(239,68,68,.2);
  color: #f87171;
  padding: .15rem .45rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Activity color dots */
.dot-olives { color: var(--olives); }
.dot-cars { color: var(--cars); }
.dot-grapes { color: var(--grapes); }
.dot-other { color: var(--other); }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Page Content ─────────────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.5rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}
.card-header-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-body { padding: 1.25rem; }

/* Activity Cards — Dashboard */
.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.activity-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--ac-color, var(--primary));
}
.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: inherit;
  border-color: var(--ac-color, var(--primary));
}
.activity-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  background: color-mix(in srgb, var(--ac-color, var(--primary)) 12%, transparent);
  color: var(--ac-color, var(--primary));
}
.activity-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .75rem;
}
.activity-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 0;
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
}
.activity-stat:last-child { border-bottom: none; }
.activity-stat-label { color: var(--text-secondary); }
.activity-stat-value { font-weight: 600; color: var(--text-primary); }
.activity-stat-value.text-danger { color: var(--danger) !important; }
.activity-stat-value.text-success { color: var(--success) !important; }

/* Summary Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-card-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .15rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}
.data-table thead th {
  background: #f8fafc;
  padding: .65rem 1rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table thead th:hover { background: #f1f5f9; color: var(--text-primary); }
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table td {
  padding: .7rem 1rem;
  vertical-align: middle;
}
.data-table .text-right, .data-table .text-end { text-align: right; }
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 500; }
.data-table .amount { font-weight: 600; color: var(--text-primary); }
.data-table .amount-danger { font-weight: 600; color: var(--danger); }
.data-table .amount-success { font-weight: 600; color: var(--success); }

/* ── Badges / Status ─────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-paid { background: #dcfce7; color: #15803d; }
.status-partial { background: #fef9c3; color: #a16207; }
.status-unpaid { background: #fee2e2; color: #991b1b; }
.status-overdue { background: #fef2f2; color: var(--danger); }
.status-cancelled { background: #f1f5f9; color: var(--text-muted); }
.status-pending { background: #f1f5f9; color: var(--text-muted); }
.status-active { background: #dcfce7; color: #15803d; }
.status-inactive { background: #f1f5f9; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 7px;
  font-size: .8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-dark); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-sm { padding: .3rem .65rem; font-size: .75rem; border-radius: 6px; }
.btn-lg { padding: .6rem 1.25rem; font-size: .9rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border-dark);
  border-radius: 7px;
  font-size: .8125rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .72rem; color: var(--danger); margin-top: .3rem; }
.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-group { display: flex; flex-direction: column; gap: .25rem; }
.filter-label { font-size: .72rem; font-weight: 500; color: var(--text-muted); }
.filter-select, .filter-input {
  padding: .4rem .65rem;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font-size: .8rem;
  color: var(--text-primary);
  background: var(--bg-card);
  min-width: 120px;
}
.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: var(--primary);
}
.filter-search {
  flex: 1;
  min-width: 200px;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  font-size: .8rem;
}
.pagination-info { color: var(--text-muted); }
.pagination-links { display: flex; gap: .25rem; }
.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .78rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-card);
  transition: all var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .8125rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fefce8; border-color: #fde047; color: #854d0e; }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }

/* ── Messages ────────────────────────────────────────────────────────────── */
#messages-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 380px;
}
.message-toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .75rem 1rem;
  font-size: .8125rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: slideIn .2s ease;
}
.message-toast.success { border-left: 4px solid var(--success); }
.message-toast.error { border-left: 4px solid var(--danger); }
.message-toast.warning { border-left: 4px solid var(--warning); }
.message-toast.info { border-left: 4px solid var(--info); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── HTMX Loading ─────────────────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request.htmx-indicator { display: inline-flex; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-dark); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h5 { font-weight: 600; color: var(--text-secondary); }

/* ── Employee Card ───────────────────────────────────────────────────────── */
.employee-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ── Summary Box ─────────────────────────────────────────────────────────── */
.summary-box {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .8125rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total {
  font-weight: 700;
  font-size: .9rem;
  border-top: 2px solid var(--border-dark);
  padding-top: .75rem;
  margin-top: .25rem;
  border-bottom: none;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: .25rem;
  margin-bottom: 1.25rem;
}
.tab-link {
  padding: .6rem 1rem;
  font-size: .825rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.tab-link:hover { color: var(--text-primary); }
.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1100;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .activity-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .activity-grid { grid-template-columns: 1fr !important; }
  .page-content { padding: 1rem; }
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }
.amount-zero { color: var(--text-muted); font-weight: 500; }
.section-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

/* ── Mobile Overlay ──────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1050;
}
.sidebar-overlay.open { display: block; }

/* ── Activity grid ───────────────────────────────────────────────────────── */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* ── Debounce search ─────────────────────────────────────────────────────── */
[hx-trigger*="keyup"] { transition: opacity .15s; }


/* ==========================================================================
   Print Styles (PDF Export)
   ========================================================================== */
@media print {
  /* Hide sidebar, topbar, and unnecessary UI elements */
  .sidebar, .topbar, .mobile-header, .sidebar-overlay, .breadcrumb,
  .btn, form, .form-control, .form-label, select, input {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  /* Reset layout for printing */
  .app-wrapper {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  /* Expand cards to fill the page without shadows */
  .card, .stat-card {
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 2rem !important;
  }
  
  /* Ensure colors print correctly */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Page breaks */
  .table-container {
    page-break-inside: auto;
  }
  
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  
  thead {
    display: table-header-group;
  }
  
  tfoot {
    display: table-footer-group;
  }
  
  /* Make typography more print-friendly */
  body {
    font-size: 11pt;
    background: #fff;
    color: #000;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}
