html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --art-bg: #0f141c;
  --art-bg-soft: #151c27;
  --art-surface: #1c2533;
  --art-surface-soft: #253144;
  --art-border: rgba(255, 255, 255, 0.1);
  --art-text: #f8fafc;
  --art-muted: #a7b0c0;
  --art-orange: #f97316;
  --art-orange-soft: rgba(249, 115, 22, 0.18);
  --art-blue: #38bdf8;
}

body {
  margin-bottom: 60px;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 28rem),
    var(--art-bg);
  color: var(--art-text);
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.page-alert-stack {
  position: sticky;
  top: 1rem;
  z-index: 1030;
}

.alert {
  transition: opacity 0.3s ease;
}

/* =========================
   Project / Item Tables
========================= */

.item-row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.item-row:focus {
  outline: none;
}

.item-row:hover {
  transform: none;
}

.item-row.table-active {
  background-color: #f8f9fa !important;
  box-shadow: inset 3px 0 0 #0d6efd;
}

.item-row.needs-attention {
  background-image: linear-gradient(to right, rgba(255, 193, 7, 0.12), rgba(255, 193, 7, 0));
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.item-row.needs-attention:hover,
.item-row.needs-attention.table-active {
  background-color: #fffdf5 !important;
}

.item-row.overdue {
  background-color: #fff5f5 !important;
  box-shadow: inset 4px 0 0 #dc3545;
}

.item-thumb-slot {
  width: 44px;
  min-width: 44px;
  flex: 0 0 44px;
}

.receipt-thumb {
  flex-shrink: 0;
}

.receipt-cell {
  min-width: 72px;
}

.item-thumb,
.receipt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  display: block;
}

.item-thumb-placeholder {
  width: 44px;
  height: 44px;
}

.collapse-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

button[aria-expanded="true"] .collapse-icon {
  transform: rotate(90deg);
}

/* =========================
   Thumb + Receipt Consistency
========================= */

.thumb-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #f8f9fa;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-frame-placeholder {
  color: #adb5bd;
  font-size: 0.8rem;
}

.receipt-link-btn {
  min-width: 72px;
}

