/* ============================================================
   OBRA360 — Sistema de diseño principal
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Variables / Design tokens ──────────────────────────────── */
:root {
  --bg: #f3f0eb;
  --bg-soft: #ece7e0;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #fbfaf8;
  --line: rgba(25, 25, 25, 0.08);
  --line-strong: rgba(25, 25, 25, 0.14);
  --text: #161616;
  --soft: #5e5a55;
  --muted: #8a857e;
  --accent: #222222;
  --shadow: 0 24px 60px rgba(25, 25, 25, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

/* ── Base ────────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 22%),
    linear-gradient(180deg, #f7f4ef 0%, #f1ede7 45%, #ebe6df 100%);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ── Screen (contenedor central mobile-first) ───────────────── */
.screen {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  padding: 24px 18px 110px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.35);
  border-left: 1px solid rgba(255, 255, 255, 0.48);
  border-right: 1px solid rgba(255, 255, 255, 0.48);
  position: relative;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Screen centrado para pantallas de auth (login) */
.screen--centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 28px;
}

.screen--login {
  max-width: 420px;
  min-height: 840px;
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.screen--login::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 36%),
    radial-gradient(circle at 85% 8%, rgba(255, 255, 255, 0.55), transparent 24%);
  pointer-events: none;
}

/* ── Topline decorativo ─────────────────────────────────────── */
.topline {
  width: 66px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.26), transparent);
  margin: 0 auto 24px;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.topbar--home {
  align-items: flex-start;
  margin-bottom: 20px;
}

/* ── Brand / Logo ────────────────────────────────────────────── */
.brand {
  position: relative;
  z-index: 1;
}

.brand small,
.brand .eyebrow-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.brand h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: 1;
  margin-bottom: 6px;
}

.brand--center {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.brand--center small {
  font-size: 10px;
  margin-bottom: 6px;
}

.brand--center h1 {
  font-size: 18px;
  letter-spacing: -.04em;
}

.brand--login h1 {
  font-size: 34px;
  letter-spacing: -.06em;
  margin-bottom: 8px;
}

.brand .company {
  font-size: 14px;
  color: var(--soft);
}

/* ── Avatar / Icon button ────────────────────────────────────── */
.avatar,
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  font-size: 18px;
  text-decoration: none;
}

/* ── Breadcrumb contextual ──────────────────────────────────── */
.breadcrumb-ctx {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.breadcrumb-ctx a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-ctx a:hover {
  color: var(--soft);
}

/* ── Hero card ──────────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 30px;
  padding: 20px;
  box-shadow:
    0 18px 40px rgba(25, 25, 25, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.70), transparent 70%);
  pointer-events: none;
}

.hero .eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.hero h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.02;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.hero p {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
  max-width: 270px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

/* ── Stats grid (dentro del hero) ──────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}

.stat {
  border: 1px solid rgba(25, 25, 25, 0.06);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 12px 10px;
}

.stat .n {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.03em;
}

.stat .l {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

/* ── Card genérica ───────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow:
    0 14px 30px rgba(25, 25, 25, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  margin-bottom: 12px;
}

.card--form {
  border-radius: 30px;
  padding: 24px 18px 18px;
  box-shadow:
    0 18px 40px rgba(25, 25, 25, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.card--form h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}

/* ── Card head ───────────────────────────────────────────────── */
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 5px;
}

.card-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ── Card footer ─────────────────────────────────────────────── */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Quick-access card ───────────────────────────────────────── */
.card--quick {
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
}

.quick-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 4px;
}

.quick-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ── Filename / code display card ───────────────────────────── */
.filename-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(25, 25, 25, 0.04);
}

.filename-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.filename-card code {
  display: block;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Chips / Tags ───────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.chip,
.tag {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.58);
  color: var(--soft);
  font-size: 11px;
  white-space: nowrap;
  display: inline-block;
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress-wrap {
  flex: 1;
}

.progress-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}

.progress-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #202020, #565656);
}

/* ── Section title ──────────────────────────────────────────── */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 12px;
}

.section-title h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

/* ── Lists de cards (works, floors, units, etc.) ────────────── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Botón "Abrir" / open ───────────────────────────────────── */
.btn-open {
  min-width: 78px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

/* ── Botón quick ─────────────────────────────────────────────── */
.btn-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* ── Botón primario ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 18px;
  background: #191919;
  color: #f7f4ef;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(20, 20, 20, 0.14);
  text-decoration: none;
}

