
/* =========================================================
   PHOENIX PROPERTY INTERNATIONAL
   MAIN STYLESHEET — TIDIED / CONSOLIDATED
   ---------------------------------------------------------
   Notes:
   - duplicate / conflicting rules removed
   - accidental global styles moved out of media queries
   - property page polish kept
   - inspection / room / report styling preserved
   ========================================================= */

/* =========================================================
   1. RESET / BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111;
  color: #f5f1e8;
}

.app-body {
  margin: 0;
  background: #f6f3ed;
  color: #1f1a14;
  font-family: Arial, Helvetica, sans-serif;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

hr {
  border: 0;
  border-top: 1px solid #e7dece;
  margin: 24px 0;
}

h2 {
  color: #1b1b1b;
  }

.muted {
  color: #6b6b6b;
}

.login-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #111111 0%, #1a1a1a 100%);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 460px;
}

.login-panel {
  background: #fffdfa;
  border: 1px solid #dbcdb7;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.login-brand {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.login-logo {
  width: 180px;
  height: auto;
  display: block;
}

.login-brand-copy h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
  color: #17130d;
}

.login-brand-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6d6456;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field input {
  min-height: 46px;
}

.login-actions {
  padding-top: 4px;
}

/* =========================================================
   2. DASHBOARD
   ========================================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.dashboard-card {
  display: flex;
  align-items: center;
  min-height: 110px;
  padding: 24px;
  border-radius: 16px;
  background: #f3f1ec;
  color: #111;
  text-decoration: none;
  border: 1px solid #d8cfbf;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  font-weight: 700;
  font-size: 24px;
}

.dashboard-card:hover {
  background: #d3a24c;
  color: #111;
  border-color: #d3a24c;
}

.dashboard-hero-side p {
  color: #e6dfd0 !important;
}

/* =========================================================
   3. APP SHELL
   ========================================================= */

.app-header {
  background: #0f0f0f;
  border-bottom: 2px solid #d4a441;
}

.app-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-brand-mark {
  background: linear-gradient(135deg, #d3a24c, #f0c77a);
  color: #111;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.app-brand-text strong {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.app-brand-text span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #d6c9b0;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 2px;
  color: #f2eadc;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.app-nav a:hover {
  color: #d4a441;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

td form {
  margin-right: 6px;
}

.app-main {
  padding: 20px 16px 36px;
}

.app-container {
  max-width: 1160px;
  margin: 0 auto;
}

.app-logo {
  display: block;
  width: 92px;
  height: 32px;
  object-fit: contain;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: #d4a441;
  color: #111111;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid #d4a441;
}

.import-btn:hover {
  background: #e0b454;
  color: #111111;
}

/* =========================================================
   4. PAGE HEADER / HERO
   ========================================================= */

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a67c2e;
}

.page-hero h1 {
  margin: 0 0 4px;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
}

.page-subtitle {
  margin: 0;
  color: #716757;
  font-size: 13px;
}

.page-actions,
.action-row,
.room-actions,
.inspection-main-actions,
.inspection-actions,
.report-actions,
.property-actions,
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-row form,
.page-actions form,
.room-actions form,
.inspection-main-actions form,
.inspection-actions form,
.report-actions form,
.property-actions form {
  display: inline-flex;
  margin: 0;
}

/* =========================================================
   5. CARDS / PANELS
   ========================================================= */

.card,
.item-card,
.room-card,
.property-card,
.report-card,
.room-card-accordion {
  background: #fffdfa;
  border: 1px solid #e3d7c5;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
}

.card {
  padding: 20px 22px;
  margin-bottom: 20px;
}

.item-card,
.room-card,
.report-card {
  padding: 18px;
  margin-bottom: 16px;
}

.card h2,
.card h3 {
  margin-top: 0;
  color: #1a1a1a;
}

.card-title {
  margin: 0 0 6px;
  font-size: 22px;
  color: #111;
}

.card-subtitle {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  color: #2e3d52;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: #1b1b1b;
  letter-spacing: -0.01em;
}

.section-caption {
  margin: 4px 0 0;
  font-size: 12px;
  color: #7a705f;
}

.section-heading-row,
.rooms-heading-row,
.section-heading-row-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card:hover {
  transform: translateY(-2px);
}

.admin-users-card {
  padding: 28px 22px 24px;
}

.admin-users-topbar {
  margin-bottom: 18px;
}

.admin-users-section-head {
  margin-bottom: 16px;
}

.admin-users-section-head-secondary {
  margin-bottom: 14px;
}

.admin-users-heading {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #1b1b1b;
}

.admin-users-form {
  display: grid;
  gap: 0;
}

.admin-users-form .label {
  margin-bottom: 6px;
}

.admin-users-form input,
.admin-users-form select {
  margin-bottom: 16px;
}

.admin-users-form-actions {
  margin-top: 4px;
}

.admin-users-divider {
  border: 0;
  border-top: 1px solid #e7dece;
  margin: 22px 0 20px;
}

/* =========================================================
   6. GRID / META / BADGES
   ========================================================= */

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-list {
  display: grid;
  gap: 0;
}

.meta-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #eee5d8;
}

