:root {
    --app-bg: #f4f5f7;
    --app-panel: #ffffff;
    --app-soft: #eef0f3;
    --app-text: #181b1f;
    --app-muted: #707782;
    --app-line: #dfe3e8;
    --app-sidebar: 278px;
}

/* Booking reviews */
.captain-review-stars {
  display: inline-flex;
  gap: 2px;
  color: #ffb400;
  white-space: nowrap;
}

.captain-review-distribution {
  display: grid;
  gap: 5px;
}

.captain-review-distribution > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--app-muted);
  font-size: .82rem;
}

.captain-review-distribution i {
  color: #ffb400;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--app-text); background: var(--app-bg); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-muted { color: var(--app-muted); }
.min-w-0 { min-width: 0; }
.flash-layer { z-index: 2000; width: min(620px, 100%); }

.app-shell { min-height: 100vh; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; width: var(--app-sidebar); padding: 25px 20px; border-right: 1px solid var(--app-line); background: #fff; overflow-y: auto; transition: transform .2s ease; }
.app-main { min-height: 100vh; margin-left: var(--app-sidebar); padding: 25px clamp(18px, 3vw, 42px) 50px; }
.app-logo { flex: 0 0 auto; display: inline-grid; place-items: center; width: 55px; height: 55px; border-radius: 15px; overflow: hidden; background: #fff; }
.app-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-nav-heading { margin: 24px 12px 8px; color: var(--app-muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-nav-link { display: flex; align-items: center; gap: 12px; min-height: 45px; margin: 3px 0; padding: 10px 13px; border-radius: 13px; color: #505761; text-decoration: none; font-weight: 500; }
.app-nav-link i { width: 22px; font-size: 1.05rem; text-align: center; }
.app-nav-link:hover { color: #17191d; background: var(--app-soft); }
.app-nav-link.active { color: #fff; background: #17191d; }

.app-topbar {
    display: flex;
    align-items: center;
    min-height: 50px;
    margin-top: -25px;
    margin-right: calc(clamp(18px, 3vw, 42px) * -1);
    margin-left: calc(clamp(18px, 3vw, 42px) * -1);
    padding: 1.2rem 2.5rem;
    border-bottom: 1px solid var(--app-line);
    background: #fff;
}
.app-user-menu { display: inline-flex; align-items: center; gap: 10px; padding: 5px 8px; border: 0; border-radius: 14px; background: transparent; }
.app-user-menu:hover { background: var(--app-soft); }
.app-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.app-avatar-fallback { display: inline-grid; place-items: center; background: #17191d; color: #fff; font-weight: 700; }
.app-dropdown { min-width: 220px; border: 1px solid var(--app-line); border-radius: 16px; }

.app-card { border: 1px solid var(--app-line); border-radius: 21px; background: var(--app-panel); }
.app-stat-card { padding: 22px; }
.app-stat-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--app-soft); font-size: 1.25rem; }
.app-page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.app-page-heading h1 { margin: 0 0 4px; font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; }

.btn {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.btn-sm { min-height: 34px; border-radius: 999px; }
.btn-app-dark { color: #fff; background: #17191d; border-color: #17191d; }
.btn-app-dark:hover { color: #fff; background: #000; border-color: #000; }
.btn-soft { color: #272b30; background: var(--app-soft); border-color: var(--app-soft); }
.btn-soft:hover { color: #000; background: #e2e5e9; border-color: #e2e5e9; }

.form-label { margin-bottom: 7px; font-size: .86rem; font-weight: 600; }
.form-control, .form-select { min-height: 44px; border-color: #d9dde2; border-radius: 13px; }
.form-control::placeholder, input::placeholder, textarea::placeholder { color: rgba(61, 73, 85, 0.38); opacity: 1; }
.form-control:focus, .form-select:focus { border-color: #888f98; box-shadow: 0 0 0 .2rem rgba(23, 25, 29, .08); }
textarea.form-control { min-height: auto; }
.form-check-input { width: 1.15rem; height: 1.15rem; margin-top: .12rem; }
.modal-content { border: 0; border-radius: 22px; }
.modal-header, .modal-body { padding: 1.4rem 1.6rem; }
.modal-footer { padding: 1rem 1.6rem 1.4rem; }

.table { --bs-table-bg: transparent; }
.table thead th { padding: 14px 16px; border-bottom-color: var(--app-line); color: var(--app-muted); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { padding: 15px 16px; border-bottom-color: #edf0f2; }
.table tbody tr:last-child td { border-bottom: 0; }
.badge { padding: .45rem .72rem; line-height: 1; font-weight: 600; }
.badge-soft-neutral { color: #464d56; background: var(--app-soft); }
.badge-soft-success { color: #187046; background: #e5f5ed; }
.badge-soft-warning { color: #875c11; background: #fff3d9; }
.badge-soft-danger { color: #a12b32; background: #fde7e8; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: var(--app-bg); }
.auth-card { width: min(470px, 100%); padding: 34px; border: 1px solid var(--app-line); border-radius: 25px; background: #fff; }
.profile-avatar-wrap { display: flex; align-items: center; gap: 18px; }
.profile-avatar, .profile-avatar-fallback { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; }
.profile-avatar-fallback { display: inline-grid; place-items: center; background: #17191d; color: #fff; font-size: 1.7rem; font-weight: 700; }
.company-logo-preview { width: 92px; height: 72px; border: 1px solid var(--app-line); border-radius: 14px; object-fit: contain; background: #fff; }

.customer-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--app-soft); font-weight: 700; }
.booking-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .82rem; }
.flatpickr-calendar { border: 1px solid var(--app-line); border-radius: 16px; box-shadow: 0 18px 50px rgba(23, 25, 29, .13); }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(23, 25, 29, .12); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

@media (max-width: 575.98px) {
    .app-main { padding-inline: 14px; }
    .app-topbar { margin-right: -14px; margin-left: -14px; }
    .app-card { border-radius: 17px; }
    .auth-card { padding: 25px 20px; }
    .modal-header, .modal-body { padding: 1.2rem; }
    .modal-footer { padding: .9rem 1.2rem 1.2rem; }
}

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.app-card-link { display: block; color: inherit; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.app-card-link:hover { color: inherit; border-color: #aeb4bc; transform: translateY(-2px); }
.app-card-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--app-soft); }

.app-avatar-lg { width: 58px; height: 58px; font-size: 1.1rem; }
.profile-card { max-width: 980px; }
.profile-email-verification-alert {
  max-width: 980px;
  padding: 16px 18px;
  border: 1px solid #e0b32f;
  border-radius: 16px;
  background: #fff8df;
  color: #654d09;
}
.profile-email-verification-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffe9a6;
  color: #725400;
  font-size: 1.1rem;
}
.profile-avatar-section { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.profile-identity-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-identity-stack .badge { width: fit-content; }
.profile-avatar-xl, .profile-avatar-section .profile-avatar-fallback { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.profile-avatar-upload { position: relative; display: inline-flex; }
.profile-camera-badge { position: absolute; right: 0; bottom: 0; display: inline-grid; place-items: center; width: 32px; height: 32px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: #17191d; cursor: pointer; }
.profile-info-box { padding: 16px; border-radius: 15px; background: var(--app-soft); }

/* Notifications */
.app-avatar-notification-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.app-notification-count { position: absolute; top: -6px; right: -7px; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #dc3545; font-size: .67rem; font-weight: 700; line-height: 1; }
.notification-list { background: var(--app-panel); }
.notification-item { display: flex; align-items: flex-start; gap: 18px; padding: 22px; border-bottom: 1px solid #edf0f2; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: #fafbfc; }
.notification-icon, .notification-empty-icon, .notification-table-icon { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 15px; background: var(--app-soft); }
.notification-icon { width: 50px; height: 50px; font-size: 1.25rem; }
.notification-empty-icon { width: 58px; height: 58px; margin-inline: auto; font-size: 1.4rem; }
.notification-table-icon { width: 38px; height: 38px; border-radius: 12px; }
.notification-content { flex: 1 1 auto; }
.notification-message { white-space: normal; line-height: 1.65; }
.notification-action { flex: 0 0 auto; }
.notification-unread-label { display: inline-flex; align-items: center; gap: 6px; color: #a12b32; font-size: .78rem; font-weight: 600; }
.notification-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: #dc3545; }
.notification-table-message { max-width: 360px; }

@media (max-width: 767.98px) {
    .notification-item { flex-wrap: wrap; padding: 18px; }
    .notification-content { flex-basis: calc(100% - 68px); }
    .notification-action { width: 100%; padding-left: 68px; }
}

/* Punto di incontro: autocomplete sopra la mappa Leaflet */
.listing-meeting-section { position: relative; z-index: 1; padding: 28px 0 4px; }
.listing-meeting-autocomplete { position: relative; z-index: 2000; }
.listing-meeting-autocomplete .listing-autocomplete-menu { z-index: 2100; }
.listing-meeting-map,
.listing-meeting-map.leaflet-container { position: relative; z-index: 1; width: 100%; min-height: 430px; overflow: hidden; border: 1px solid var(--app-line); border-radius: 18px; background: #eef1f3; }
.listing-meeting-map .leaflet-tile-pane { filter: grayscale(.58) saturate(.32) contrast(.94) brightness(1.04); }
.listing-meeting-map .leaflet-control-zoom a { color: #20242a; background: rgba(255, 255, 255, .96); }
.listing-meeting-map .leaflet-control-zoom a:hover { background: #f1f3f5; }
.listing-meeting-marker { border: 0 !important; background: transparent !important; cursor: grab; }
.listing-meeting-marker:active { cursor: grabbing; }
.listing-meeting-pin-image {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(17, 19, 22, .3));
  user-select: none;
  -webkit-user-drag: none;
  animation: listingMeetingPinDrop .42s cubic-bezier(.22, .8, .35, 1.2);
}
@keyframes listingMeetingPinDrop { from { opacity: 0; transform: translateY(-16px) scale(.86); } to { opacity: 1; transform: translateY(0) scale(1); } }
#listingMeetingPointPane,
.listing-editor-content { overflow: visible; }

/* Listings */
.listing-autocomplete { z-index: 20; }
.listing-autocomplete-menu { position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 1080; max-height: 270px; overflow-y: auto; padding: 7px; border: 1px solid var(--app-line); border-radius: 15px; background: #fff; box-shadow: 0 18px 45px rgba(23, 25, 29, .12); }
.listing-autocomplete-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--app-text); background: transparent; text-align: left; }
.listing-autocomplete-item:hover, .listing-autocomplete-item.is-active { background: var(--app-soft); }
.listing-autocomplete-empty { padding: 12px; color: var(--app-muted); font-size: .88rem; }
.listing-form { max-width: 1100px; }
.listing-price-summary {
  display: grid;
  gap: 3px;
}
.listing-commission-text {
  color: var(--app-muted);
  font-size: .78rem;
}
.listing-commission-text strong {
  color: #064f68;
  font-weight: 700;
}
.listing-net-total {
  color: var(--app-muted);
  font-size: .78rem;
}
.listing-net-total strong {
  color: var(--app-text);
  font-weight: 700;
}

.listing-number-stepper { display: grid; grid-template-columns: 44px minmax(90px, 1fr) 44px; gap: 9px; max-width: 270px; }
.listing-number-stepper .btn {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 0;
  justify-content: center;
}
.listing-number-stepper .form-control { text-align: center; }
.listing-number-stepper input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.listing-number-stepper input[type="number"]::-webkit-inner-spin-button,
.listing-number-stepper input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; appearance: none; }
.listing-checkbox-option,
.listing-switch-option { display: flex; align-items: center; min-height: 58px; padding: 15px 17px; border: 1px solid var(--app-line); border-radius: 15px; color: var(--app-text); background: var(--app-soft); cursor: pointer; }
.listing-checkbox-option .form-check,
.listing-switch-option .form-check { display: flex; align-items: center; gap: 8px; width: 100%; padding-left: 0; margin: 0; }
.listing-checkbox-option .form-check-input,
.listing-switch-option .form-check-input { flex: 0 0 auto; margin: 0; cursor: pointer; }
.listing-checkbox-option .form-check-input:checked,
.listing-switch-option .form-check-input:checked { border-color: #000; background-color: #000; }
.listing-checkbox-option .form-check-input:focus,
.listing-switch-option .form-check-input:focus { border-color: #000; box-shadow: none; }
.listing-checkbox-option .form-check-label,
.listing-switch-option .form-check-label { color: var(--app-text); font-weight: 500; cursor: pointer; }
.listing-switch-option .form-switch .form-check-input { width: 2.55rem; height: 1.35rem; }
.input-group-text { border-color: #d9dde2; border-radius: 13px; color: var(--app-muted); background: var(--app-soft); font-weight: 600; }
.listing-editor-panel { overflow: visible; }
.listing-editor-tabs { padding: 0 24px; border-bottom: 1px solid var(--app-line); }
.listing-editor-tabs .nav-tabs { gap: 26px; border-bottom: 0; }
.listing-editor-tabs .nav-link { margin-bottom: -1px; padding: 19px 0 17px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--app-muted); background: transparent; font-weight: 600; }
.listing-editor-tabs .nav-link:hover { border-color: transparent; color: var(--app-text); }
.listing-editor-tabs .nav-link:focus { box-shadow: none; }
.listing-editor-tabs .nav-link.active { border-bottom-color: #000; color: #000; background: transparent; }
.listing-editor-content > .tab-pane { padding: 0 24px 24px; }
.listing-form-section { padding: 24px 0; border-bottom: 1px solid var(--app-line); }
.listing-form-section:last-of-type { border-bottom: 0; }
.listing-photo-section { padding: 28px 0 4px; }
.listing-photo-upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 310px; padding: 42px 24px; border: 1px dashed #cfd4da; border-radius: 18px; color: var(--app-text); background: #f5f6f7; text-align: center; cursor: pointer; }
.listing-photo-upload-zone:hover { border-color: #9ca3ab; background: #f0f2f3; }
.listing-photo-upload-zone:focus-within { border-color: #000; }
.listing-photo-upload-icon { display: inline-grid; place-items: center; width: 70px; height: 70px; margin-bottom: 18px; border-radius: 20px; color: #fff; background: #000; font-size: 1.8rem; }
.listing-photo-upload-title { margin-bottom: 7px; font-size: 1.05rem; font-weight: 700; }
.listing-photo-upload-text { color: var(--app-muted); font-size: .92rem; }
.listing-photo-manager { padding-bottom: 24px; border-bottom: 1px solid var(--app-line); }
.listing-photo-preview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.listing-photo-preview-item { position: relative; min-width: 0; border: 1px solid var(--app-line); border-radius: 14px; background: #fff; cursor: grab; touch-action: none; user-select: none; }
.listing-photo-preview-item:active { cursor: grabbing; }
.listing-photo-preview-item.is-dragging { opacity: 1 !important; cursor: grabbing; box-shadow: 0 10px 26px rgba(15, 23, 42, .16); }
.listing-photo-preview-item.is-dragging,
.listing-photo-preview-item.is-dragging * { opacity: 1 !important; }
.listing-photo-placeholder { border: 1px dashed #aeb5bd; background: #f4f5f6; cursor: default; }
body.listing-photo-sorting { user-select: none; cursor: grabbing; }
.listing-photo-preview-item.is-primary { border-color: #000; }
.listing-photo-media { position: relative; overflow: hidden; border-radius: 13px; background: var(--app-soft); }
.listing-photo-preview-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--app-soft); }
.listing-photo-actions { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.listing-photo-action { position: absolute; bottom: 9px; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(0, 0, 0, .82); line-height: 1; cursor: pointer; pointer-events: auto; }
.listing-photo-action:focus { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }
.listing-photo-action.js-listing-photo-primary { left: 9px; }
.listing-photo-action.js-listing-photo-primary:hover { color: #4d3b00; background: #fff1a8; }
.listing-photo-action.js-listing-photo-delete { right: 9px; }
.listing-photo-action.js-listing-photo-delete:hover { color: #fff; background: #dc3545; }
.listing-fishing-section { padding: 28px 0 4px; }
.listing-species-select { position: relative; }
.listing-species-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 50px; padding: 7px 10px; border: 1px solid #d9dde2; border-radius: 13px; background: #fff; cursor: text; }
.listing-species-control:focus-within { border-color: #000; box-shadow: none; }
.listing-species-selected { display: contents; }
.listing-species-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 6px 4px 4px; border: 1px solid var(--app-line); border-radius: 999px; background: var(--app-soft); }
.listing-species-chip img { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #e9ecef; }
.listing-species-chip > span { overflow: hidden; max-width: 190px; color: var(--app-text); font-size: .88rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.listing-species-chip button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; line-height: 1; }
.listing-species-chip button:hover { color: #fff; background: #000; }
.listing-species-chip button:focus { outline: 2px solid #000; outline-offset: 1px; box-shadow: none; }
.listing-species-search { flex: 1 1 210px; min-width: 150px; min-height: 34px; padding: 0 4px; border: 0; outline: 0; color: var(--app-text); background: transparent; }
.listing-species-search:disabled { cursor: not-allowed; }
.listing-species-results { position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 1080; max-height: 330px; overflow-y: auto; padding: 7px; border: 1px solid var(--app-line); border-radius: 15px; background: #fff; box-shadow: 0 18px 45px rgba(23, 25, 29, .12); }
.listing-species-result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 11px; color: var(--app-text); background: transparent; text-align: left; }
.listing-species-result:hover, .listing-species-result.is-active { background: var(--app-soft); }
.listing-species-result img { flex: 0 0 auto; width: 58px; height: 44px; border-radius: 10px; object-fit: cover; background: #e9ecef; }
.listing-species-result span { font-weight: 600; }
.listing-species-empty { padding: 14px; color: var(--app-muted); font-size: .9rem; }
.fish-species-table-photo { display: block; width: 64px; height: 48px; border-radius: 11px; object-fit: cover; background: var(--app-soft); }
.fish-species-modal-photo { display: block; flex: 0 0 auto; width: 76px; height: 76px; border-radius: 14px; object-fit: cover; background: var(--app-soft); }

@media (max-width: 575.98px) {
    .listing-editor-tabs { padding-inline: 18px; }
    .listing-editor-tabs .nav-tabs { gap: 22px; }
    .listing-editor-content > .tab-pane { padding-inline: 18px; }
    .listing-photo-upload-zone { min-height: 260px; padding-inline: 18px; }
    .listing-photo-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .listing-photo-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.listing-trip-days .listing-switch-option .form-switch .form-check-input {
  width: 2.2rem;
  height: 1.1rem;
}

/* Listings index: stable columns and a subtle temporary clone indicator. */
.listing-index-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}

.listing-index-table .listing-col-title { width: 25%; }
.listing-index-table .listing-col-location { width: 16%; }
.listing-index-table .listing-col-guests { width: 8%; }
.listing-index-table .listing-col-boat { width: 25%; }
.listing-index-table .listing-col-merchant { width: 12%; }
.listing-index-table .listing-col-actions { width: 14%; }

.listing-index-table th,
.listing-index-table td {
  vertical-align: middle;
}

.listing-index-table td:first-child,
.listing-index-table td:nth-child(2),
.listing-index-table td:nth-child(4),
.listing-index-table td:nth-child(5) {
  overflow-wrap: anywhere;
}

.listing-index-table th:last-child,
.listing-index-table td:last-child {
  white-space: nowrap;
}

.listing-index-table td:last-child .d-inline-flex {
  justify-content: flex-end;
}

.listing-index-table td:last-child .btn-sm {
  width: 34px;
  min-width: 34px;
  flex: 0 0 34px;
  justify-content: center;
}

.listing-row-new > td:first-child {
  position: relative;
}

.listing-row-new > td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #198754;
  animation: listing-clone-indicator-fade 3.8s ease-out forwards;
  pointer-events: none;
}

.listing-cloned-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(25, 135, 84, 0.42);
  border-radius: 999px;
  background: rgba(25, 135, 84, 0.10);
  color: #198754;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  animation: listing-clone-indicator-fade 3.8s ease-out forwards;
}

@keyframes listing-clone-indicator-fade {
  0%, 62% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .listing-row-new > td:first-child::before,
  .listing-cloned-badge {
    animation-duration: 0.01ms;
  }
}

/* SuperAdmin: gruppi di navigazione richiudibili */
.app-nav-heading-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 8px);
  margin: 24px 4px 8px;
  padding: 8px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.app-nav-heading-toggle:hover { background: var(--app-soft); }
.app-nav-heading-toggle i { font-size: .75rem; transition: transform .18s ease; }
.app-nav-heading-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.app-nav-submenu { margin-top: 2px; }
.app-nav-submenu[hidden] { display: none !important; }

/* SuperAdmin settings */
.settings-grid { display: grid; gap: 18px; }
.settings-section { overflow: hidden; }
.settings-section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--app-line); }
.settings-section-heading h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.settings-section-heading p { margin: 0; color: var(--app-muted); font-size: .88rem; line-height: 1.5; }
.settings-section-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; background: var(--app-soft); font-size: 1.05rem; }
.app-nav-heading-toggle { font-family: inherit; }
.app-nav-submenu .app-nav-link { padding-left: 16px; }

/* SuperAdmin Capitani */
.superadmin-captains-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.superadmin-captains-search {
  position: relative;
  width: min(440px, 100%);
}
.superadmin-captains-search > .bi-search {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--app-muted);
  pointer-events: none;
}
.superadmin-captains-search .form-control {
  padding-left: 43px;
  padding-right: 42px;
}
.superadmin-captains-search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--app-muted);
  transform: translateY(-50%);
}
.superadmin-captains-search-clear:hover { background: var(--app-soft); color: var(--app-text); }
.superadmin-captains-sort { width: 150px; min-height: 40px; }
.superadmin-captains-table { min-width: 1180px; }
.superadmin-captains-table th,
.superadmin-captains-table td { vertical-align: middle; }
.superadmin-captains-table th:last-child,
.superadmin-captains-table td:last-child { min-width: 190px; }
.superadmin-captain-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  padding: 0;
  border-radius: 50% !important;
  gap: 0;
}
.superadmin-captain-action-btn i { margin: 0; }
.superadmin-captain-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}
.superadmin-captain-avatar,
.superadmin-captain-avatar img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
}
.superadmin-captain-avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--app-line);
  background: var(--app-soft);
  color: var(--app-muted);
  font-size: 1.1rem;
}
.superadmin-captain-avatar img {
  display: block;
  object-fit: cover;
}
.superadmin-captain-edit-photo-wrap {
  position: relative;
  display: block;
  width: 180px;
  height: 180px;
  overflow: visible;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  background: var(--app-soft);
  cursor: pointer;
}
.superadmin-captain-edit-photo,
.superadmin-captain-edit-photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.superadmin-captain-edit-photo {
  display: block;
  object-fit: cover;
}
.superadmin-captain-edit-photo-fallback {
  display: grid;
  place-items: center;
  color: rgba(61, 73, 85, .32);
  font-size: 4rem;
}
.superadmin-captain-edit-photo-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #17191d;
}

/* Captain photo cropper */
.captain-photo-crop-trigger {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 11px;
  white-space: nowrap;
}
.captain-photo-crop-modal .modal-dialog {
  max-width: 520px;
}
.captain-photo-crop-modal .modal-content {
  overflow: hidden;
}
.captain-photo-crop-modal .modal-title {
  font-weight: 700;
}
.captain-photo-crop-subtitle {
  color: var(--app-muted);
  font-size: .88rem;
}
.captain-photo-crop-stage {
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 20px;
  background: #edf1f2;
}
.captain-photo-crop-viewport {
  position: relative;
  width: min(340px, 72vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #dfe5e7;
  box-shadow: 0 12px 30px rgba(20, 40, 48, .16);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.captain-photo-crop-viewport.is-dragging {
  cursor: grabbing;
}
.captain-photo-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.captain-photo-crop-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 390px;
  margin: 22px auto 6px;
  color: #52646d;
}
.captain-photo-crop-controls .form-range {
  margin: 0;
  accent-color: #17191d;
}
.captain-photo-crop-reset {
  display: flex;
  width: fit-content;
  margin: 6px auto 0;
  padding: 5px 8px;
  color: #52646d;
  font-size: .86rem;
  text-decoration: none;
}
.captain-photo-crop-reset:hover {
  color: #17191d;
}
@media (max-width: 575.98px) {
  .captain-photo-crop-modal .modal-dialog {
    margin: .75rem;
  }
  .captain-photo-crop-stage {
    padding: 14px;
  }
  .captain-photo-crop-viewport {
    width: min(310px, 76vw);
  }
}

/* Captain onboarding gates */
.captain-onboarding-page { max-width: 1180px; }
.captain-onboarding-card { overflow: hidden; }
.captain-speedometer {
  --progress: 25;
  position: relative;
  display: inline-grid;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#167c56 calc(var(--progress) * 1%), #e9eef0 0);
  box-shadow: inset 0 0 0 1px rgba(16, 44, 55, .04), 0 20px 50px rgba(19, 54, 66, .09);
}
.captain-speedometer::before {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
}
.captain-speedometer-inner { position: relative; z-index: 1; display: grid; gap: 3px; text-align: center; }
.captain-speedometer-value { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; font-weight: 850; color: #172f38; }
.captain-speedometer-label { color: var(--app-muted); font-size: .9rem; font-weight: 700; }
.captain-onboarding-eyebrow { display: inline-block; margin-bottom: 10px; color: #167c56; font-size: .82rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.captain-onboarding-title { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; font-weight: 820; }
.captain-onboarding-text { max-width: 720px; margin-bottom: 28px; color: var(--app-muted); font-size: 1.04rem; line-height: 1.7; }
.captain-onboarding-steps { display: grid; gap: 10px; margin-bottom: 30px; }
.captain-onboarding-step { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--app-line); border-radius: 14px; background: #fff; }
.captain-onboarding-step > span { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; border-radius: 50%; background: #f0f3f4; color: #60717a; }
.captain-onboarding-step.is-complete > span { background: #e8f6ee; color: #167c56; }
.captain-onboarding-step strong, .captain-onboarding-step small { display: block; }
.captain-onboarding-step small { margin-top: 2px; color: var(--app-muted); }
.captain-onboarding-action { display: inline-flex; min-height: 50px; align-items: center; gap: 9px; border-radius: 16px; }
.captain-boat-required-note { display: flex; max-width: 650px; align-items: flex-start; gap: 10px; margin-bottom: 26px; padding: 14px 16px; border: 1px solid #d6e9df; border-radius: 14px; background: #f4faf6; color: #315e49; }
.captain-approval-alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 1.5rem; padding: 14px 16px; border: 1px solid #f2d48a; border-radius: 14px; background: #fff9e9; color: #755717; }
.captain-approval-alert.is-suspended { border-color: #efc1bc; background: #fff1ef; color: #8b2c22; }
@media (max-width: 767.98px) {
  .captain-speedometer { width: min(230px, 72vw); }
  .captain-speedometer::before { inset: 18px; }
}

/* SuperAdmin logs */
.superadmin-log-table-wrap {
  max-height: 68vh;
}
.superadmin-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafb;
  box-shadow: inset 0 -1px 0 var(--app-line);
}
.superadmin-log-table th:first-child,
.superadmin-log-table td:first-child {
  padding-left: 1.5rem;
}
.superadmin-log-table th:last-child,
.superadmin-log-table td:last-child {
  padding-right: 1.5rem;
}
.superadmin-log-datetime {
  width: 1%;
  color: #52646d;
  font-size: .84rem;
  font-weight: 650;
}
.superadmin-log-level {
  display: inline-flex;
  min-width: 68px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.superadmin-log-level-info {
  color: #0a5d77;
  background: #e5f5fa;
}
.superadmin-log-level-warning {
  color: #765718;
  background: #fff3cd;
}
.superadmin-log-level-error {
  color: #9f2d25;
  background: #fde9e7;
}
.superadmin-log-message {
  display: block;
  min-width: 420px;
  color: #253a44;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 767.98px) {
  .superadmin-log-table-wrap { max-height: none; }
  .superadmin-log-message { min-width: 300px; }
}

/* SuperAdmin SMS */
.superadmin-sms-card {
  overflow: hidden;
}
.superadmin-sms-section {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--app-line);
}
.superadmin-sms-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 1.5rem;
}
.superadmin-sms-section-heading h2 {
  margin: 0 0 4px;
  color: #1d333d;
  font-size: 1.1rem;
  font-weight: 700;
}
.superadmin-sms-section-heading p {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.55;
}
.superadmin-sms-section-icon,
.superadmin-sms-help-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  color: #167c56;
  background: #e9f7ef;
  font-size: 1.1rem;
}
.superadmin-sms-manual-toggle {
  margin: 1.25rem 0;
  padding: 14px 16px 14px 3.25rem;
  border: 1px solid #dce6e2;
  border-radius: 14px;
  background: #f7faf9;
}
.superadmin-sms-manual-toggle .form-check-input {
  margin-left: -2.35rem;
}
.superadmin-sms-card input[readonly] {
  color: #52646d;
  background: #f4f7f8;
}
.superadmin-sms-card textarea {
  min-height: 150px;
  resize: vertical;
}
.superadmin-sms-counter {
  color: #60717a;
  font-size: .82rem;
}
.superadmin-sms-submit {
  width: auto;
  min-width: 150px;
  min-height: 46px;
  padding-inline: 22px;
  border-radius: 13px;
}
.superadmin-sms-help {
  position: sticky;
  top: 92px;
  border-color: #dce9e4;
  background: linear-gradient(145deg, #fff 0%, #f3faf6 100%);
}
.superadmin-sms-help-icon {
  margin-bottom: 1rem;
}
.superadmin-sms-help ul {
  padding-left: 1.15rem;
  color: #52646d;
  line-height: 1.8;
}
@media (max-width: 575.98px) {
  .superadmin-sms-section-heading {
    align-items: center;
  }
  .superadmin-sms-submit {
    width: 100%;
  }
}