.btn-primary:hover {
  background: #2a2a2a;
  color: #f7f4ef;
}

/* ── Botón secundario (outline) ─────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 15px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

/* ── Botón de acción (2 columnas) ───────────────────────────── */
.action-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.action-btn {
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(25, 25, 25, 0.05);
  cursor: pointer;
  border-style: solid;
}

.action-btn--primary {
  background: #191919;
  color: #f7f4ef;
  border: none;
  box-shadow: 0 18px 30px rgba(20, 20, 20, 0.14);
}

.action-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.06);
}

.action-btn--primary .action-icon {
  background: rgba(255, 255, 255, 0.08);
}

/* ── FAB (Floating Action Button) ───────────────────────────── */
.fab-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: min(394px, calc(100% - 36px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  z-index: 100;
}

.fab-wrap--split {
  grid-template-columns: 1fr 58px;
}

.fab-main {
  height: 58px;
  border: none;
  border-radius: 20px;
  background: #191919;
  color: #f7f4ef;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 20px 40px rgba(25, 25, 25, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.fab-main:hover {
  background: #2a2a2a;
  color: #f7f4ef;
}

.fab-side {
  height: 58px;
  border-radius: 20px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  text-decoration: none;
}

.fab-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

/* ── Search input ───────────────────────────────────────────── */
.search-wrap {
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  font-size: 14px;
  font-family: Inter, sans-serif;
  transition: .2s ease;
}

.search-input::placeholder {
  color: #9d978f;
}

.search-input:focus {
  border-color: rgba(25, 25, 25, 0.20);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
  background: #fff;
}

/* ── Form fields ────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 7px;
}

.field-input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 0 15px;
  font-size: 14px;
  font-family: Inter, sans-serif;
  outline: none;
  transition: .2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.field textarea {
  height: auto;
  padding: 14px 15px;
  resize: vertical;
  min-height: 100px;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a857e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9d978f;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(25, 25, 25, 0.20);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
  background: #fff;
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.field-required {
  color: #c0392b;
}

.field-optional {
  color: var(--muted);
  font-weight: 400;
}

/* Remember me row */
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 18px;
  gap: 10px;
  font-size: 12px;
  color: var(--soft);
}

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

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #202020;
}

.field-row a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Buttons grid (form actions) ────────────────────────────── */
.btn-group {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.btn-group--2col {
  grid-template-columns: 1fr 1fr;
}

/* ── Gallery grid ───────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.photo-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(25, 25, 25, 0.05);
}

.photo-thumb {
  height: 128px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, #e6e0d8, #d8d1c8);
  position: relative;
}

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

.photo-watermark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45);
  letter-spacing: .12em;
  text-transform: uppercase;
  z-index: 1;
}

.photo-body {
  padding: 12px;
}

.photo-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 6px;
  color: var(--text);
}

.photo-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.timeline-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 24px rgba(25, 25, 25, 0.04);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.timeline-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.timeline-tag {
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.58);
  color: var(--soft);
  font-size: 10px;
  white-space: nowrap;
}

/* ── Flashes / alertas ──────────────────────────────────────── */
.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.flash--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.20);
  color: #166534;
}

.flash--error {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  opacity: 0.35;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Footer label ───────────────────────────────────────────── */
.screen-footer {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  font-size: 10px;
  color: #8d877f;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Eyebrow (label uppercase pequeño) ─────────────────────── */
.eyebrow {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: block;
}

/* ── Heading secundario de sección ─────────────────────────── */
.section-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

/* ── Navegación superior login ──────────────────────────────── */
.login-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.login-secondary button {
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(25, 25, 25, 0.08);
  background: rgba(255, 255, 255, 0.55);
  color: var(--soft);
  font-weight: 600;
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-size: 13px;
}

/* ── Responsive: sin bordes laterales en móvil < 430px ─────── */
@media (max-width: 430px) {
  .screen {
    border-left: none;
    border-right: none;
  }

  .screen--login {
    border-radius: 30px;
    min-height: auto;
  }

  .brand h1 {
    font-size: 26px;
  }

  .brand--login h1 {
    font-size: 31px;
  }
}

/* ── Wrapper para body centrado en login ─────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100%;
}

/* ============================================================
   MÓDULO DE FOTOS — Fase 2
   ============================================================ */

/* ── Grid de fotos ───────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 100px; /* espacio para el FAB */
}

@media (min-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Item de foto ────────────────────────────────────────────── */
.photo-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(25, 25, 25, 0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}

.photo-item:active {
  transform: scale(0.98);
}

/* ── Thumbnail ───────────────────────────────────────────────── */
.photo-item__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, #e6e0d8, #d8d1c8);
  cursor: pointer;
  overflow: hidden;
}

.photo-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .2s ease;
}