.meta-row:last-child {
  border-bottom: 0;
}

.meta-row strong {
  color: #5d5344;
  font-size: 13px;
  font-weight: 600;
}

.meta-row-notes {
  align-items: start;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ece7dc;
  color: #333;
  vertical-align: middle;
}

.badge-good {
  background: #d9f1df;
  color: #1f6a32;
}

.badge-fair {
  background: #fff0c9;
  color: #8c6300;
}

.badge-poor {
  background: #f8d9d9;
  color: #8b1f1f;
}

.badge-na {
  background: #e5e5e5;
  color: #555;
}

/* =========================================================
   7. FORMS / BUTTONS
   ========================================================= */

.label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #222;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8ccb8;
  border-radius: 10px;
  background: #fffdfa;
  color: #111;
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: #777;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input[name="postcode"] {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="file"] {
  padding: 8px 10px;
  background: #fff;
}

button,
.btn,
.btn-primary,
.btn-outline,
.btn-danger,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 0;
  width: auto;
  padding: 0 12px;
  margin: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

button,
.btn-primary {
  background: #d0a046;
  color: #16120d;
  border: 1px solid #d0a046;
  font-weight: 700;
}

.btn-secondary {
  background: #111;
  color: #fff;
  border: 1px solid #111;
}

.btn-outline {
  background: transparent;
  border: 1px solid #e0d6c2;
  color: #5a5143;
}

.btn-danger {
  background: transparent;
  border: 1px solid #e5b5b5;
  color: #c54141;
}

button:hover,
.btn:hover,
.btn-primary:hover {
  transform: translateY(-1px);
}

/* =========================================================
   8. SHARED ICON BUTTONS / TOOLBARS
   ========================================================= */

.cover-photo-hidden-input,
.item-photo-hidden-input,
.room-photo-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #d8ccb8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fffdfa;
  color: #2c251d;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn-gold {
  background: #d0a046;
  border-color: #d0a046;
  color: #17120c;
}

.icon-btn-gold:hover {
  background: #c5933b;
  border-color: #c5933b;
}

.icon-btn-danger {
  background: #fffdfa;
  border-color: #e1a2a2;
  color: #c54141;
}

.icon-btn-gold-text {
  width: auto;
  min-width: 42px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
}

.icon-btn-sm {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  flex: 0 0 34px !important;
  padding: 0 !important;
  font-size: 18px !important;
}

.cover-photo-toolbar,
.cover-photo-upload-form-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cover-photo-upload-form,
.cover-photo-delete-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.cover-photo-upload-form button[type="submit"],
.cover-photo-delete-form button[type="submit"] {
  margin: 0;
}

/* =========================================================
   9. PHOTOS / VIEWER
   ========================================================= */

.photo-list,
.report-body .photo-list,
.report-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.photo-card {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  background: #f6f4ef;
  border: 1px solid #ddd4c4;
}

.photo-card img,
.report-body .photo-list img,
.report-photo-list img {
  width: 180px;
  height: 135px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ddd4c4;
}

.photo-card .photo-viewer-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-card .photo-viewer-trigger img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: block;
}

.photo-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

.photo-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 18, 12, 0.72);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.photo-card:hover .photo-delete-btn,
.photo-card:focus-within .photo-delete-btn {
  opacity: 1;
  transform: scale(1);
}

.photo-delete-btn:hover {
  background: rgba(197, 65, 65, 0.95);
  transform: scale(1);
}

.photo-viewer-trigger,
.report-photo-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}

.photo-viewer-trigger img {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
}

.report-photo-list {
  gap: 14px;
  margin: 10px 0 16px;
}

.report-photo-trigger img {
  width: 178px;
  height: 132px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #ddd4c4;
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.report-photo-trigger:hover img {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.photo-viewer-modal {
  display: none;
}

.photo-viewer-modal.is-open {
  display: block;
}

.photo-viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.82);
  backdrop-filter: blur(3px);
  z-index: 9998;
}

