/* Print Management Page Styling */
body {
  background-color: var(--color-bg-warm, #f8fafc);
  min-height: 100vh;
}

.print-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 24px;
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.print-hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(235, 35, 113, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.print-hero-content h1 {
  font-size: 2.1rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.print-hero-content p {
  font-size: 1.05rem;
  color: #94a3b8;
  margin: 0;
}

.print-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.stat-box.warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, rgba(254, 243, 199, 0.2) 100%);
}

.stat-box.success {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, rgba(209, 250, 229, 0.2) 100%);
}

.stat-box.info {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, rgba(219, 234, 254, 0.2) 100%);
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
}

.stat-box.warning .stat-value { color: #d97706; }
.stat-box.success .stat-value { color: #059669; }
.stat-box.info .stat-value { color: #2563eb; }

/* Toolbar & Filters */
.print-toolbar {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Status Multi-Select Filter Dropdown */
.status-filter-dropdown-wrapper {
  position: relative;
  display: inline-block;
  min-width: 200px;
}

.status-filter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.status-filter-trigger:hover,
.status-filter-dropdown-wrapper.open .status-filter-trigger {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-filter-trigger-text {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.status-filter-badge-count {
  background: var(--color-accent, #eb2371);
  color: #ffffff;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.status-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.16), 0 6px 14px -3px rgba(15, 23, 42, 0.08);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  direction: rtl;
  text-align: right;
  animation: fadeInDown 0.15s ease-out;
}

.status-filter-dropdown-wrapper.open .status-filter-menu {
  display: flex;
}

.status-filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

.status-filter-option:hover {
  background: #f1f5f9;
}

.status-filter-option.select-all-opt {
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 4px;
  padding-bottom: 10px;
  font-weight: 800;
  color: #0f172a;
}

.status-filter-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-filter-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent, #eb2371);
  cursor: pointer;
}

.status-filter-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-filter-dot.unprinted { background: #d97706; }
.status-filter-dot.printed { background: #059669; }
.status-filter-dot.shipped { background: #2563eb; }

.status-filter-count {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 700;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 8px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.toolbar-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 16px;
  flex: 1 1 300px;
  max-width: 450px;
}

.toolbar-search-box input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
  color: #0f172a;
  font-family: inherit;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.custom-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent, #eb2371);
  cursor: pointer;
}

/* Orders Grid & Cards */
.orders-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loading-state, .empty-state {
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 20px;
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.order-manage-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  transition: all 0.2s ease;
  position: relative;
}

.order-manage-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.order-manage-card.selected {
  border-color: var(--color-accent, #eb2371);
  background: rgba(235, 35, 113, 0.02);
  box-shadow: 0 0 0 3px rgba(235, 35, 113, 0.12);
}

.card-left-section {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 500px;
}

.card-select-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--color-accent, #eb2371);
  cursor: pointer;
  flex-shrink: 0;
}

.card-main-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-header-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-order-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.badge-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-status.unprinted {
  background: #fef3c7;
  color: #b45309;
}

.badge-status.printed {
  background: #d1fae5;
  color: #047857;
}

.badge-status.shipped {
  background: #dbeafe;
  color: #1d4ed8;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 600;
  flex-wrap: wrap;
}

.card-dim-badge {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.card-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-card-view {
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-card-view:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Order Preview Wrapper & Eye Icon Button */
.order-preview-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.order-preview-wrapper:hover,
.order-preview-wrapper:focus-within {
  z-index: 100;
}

.order-manage-card:has(.order-preview-wrapper:hover) {
  z-index: 95;
}

.btn-card-eye {
  width: 42px;
  height: 42px;
  background: #f8fafc;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn-card-eye:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-card-eye svg {
  display: block;
}

/* Tooltip Modal */
.order-preview-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 360px;
  max-width: 90vw;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.18), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 999;
  cursor: default;
  text-align: right;
  direction: rtl;
  font-family: inherit;
}

/* Safe invisible bridge so mouse movement between eye icon and modal never loses hover */
.order-preview-tooltip::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* Little arrow pointing at the eye button */
.order-preview-tooltip::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 15px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1.5px solid #e2e8f0;
  border-top: 1.5px solid #e2e8f0;
  transform: rotate(45deg);
}

.order-preview-wrapper:hover .order-preview-tooltip,
.order-preview-wrapper:focus-within .order-preview-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Tooltip Header */
.tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}

.tooltip-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tooltip-class-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.tooltip-order-id {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.tooltip-badge-partial {
  font-size: 0.75rem;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Tooltip Body & Sections */
.tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
  padding-left: 4px;
}

.tooltip-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.tooltip-item-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  color: #1e293b;
}

.tooltip-item-name {
  color: #334155;
  font-weight: 500;
  line-height: 1.3;
}

.tooltip-item-val {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.tooltip-val-highlight-green {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0;
}

.tooltip-val-highlight-blue {
  background: #dbeafe !important;
  color: #1e40af !important;
  border: 1px solid #bfdbfe;
}

.tooltip-val-muted {
  color: #64748b !important;
}

.tooltip-address-row {
  font-size: 0.78rem;
  color: #64748b;
  background: #f8fafc;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  margin-top: 2px;
  line-height: 1.35;
}

.tooltip-empty-row {
  font-size: 0.82rem;
  color: #94a3b8;
  font-style: italic;
}

.tooltip-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1.5px dashed #e2e8f0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.tooltip-total-price {
  color: var(--color-accent, #eb2371);
  font-size: 1.1rem;
}

/* Tooltip Footer & PDF Button */
.tooltip-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tooltip-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-tooltip-pdf {
  flex: 1;
  box-sizing: border-box;
  background: #0f172a;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tooltip-pdf:hover {
  background: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-tooltip-print {
  flex: 1;
  box-sizing: border-box;
  background: linear-gradient(135deg, #eb2371 0%, #db2777 100%);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(235, 35, 113, 0.25);
}

.btn-tooltip-print:hover {
  background: linear-gradient(135deg, #d91b63 0%, #be185d 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(235, 35, 113, 0.4);
}

.btn-tooltip-print:disabled,
.btn-tooltip-pdf:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.spin-animation {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Card Order Status Dropdown */
.order-status-dropdown {
  position: relative;
  display: inline-block;
}

.btn-order-status {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #0f172a;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-order-status:hover,
.order-status-dropdown.open .btn-order-status {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-order-status .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.btn-order-status .status-dot.unprinted { background: #d97706; }
.btn-order-status .status-dot.printed { background: #059669; }
.btn-order-status .status-dot.shipped { background: #2563eb; }

.btn-order-status .dropdown-arrow {
  color: #64748b;
  transition: transform 0.2s ease;
}

.order-status-dropdown.open .btn-order-status .dropdown-arrow {
  transform: rotate(180deg);
}

.order-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.15), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  direction: rtl;
  text-align: right;
  animation: fadeInDown 0.15s ease-out;
}

.order-status-dropdown.open .order-status-menu {
  display: flex;
}

.order-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  font-family: inherit;
}

.order-status-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.order-status-item.active {
  background: #f8fafc;
  color: #0f172a;
}

.order-status-item-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-status-item .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.order-status-item .status-dot.unprinted { background: #d97706; }
.order-status-item .status-dot.printed { background: #059669; }
.order-status-item .status-dot.shipped { background: #2563eb; }

.order-status-item.active .status-check {
  color: var(--color-accent, #eb2371);
}

.btn-toggle-print {
  display: none;
}

/* Sticky Bottom Panel */
.sticky-batch-panel {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1000px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 24px;
  padding: 18px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-batch-panel.hidden {
  transform: translate(-50%, 150%);
  opacity: 0;
  pointer-events: none;
}

.batch-panel-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.batch-panel-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.batch-count-badge {
  background: var(--color-accent, #eb2371);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 30px;
}

.batch-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  color: #cbd5e1;
}

.batch-metrics strong {
  color: #ffffff;
  font-size: 1.15rem;
}

.metric-divider {
  color: #475569;
}

.btn-batch-generate {
  background: linear-gradient(135deg, #eb2371 0%, #d91b63 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(235, 35, 113, 0.4);
  transition: all 0.2s ease;
}

.btn-batch-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(235, 35, 113, 0.5);
}

.btn-batch-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