.photo-item__thumb--error {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-item__thumb--error::after {
  content: "!";
  font-size: 28px;
  color: var(--muted);
  opacity: 0.5;
}

/* ── Watermark sobre la foto ─────────────────────────────────── */
.photo-item__watermark {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: .10em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ── Footer del item ─────────────────────────────────────────── */
.photo-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  gap: 6px;
}

.photo-item__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.photo-item__seq {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.photo-item__date {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Botón eliminar ──────────────────────────────────────────── */
.photo-item__delete {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  flex-shrink: 0;
}

.photo-item__delete:active {
  background: rgba(239, 68, 68, 0.16);
  transform: scale(0.93);
}

/* ── Barra de progreso de upload ─────────────────────────────── */
.upload-progress {
  margin-bottom: 14px;
  padding: 12px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.70)),
    var(--card-solid);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(25, 25, 25, 0.04);
}

.upload-progress__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.08);
  overflow: hidden;
}

.upload-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #202020, #565656);
  transition: width .3s ease;
  width: 0%;
}

/* ── Toast de feedback ───────────────────────────────────────── */
.upload-toast {
  position: fixed;
  bottom: 92px; /* encima del FAB */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: min(360px, calc(100% - 36px));
  width: max-content;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 200;
  box-shadow: 0 12px 30px rgba(25, 25, 25, 0.12);
}

.upload-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.upload-toast--success {
  background: rgba(34, 197, 94, 0.92);
  color: #fff;
}

.upload-toast--error {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
}

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.lightbox__content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 700px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  letter-spacing: .06em;
  text-align: center;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Modal de confirmación de eliminación ────────────────────── */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  cursor: pointer;
}

.confirm-modal__box {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  padding: 22px 20px 16px;
  width: min(380px, calc(100% - 36px));
  box-shadow: 0 24px 60px rgba(25, 25, 25, 0.18);
}

.confirm-modal__msg {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 18px;
  text-align: center;
}

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

.confirm-modal__btn {
  height: 50px;
  border-radius: 16px;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease;
}

.confirm-modal__btn:active {
  opacity: 0.85;
}

.confirm-modal__btn--cancel {
  background: rgba(25, 25, 25, 0.06);
  color: var(--soft);
}

.confirm-modal__btn--confirm {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.22);
}

/* ── Plan Editor ─────────────────────────────────────────────── */

/* Topbar específica del editor de plano (full-width, no móvil) */
.plan-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  background: var(--card-solid);
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.plan-topbar__back {
  font-size: 20px;
  line-height: 1;
  color: var(--soft);
  text-decoration: none;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}
.plan-topbar__back:hover { background: var(--bg-soft); }