.photo-viewer-dialog {
  position: fixed;
  inset: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer-dialog img {
  max-width: min(92vw, 1300px);
  max-height: 84vh;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: block;
}

.photo-viewer-counter {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 17, 13, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.photo-viewer-close,
.photo-viewer-nav {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 17, 13, 0.72);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.photo-viewer-close:hover,
.photo-viewer-nav:hover {
  background: rgba(208, 160, 70, 0.96);
  color: #16120d;
  transform: scale(1.04);
}

.photo-viewer-close {
  top: 18px;
  right: 18px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.photo-viewer-prev,
.photo-viewer-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 0;
  line-height: 1;
}

.photo-viewer-prev::before,
.photo-viewer-next::before {
  display: block;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.photo-viewer-prev::before {
  content: '‹';
  transform: translateX(-1px);
}

.photo-viewer-next::before {
  content: '›';
  transform: translateX(1px);
}

.photo-viewer-prev:hover,
.photo-viewer-next:hover {
  transform: translateY(-50%) scale(1.04);
}

.photo-viewer-prev {
  left: 18px;
}

.photo-viewer-next {
  right: 18px;
}

/* =========================================================
   10. PROPERTY / REPORT LISTS
   ========================================================= */

.property-card {
  background: #ffffff;
  border: 1px solid #e6dccb;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.property-card + .property-card {
  margin-top: 18px;
}

.property-title {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: #1f3f6d;
}

.property-address {
  font-size: 13px;
  color: #6f6657;
  margin-top: 2px;
}

.property-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #7a705f;
  margin-top: 6px;
}

.property-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee3cf;
}

.property-reports {
  margin-top: 16px;
  padding-top: 10px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-top: 1px solid #eadfcd;
}

.report-row:first-child {
  border-top: 0;
}

.report-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.report-type-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3e7c8;
  color: #6e5312;
  font-size: 13px;
  font-weight: 700;
}

.report-date {
  color: #5f6672;
  font-size: 14px;
}

.report-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-row-actions .btn,
.report-row-actions .btn-outline {
  min-height: 32px;
  padding: 0 13px;
  font-size: 14px;
}

/* =========================================================
   11. PROPERTY PAGE FORMS
   ========================================================= */

.property-address-grid,
.property-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-bottom: 14px;
}

.property-address-grid-wide,
.property-search-grid-wide {
  grid-column: 1 / -1;
}

/* =========================================================
   12. ROOM ITEM CARDS / ROOM PHOTOS
   ========================================================= */

.room-item-list {
  display: grid;
  gap: 10px;
}

.room-item-card {
  background: #fffdfa;
  border: 1px solid #e3d7c5;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
  overflow: hidden;
}

.room-item-card-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
}

.room-item-card-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  background: #fcf7ee;
  border-right: 1px solid #eee1cb;
}

.room-item-card-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.room-item-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-item-ref {
  font-size: 18px;
  font-weight: 700;
  color: #9b6b17;
}

.room-item-tag {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.item-drag-handle {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  border-radius: 999px;
  background: #fff8e8;
  border: 1px solid #e2cfaa;
}

.item-drag-handle:active {
  cursor: grabbing;
}

.drag-icon {
  font-size: 22px;
  font-weight: 700;
  color: #b17719;
  line-height: 1;
}

.room-item-grid,
.room-item-grid-dynamic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.room-item-field {
  display: grid;
  gap: 4px;
}

.room-item-field-wide {
  min-width: 0;
  grid-column: 1 / -1;
}

.room-item-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a705f;
}

.room-item-value {
  min-height: 46px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e7dccb;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
}

.room-item-value .cell-display {
  min-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.room-item-value.editable-cell:hover {
  background: #faf7ef;
}

.photo-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f3e8;
  color: #1d6b3c;
  font-size: 12px;
  font-weight: 700;
}

.reports-search-card {
  margin-bottom: 24px;
}

.reports-search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 12px 14px;
  margin-bottom: 14px;
}

.reports-filter-grid-wide {
  grid-column: 1 / -1;
}

.reports-list-section {
  display: grid;
  gap: 0;
}

.report-summary-card-ui {
  padding: 20px;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.report-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.report-card-address {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  color: #1f3f6d;
}

.report-card-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px 0 16px;
  border-top: 1px solid #eee3cf;
  border-bottom: 1px solid #eee3cf;
  margin-bottom: 14px;
}

.report-meta-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.report-meta-cell-wide {
  grid-column: 1 / -1;
}

.report-meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a705f;
}

.report-meta-value {
  font-size: 15px;
  color: #201a14;
  line-height: 1.45;
  word-break: break-word;
}

.report-share-box summary {
  list-style: none;
}

.report-share-box summary::-webkit-details-marker {
  display: none;
}

.room-item-photos-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #efe5d7;
}

