@font-face {
  font-family: 'HU Custom Industry';
  src: url("/assets/hucustomindustry-webfont-ca36b89e.woff2") format('woff2'),
       url("/assets/hucustomindustry-webfont-da2126ce.woff") format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --hu-bg: #E8E0DB;
  --hu-accent: #f5a3bf;
  --hu-text: #000000;
  --hu-font-heading: 'HU Custom Industry', sans-serif;
  --hu-font-body: 'Archivo', sans-serif;
  --hu-sidebar-width: 240px;
}

body {
  background-color: var(--hu-bg);
  color: var(--hu-text);
  font-family: var(--hu-font-body);
  margin: 0;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hu-font-heading);
}

a:link, a:visited {
  color: var(--hu-text);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--hu-sidebar-width);
  height: 100vh;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 0;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #333;
}

.sidebar-brand img {
  max-width: 160px;
  height: auto;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background-color: #333;
  color: #ffffff;
}

.sidebar-nav li a.active {
  border-left: 3px solid var(--hu-accent);
  padding-left: calc(1.25rem - 3px);
}

.sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  padding: 1rem 1.25rem 0.3rem;
  margin-top: 0.25rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #333;
  font-size: 0.85rem;
}

.sidebar-footer a {
  color: #ccc;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #fff;
}

/* Mobile topbar (hidden on desktop) */
.mobile-topbar {
  display: none;
  background-color: #1a1a1a;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.mobile-topbar img {
  height: 28px;
  width: auto;
}

.mobile-topbar .burger {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

/* Main content */
.main-content {
  margin-left: var(--hu-sidebar-width);
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

/* Page header: title + action buttons */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Summary card rows need gap when stacked */
.row.gx-3 {
  --bs-gutter-y: 0.75rem;
}

/* Accent utilities */
.text-accent {
  color: var(--hu-accent);
}

.bg-accent {
  background-color: var(--hu-accent);
}

.btn-accent {
  background-color: var(--hu-accent);
  border-color: var(--hu-accent);
  color: #000;
}

.btn-accent:hover {
  background-color: #f08aaf;
  border-color: #f08aaf;
  color: #000;
}

/* Cards */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid #e0d8d3;
  font-family: var(--hu-font-heading);
}

/* Tables */
.table {
  --bs-table-bg: transparent;
}

.table .col-pct {
  width: 5ch;
}

/* Flash messages */
.flash-notice {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.flash-alert {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Login page (no sidebar) */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-card img {
  max-width: 200px;
  margin-bottom: 1.5rem;
}

/* Print: PDF-friendly layout */
@media print {
  @page {
    size: A4 portrait;
    margin: 1cm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
  }

  .sidebar,
  .sidebar-backdrop,
  .mobile-topbar,
  .page-actions,
  .flash-notice,
  .flash-alert,
  form .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
    min-height: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card-header {
    border-bottom: 1px solid #ccc;
  }

  h1, h2, h3, h4, h5, h6,
  table, tr, .row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1 { font-size: 18pt; }
  h2 { font-size: 15pt; }
  h3, h4, h5, h6 { font-size: 12pt; }

  a, a:link, a:visited {
    color: #000;
    text-decoration: none;
  }

  /* Don't append href URLs after links when printing */
  a[href]::after { content: none !important; }

  /* Tighten up filter card inputs so they don't waste horizontal space */
  .form-control, .form-select {
    border: 1px solid #ccc;
    background: transparent;
  }

  /* Honest Umami logo next to the page title. */
  .main-content h1::before {
    content: url("/assets/honest-umami-logo-d041b8bd.svg");
    display: inline-block;
    width: 50pt;
    height: 50pt;
    vertical-align: middle;
    margin-right: 0.5em;
  }
}

/* Responsive: offcanvas sidebar on mobile */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -100%;
    width: 280px;
    transition: left 0.3s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .mobile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}
