:root {
  color-scheme: light;
  --bg: oklch(98.5% 0.006 255);
  --surface: oklch(100% 0.004 255);
  --surface-2: oklch(96.8% 0.01 255);
  --line: oklch(88% 0.018 255);
  --line-strong: oklch(78% 0.03 255);
  --text: oklch(22% 0.045 260);
  --muted: oklch(48% 0.035 260);
  --muted-2: oklch(62% 0.028 260);
  --primary: oklch(52% 0.19 260);
  --primary-strong: oklch(44% 0.2 260);
  --primary-soft: oklch(94% 0.035 260);
  --danger: oklch(58% 0.21 27);
  --warning: oklch(70% 0.18 65);
  --success: oklch(59% 0.16 150);
  --purple: oklch(58% 0.17 305);
  --shadow: 0 16px 42px oklch(30% 0.05 255 / 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --tap: 44px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, oklch(97.5% 0.012 255), var(--bg) 34%),
    var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-root {
  min-height: 100dvh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
}

@media (min-width: 900px) {
  body {
    background:
      linear-gradient(135deg, oklch(98% 0.012 250), oklch(96% 0.015 185)),
      var(--bg);
  }
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: 18px;
}

.login-art {
  min-height: 170px;
  display: grid;
  align-items: end;
  opacity: 0.8;
}

.plant-line {
  height: 120px;
  border-bottom: 2px solid var(--line);
  position: relative;
  overflow: hidden;
}

.plant-line span {
  position: absolute;
  bottom: 0;
  width: 72px;
  border: 2px solid oklch(76% 0.06 255);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.plant-line span:nth-child(1) {
  left: 8%;
  height: 58px;
}

.plant-line span:nth-child(2) {
  left: 28%;
  height: 92px;
  width: 38px;
}

.plant-line span:nth-child(3) {
  left: 47%;
  height: 76px;
  width: 104px;
}

.plant-line span:nth-child(4) {
  right: 8%;
  height: 44px;
  width: 128px;
}

.login-panel {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 18px;
}

.brand-mark .icon {
  width: 40px;
  height: 40px;
}

.login-panel h1,
.top-bar h1,
.panel h2,
.detail-hero h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  text-align: center;
  font-size: 2rem;
  color: var(--primary-strong);
}

.login-subtitle {
  margin: 8px auto 24px;
  max-width: 28ch;
  text-align: center;
  color: var(--muted);
}

.form-stack,
.work-form,
.close-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(63% 0.18 260 / 0.16);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.back-button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 750;
}

.primary-button {
  color: oklch(99% 0.004 255);
  background: var(--primary);
  box-shadow: 0 12px 22px oklch(48% 0.18 260 / 0.22);
}

.secondary-button,
.back-button {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: oklch(84% 0.055 260);
}

.danger-button {
  color: oklch(99% 0.004 255);
  background: var(--danger);
}