.item-photos-toggle {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.item-photos-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-photos-row {
  margin-top: 4px;
}

.item-photos-row.is-collapsed {
  display: none;
}

.item-photos-row.is-collapsed .item-photos-panel-body {
  display: none;
}

.item-photos-panel {
  padding: 8px 0;
}

.item-photos-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.item-row-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.room-photos-card {
  display: grid;
  gap: 0;
}

.room-photos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.room-photos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.room-photos-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-photos-chevron {
  font-size: 11px;
  color: #ad8440;
  transition: transform 0.18s ease;
}

.room-photos-toggle[aria-expanded="true"] .room-photos-chevron {
  transform: rotate(180deg);
}

.room-photos-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-photos-actions form {
  margin: 0;
  display: flex;
  align-items: center;
}

.room-photos-body {
  margin-top: 14px;
}

.room-photos-body.is-collapsed {
  display: none;
}

.room-photos-panel {
  padding-top: 2px;
}

/* =========================================================
   13. ROOM PAGE / EMBED
   ========================================================= */

.room-hero-card,
.room-item-form-card,
.room-item-form-card-compact,
.room-embed-add-item-card {
  padding: 14px 16px;
}

.room-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.room-hero-top-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.room-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.room-hero-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f0e4cb;
  color: #8a651c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.room-hero-copy {
  min-width: 0;
}

.room-hero-title {
  margin-bottom: 4px;
}

.room-hero-meta {
  margin-top: 4px;
}

.room-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d8c5a2;
  background: #fffdfa;
  color: #2a2116;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.room-back-link:hover {
  background: #f7f1e7;
}

.room-item-form-card .section-heading-row,
.room-item-form-card .section-heading-row-compact {
  margin-bottom: 8px;
}

.room-item-form-card .section-title,
.room-item-form-head .section-title {
  margin-bottom: 2px;
}

.room-item-form-card .section-caption,
.room-item-form-head .section-caption {
  margin: 0;
  font-size: 13px;
  color: #7a705f;
}

.room-item-form-shell,
.room-item-form-shell-compact {
  display: grid;
  gap: 10px;
}

.room-item-form-fields {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px 14px;
  align-items: start;
}

.room-item-form-fields textarea {
  grid-column: 1 / -1;
  min-height: 70px;
}

.room-item-form-fields .label,
.room-item-form-fields-compact .label {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6e624f;
}

.room-item-form-fields input,
.room-item-form-fields textarea,
.room-item-form-fields select,
.room-item-form-fields-compact input,
.room-item-form-fields-compact textarea,
.room-item-form-fields-compact select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: #fffdfa;
  border: 1px solid #dbc8a8;
  font: inherit;
}

.room-item-form-fields-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-item-form-fields-compact textarea {
  min-height: 72px;
  resize: vertical;
}

.room-item-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.room-item-form-actions .btn,
.room-item-form-actions button {
  margin: 0;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.room-item-form-actions .btn-outline {
  background: #fffdfa;
  border: 1px solid #d8c5a2;
  color: #2a2116;
}

.room-item-form-actions .btn-outline:hover {
  background: #f7f1e7;
}

.room-item-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.room-item-form-head-actions,
.room-item-form-submit-wrap,
.room-item-form-secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#custom-room-name-wrap {
  display: none;
}

#room-template-select,
#custom-room-name-input {
  width: 100%;
}

