:root {
  --hf-navy: #1a2b4a;
  --hf-orange: #e87722;
  --hf-bg: #f8f9fa;
  --hf-card: #ffffff;
  --hf-border: #dee2e6;
  --hf-text: #212529;
  --hf-muted: #6c757d;
  --hf-sidebar-width: 240px;
}

body {
  background: var(--hf-bg);
  color: var(--hf-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hf-shell {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--hf-sidebar-width);
  background: var(--hf-navy);
  color: #fff;
  flex-shrink: 0;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

#sidebar .sidebar-brand {
  padding: 0 1rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
}

#sidebar .brand-name {
  font-weight: 600;
  color: #fff;
}

#sidebar .nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 0.75rem 1rem 0.25rem 1rem;
  letter-spacing: 0.05em;
}

#sidebar .nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  border-left: 3px solid transparent;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  color: #fff;
  background: rgba(232, 119, 34, 0.2);
  border-left-color: var(--hf-orange);
}

#sidebar .nav-link i {
  margin-right: 0.5rem;
}

.hf-main {
  flex-grow: 1;
  padding: 1rem 1.5rem 2rem 1.5rem;
}

.hf-topbar {
  background: #fff;
  border-bottom: 1px solid var(--hf-border);
  margin: -1rem -1.5rem 1rem -1.5rem;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hf-breadcrumbs a {
  color: var(--hf-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.page-header {
  border-bottom: 1px solid var(--hf-border);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.btn-primary {
  background-color: var(--hf-navy);
  border-color: var(--hf-navy);
}
.btn-primary:hover {
  background-color: #142036;
  border-color: #142036;
}

.btn-warning {
  background-color: var(--hf-orange);
  border-color: var(--hf-orange);
  color: #fff;
}
.btn-warning:hover {
  background-color: #c5631a;
  border-color: #c5631a;
  color: #fff;
}

.badge-status-draft     { background:#6c757d; color:#fff; }
.badge-status-sent      { background:#0d6efd; color:#fff; }
.badge-status-accepted  { background:#198754; color:#fff; }
.badge-status-rejected  { background:#dc3545; color:#fff; }
.badge-status-converted { background:#6610f2; color:#fff; }
.badge-status-expired   { background:#adb5bd; color:#fff; }
.badge-status-confirmed { background:#0d6efd; color:#fff; }
.badge-status-in_production { background:#fd7e14; color:#fff; }
.badge-status-ready     { background:#20c997; color:#fff; }
.badge-status-dispatched{ background:#6610f2; color:#fff; }
.badge-status-completed { background:#198754; color:#fff; }
.badge-status-cancelled { background:#dc3545; color:#fff; }
.badge-status-pending   { background:#ffc107; color:#212529; }
.badge-status-cutting,
.badge-status-crimping,
.badge-status-testing,
.badge-status-qc        { background:#fd7e14; color:#fff; }
.badge-status-complete  { background:#198754; color:#fff; }
.badge-status-paid      { background:#198754; color:#fff; }
.badge-status-partial   { background:#ffc107; color:#212529; }
.badge-status-unpaid    { background:#dc3545; color:#fff; }
.badge-status-preparing { background:#6c757d; color:#fff; }
.badge-status-in_transit{ background:#0dcaf0; color:#212529; }
.badge-status-delivered { background:#198754; color:#fff; }
.badge-status-returned  { background:#dc3545; color:#fff; }
.badge-status-received  { background:#198754; color:#fff; }
.badge-status-superseded{ background:#adb5bd; color:#fff; }
.badge-status-pending_approval { background:#fd7e14; color:#fff; }
.badge-status-open      { background:#6c757d; color:#fff; }
.badge-status-qualified { background:#0d6efd; color:#fff; }
.badge-status-quoted    { background:#6610f2; color:#fff; }
.badge-status-won       { background:#198754; color:#fff; }
.badge-status-lost      { background:#dc3545; color:#fff; }
.badge-status-dropped   { background:#adb5bd; color:#fff; }

.hf-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  width: 100%;
}

.hf-login-card {
  width: 380px;
  max-width: 90%;
}

.hf-error {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--hf-muted);
}

@media (max-width: 768px) {
  #sidebar { display: none; }
  .hf-main { padding: 1rem; }
}
