:root {
  --hssd-primary: #013a4a;
  --hssd-accent: #f46d32;
  --hssd-ink: #0f172a;
  --hssd-bg: #f7f9fb;
  --hssd-panel: #ffffff;
  --hssd-shadow: 0 18px 40px rgba(1, 58, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  background: radial-gradient(circle at top left, #f1f5f9, #ffffff 40%),
    var(--hssd-bg);
  color: var(--hssd-ink);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
.navbar-brand {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.3px;
}

.hssd-navbar {
  background: var(--hssd-primary);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: var(--hssd-shadow);
  position: relative;
  z-index: 10;
}

.hssd-navbar .navbar-brand {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hssd-navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.hssd-navbar .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

#deletedCount {
  display: none;
}

.panel-card {
  background: var(--hssd-panel);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--hssd-shadow);
  border: 1px solid rgba(1, 58, 74, 0.08);
  position: relative;
}

.hub-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f6fafb 100%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f4f8;
}

.panel-header > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title {
  margin: 0;
  color: var(--hssd-primary);
  font-size: 1.6rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

.btn-accent {
  background: var(--hssd-accent);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-accent:hover {
  background: #e45b22;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(244, 109, 50, 0.3);
}

/* Tabs */
.pt-tabs {
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
}

.pt-tabs .nav-link {
  color: #64748b;
  font-weight: 500;
  border: none;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.pt-tabs .nav-link:hover {
  color: var(--hssd-primary);
}

.pt-tabs .nav-link.active {
  background: var(--hssd-primary);
  color: #ffffff;
  border-radius: 8px 8px 0 0;
}

/* Filters */
.pt-filters,
.hub-filters {
  background: #f8fafb;
  padding: 1rem;
  border-radius: 12px;
}

.pt-filters .form-label,
.hub-filters .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hssd-accent);
  box-shadow: 0 0 0 3px rgba(244, 109, 50, 0.1);
}

/* Tables */
.table {
  margin-bottom: 0;
}

.table.table-compact thead th {
  padding: 0.6rem 0.5rem;
}

.table.table-compact tbody td {
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
}

.table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
  padding: 1rem 0.75rem;
}

.table tbody td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #f0f4f8;
}

.table tbody tr {
  transition: all 0.15s ease;
}

.table tbody tr:hover {
  background: #f8fafb;
}

/* Buttons in table */
.btn-sm {
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Badges */
.badge {
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Shipping line badges */
.shipping-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
}

/* Modal */
.modal-backdrop,
.modal-backdrop.show {
  display: none !important;
}

.modal {
  z-index: 1050 !important;
  pointer-events: none !important;
}

.modal.show {
  display: block;
  z-index: 1050 !important;
  pointer-events: none !important;
}

.modal-dialog {
  z-index: 1050 !important;
  pointer-events: auto !important;
}

.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1051 !important;
  background: #ffffff;
  pointer-events: auto !important;
}

.modal-header {
  border-bottom: 2px solid #f0f4f8;
  padding: 1.5rem;
  background: #ffffff;
}

.modal-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--hssd-primary);
  font-size: 1.3rem;
}

.modal-body {
  padding: 1.5rem;
  background: #ffffff;
}

.modal-body .mb-3 {
  margin-bottom: 1.25rem;
}

.modal-body .form-label {
  font-weight: 600;
  color: var(--hssd-primary);
  margin-bottom: 0.6rem;
  display: block;
}

.modal-footer {
  border-top: 2px solid #f0f4f8;
  padding: 1.5rem;
  gap: 0.75rem;
  background: #ffffff;
}

.modal-body .form-control,
.modal-body .form-select {
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
  color: #000000;
  pointer-events: auto !important;
  cursor: text !important;
}

.modal-body .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer !important;
  pointer-events: auto !important;
  background-color: #ffffff;
  transition: all 0.2s ease;
  accent-color: var(--hssd-accent);
}

.modal-body .form-check-input:checked {
  background-color: var(--hssd-accent);
  border-color: var(--hssd-accent);
}

.modal-body .form-check-input:focus {
  border-color: var(--hssd-accent);
  box-shadow: 0 0 0 3px rgba(244, 109, 50, 0.1);
}

.modal-body .form-check-label {
  cursor: pointer !important;
  user-select: none;
  pointer-events: auto !important;
}

.modal-body .form-select {
  cursor: pointer !important;
}

.modal-body .form-control::placeholder {
  color: #94a3b8;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
  border-color: var(--hssd-accent);
  box-shadow: 0 0 0 3px rgba(244, 109, 50, 0.1);
  outline: none;
  background-color: #ffffff;
  color: #000000;
  pointer-events: auto !important;
}