.room-embed-inner {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.room-card-panel .card,
.room-embed-inner .card {
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: none;
}

.room-card-panel .section-title,
.room-embed-inner .section-title {
  font-size: 16px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.room-card-panel .section-caption,
.room-embed-inner .section-caption,
.room-card-panel .muted,
.room-embed-inner .muted {
  font-size: 12px;
  line-height: 1.35;
}

.room-card-panel .photo-count-badge,
.room-embed-inner .photo-count-badge {
  font-size: 12px;
  padding: 4px 10px;
}

.room-card-panel .icon-btn,
.room-embed-inner .icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  font-size: 16px;
}

.room-embed-add-item-card .room-item-form-head {
  margin-bottom: 8px;
}

.room-embed-add-item-card .section-title {
  font-size: 15px;
}

.room-embed-add-item-card .section-caption {
  font-size: 12px;
}

.room-embed-add-item-card .room-item-form-fields-compact {
  gap: 8px;
}

.room-embed-add-item-card .label {
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.room-embed-add-item-card input,
.room-embed-add-item-card textarea,
.room-embed-add-item-card select {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.room-embed-add-item-card textarea {
  min-height: 66px;
}

.room-card-panel .room-photos-head,
.room-embed-inner .room-photos-head {
  min-height: auto;
}

.room-card-panel .room-item-photos-strip,
.room-embed-inner .room-item-photos-strip {
  padding-top: 8px;
}

.room-card-panel .room-item-ref,
.room-embed-inner .room-item-ref {
  font-size: 14px;
}

.room-card-panel .badge,
.room-embed-inner .badge {
  font-size: 12px;
  padding: 4px 10px;
}

.room-card-panel .room-item-label,
.room-embed-inner .room-item-label {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.room-card-panel .room-item-value,
.room-embed-inner .room-item-value {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
}

.room-action-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
}

.room-card-right .room-header-form {
  display: flex;
  align-items: center;
}

.room-card-right .btn-room-header {
  min-height: 32px;
  padding: 0;
}

.room-drag-handle.room-action-icon {
  background: #d0a046;
  color: #16120d;
  border: 1px solid #d0a046;
  cursor: grab;
  user-select: none;
}

.room-drag-handle.room-action-icon:active {
  cursor: grabbing;
}

.room-page-saved-items .muted,
.room-item-list + .muted,
section > .muted {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.3;
}

/* =========================================================
   14. ITEM ACTIONS / INLINE EDITING
   ========================================================= */

.item-actions-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.item-file-row {
  width: 100%;
  overflow: hidden;
}

.item-file-row input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
}

.item-button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.item-button-row button,
.item-button-row .btn,
.item-actions button,
.item-actions .btn {
  width: 100%;
  min-width: 0;
}

.inline-photo-form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-photo-form input[type="file"] {
  max-width: 220px;
  font-size: 14px;
  margin: 0;
}

.editable-cell,
.editable-room-name,
.report-editable-cell {
  cursor: pointer;
}

.editable-cell:hover,
.editable-room-name:hover {
  background: #faf7ef;
}

.report-editable-cell:hover {
  background: #fbf7ef;
}

.editable-cell .cell-display,
.report-editable-cell .cell-display {
  display: block;
  min-height: 22px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.editable-cell.is-editing,
td.is-editing,
.report-editable-cell.is-editing {
  padding: 6px 8px;
  vertical-align: top;
}

.editable-room-name {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
}

.editable-room-name.is-editing {
  background: #fff8e8;
}

.inline-editor,
.inline-edit-input,
.inline-edit-textarea,
.inline-room-editor {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cfc7b8;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  outline: none;
}

.inline-editor:focus {
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

textarea.inline-editor,
.inline-editor-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.inline-room-editor {
  min-width: 220px;
  padding: 6px 8px;
  border: 1px solid #c9b37a;
}

/* =========================================================
   15. INSPECTION PAGE
   ========================================================= */

.inspection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.85fr);
  gap: 16px;
  margin-bottom: 12px;
  align-items: start;
}

.inspection-main-column,
.inspection-side-column {
  min-width: 0;
}

.inspection-side-column {
  display: grid;
  gap: 6px;
  align-content: start;
}

.inspection-card {
  background: #fcfbf8;
}

.inspection-details-card {
  padding: 14px 18px 12px;
}

.inspection-details-card .section-heading-row {
  margin-bottom: 8px;
}

.inspection-details-card .section-title {
  font-size: 15px;
}

.inspection-details-card .section-caption {
  font-size: 12px;
  margin-top: 2px;
}

.inspection-meta-list .meta-row {
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  padding: 6px 0;
  min-height: 0;
}

.inspection-meta-list .meta-row strong {
  font-size: 13px;
  line-height: 1.2;
}

.inspection-actions {
  gap: 8px;
  margin-top: 12px;
}

.inspection-actions-vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.inspection-actions-vertical .btn,
.inspection-actions-vertical button,
.inspection-actions-vertical form {
  width: 100%;
}

.inspection-actions-card,
.inspection-cover-shell {
  padding: 14px 16px;
  margin: 0 !important;
}

.inspection-static-value {
  font-size: 14px;
  line-height: 1.25;
  color: #1f1a14;
}

.inspection-inline-wrap,
.inspection-inline-wrap-wide {
  display: block;
  width: 100%;
  max-width: 100%;
}

.inspection-inline-input,
.inspection-details-card input,
.inspection-details-card select,
.inspection-details-card textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 14px;
  border-radius: 10px;
}

.inspection-inline-textarea,
.inspection-details-card textarea {
  resize: vertical;
  min-height: 86px;
}

.inspection-inline-input.is-saving {
  opacity: 0.7;
}

.inspection-inline-input.is-saved {
  border-color: #6aa56a;
}

.inspection-inline-input.is-error {
  border-color: #d9534f;
}

/* Cover photo */

.inspection-cover-shell .section-caption {
  margin-bottom: 8px;
}

.inspection-cover-card {
  display: grid;
  gap: 10px;
}

.inspection-cover-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inspection-cover-heading {
  min-width: 0;
}

.inspection-cover-heading .section-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
}

.inspection-cover-heading .section-caption {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.25;
}

.cover-photo-toolbar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}

.cover-photo-toolbar-head .cover-photo-upload-form,
.cover-photo-toolbar-head .cover-photo-delete-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.inspection-cover-photo-preview {
  margin-top: 0;
  margin-bottom: 2px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e4d8c6;
  background: #f3eee5;
  aspect-ratio: 16 / 9;
}

.inspection-cover-photo-preview img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  border: 0;
  border-radius: 12px;
}

.inspection-cover-photo-preview img:hover {
  transform: scale(1.01);
}

.inspection-cover-empty {
  align-items: start;
  padding: 4px 0 0;
}

.inspection-cover-empty-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 2px;
}

.inspection-cover-empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2e7d2;
  font-size: 16px;
  flex: 0 0 38px;
}

