:root {
  --primary-color: #b87344;
  --success-color: #7a8f55;
  --warning-color: #d9a574;
  --danger-color: #c8735f;
  --info-color: #7d8c6b;
  --light-color: #fafaf8;
  --dark-color: #2c2926;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-color);
}

/* Fluid Typography */
h1 {
  font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.75rem);
}
h2 {
  font-size: clamp(1.55rem, 1.4rem + 0.9vw, 2.1rem);
}
h3 {
  font-size: clamp(1.3rem, 1.2rem + 0.6vw, 1.75rem);
}
h4 {
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.45rem);
}
h5 {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.25rem);
}
h6 {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.05rem);
}

/* Global Responsive Helpers */
img {
  max-width: 100%;
  height: auto;
  display: block;
}
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min, 220px), 1fr));
  gap: var(--grid-gap, 1rem);
}
.flow-y {
  display: flex;
  flex-direction: column;
  gap: var(--flow-gap, 0.75rem);
}

/* Performance: avoid layout thrash for large lists */
.virtual-section {
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark Mode (hook - body.dark-mode applied elsewhere) */
body.dark-mode {
  background: #2c2926;
  color: #fafaf8;
}
body.dark-mode .card {
  background: rgba(62, 57, 51, 0.85);
  box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.55);
}
body.dark-mode .card-header {
  background: linear-gradient(135deg, #b87344 0%, #9a5d3a 100%);
  color: #fafaf8;
}
body.dark-mode .btn-primary {
  background: #b87344;
  border-color: #b87344;
}
body.dark-mode .btn-success {
  background: #7a8f55;
  border-color: #7a8f55;
}

/* Responsive Card Grid Enhancement */
@media (min-width: 576px) {
  .responsive-cards {
    --grid-min: 240px;
  }
}
@media (min-width: 768px) {
  .responsive-cards {
    --grid-min: 260px;
  }
}
@media (min-width: 992px) {
  .responsive-cards {
    --grid-min: 280px;
  }
}
@media (min-width: 1200px) {
  .responsive-cards {
    --grid-min: 300px;
  }
}

/* Utility Classes */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-wrap-balance {
  text-wrap: balance;
}
.elevate-sm {
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.25);
}

/* Document list performance */
.document-card {
  content-visibility: auto;
  contain-intrinsic-size: 180px 180px;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.5rem;
}

.card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.card-header {
  border-radius: 10px 10px 0 0 !important;
  font-weight: 600;
}

.btn {
  border-radius: 6px;
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.alert {
  border-radius: 8px;
  border: none;
}

.form-control {
  border-radius: 6px;
  border: 1px solid #ced4da;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(10, 102, 194, 0.25);
}

.list-group-item {
  border-radius: 6px !important;
  margin-bottom: 0.5rem;
  border: 1px solid #dee2e6;
}

.spinner-border {
  width: 1rem;
  height: 1rem;
}

.text-muted {
  opacity: 0.7;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print queue specific styles */
#slot1,
#slot2 {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#queueContainer {
  min-height: 100px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .card {
    margin-bottom: 1rem;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* File upload area styling */
.file-upload-area {
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background-color: #f8f9fa;
  transition: border-color 0.3s ease;
}

.file-upload-area:hover {
  border-color: var(--primary-color);
}

.file-upload-area.dragover {
  border-color: var(--success-color);
  background-color: rgba(40, 167, 69, 0.1);
}

/* Advanced print option display */
.adv-block {
  background: #f1f5f9;
  border: 1px solid #dbe2e8;
  border-radius: 6px;
  padding: 0.4rem 0.55rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.15;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.35rem 0.6rem;
}
.adv-block.compact {
  background: #f8fafc;
  font-size: 0.68rem;
}
.adv-row {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
}
.adv-label {
  font-weight: 600;
  color: #374151;
}
.adv-value {
  font-weight: 500;
  color: #111827;
}
body.dark .adv-block {
  background: #1e293b;
  border-color: #324459;
}
body.dark .adv-label {
  color: #cbd5e1;
}
body.dark .adv-value {
  color: #f1f5f9;
}

/* New advanced panel (replaces adv-block where used) */
.adv-panel {
  background: #f1f5f9;
  border: 1px solid #d6dee5;
  border-radius: 10px;
  padding: 0.55rem 0.7rem 0.6rem;
  position: relative;
}
.adv-panel.compact {
  padding: 0.5rem 0.55rem;
  background: #f8fafc;
}
.adv-panel-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.adv-spec {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem 0.9rem;
}
@media (max-width: 600px) {
  .adv-spec {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}
.spec-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.adv-panel.compact .spec-row {
  background: #fff;
  font-size: 0.68rem;
  padding: 0.28rem 0.4rem;
}
.spec-icon {
  width: 20px;
  text-align: center;
  color: #475569;
  font-size: 0.7rem;
  opacity: 0.85;
}
.spec-label {
  font-weight: 600;
  color: #334155;
}
.spec-value {
  font-weight: 600;
  font-family: system-ui, Segoe UI, sans-serif;
  color: #0f172a;
}
.spec-value.bad {
  color: #b91c1c;
}
.spec-value.good {
  color: #047857;
}
.spec-value.pending {
  color: #b45309;
}
body.dark .adv-panel {
  background: #1e293b;
  border-color: #334155;
}
body.dark .adv-panel.compact {
  background: #243248;
}
body.dark .adv-panel-title {
  color: #90a5bd;
}
body.dark .spec-row {
  background: #243248;
  border-color: #334155;
}
body.dark .spec-label {
  color: #d5dee9;
}
body.dark .spec-icon {
  color: #94a3b8;
}
body.dark .spec-value {
  color: #f1f5f9;
}

/* Inline slot action buttons (print + complete) */
.slot-actions {
  margin-top: 0.15rem;
  display: flex;
  gap: 0.5rem;
}
/* Shop dashboard slot student name styling */
.slot-student-header {
  text-align: center;
}
.slot-student-name {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: linear-gradient(135deg, #b87344 0%, #d9a574 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  position: relative;
}
.slot-student-name strong {
  font-weight: 700;
}
.slot-student-name .badge {
  vertical-align: middle;
  margin-left: 0.4rem;
}
.slot-student-name:after {
  content: "";
  display: block;
  margin: 0.35rem auto 0;
  width: 48%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #b87344 0%, #d9a574 100%);
}
.slot-actions .btn {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .slot-actions .btn {
    font-size: 0.75rem;
  }
}
@media (max-width: 520px) {
  .slot-actions .btn .label {
    display: none !important;
  }
}
body.dark .slot-actions .btn.btn-primary {
  background: #c88b54;
  border-color: #c88b54;
}
body.dark .slot-actions .btn.btn-success {
  background: #7a8f55;
  border-color: #7a8f55;
}
/* Meta line under file name */
.slot-meta {
  color: #475569;
  letter-spacing: 0.25px;
}
body.dark .slot-meta {
  color: #cbd5e1;
}

/* Status badge styles removed per request */
