/* ── Base ── */
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: #f5f6fa;
  font-size: 15px;
}

.navbar-brand { font-weight: 700; font-size: 1.1rem; }

.card {
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-radius: .5rem;
}
.card-header {
  background: #fff;
  border-bottom: 2px solid #f0f0f0;
  font-weight: 600;
}

/* Status colors */
.text-orange { color: #fd7e14 !important; }
.bg-orange { background-color: #fd7e14 !important; }

/* Photo gallery */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .5rem;
}
.photo-item {
  display: flex;
  flex-direction: column;
}
.photo-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: .375rem;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: border-color .2s;
}
.photo-meta {
  font-size: .65rem;
  color: #6c757d;
  text-align: center;
  margin-top: .2rem;
  line-height: 1.2;
  word-break: break-all;
}

/* Checklist items */
.checklist-item {
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  padding: .75rem 1rem;
  background: #fff;
  transition: border-color .2s, background .2s;
}
.checklist-item.is-bad  { border-color: #dc3545; background: #fff5f5; }
.checklist-item.is-good { border-color: #198754; background: #f0fff4; }

/* Hover cards */
.hover-card { transition: box-shadow .2s, transform .2s; }

/* Table header */
.table th { background: #f8f9fa; white-space: nowrap; }

/* Stat cards */
.stat-number { font-size: 2.2rem; font-weight: 700; line-height: 1; }

/* List group card style */
.list-group-item { border-left: none; border-right: none; }
.list-group-item:first-child { border-top: none; border-radius: .5rem .5rem 0 0; }
.list-group-item:last-child  { border-radius: 0 0 .5rem .5rem; }
.list-group { border-radius: .5rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); background:#fff; }
.list-group-item-action:active { background-color: #f0f4ff; }

/* Ensure min-width truncation works */
.min-w-0 { min-width: 0; }

/* Force LTR for hyphenated numbers (e.g. cabinet "8-1" must not render as "1-8") */
.n { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ── Touch-friendly buttons (mobile) ── */
.btn { touch-action: manipulation; }

/* ── Mobile-first adjustments ── */
@media (max-width: 767.98px) {
  .container-fluid { padding-left: .75rem; padding-right: .75rem; }

  h4 { font-size: 1.1rem; }
  h5 { font-size: 1rem; }

  /* Larger tap targets */
  .btn:not(.btn-sm) { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .list-group-item { padding-top: .9rem; padding-bottom: .9rem; }

  /* Compact tables */
  .table { font-size: 0.85rem; }
  .table th, .table td { padding: .4rem .5rem; }

  /* Cards */
  .card-body { padding: .75rem; }
  .card-header { padding: .65rem .75rem; }

  /* Navbar expanded items */
  .navbar-collapse .nav-link {
    padding: .75rem 1rem !important;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .navbar-collapse .dropdown-menu { margin: 0 1rem .5rem; }

  /* Photo grid — bigger thumbnails on mobile */
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .4rem; }
  .photo-thumb { height: 100px; }

  /* Stat cards — fit 3 per row */
  .col-6.col-md-2 { flex: 0 0 33.333%; max-width: 33.333%; }

  /* Dashboard quick links — 2 per row */
  .hover-card .card-body { padding: .75rem .5rem; }
  .hover-card i.fs-2 { font-size: 1.5rem !important; }
}

/* Remove hover effects on touch devices */
@media (hover: none) {
  .hover-card:hover { box-shadow: 0 1px 4px rgba(0,0,0,.08); transform: none; }
  .photo-thumb:hover { border-color: #dee2e6; }
}