.inspection-cover-empty-text {
  display: grid;
  gap: 2px;
}

.inspection-cover-empty-text strong {
  font-size: 14px;
}

.inspection-cover-empty-text span {
  font-size: 12px;
  color: #7c725f;
}

.inspection-cover-shell .cover-photo-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.inspection-cover-shell .cover-photo-upload-form {
  display: contents;
}

.inspection-cover-shell .cover-photo-upload-form input[type="file"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.inspection-cover-shell .cover-photo-upload-form button,
.inspection-cover-shell .cover-photo-delete-form button {
  margin: 0;
  min-width: 140px;
  white-space: nowrap;
}

.cover-photo-upload-form-single {
  display: grid;
  gap: 8px;
}

.cover-photo-upload-form-single input[type="file"] {
  width: 100%;
  max-width: 100%;
}

/* add room / rooms */

.inspection-add-room-card {
  margin-bottom: 10px;
  padding: 14px 16px;
}

.compact-form {
  display: grid;
  gap: 8px;
}

.compact-form-inline {
  gap: 0;
}

.compact-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.compact-form-field {
  min-width: 0;
}

.compact-form-actions,
.compact-form-actions-inline {
  display: flex;
  gap: 8px;
  margin-top: 0;
  white-space: nowrap;
}

.inspection-rooms-section {
  margin-top: 8px;
}

.rooms-heading-row {
  margin-bottom: 8px;
}

.room-accordion-list {
  display: grid;
  gap: 6px;
}

.room-card-accordion {
  padding: 0;
  overflow: hidden;
  background: #fdfbf8;
  border: 1px solid #e5dac9;
  transition: box-shadow 0.18s ease;
  margin: 0;
}

.room-card-accordion:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.room-card-toggle {
  width: 100%;
  display: block;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
}

.room-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.room-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-card-heading-text {
  min-width: 0;
  line-height: 1.15;
}

.room-card-index {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #f0e4cb;
  color: #7a591c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.room-card-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.room-card-meta {
  display: block;
  margin-top: 1px;
  color: #7c715f;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 500;
}

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

.btn-room-header,
.room-drag-handle {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.room-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 999px;
  background: #d0a046;
  color: #16120d;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}

.room-chevron {
  font-size: 9px;
  color: #ad8440;
  transition: transform 0.2s ease;
}

.room-card-toggle[aria-expanded="true"] .room-chevron {
  transform: rotate(180deg);
}

.room-card-panel {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid #eadfcd;
  background: #fffdfa;
}

.room-card-panel.is-open {
  display: block;
}

.room-preview-simple {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #eadfcd;
  border-radius: 14px;
  background: #fff;
}

.room-embed-loading {
  padding: 8px 0;
  font-size: 13px;
  color: #746a59;
}

.room-header-form {
  margin: 0;
}

/* =========================================================
   16. REPORTS / REPORT VIEW
   ========================================================= */

.report-container {
  padding-top: 30px;
}

.report-main {
  padding-top: 18px;
}

.report-body .app-main {
  padding: 6px 0;
  min-height: calc(100vh - 80px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.report-body .app-container {
  width: 100%;
  max-width: 900px;
  padding: 0 8px;
}

.report-body .card {
  padding: 16px;
  margin: 0 auto;
  border-radius: 12px;
}

.report-toolbar-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 12px 20px;
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #ddd2bf;
}

.report-top-actions {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.report-page {
  min-height: 240mm;
  width: 100%;
  padding-top: 84px;
}

.report-page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  page-break-after: always;
  break-after: page;
}

.report-summary-card {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.report-section,
.report-toc,
.report-signature {
  padding: 14px 16px;
  border-radius: 16px;
}

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee2cf;
}

.report-section-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.back-to-toc {
  float: none;
  margin: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #b57d1f;
  text-decoration: none;
}

.back-to-toc:hover {
  text-decoration: underline;
}

.report-toc .section-title,
.report-signature .section-title,
.report-section .section-title {
  margin: 0;
}

.toc-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.toc-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px dotted #cdbfa5;
  font-size: 14px;
}

.toc-row a {
  display: block;
  color: #1b1b1b;
  text-decoration: none;
}

.toc-row a:hover {
  text-decoration: underline;
}

/* report cover */

.report-cover {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  page-break-after: always;
  break-after: page;
  position: relative;
  z-index: 2;
}

.report-cover-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
}

.report-cover-logo {
  width: 420px;
  max-width: 92%;
  height: auto;
  display: block;
  margin: 0 auto 24px;
}

.report-cover h1 {
  margin: 12px 0;
  font-size: 38px;
  line-height: 1.15;
  color: #1b1b1b;
}

.report-cover-type {
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c96d10;
}

.report-cover-meta {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e8d7ba;
  border-radius: 14px;
  text-align: left;
}

.report-cover-meta div {
  margin-bottom: 10px;
  font-size: 15px;
}

.report-cover-meta div:last-child {
  margin-bottom: 0;
}

.report-cover-photo-wrap {
  margin: 18px auto 22px;
  max-width: 640px;
}

.report-cover-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #d8cfbf;
  display: block;
}