.text-button {
  color: var(--primary);
  background: transparent;
  border: 0;
  padding-inline: 4px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.demo-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-users strong {
  flex-basis: 100%;
  color: var(--text);
}

.demo-users span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.workspace {
  min-width: 0;
  padding-bottom: 78px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: oklch(98.8% 0.006 255 / 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.top-bar h1 {
  font-size: 1.45rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-picker {
  min-width: 148px;
}

.company-picker select {
  min-height: 40px;
  padding-right: 28px;
}

.icon-button {
  width: var(--tap);
  height: var(--tap);
  flex: 0 0 var(--tap);
  display: inline-grid;
  place-items: center;
  position: relative;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-button.small {
  width: var(--tap);
  height: var(--tap);
}

.icon-button.danger {
  color: var(--danger);
}

.badge-dot {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: oklch(99% 0.004 255);
  background: var(--primary);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
}

.content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 16px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: oklch(99% 0.004 255 / 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.side-nav {
  display: none;
}

.nav-item {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.filter-panel,
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px oklch(40% 0.04 255 / 0.08);
}

.metric-card {
  min-height: 122px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: 2.15rem;
  line-height: 1;
}

.metric-card.pending,
.status-pill.pending {
  color: var(--danger);
}

.metric-card.in-progress,
.status-pill.in_progress {
  color: var(--warning);
}

.metric-card.solved,
.status-pill.solved {
  color: var(--success);
}

.metric-card.critical {
  color: var(--danger);
}

.dashboard-layout,
.detail-stack,
.profile-layout,
.admin-layout {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 14px;
}

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

.panel-head h2 {
  font-size: 1.06rem;
}

.panel-head span,
.muted {
  color: var(--muted);
}

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

.incident-row {
  width: 100%;
  min-height: 132px;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 0 12px 0 0;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.incident-row:hover {
  border-color: var(--primary);
}

.priority-rail {
  display: block;
  background: var(--warning);
}

.incident-row.high .priority-rail,
.incident-row.critical .priority-rail {
  background: var(--danger);
}

.incident-row.low .priority-rail {
  background: var(--success);
}

.incident-main {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: center;
  padding-block: 12px;
}

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

.incident-title {
  font-weight: 680;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.incident-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.incident-meta .icon {
  width: 15px;
  height: 15px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 99px;
  background: currentColor;
  color: oklch(99% 0.004 255);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.pending {
  background: var(--danger);
  color: oklch(99% 0.004 255);
}

.status-pill.in_progress {
  background: var(--warning);
  color: oklch(99% 0.004 255);
}

.status-pill.solved {
  background: var(--success);
  color: oklch(99% 0.004 255);
}

.status-pill.cancelled {
  background: var(--muted);
  color: oklch(99% 0.004 255);
}

.photo-count,
.row-media {
  align-self: center;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  display: grid;
  justify-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
}

.row-thumb-frame {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  max-width: 52px;
  max-height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.row-thumb-frame .icon {
  width: 22px;
  height: 22px;
}

.row-photo-count {
  font-size: 0.78rem;
  line-height: 1;
}

.filter-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: var(--muted);
}

.search-box input {
  padding-left: 40px;
}

.filter-row,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid oklch(84% 0.055 260);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
}

.filter-chip .icon {
  width: 15px;
  height: 15px;
}

.filter-chip.clear-all {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

.work-form,
.detail-stack {
  margin-bottom: 22px;
}

.priority-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.priority-group legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 750;
}

.priority-option {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.priority-option input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.priority-option.low {
  color: var(--success);
}

.priority-option.medium {
  color: var(--warning);
}

.priority-option.high {
  color: var(--danger);
}

.priority-option.critical {
  color: var(--purple);
}

.textarea-field {
  font-weight: 700;
}

.sticky-action {
  position: sticky;
  bottom: 82px;
  z-index: 10;
}

.photo-picker {
  display: grid;
  gap: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.photo-thumb,
.add-photo {
  min-height: 110px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px dashed oklch(72% 0.08 260);
  border-radius: var(--radius);
}

.photo-preview-button {
  width: 100%;
  min-width: 0;
  cursor: zoom-in;
}

.photo-preview-button:focus-visible {
  outline: 3px solid oklch(63% 0.18 260 / 0.35);
  outline-offset: 2px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-caption {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  color: oklch(99% 0.004 255);
  background: oklch(24% 0.04 260 / 0.78);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
}

.add-photo {
  cursor: pointer;
  min-height: 110px;
  text-align: center;
  font-weight: 800;
}

.add-photo input {
  display: none;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  color: oklch(99% 0.004 255);
  background: oklch(16% 0.035 260 / 0.96);
}

.photo-lightbox-bar,
.photo-lightbox-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.photo-lightbox-bar > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.photo-lightbox-bar strong,
.photo-lightbox-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-lightbox-bar span {
  color: oklch(82% 0.018 255);
  font-size: 0.84rem;
}

.photo-lightbox .icon-button {
  color: oklch(99% 0.004 255);
  background: oklch(28% 0.04 260);
  border-color: oklch(42% 0.04 260);
}

.photo-lightbox-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.photo-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}

.photo-lightbox-actions {
  justify-content: center;
}

.photo-lightbox-actions .secondary-button {
  flex: 1 1 0;
  max-width: 190px;
  color: oklch(99% 0.004 255);
  background: oklch(28% 0.04 260);
  border-color: oklch(42% 0.04 260);
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-top: 5px solid var(--warning);
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-hero.high,
.detail-hero.critical {
  border-top-color: var(--danger);
}

.detail-hero.low {
  border-top-color: var(--success);
}

.detail-hero p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.info-grid span,
.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field {
  justify-content: space-between;
  margin-bottom: 14px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
}

.timeline-item > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  background: var(--primary);
  border-radius: 99px;
}

.timeline-item small {
  display: block;
  color: var(--muted);
}

.admin-layout {
  grid-template-columns: 1fr;
}

.admin-card {
  min-width: 0;
}

.admin-add {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-row {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.admin-row.inactive {
  opacity: 0.6;
}

.admin-row > div {
  display: flex;
  gap: 6px;
}

.profile-card {
  text-align: center;
}

.avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 4px auto 12px;
  color: oklch(99% 0.004 255);
  background: var(--primary);
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 850;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: 30px minmax(82px, 0.7fr) minmax(90px, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.rank-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: oklch(99% 0.004 255);
  background: var(--primary);
  border-radius: 50%;
  font-weight: 800;
}

.rank-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.rank-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

@media (min-width: 680px) {
  .login-screen {
    grid-template-columns: minmax(260px, 0.9fr) minmax(380px, 480px);
    gap: 34px;
    padding: 34px;
  }

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

  .dashboard-layout,
  .profile-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  }

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

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

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

  .admin-add {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 1020px) {
  .app-shell {
    grid-template-columns: 244px 1fr;
    grid-template-rows: 1fr;
  }

  .workspace {
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none;
  }

  .side-nav {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    padding: 22px 14px;
    background: oklch(99% 0.004 255 / 0.82);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }

  .side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--primary-strong);
    font-size: 1.1rem;
    font-weight: 850;
    line-height: 1.05;
  }

  .side-brand .icon {
    width: 40px;
    height: 40px;
  }

  .side-nav .nav-item {
    grid-template-columns: 24px 1fr;
    place-items: center start;
    min-height: 48px;
    padding: 0 12px;
    font-size: 0.94rem;
  }

  .top-bar {
    padding-inline: 28px;
  }

  .content {
    padding: 24px 28px 38px;
  }

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

  .sticky-action {
    position: static;
  }
}

@media (max-width: 430px) {
  .top-actions {
    gap: 6px;
  }

  .company-picker {
    min-width: 126px;
  }

  .top-bar h1 {
    font-size: 1.24rem;
  }

  .content {
    padding-inline: 12px;
  }

  .filter-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

}

/* Contexto de administración */
.admin-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 0.9rem;
}

.admin-context .icon {
  flex: none;
}

.admin-add-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 8px;
}

.admin-add-area select {
  min-width: 0;
}

@media (max-width: 640px) {
  .admin-add-area {
    grid-template-columns: 1fr;
  }
}

/* Grupo de empresa en el header */
.company-picker-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Zona de eliminar novedad */
.danger-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.danger-zone .danger-button {
  align-self: flex-start;
}

/* Indicador de conexión */
.net-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--success);
  background: oklch(59% 0.16 150 / 0.12);
}

.net-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.net-status.offline {
  color: var(--warning);
  background: oklch(70% 0.18 65 / 0.15);
}

/* Aviso de guardado */
.saved-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  transform: translate(-50%, 12px);
  z-index: 50;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.saved-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 901px) {
  .saved-toast {
    bottom: 28px;
  }
}

/* Ventana de confirmación propia (funciona en iOS PWA) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: oklch(20% 0.04 260 / 0.45);
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-box p { margin: 0 0 16px; color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Auditoría móvil: evitar que algo se salga del margen en pantallas chicas */
.top-bar { flex-wrap: wrap; }
.top-bar > div:first-child { min-width: 0; flex: 1 1 auto; }
.top-bar h1 { overflow-wrap: anywhere; }
.top-actions { flex-wrap: wrap; justify-content: flex-end; }
.detail-hero > div { min-width: 0; }
.detail-hero h2,
.detail-hero p,
.incident-title { overflow-wrap: anywhere; }
.admin-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.net-status { max-width: 100%; }

.modal-input { width: 100%; margin-bottom: 14px; }

/* Preview de foto en el historial */
.row-thumb {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 52px;
}

/* Editar prioridad en el detalle */
.priority-edit { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.priority-edit label { flex: 1 1 160px; }
.priority-edit button { flex: 0 0 auto; }

/* Logo de la empresa en el login */
.brand-mark { background: var(--surface); border: 1px solid var(--line); padding: 6px; width: 96px; height: 96px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }

/* Logo en la barra lateral (escritorio) */
.side-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }

/* Barra superior reorganizada: nada se sale del borde y la empresa se lee mejor */
.top-bar { flex-direction: column; align-items: stretch; gap: 10px; justify-content: flex-start; }
.top-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-title { min-width: 0; }
.company-picker-group { display: flex; align-items: center; gap: 8px; width: 100%; }
.company-picker { flex: 1 1 auto; min-width: 0; }
.company-picker select { width: 100%; font-size: 0.98rem; }
.net-status { flex: 0 0 auto; }