.modal-body .form-select option {
  background-color: #ffffff;
  color: #000000;
  padding: 0.5rem;
  pointer-events: auto !important;
}

.modal-body .form-label {
  pointer-events: auto !important;
}

.modal-body .form-check {
  pointer-events: auto !important;
}

#reservation-note-field {
  margin-bottom: 1.25rem;
  padding: 0;
  pointer-events: auto !important;
}

#unitReservationNote {
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
  color: #000000;
  pointer-events: auto !important;
  cursor: text !important;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#unitReservationNote:focus {
  border-color: var(--hssd-accent);
  box-shadow: 0 0 0 3px rgba(244, 109, 50, 0.1);
  outline: none;
  background-color: #ffffff;
  color: #000000;
}

.modal-body input[type="text"],
.modal-body input[type="date"],
.modal-body textarea,
.modal-body select {
  pointer-events: auto !important;
  cursor: auto !important;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.btn-close {
  z-index: 1052 !important;
}

.text-danger {
  color: #d90429 !important;
}

/* Info dot */
.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--hssd-primary);
  color: #ffffff;
  font-size: 0.7rem;
  margin-left: 0.5rem;
  cursor: help;
  font-weight: bold;
}

/* Background orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

.orb-1 {
  width: 220px;
  height: 220px;
  background: var(--hssd-accent);
  top: -60px;
  right: -60px;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: var(--hssd-primary);
  bottom: -140px;
  left: -140px;
}

main,
.navbar {
  position: relative;
  z-index: 1;
}

/* HUB list styling */
.hub-list {
  max-height: calc(100vh - 400px);
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .panel-card {
    padding: 1rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-accent {
    width: 100%;
    justify-content: center;
  }

  .pt-filters,
  .hub-filters {
    padding: 0.75rem;
  }

  .pt-tabs .nav-link {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
  }

  .table-responsive {
    font-size: 0.9rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.6rem 0.4rem;
  }
}

/* Toast Notifications */
.toast-container {
  z-index: 99999 !important;
}

.toast {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  min-width: 300px;
  z-index: 99999 !important;
}

.toast.bg-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.toast-body {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}

.toast-body i {
  font-size: 1.2rem;
  vertical-align: middle;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.show {
  animation: slideInRight 0.3s ease-out;
}

/* Delete Confirmation Modal */
#deleteConfirmModal {
  z-index: 10000 !important;
}

#deleteConfirmModal .modal-backdrop {
  z-index: 9999 !important;
}

#deleteConfirmModal .modal-content {
  border-radius: 16px;
  overflow: hidden;
}

#deleteConfirmModal .modal-header {
  padding: 1.25rem 1.5rem;
}

#deleteConfirmModal .modal-body {
  padding: 2rem;
}

#deleteConfirmModal .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

#deleteConfirmModal .btn-danger {
  background: #dc3545;
  border: none;
}

#deleteConfirmModal .btn-danger:hover {
  background: #bb2d3b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

#deleteConfirmModal .btn-secondary:hover {
  transform: translateY(-2px);
}

/* Permanent Delete Confirmation Modal */
#permanentDeleteConfirmModal {
  z-index: 10000 !important;
}

#permanentDeleteConfirmModal .modal-backdrop {
  z-index: 9999 !important;
}

#permanentDeleteConfirmModal .modal-content {
  border-radius: 16px;
  overflow: hidden;
}

#permanentDeleteConfirmModal .modal-header {
  padding: 1.25rem 1.5rem;
}

#permanentDeleteConfirmModal .modal-body {
  padding: 2rem;
}

#permanentDeleteConfirmModal .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

#permanentDeleteConfirmModal .btn-danger:hover {
  background: #bb2d3b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Clear All Deleted Confirmation Modal */
#clearAllDeletedConfirmModal {
  z-index: 10000 !important;
}

#clearAllDeletedConfirmModal .modal-backdrop {
  z-index: 9999 !important;
}

#clearAllDeletedConfirmModal .modal-content {
  border-radius: 16px;
  overflow: hidden;
}

#clearAllDeletedConfirmModal .modal-header {
  padding: 1.25rem 1.5rem;
}

#clearAllDeletedConfirmModal .modal-body {
  padding: 2rem;
}

#clearAllDeletedConfirmModal .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

#clearAllDeletedConfirmModal .btn-warning {
  background: #ffc107;
  border: none;
  color: #000;
}

#clearAllDeletedConfirmModal .btn-warning:hover {
  background: #ffca2c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Print friendly */
@media print {
  .bg-orb,
  .btn-accent,
  .pt-filters,
  .hub-filters {
    display: none;
  }
}