/* report table */

.report-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  padding: 8px 12px;
  border: 1px solid #e3ddd3;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.4;
}

.report-table th {
  background: #dfd8cd;
  border: 1px solid #d7cfc2;
  text-align: left;
  font-weight: 600;
}

.report-table td:first-child {
  text-align: center;
  font-weight: 600;
}

.report-table th:first-child,
.report-table td:first-child,
.report-table .cell-ref,
.report-col-ref {
  width: 9%;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
}

.report-col-name { width: 17%; }
.report-col-description { width: 34%; }
.report-col-condition { width: 24%; }
.report-col-checkin,
.report-col-checkout { width: 18%; }
.report-col-location { width: 24%; }
.report-col-serial { width: 16%; }
.report-col-reading { width: 14%; }
.report-col-test { width: 20%; }

.report-table--standard .report-col-name,
.report-table--keys.report-table--standard .report-col-name { width: 16%; }

.report-table--standard .report-col-description,
.report-table--keys.report-table--standard .report-col-description { width: 34%; }

.report-table--standard .report-col-condition,
.report-table--keys.report-table--standard .report-col-condition { width: 24%; }

.report-table--schedule.report-table--standard .report-col-name { width: 26%; }
.report-table--schedule.report-table--standard .report-col-condition { width: auto; }

.report-table--standard.report-table--checkout .report-col-name,
.report-table--keys.report-table--checkout .report-col-name { width: 15%; }

.report-table--standard.report-table--checkout .report-col-description,
.report-table--keys.report-table--checkout .report-col-description { width: 28%; }

.report-table--standard.report-table--checkout .report-col-checkin,
.report-table--standard.report-table--checkout .report-col-condition,
.report-table--keys.report-table--checkout .report-col-checkin,
.report-table--keys.report-table--checkout .report-col-condition { width: 18%; }

.report-table--schedule.report-table--checkout .report-col-name { width: 24%; }
.report-table--schedule.report-table--checkout .report-col-checkin,
.report-table--schedule.report-table--checkout .report-col-condition { width: 28%; }

.report-table--smoke .report-col-name { width: 18%; }
.report-table--smoke .report-col-location { width: 30%; }
.report-table--smoke .report-col-test,
.report-table--smoke .report-col-checkin,
.report-table--smoke .report-col-condition { width: 20%; }

.report-table--meter .report-col-name { width: 16%; }
.report-table--meter .report-col-location { width: 24%; }
.report-table--meter .report-col-serial { width: 18%; }
.report-table--meter .report-col-reading,
.report-table--meter .report-col-checkin,
.report-table--meter .report-col-condition { width: 16%; }

.report-table--schedule .report-col-name { width: 22%; }
.report-table--schedule .report-col-condition { width: auto; }

.report-table--keys .report-col-name,
.report-table--smoke .report-col-name { width: 16%; }
.report-table--keys .report-col-description,
.report-table--smoke .report-col-description { width: 38%; }
.report-table--keys .report-col-condition,
.report-table--smoke .report-col-condition { width: 22%; }

.report-condition-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.report-condition-text {
  line-height: 1.35;
}

.report-condition-badge .badge,
.report-table td .badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  padding: 5px 10px;
}

.report-table td.tag-cell {
  text-align: center;
  vertical-align: middle;
}

/* report signature */

.report-signature-declaration {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid #e3d7c5;
  border-radius: 12px;
  background: #faf7f2;
  font-size: 14px;
  line-height: 1.5;
}

.report-signature-declaration p {
  margin: 0 0 6px;
}

.report-signature-declaration p:last-child {
  margin-bottom: 0;
}

.sig-panels {
  column-gap: 24px;
  row-gap: 32px;
  margin-top: 18px;
}

.sig-panel {
  min-height: 0;
  padding: 22px 24px;
  border: 1px solid #d8cfbf;
  border-radius: 18px;
  background: #fcfbf8;
  display: flex;
  flex-direction: column;
}

.sig-panel + .sig-panel {
  margin-top: 24px;
}

.sig-panel-tenants {
  gap: 18px;
}

.sig-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1b1b1b;
}