.receipt-status-missing,
.receipt-status-complete {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.receipt-status-complete {
  color: #198754;
}

.receipt-status-missing {
  color: #e0a800; /* slightly deeper yellow for better weight */
}

.item-preview-trigger,
.receipt-preview-trigger {
  display: inline-flex;
  text-decoration: none;
}

.item-preview-trigger:hover .thumb-frame,
.receipt-preview-trigger:hover .thumb-frame {
  border-color: #c6d4f7;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.08);
}

/* .receipt-preview-large {
  min-height: 220px;
} */

.notes-col {
  min-width: 220px;
  max-width: 320px;
  vertical-align: top;
}

.notes-col .small {
  line-height: 1.35;
  overflow-wrap: anywhere;
  margin-bottom: 0.2rem;
}

.notes-col .small, .mobile-item-notes {
  line-height: 1.4;
  color: #6c757d;
}

/* =========================
   Item Details / Receipt Preview
========================= */

.item-details-header .badge {
  align-self: flex-start;
}

.item-detail-list dt {
  font-weight: 600;
  color: #6c757d;
}

.item-detail-list dd {
  color: #212529;
}

.item-detail-list dt, .item-detail-list dd {
  margin-bottom: 0.9rem;
}

.receipt-preview-large {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.receipt-preview-surface {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  max-height: 340px;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  background: #f8f9fa;
  overflow: hidden;
}

.receipt-preview-image {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

/* =========================
   Item Details Status Panel
========================= */

.item-details-status-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.item-details-status-badges .badge {
  margin-left: 0 !important;
}

.item-status-panel {
  border: 1px solid #e9ecef;
  border-left-width: 4px;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
}

.item-status-panel-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.item-status-panel-message {
  margin-top: 0.35rem;
  color: #6c757d;
  line-height: 1.4;
}

.item-status-panel-warning {
  border-left-color: #e0a800;
  background: #fffdf5;
}

.item-status-panel-warning .item-status-panel-title {
  color: #9a6b00;
}

.item-status-panel-danger {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.item-status-panel-danger .item-status-panel-title {
  color: #b02a37;
}

.item-details-side-stack {
  display: grid;
  gap: 1.25rem;
}

/* =========================
   Item Details Actions Card
========================= */

.item-actions-panel {
  display: grid;
  gap: 1rem;
}

.item-actions-group {
  display: grid;
  gap: 0.5rem;
}

.item-actions-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
}

.item-actions-group .btn,
.item-actions-group form {
  width: 100%;
}

.item-actions-group form {
  margin: 0;
}

.item-actions-group-secondary {
  padding-top: 0.85rem;
  border-top: 1px solid #eef1f4;
}

@media (max-width: 767.98px) {
  .item-actions-panel {
    gap: 0.85rem;
  }

  .item-actions-group {
    gap: 0.45rem;
  }
}

@media (max-width: 767.98px) {
  .item-details-status-badges {
    justify-content: flex-start;
  }

  .item-status-panel {
    padding: 0.8rem 0.9rem;
  }

  .item-status-panel-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 767.98px) {
  .receipt-preview-surface {
    min-height: 120px;
    max-height: 220px;
    padding: 0.35rem;
  }

  .receipt-preview-image {
    max-height: 200px;
  }
}

/* =========================
   Return Info Page Polish
========================= */

.item-page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.item-page-subtitle {
  display: grid;
  gap: 0.2rem;
}

.item-inline-status {
  padding: 0.75rem 0.9rem;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  background: #f8f9fa;
  color: #495057;
}

@media (max-width: 767.98px) {
  .item-page-header h1 {
    font-size: 1.5rem;
  }
}

/* Notes clamp */
@media (min-width: 768px) {
  .notes-col .small.note-clamp:not(.is-expanded) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.note-toggle-btn {
  font-size: 0.8rem;
  text-decoration: none;
}

.note-clamp.is-expanded {
  display: block;
  overflow: visible;
}

/* Notes UX polish */
.note-clamp {
  position: relative;
  transition: max-height 0.2s ease;
}

.note-clamp:not(.is-expanded)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.4em;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
}

.note-toggle-btn {
  font-size: 0.75rem;
  text-decoration: none;
  color: #0d6efd;
}

.note-toggle-btn:hover {
  text-decoration: underline;
}

.mobile-item-notes {
  font-size: 0.9rem;
}

.edit-description-btn, .mobile-edit-description-btn {
  font-size: 0.8rem;
  text-decoration: none;
}

.form-text {
  font-size: 0.75rem;
}

#description-display,
[id^="description-display-"] {
  display: block;
  line-height: 1.3;
}

.inline-description-input {
  resize: vertical;
  min-height: 60px;
}

.edit-description-btn {
  font-size: 0.8rem;
  text-decoration: none;
}

/* =========================
   Quantity Stepper
========================= */

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #fff;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: #f8f9fa;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: #e9ecef;
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-value {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  padding: 0 0.4rem;
}

/* =========================
   Receipt Upload UI
========================= */

.receipt-drop-zone {
  border: 2px dashed #ced4da;
  border-radius: 0.5rem;
  background: #f8f9fa;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.receipt-drop-zone:hover {
  background: #f1f3f5;
}

.receipt-drop-zone.dragover {
  border-color: #0d6efd;
  background: #e7f1ff;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* =========================
   Shared UI Polish
========================= */

.card-header {
  background-color: #f8f9fa;
  font-weight: 600;
}

.badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  letter-spacing: 0.02em;
}

.text-success {
  transition: color 0.2s ease;
}

.project-items-table {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  min-width: 600px;
}

.project-items-table th,
.project-items-table td {
  vertical-align: middle;
}

.actions-col {
  min-width: 200px;
}

.actions-col-cell {
  min-width: 200px;
  vertical-align: top;
}

.actions-col-cell-wide {
  min-width: 140px;
  max-width: 160px;
}

.item-action-group {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.item-action-group .btn {
  min-width: 64px;
}

.item-action-group .btn.btn-icon {
  min-width: 40px;
}

.item-action-group-stacked {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: 160px;
  margin-left: auto;
}

.item-action-group-stacked .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.item-action-group-stacked .btn,
.item-action-group-stacked form,
.item-action-group-stacked form .btn {
  width: 100%;
}

.item-action-group-stacked form {
  margin: 0;
}

.item-name-cell-content {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 140px;
}

.returned-at-cell {
  min-width: 150px;
  white-space: nowrap;
}

.item-name-text {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* =========================
   Cross-Page Consistency Sweep
========================= */

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: #6c757d;
  line-height: 1.4;
}

.section-card-title,
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #212529;
}

.card.shadow-sm {
  border: 1px solid #e9ecef;
  border-radius: 0.85rem;
}

.card.shadow-sm .card-body {
  padding: 1rem;
}

.btn {
  border-radius: 0.5rem;
}

.btn-sm {
  border-radius: 0.45rem;
}

.badge.fs-6 {
  font-size: 0.78rem !important;
  font-weight: 600;
  padding: 0.45em 0.65em;
}

.text-muted,
.small.text-muted,
.form-text {
  color: #6c757d !important;
}

.empty-state-text {
  color: #6c757d;
  margin-bottom: 0;
}

.empty-state-text, .project-empty-state {
  color: var(--art-muted) !important;
  font-style: italic;
  margin-bottom: 0;
}

.receipt-action-btn {
  min-width: 150px;
}

.status-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
}

@media (max-width: 767.98px) {
  .page-title {
    font-size: 1.5rem;
  }

  .card.shadow-sm .card-body {
    padding: 0.9rem;
  }
}

/* =========================
   Section + Card Polish
========================= */

.project-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.project-section-title h2,
.project-section-title .h2-like {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.project-group-card {
  background: linear-gradient(145deg, #1b2636, #121a26);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.75rem;
  overflow: hidden;
}

.project-group-card .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  transition: background 0.2s ease;
}

.project-group-card:hover,
.project-index-card:hover {
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.24);
}

.project-group-card .card-header:hover {
  background: rgba(249,115,22,0.08);
}

.project-group-card .card-body {
  background: #fff;
}

.project-items-table.table-striped tbody tr:nth-of-type(odd) {
  background-color: #f4f6f9;
}

.project-items-table.table-hover tbody tr:hover {
  background-color: #e9edf3;
}

/* =========================
   Desktop Table Polish
========================= */

.project-items-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #495057;
  background: #eef1f5;
  border-bottom-width: 1px;
}

.project-items-table tbody td {
  color: #212529;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.project-items-table .qty-value {
  font-size: 0.95rem;
}

.item-name-text > div:first-child {
  font-weight: 600;
  color: #212529;
}

.receipt-cell .text-warning,
.project-items-table .text-warning.fw-semibold {
  font-size: 0.85rem;
}

/* =========================
   Button + Badge Polish
========================= */

.btn.btn-sm {
  border-radius: 0.45rem;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-warning {
  border-color: #dcdfe3;
}

.badge {
  font-size: 0.72rem;
}

.btn-icon {
  font-weight: 700;
}

/* =========================
   Empty State Polish
========================= */

.project-empty-state {
  padding: 0.75rem 0;
  color: #6c757d;
}

/* =========================
   Project Details Header
========================= */

.project-hero {
  border: 1px solid var(--art-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(28, 37, 51, 0.96), rgba(21, 28, 39, 0.96));
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
}

.project-hero-title {
  color: var(--art-text);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

.project-hero-meta {
  margin-top: 1rem;
  color: var(--art-muted);
  display: grid;
  gap: 0.25rem;
}

.project-hero-meta strong {
  color: var(--art-text);
}

.project-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

@media (max-width: 767.98px) {
  .project-hero {
    grid-template-columns: 1fr;
  }

  .project-hero-actions {
    justify-content: flex-start;
  }
}

/* =========================
   Project Index
========================= */

.project-index-hero,
.project-index-toolbar,
.project-index-card {
  border: 1px solid var(--art-border);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(28, 37, 51, 0.96), rgba(21, 28, 39, 0.96));
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.18);
}

.project-index-hero {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: center;
}

.project-index-title {
  color: var(--art-text);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.project-index-subtitle {
  color: var(--art-muted);
  max-width: 48rem;
  margin-bottom: 0;
  line-height: 1.55;
}

.project-index-toolbar {
  padding: 1rem 1.25rem;
}

.project-index-toolbar label {
  color: var(--art-text);
}

.project-filter-select {
  max-width: 220px;
}

.project-index-card {
  overflow: hidden;
}

.project-index-table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
  --bs-table-hover-bg: rgba(249, 115, 22, 0.08);
  border-color: var(--art-border);
}

.project-index-table thead th {
  color: var(--art-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-color: var(--art-border);
}

.project-index-table tbody td {
  color: var(--art-text);
  border-color: var(--art-border);
}

.project-index-description {
  color: var(--art-muted) !important;
  max-width: 420px;
}

@media (max-width: 767.98px) {
  .project-index-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-index-hero .btn {
    width: 100%;
  }
}

/* =========================
   App Shell / Home Page
========================= */

.app-navbar {
  background: rgba(15, 20, 28, 0.92);
  border-bottom: 1px solid var(--art-border);
  backdrop-filter: blur(10px);
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .btn-link {
  color: var(--art-text) !important;
}

.app-navbar .nav-link:hover,
.app-navbar .btn-link:hover {
  color: var(--art-orange) !important;
}

.app-nav-user {
  color: var(--art-muted) !important;
}

.app-navbar .navbar-nav {
  gap: 0.25rem;
}

.app-navbar .nav-link,
.app-navbar .btn-link {
  font-weight: 600;
}

.app-brand {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 2rem;
  align-items: stretch;
  min-height: 420px;
  padding: 3rem 0 2rem;
}

.home-hero-content,
.home-hero-panel,
.home-feature-card {
  border: 1px solid var(--art-border);
  background: linear-gradient(145deg, rgba(28, 37, 51, 0.94), rgba(21, 28, 39, 0.94));
  border-radius: 1.25rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.22);
}

.home-hero-content {
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.home-hero-content::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -4rem;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: var(--art-orange-soft);
  filter: blur(4px);
}

.home-hero-wide {
  grid-template-columns: 1fr;
}

.home-hero-wide .home-hero-content {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-hero-wide .home-hero h1, .home-hero-wide h1 {
  max-width: 100%;
}

.eyebrow {
  color: var(--art-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.home-hero h1 {
  font-size: clamp(3rem, 7vw, 5.75rem);
  font-weight: 900;
  line-height: 0.95;
  margin-bottom: 1.25rem;
  letter-spacing: -0.06em;
}

.home-hero-lead {
  max-width: 44rem;
  color: var(--art-muted);
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-art-primary {
  background: var(--art-orange);
  border-color: var(--art-orange);
  color: #111827;
  font-weight: 1000;
}

.btn-art-primary:hover {
  background: #fb923c;
  border-color: #fb923c;
  color: #111827;
}

.btn-art-outline {
  border: 1px solid var(--art-border);
  color: var(--art-text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
}

.btn-art-outline:hover {
  border-color: var(--art-orange);
  color: var(--art-orange);
  background: rgba(249, 115, 22, 0.08);
}

.home-hero-panel {
  padding: 1.5rem;
  align-self: stretch;
}

.panel-label {
  color: var(--art-orange);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.pulse-row {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--art-border);
}

.pulse-row span {
  color: var(--art-muted);
  font-size: 0.8rem;
}

.pulse-row strong {
  color: var(--art-text);
  font-size: 0.95rem;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.home-feature-card {
  padding: 1.35rem;
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.home-feature-card h2 {
  color: var(--art-text);
  margin-bottom: 0.5rem;
}

.home-feature-card p {
  color: var(--art-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.footer {
  background: rgba(15, 20, 28, 0.9);
  border-color: var(--art-border) !important;
}

.footer,
.footer a {
  color: var(--art-muted) !important;
}

/* =========================
   Shared Form Pages
========================= */

.form-hero,
.form-shell,
.form-section-card {
  border: 1px solid var(--art-border);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(28, 37, 51, 0.96), rgba(21, 28, 39, 0.96));
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.16);
}

.form-section-card.border-danger-subtle {
  border-color: rgba(220, 53, 69, 0.35);
}

.form-section-card,
.project-group-card,
.project-index-card,
.project-index-toolbar {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.form-hero {
  padding: 1.5rem;
}

.form-hero-title {
  color: var(--art-text);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.form-hero-subtitle {
  color: var(--art-muted);
  margin-bottom: 0;
}

.form-hero-subtitle strong {
  color: var(--art-text);
}

.form-shell {
  padding: 1rem;
  max-width: 900px;
}

.form-section-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: none;
}

.form-section-card h2 {
  color: var(--art-text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.form-section-card .form-label {
  color: var(--art-text);
  font-weight: 650;
}

.form-section-card .form-text {
  color: var(--art-muted) !important;
}

.form-section-card .form-control,
.form-section-card .form-select {
  background-color: rgba(255, 255, 255, 0.96);
  border-color: transparent;
}

.form-section-card .form-control:focus,
.form-section-card .form-select:focus {
  border-color: var(--art-orange);
  box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.22);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.25rem;
}

@media (max-width: 767.98px) {
  .form-shell {
    padding: 0.75rem;
  }

  .form-actions .btn {
    width: 100%;
  }
}

.form-section-card .item-detail-list dt {
  color: var(--art-muted);
}

.form-section-card .item-detail-list dd {
  color: var(--art-text);
}

.form-section-card .small.text-muted,
.form-section-card .empty-state-text {
  color: var(--art-muted) !important;
}

/* =========================
   Final Polish Utilities
========================= */

.stack-sm {
  display: grid;
  gap: 0.5rem;
}

.stack-md {
  display: grid;
  gap: 1rem;
}

.stack-lg {
  display: grid;
  gap: 1.5rem;
}

.section-gap {
  margin-bottom: 1.5rem;
}

.page-gap {
  margin-bottom: 2rem;
}

/* =========================
   Auth Pages
========================= */

.auth-page {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.auth-card {
  width: min(100%, 460px);
  border: 1px solid var(--art-border);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(28, 37, 51, 0.96), rgba(21, 28, 39, 0.96));
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.28);
  padding: 2rem;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  color: var(--art-text);
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--art-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.auth-card .form-label,
.auth-card .form-check-label {
  color: var(--art-muted);
}

.auth-card .form-control {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: transparent;
}

.auth-card .form-control:focus {
  border-color: var(--art-orange);
  box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.22);
}

.auth-card .form-floating > label {
  color: #6b7280;
}

.auth-links {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  text-align: center;
}

.auth-links a {
  color: var(--art-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--art-orange);
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
  }

  .home-hero-content {
    padding: 2rem;
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================
   ITEM TEXT HIERARCHY
============================= */

.mobile-item-name {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
}

.mobile-item-notes {
  font-size: 0.875rem;
  color: #6c757d;
}

.mobile-item-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

@media (max-width: 767.98px) {
  .notes-col {
    min-width: 160px;
    max-width: 220px;
  }

  .actions-col {
    min-width: 120px;
  }

  .actions-col-cell {
    min-width: 120px;
  }

  .actions-col-cell-wide {
    min-width: 140px;
    max-width: 150px;
  }

  .returned-at-cell {
    min-width: 110px;
    white-space: normal;
  }

  .receipt-cell {
    min-width: 56px;
  }

  .item-action-group .btn {
    min-width: 64px;
    font-size: 0.85rem;
    padding: 0.35rem 0.55rem;
  }

  .item-action-group .btn.btn-icon {
    min-width: 34px;
  }

  .item-action-group-stacked {
    max-width: 140px;
  }

  .item-thumb-slot {
    width: 36px;
    min-width: 36px;
    flex: 0 0 36px;
  }

  .item-thumb,
  .receipt-thumb,
  .item-thumb-placeholder {
    width: 36px;
    height: 36px;
  }

  .project-items-table {
    background: #f8f9fb; 
    border-radius: 0.5rem;
    font-size: 0.875rem;
  }

  .item-name-cell-content {
    min-width: 120px;
  }

  .mobile-item-list {
    display: grid;
    gap: 0.75rem;
  }

  .mobile-item-card {
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.75rem 0.75rem 0.65rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.06);
  }

  .mobile-item-card > * + * {
    margin-top: 0.4rem;
  }

  .mobile-item-card.needs-attention {
    background-image: linear-gradient(to right, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0));
  }

  .mobile-item-card.overdue {
    box-shadow: inset 4px 0 0 #dc3545;
  }

  .mobile-item-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .mobile-item-top .item-thumb-slot {
    width: 40px;
    min-width: 40px;
    flex: 0 0 40px;
  }

  .mobile-item-top .item-thumb,
  .mobile-item-top .item-thumb-placeholder {
    width: 40px;
    height: 40px;
  }

  .mobile-item-main {
    min-width: 0;
    flex: 1;
  }

  .mobile-item-name {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
  }

  .mobile-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .mobile-item-notes {
    font-size: 0.88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
  }

  .mobile-item-meta {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #f1f3f5;
    font-size: 0.88rem;
  }

  .mobile-item-meta > div {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .mobile-label {
    min-width: 6.25rem;
    font-weight: 600;
    color: #495057;
    flex: 0 0 6.25rem;
  }

  .mobile-item-meta .receipt-thumb {
    width: 32px;
    height: 32px;
    vertical-align: middle;
  }

  .mobile-item-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }

  .mobile-item-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
  }

  .mobile-item-actions .btn-outline-primary {
  border-color: #dee2e6;
}

.mobile-item-actions .btn-outline-secondary {
  border-color: #dee2e6;
}

  .btn-icon {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.mobile-item-actions .btn.btn-icon {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  padding: 0;
}

  /* Needed / Acquired: compact horizontal actions */
  .mobile-item-actions:not(.mobile-item-actions-stacked) {
    align-items: center;
  }

  .mobile-item-actions:not(.mobile-item-actions-stacked) form {
    flex: 0 0 auto;
  }

  .mobile-item-actions:not(.mobile-item-actions-stacked) .btn:not(.btn-icon) {
  width: auto;
  min-width: 0;
}

  .mobile-item-actions:not(.mobile-item-actions-stacked) > a,
  .mobile-item-actions:not(.mobile-item-actions-stacked) > form {
    flex: 0 0 auto;
  }

  .mobile-item-list > * {
    min-width: 0;
  }

  .mobile-item-card {
    min-width: 0;
    width: 100%;
  }

  .mobile-item-notes,
  .mobile-item-name {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Return Queue / Returned: stacked full-width actions */
  .mobile-item-actions-stacked {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-item-actions-stacked .btn,
  .mobile-item-actions-stacked form,
  .mobile-item-actions-stacked form .btn {
    width: 100%;
    min-width: 0;
  }

  .mobile-item-actions .btn-danger {
    font-weight: 600;
  }

  .mobile-item-actions .btn-success {
    font-weight: 600;
  }

  .mobile-item-card .form-text {
    font-size: 0.75rem;
  }

  .mobile-item-notes.note-clamp:not(.is-expanded) {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

}