.plan-topbar__breadcrumb {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.plan-topbar__breadcrumb a { color: var(--soft); text-decoration: none; }
.plan-topbar__breadcrumb a:hover { color: var(--text); }
.plan-topbar__sep { color: var(--muted); font-size: 12px; }
.plan-topbar__current { color: var(--text); font-weight: 600; }

.plan-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.plan-topbar__btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.plan-topbar__btn:hover { background: var(--bg); }
.plan-topbar__btn--danger { border-color: rgba(220, 38, 38, 0.3); color: #dc2626; }
.plan-topbar__btn--danger:hover { background: rgba(220, 38, 38, 0.06); }

/* Flashes dentro del editor de plano */
.plan-flash-list {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.plan-flash {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(25, 25, 25, 0.12);
}
.plan-flash--success { background: rgba(34, 197, 94, 0.92); color: #fff; }
.plan-flash--error   { background: rgba(239, 68, 68, 0.92);  color: #fff; }

/* Layout de dos columnas: área del plano + sidebar */
.plan-layout {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
  width: 100%;
}

/* Área principal del plano */
.plan-area {
  flex: 1;
  overflow: auto;
  padding: 32px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

/* Canvas relativo sobre el que se posicionan los markers */
.plan-canvas {
  position: relative;
  display: inline-block;
  cursor: default;
  user-select: none;
  max-width: 100%;
}
.plan-canvas img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  display: block;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.plan-canvas-hint {
  font-size: 13px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 16px;
  backdrop-filter: blur(6px);
}

/* Markers sobre el plano */
.plan-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border: 2.5px solid white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  z-index: 10;
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0;
}
.plan-marker:hover {
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.plan-marker.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 20;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Tooltip flotante sobre el marker */
.plan-marker-label {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 22, 22, 0.85);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(4px);
}
.plan-marker:hover .plan-marker-label { opacity: 1; }

/* Sidebar de ambientes */
.plan-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--card-solid);
  border-left: 1px solid var(--line-strong);
  overflow-y: auto;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.plan-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

/* Cabecera de unidad dentro del sidebar */
.plan-unit-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 18px 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.plan-unit-name:first-of-type { margin-top: 0; }

/* Item de ambiente en el sidebar */
.plan-env-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.plan-env-item:hover  { background: var(--bg-soft); }
.plan-env-item.active { background: var(--accent); color: white; }
.plan-env-item.active .plan-env-dot { background: rgba(255, 255, 255, 0.7); }
.plan-env-item.active .plan-env-badge { color: rgba(255, 255, 255, 0.8); }

/* Dot indicador de si tiene marker */
.plan-env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.2s;
}
.plan-env-dot.has-marker { background: #22c55e; }

.plan-env-name  { font-size: 13px; flex: 1; }
.plan-env-badge { font-size: 11px; color: #22c55e; font-weight: 700; }

/* Zona de upload vacío */
.plan-upload-zone {
  border: 2px dashed var(--muted);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  color: var(--soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  max-width: 480px;
  width: 100%;
}
.plan-upload-zone:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.plan-upload-btn {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.plan-upload-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* Panel de instrucciones al pie del sidebar */
.plan-instructions {
  margin-top: auto;
  padding-top: 20px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
}

/* ── Responsive mobile del editor de plano ─────────────────────────────── */
@media (max-width: 768px) {
  /* El layout pasa a columna vertical, sin altura fija */
  .plan-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  /* Área del plano: altura fija para contener el zoom, overflow hidden para clipear */
  .plan-area {
    flex: none;
    padding: 0;
    height: 60vh;
    min-height: 220px;
    overflow: hidden;
    position: relative;
    touch-action: none;
    justify-content: flex-start;
    align-items: stretch;
  }

  /* El canvas es transformable (pinch-zoom vía JS) */
  .plan-canvas {
    width: 100%;
    transform-origin: 0 0;
    will-change: transform;
  }

  /* La imagen se ajusta al ancho y no tiene límite de alto */
  .plan-canvas img {
    max-height: none;
    width: 100%;
    height: auto;
  }

  /* Sidebar debajo del plano, ancho completo */
  .plan-sidebar {
    width: 100%;
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--line-strong);
    overflow-y: visible;
  }

  /* Markers: tamaño mayor y etiquetas siempre visibles en mobile */
  .plan-marker {
    width: 36px;
    height: 36px;
    font-size: 11px;
    cursor: default;
  }
  .plan-marker:hover {
    transform: translate(-50%, -50%);
  }
  .plan-marker-label {
    opacity: 1;
    font-size: 10px;
    bottom: 40px;
  }

  /* Topbar: ocultar breadcrumb, mostrar sólo título compacto */
  .plan-topbar__breadcrumb {
    display: none;
  }
  .plan-topbar__title-mobile {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Botones del topbar más compactos */
  .plan-topbar__btn {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  /* Zona de upload sin tanto espacio */
  .plan-upload-zone {
    padding: 32px 20px;
  }

  /* Instrucciones no aplican en mobile */
  .plan-instructions {
    display: none;
  }

  /* Hint de colocar marker no aplica en mobile */
  .plan-canvas-hint {
    display: none !important;
  }

  /* Botón de reset de zoom */
  .plan-zoom-reset {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(25, 25, 25, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(25, 25, 25, 0.12);
    display: none;
    align-items: center;
    gap: 6px;
  }
}