.sig-signatory {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sig-signatory-single {
  margin-top: 2px;
}

.sig-sign-line {
  width: 100%;
  height: 34px;
  margin: 0 0 4px;
  border-bottom: 2px solid #4a4a4a;
}

.sig-meta-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.sig-meta-label {
  font-size: 14px;
  font-weight: 500;
  color: #5f5648;
  white-space: nowrap;
}

.sig-meta-line {
  height: 22px;
  border-bottom: 1.5px solid #6a6a6a;
}

.sig-meta-line-date {
  max-width: 180px;
}

.sig-signatory-divider {
  height: 1px;
  background: #e7dece;
  margin: 2px 0;
}

/* watermark / print */

.report-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  max-width: 900px;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.report-watermark img {
  width: 100%;
  height: auto;
  display: block;
}

.report-cover,
.report-toc,
.report-section,
.report-signature,
.report-table,
.card {
  position: relative;
  z-index: 1;
}

/* =========================================================
   17. ALERTS / SHARE
   ========================================================= */

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fdecea;
  color: #b42318;
  border: 1px solid #f5c2c0;
}

.report-share-box {
  display: inline-block;
}

.share-report-form {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

/* =========================================================
   18. RESPONSIVE
   ========================================================= */

@media (max-width: 920px) {
  .inspection-layout {
    grid-template-columns: 1fr;
  }

  .inspection-side-column {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .compact-form-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-form-actions-inline {
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .inspection-cover-shell .cover-photo-actions {
    grid-template-columns: 1fr;
  }

  .inspection-cover-shell .cover-photo-upload-form {
    display: grid;
    gap: 8px;
  }

  .inspection-cover-shell .cover-photo-delete-form {
    justify-self: start;
  }

  .inspection-cover-card-head {
    align-items: flex-start;
  }
}

@media (max-width: 800px) {
    .grid-2,
  .grid-3,
  .signature-grid-clean,
  .sig-panels,
  .property-address-grid,
  .property-search-grid,
  .reports-filter-grid {
    grid-template-columns: 1fr;
  }

  .property-address-grid-wide,
  .property-search-grid-wide {
    grid-column: auto;
  }

  .meta-row,
  .sig-meta-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .inline-photo-form input[type="file"] {
    max-width: 100%;
  }

  .page-hero h1 {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }

  .app-brand {
    justify-content: flex-start;
  }

  .app-nav {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }

  .app-nav a {
    font-size: 14px;
  }

  .import-btn {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  .inspection-side-column {
    grid-template-columns: 1fr;
  }

  .room-hero-top,
  .room-hero-top-split,
  .room-card-main,
  .room-item-form-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .room-item-form-actions {
    flex-direction: row;
    align-items: stretch;
  }

  .room-card-right,
  .room-photos-actions,
  .property-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .property-actions .btn,
  .property-actions .btn-outline,
  .property-actions .btn-danger {
    min-height: 36px;
    font-size: 13px;
    padding: 0 12px;
  }

  .report-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .report-row-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .room-item-card-main,
  .room-item-grid,
  .room-item-grid-dynamic {
    grid-template-columns: 1fr;
  }

  .room-item-card-rail {
    flex-direction: row;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid #eee1cb;
  }

  .room-item-card-top,
  .room-photos-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-item-field-wide {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .photo-viewer-dialog {
    inset: 12px;
  }

  .photo-viewer-dialog img {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 14px;
  }

  .photo-viewer-close,
  .photo-viewer-nav {
    width: 42px;
    height: 42px;
  }

  .photo-viewer-close {
    top: 10px;
    right: 10px;
    font-size: 22px;
  }

  .photo-viewer-prev {
    left: 10px;
  }

  .photo-viewer-next {
    right: 10px;
  }

  .photo-viewer-counter {
    top: 10px;
    font-size: 12px;
    min-height: 30px;
    padding: 0 12px;
  }

  .report-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .back-to-toc {
    margin-top: 2px;
  }
}

@media (min-width: 921px) {
  .inspection-layout {
    align-items: stretch;
  }

  .inspection-main-column,
  .inspection-side-column {
    min-height: 0;
  }

  .inspection-main-column {
    display: flex;
  }

  .inspection-details-card {
    flex: 1 1 auto;
    height: 100%;
    margin: 0 !important;
  }

  .inspection-side-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    height: 100%;
  }

  .inspection-cover-shell {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
  }

  .inspection-cover-card {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  .inspection-cover-photo-preview {
    min-height: 0;
    height: 100%;
    max-height: none !important;
    aspect-ratio: auto !important;
    overflow: hidden;
  }

  .inspection-cover-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

@media print {
  .report-toolbar-shell {
    display: none !important;
  }

  .card,
  .report-section,
  .report-signature,
  .report-toc,
  .report-cover,
  .photo-list,
  img,
  .report-table tr,
  .report-table td,
  .report-table th,
  .item-photos-row,
  .item-main-row,
  tbody {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-table {
    width: 100%;
    border-collapse: collapse;
  }

  .report-table thead {
    display: table-header-group;
  }

  .report-table tfoot {
    display: table-footer-group;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-cover,
  .report-toc,
  .report-signature,
  .report-section {
    width: 100%;
  }
}
