:root {
  --bg: #0b0e14;
  --bg-card: #121622;
  --bg-card-hover: #171d2b;
  --bg-input: #1a202e;
  --border: #1f2738;
  --border-focus: #ea580c;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --accent-orange: #ea580c;
  --accent-orange-hover: #c2410c;
  --accent-orange-glow: rgba(234, 88, 12, 0.35);
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.16);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  user-select: none;
  overflow-x: hidden;
}

/* Reset universal de enlaces: CERO azul ni morado */
a, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none;
}

.link {
  color: var(--gold) !important;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link:hover {
  color: #fbbf24 !important;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 80px;
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header & Hero */
.hero {
  padding: 24px 20px 16px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, #1e2530 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--border);
}
.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.hero-logo .logo {
  max-width: 200px;
  height: auto;
  margin: 8px auto;
  display: block;
}
.hero-greet {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-top: 6px;
}
.hero-greet span {
  color: var(--gold);
}
.hero-date {
  font-size: 13px;
  color: var(--text-muted);
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.status-pill.demo {
  background: rgba(201, 166, 107, 0.15);
  color: var(--gold);
  border: 1px solid rgba(201, 166, 107, 0.3);
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title h1 {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}
.topbar-title p {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.topbar-spacer {
  width: 36px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-orange-glow);
}
.btn-primary:active {
  transform: scale(0.98);
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-xl {
  padding: 16px;
  font-size: 16px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.btn-block {
  width: 100%;
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cards & Content */
.content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-head h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
}
.section-head a {
  color: var(--gold) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.section-head a:hover {
  color: #fbbf24 !important;
  text-decoration: underline;
}

/* Call to Action */
.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #242933 0%, #171b22 100%);
  border: 1px solid rgba(201, 166, 107, 0.4);
  padding: 18px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
.cta-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dfc18b, #b89353);
  color: #121418;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cta-text strong {
  font-size: 16px;
}
.cta-text small {
  color: var(--text-muted);
}

/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  position: relative;
}
.tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.tile-icon.gold {
  background: var(--gold-glow);
  color: var(--gold);
}
.tile-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.tile-icon.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.tile small {
  font-size: 12px;
  color: var(--text-muted);
}
.tile-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Active Round Card */
.active-round {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--gold);
  background: #171b22;
  text-decoration: none;
  color: var(--text);
}
.active-round-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.active-round-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.active-round-ring b {
  position: absolute;
  font-size: 12px;
}

/* Sector & Points */
.sector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sector-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sector-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sector-title {
  flex: 1;
}
.sector-title strong {
  font-size: 15px;
}
.sector-title small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.point {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.point-status {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.point-status i {
  font-style: normal;
  font-size: 12px;
  color: var(--text-muted);
}
.point-body {
  flex: 1;
}
.point-body strong {
  font-size: 14px;
  display: block;
}
.point-body small {
  font-size: 12px;
  color: var(--text-muted);
}
.point.ok .point-status { color: var(--ok); }
.point.warn .point-status { color: var(--warn); }
.point.danger .point-status { color: var(--danger); }
.point.flash {
  animation: flashHighlight 1.5s ease;
}

@keyframes flashHighlight {
  0% { background: rgba(201, 166, 107, 0.4); }
  100% { background: var(--bg-input); }
}

/* Results Selection */
.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.result-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-text {
  flex: 1;
}
.result-text strong {
  display: block;
  font-size: 15px;
}
.result-text small {
  font-size: 12px;
  color: var(--text-muted);
}
.result-check {
  display: none;
}
.result.active {
  border-color: currentColor;
}
.result.active .result-check {
  display: block;
}
.result-ok { color: var(--ok); }
.result-ok .result-icon { background: var(--ok-bg); }
.result-warn { color: var(--warn); }
.result-warn .result-icon { background: var(--warn-bg); }
.result-danger { color: var(--danger); }
.result-danger .result-icon { background: var(--danger-bg); }

/* Photos */
.photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.photo-slot {
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-input);
}
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  justify-content: center;
}
.photo-slot img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.photo-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: none;
}
.photo-slot.has img { display: block; }
.photo-slot.has .photo-del { display: flex; align-items: center; justify-content: center; }
.photo-slot.has .photo-add { display: none; }

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.select-field, .input-field, textarea,
input[type="text"], input[type="number"], input[type="password"], input[type="date"], input[type="datetime-local"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  color-scheme: dark;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.select-field:focus, .input-field:focus, textarea:focus,
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime-local"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* Universal Select Styling */
select, .select-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  border: 1px solid var(--border);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 40px 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  color-scheme: dark;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, .select-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}
select option, .select-field option {
  background-color: #121622;
  color: #ffffff;
  padding: 10px 12px;
}

.select-sm {
  font-size: 13px !important;
  padding: 8px 36px 8px 12px !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  border-radius: 6px !important;
}

/* Select with leading icon */
.select-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.select-leading-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 2;
}
.select-wrapper select,
.select-wrapper .select-field {
  padding-left: 38px !important;
}

/* Filters & Filter Panels */
.filters,
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2px;
}
.filters-title {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filters-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 12px;
}
.filter-select-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-clear-filters {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-clear-filters:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Chip Select & Chip Opt */
.chip-select {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-select::-webkit-scrollbar {
  display: none;
}
.chip-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  outline: none;
}
.chip-opt:hover {
  border-color: var(--gold);
  color: #ffffff;
}
.chip-opt.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  color: #0b0e14;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

/* Empty State Component */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 20px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-bottom: 16px;
}
.empty svg {
  color: var(--gold);
}
.empty h3 {
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.2px;
}
.empty p {
  color: var(--text-muted) !important;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  max-width: 300px;
}
.empty-action {
  margin-top: 18px;
}

/* Segmented Buttons */
.seg {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
  border: 1px solid var(--border);
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.seg-btn:hover {
  color: #ffffff;
}
.seg-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0e14 !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

/* People Radio Group */
.people {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.person.selected {
  border-color: var(--gold);
  background: #171b22;
}
.person-body {
  flex: 1;
}
.person-body strong {
  display: block;
  font-size: 14px;
}
.person-body small {
  color: var(--text-muted);
  font-size: 12px;
}
.person-check {
  display: none;
  color: var(--gold);
}
.person.selected .person-check {
  display: block;
}

/* Action Bar */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 20px;
  background: linear-gradient(to top, var(--bg) 80%, transparent);
  z-index: 60;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 66px;
  background: rgba(14, 18, 28, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 8px;
  z-index: 70;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}
.nav-item {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  background: #141824;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  padding: 4px 2px;
}
.nav-item:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: #ffffff;
}
.nav-item:active {
  transform: scale(0.96);
}
.nav-item.active {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.14);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.nav-item.active .nav-icon {
  color: var(--gold);
}
.nav-item.active .nav-label {
  color: #ffffff;
  font-weight: 700;
}
.nav-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  width: 22px;
  height: 22px;
}
.nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
  line-height: 1.1;
}
.nav-icon .badge {
  position: absolute;
  top: -4px;
  right: -9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  height: 15px;
  min-width: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #141824;
  line-height: 1;
}

/* Badge & Chips */
.badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  position: absolute;
  top: -4px;
  right: -8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-muted { background: var(--bg-input); color: var(--text-muted); }

/* Pisos Grid y Panel de Suministros (Aguas Andinas / Enel) */
.suministro-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
}
.suministro-status-bar.has-alert {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.suministro-status-bar .status-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.suministro-status-bar .status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.suministro-status-bar .status-pill.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.suministro-status-bar .status-pill.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pisos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.piso-badge {
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.piso-badge:hover {
  border-color: var(--accent);
}
.piso-badge:active {
  transform: scale(0.96);
}
.piso-badge.normal {
  color: var(--text);
}
.piso-badge.normal small {
  color: var(--ok);
  font-weight: 600;
}
.piso-badge.corte {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}
.piso-badge.corte small {
  color: #f87171;
  font-weight: 700;
}
.piso-badge.parcial {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}
.piso-badge.parcial small {
  color: #f59e0b;
  font-weight: 700;
}

/* Caja de Selección Múltiple de Pisos y Departamentos */
.floor-selector-box {
  background: var(--bg-card-subtle, #121622);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.floor-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.floor-selector-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.floor-selected-count {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.field-sublabel {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 2px;
  font-weight: 500;
  display: block;
}

/* Atajos rápidos de selección */
.floor-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.floor-shortcut-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.floor-shortcut-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
}
.floor-shortcut-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}
.floor-shortcut-btn.clear {
  color: var(--text-muted);
  margin-left: auto;
}
.floor-shortcut-btn.clear:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Cuadrícula de listado por piso (pestañas) */
.floor-chips-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .floor-chips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.floor-chip {
  position: relative;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  box-sizing: border-box;
  background: var(--bg-input, #0d111a);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 3px 2px;
  overflow: hidden;
}
.floor-chip:hover {
  border-color: var(--border-hover, #475569);
  color: var(--text);
}
.floor-chip.tab-active {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: var(--accent) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  font-weight: 700;
}
.floor-chip.has-selection {
  border-color: rgba(245, 158, 11, 0.5);
}
.floor-tab-num {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
}
.floor-tab-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.1;
  margin-top: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  pointer-events: none;
}
.floor-chip.has-cut::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

/* Panel interactivo de departamentos del piso activo */
.active-floor-panel {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}
.active-floor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.active-floor-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.active-floor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-sm-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sm-text:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}
.btn-sm-text.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Grilla de Chips de Departamentos */
.deptos-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
}
.deptos-chips-grid.areas-subt {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.depto-chip {
  position: relative;
  min-height: 38px;
  height: 38px;
  box-sizing: border-box;
  padding: 6px 4px;
  background: var(--bg-input, #0d111a);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.depto-chip:hover {
  border-color: var(--border-hover, #475569);
  color: var(--text);
}
.depto-chip.selected {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--accent);
  color: #fbbf24;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.25);
}
.depto-chip.has-cut {
  border-color: rgba(239, 68, 68, 0.5);
}
.depto-chip.has-cut::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}

/* Resumen interactivo de unidades seleccionadas */
.deptos-summary-box {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px dashed var(--border);
}
.deptos-summary-box.empty {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.3);
}
.deptos-summary-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.summary-floor-chip {
  display: inline-block;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  margin: 2px 4px 2px 0;
  font-size: 11px;
  color: #cbd5e1;
}
.summary-floor-chip strong {
  color: #f59e0b;
}

/* Desglose de departamentos en Historial */
.hist-deptos-wrap {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  line-height: 1.4;
  margin-top: 4px;
}
.hist-deptos-wrap strong {
  color: #fbbf24;
}

/* Filtros del Historial */
.hist-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hist-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hist-filter-field {
  flex: 1;
  min-width: 140px;
}
.hist-filter-count {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Agrupador de fecha del Historial */
.hist-day-group {
  margin-bottom: 16px;
}
.hist-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 8px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.hist-day-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Tarjeta de Evento en el Historial */
.hist-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.hist-item-card:hover {
  border-color: var(--border-hover, #475569);
}
.hist-item-card.is-corte-activo {
  border-left: 3px solid var(--danger);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-card) 40%);
}
.hist-item-card.is-repuesto {
  border-left: 3px solid var(--ok);
}
.hist-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hist-item-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hist-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hist-item-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.hist-item-icon.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.hist-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.hist-item-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.hist-chip.danger-live {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulse-glow 2s infinite ease-in-out;
}
.hist-chip.ok-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Tags de Pisos Afectados en Historial */
.hist-floors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.hist-floor-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-input, #0d111a);
  color: #cbd5e1;
  border: 1px solid var(--border);
}
.hist-floor-tag.all {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}
.hist-floor-tag.active-cut {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Meta y Observaciones */
.hist-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 6px;
}
.hist-item-obs {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  line-height: 1.4;
  margin-top: 2px;
}
.hist-item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-hist-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-hist-action:hover {
  color: var(--text);
  border-color: var(--accent);
}
.btn-hist-action.del:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}
.btn-hist-action.edit:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}
.btn-hist-action.pdf:hover {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

/* Modal de Descarga PDF */
.pdf-modal-pisos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 10px 0;
}
@media (max-width: 480px) {
  .pdf-modal-pisos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.pdf-floor-chip {
  min-height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}
.pdf-floor-chip.selected {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent);
  color: #fbbf24;
  font-weight: 700;
}

/* Avatar */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: hsl(var(--h, 40), 45%, 25%);
  color: hsl(var(--h, 40), 80%, 75%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

/* Toast */
#toast-root {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  max-width: 440px;
  margin: 0 auto;
  pointer-events: none;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}
.toast {
  background: #1e2430;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-ok { border-color: var(--ok); }
.toast-danger { border-color: var(--danger); }

/* Utilities */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}
.callout p b { color: var(--text); }
.callout-warn { border-color: var(--warn); color: var(--warn); }
.callout-ok { border-color: var(--ok); color: var(--ok); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.flex-row { display: flex; }
.gap-2 { gap: 8px; }
.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.block { display: block; }

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.stat small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.stat b {
  font-size: 18px;
}
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
.stat.danger b { color: var(--danger); }

/* List */
.list {
  padding: 0;
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.list-row:last-child {
  border-bottom: none;
}
.list-body {
  flex: 1;
}
.list-body strong {
  display: block;
  font-size: 14px;
}
.list-body small {
  font-size: 12px;
  color: var(--text-muted);
}
.list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}
.list-icon.danger { color: var(--danger); background: var(--danger-bg); }
.list-icon.ok { color: var(--ok); background: var(--ok-bg); }
.list-icon.warn { color: var(--warn); background: var(--warn-bg); }
.point-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox.open { opacity: 1; }
.lightbox img { max-width: 90%; max-height: 85vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; }

/* Ring SVG */
.ring circle {
  fill: none;
}
.ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.ring-fg {
  stroke: var(--gold);
  transition: stroke-dashoffset 0.4s ease;
}

/* Print view for PDF */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .no-print, .bottom-nav, .topbar, .fab-btn, .portal-badges-row, .seg { display: none !important; }
  .sheet-backdrop { display: none !important; }
  .sheet-wrap { position: static !important; background: transparent !important; z-index: auto !important; }
  .sheet {
    position: static !important;
    max-height: none !important;
    width: 100% !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  #app { max-width: 100% !important; padding: 0 !important; }
  .report { padding: 15px !important; background: #fff !important; color: #111 !important; border: 1px solid #ddd !important; }
  .report * { color: #111 !important; text-shadow: none !important; }
  .report h1, .report h2, .report h3, .report b, .report strong { color: #000 !important; }
  .report img { max-width: 100% !important; display: block !important; }
  .report-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
  .report-table th, .report-table td { border: 1px solid #ccc; padding: 6px 10px; font-size: 12px; text-align: left; color: #111 !important; }
}

/* Incidencias Styles */
.inc-date-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 4px;
}
.inc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.inc-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
}
.inc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inc-thumb-empty {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.inc-title {
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inc-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inc-status-tag {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inc-level-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.inc-level-tag.ok { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.inc-level-tag.warn { color: #eab308; background: rgba(234, 179, 8, 0.12); }
.inc-level-tag.orange { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.inc-level-tag.danger { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-level.lvl-baja { color: #22c55e; }
.btn-level.lvl-media { color: #eab308; }
.btn-level.lvl-alta { color: #f97316; }
.btn-level.lvl-critica { color: #ef4444; }
.btn-level.active {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px currentColor;
}

/* Inventario Styles */
.inv-table-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.inv-date {
  font-size: 12px;
  color: var(--text-muted);
}
.inv-prod {
  text-align: right;
  flex: 1;
  padding-left: 12px;
}
.inv-prod.inv-warn {
  color: #f97316;
}
.inv-prod strong {
  display: block;
  font-size: 13px;
}
.inv-alert-icon {
  color: #f97316;
  vertical-align: middle;
  margin-right: 4px;
}
.inv-stock-badge {
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.inv-stock-badge.danger {
  border-color: #f97316;
  color: #f97316;
}
.inv-stock-badge b {
  font-size: 16px;
  display: block;
}
.inv-stock-badge small {
  font-size: 10px;
  color: var(--text-muted);
}

.fab-btn {
  position: fixed;
  bottom: 76px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 18px var(--accent-orange-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 65;
  transition: transform 0.15s ease;
}
.fab-btn:active {
  transform: scale(0.92);
}
.badge-dot-warn {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
  margin-left: 4px;
}
.tag-warn {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.danger-text { color: #ef4444; }
.ok-text { color: #22c55e; }

/* Drawer / Menú Lateral */
.drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  transition: visibility 0.25s ease;
  visibility: hidden;
}
.drawer-wrap.open {
  visibility: visible;
  pointer-events: auto;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drawer-wrap.open .drawer-backdrop {
  opacity: 1;
}
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  background: #14171d;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.drawer-wrap.open .drawer {
  transform: translateX(0);
}
.drawer-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.drawer-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.drawer-close {
  position: absolute;
  top: 16px;
  right: 12px;
}
.drawer-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}
.drawer-item:hover, .drawer-item:active {
  background: var(--bg-input);
}
.drawer-item.active-tag {
  background: rgba(201, 166, 107, 0.12);
  color: var(--gold);
}
.drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.badge-inline {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.badge-inline.warn { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-inline.danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Botón Hero para Reportar Incidencia */
.big-action-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0d0f12;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.big-action-circle:active {
  transform: scale(0.94);
}

.seg-scrollable {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.seg-scrollable::-webkit-scrollbar {
  display: none;
}
.seg-scrollable .seg-btn {
  flex: 0 0 auto;
  min-width: max-content;
}



/* Productos y Categorías */
.cat-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 8px 4px 6px;
}
.prod-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.prod-name {
  font-size: 14px;
  color: var(--text);
}
.prod-name.prod-bajo {
  color: #f97316;
}
.prod-name.prod-critico {
  color: #ef4444;
}
.alert-tag-orange {
  color: #f97316;
  font-weight: 800;
}
.alert-tag-red {
  color: #ef4444;
  font-weight: 800;
}
.prod-actions-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.stepper-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-input);
  transition: all 0.12s ease;
}
.stepper-circle:active {
  transform: scale(0.9);
  background: var(--gold-glow);
  border-color: var(--gold);
}

/* Stepper Form */
.number-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stepper-btn:active {
  background: rgba(255, 255, 255, 0.1);
}
.stepper-input {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

/* Drawer Profile */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0d0f12;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.drawer-offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
}
.drawer-divider {
  height: 1px;
  background: var(--border);
}
.subtle-item {
  color: var(--text-muted);
  font-size: 13px;
}
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

/* ==========================================================================
   MODAL & BOTTOM SHEET DIALOGS (FIX & ANIMATIONS)
   ========================================================================== */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}
.sheet-wrap.open {
  visibility: visible;
  pointer-events: auto;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sheet-wrap.open .sheet-backdrop {
  opacity: 1;
}
.sheet {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 16px 20px 32px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.7);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.sheet-wrap.open .sheet {
  transform: translateY(0);
}
.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 0 auto 16px;
}
.sheet-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}
.sheet-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.sheet-actions .btn {
  flex: 1;
}

/* ==========================================================================
   PORTAL BRANDING & THEME COMPONENTS (MATCHING IMAGE 1)
   ========================================================================== */
.portal-hero {
  background: radial-gradient(circle at 50% 0%, #171d2b 0%, var(--bg) 80%);
  padding: 16px 16px 12px;
}
.portal-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.portal-live-pill.online {
  background: rgba(34, 197, 94, 0.12);
  color: var(--ok);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.portal-live-pill.offline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.live-dot-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.portal-brand-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.portal-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.portal-sq-icon {
  width: 44px;
  height: 44px;
  background: #19202f;
  border: 1px solid #28334a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.portal-sq-letter {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Times New Roman', serif;
  color: var(--gold);
}
.portal-building-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}
.portal-building-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin: 2px 0 0 0;
}
.portal-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.portal-tag-gold {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: default;
}
.portal-tag-orange {
  background: var(--accent-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-orange-glow);
  transition: transform 0.15s ease;
}
.portal-tag-orange:active {
  transform: scale(0.95);
}
.hero-date-row {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.dot-sep {
  opacity: 0.4;
}

/* ==========================================================================
   ORDER PANEL & COMPACT REPORT HEADERS (FIX PEDIDO Y SIN STOCK)
   ========================================================================== */
.report-head-compact {
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.report-pill {
  background: rgba(234, 88, 12, 0.15);
  color: var(--accent-orange);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}
.order-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
}
.stepper-box {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.btn-step {
  width: 28px;
  height: 28px;
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-step:active {
  background: var(--accent-orange);
}
.step-input {
  width: 44px;
  height: 28px;
  background: transparent;
  color: #ffffff;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 0;
  outline: none;
}
.step-input::-webkit-inner-spin-button, 
.step-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ==========================================================================
   RONDAS CARDS & MENU LIST (ELEGANT WHITE & GOLD TYPOGRAPHY)
   ========================================================================== */
.round-item {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #ffffff !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.round-item:active {
  background: var(--bg-card-hover) !important;
  transform: scale(0.99);
}
.round-conserje-title {
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 700;
  display: block;
}
.round-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px 0;
  font-size: 13px;
}
.round-turno-badge {
  color: var(--gold) !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.round-time-text {
  color: #cbd5e1 !important;
}
.round-duration-text {
  color: var(--text-muted) !important;
}
.round-chevron {
  color: var(--gold) !important;
  margin-left: auto;
}
.section-head h2 {
  color: var(--gold) !important;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Menu items for modal options */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.menu-item svg {
  color: var(--gold) !important;
}
.menu-item:active {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}
.menu-item.danger {
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}
.menu-item.danger svg {
  color: var(--danger) !important;
}

/* ==========================================================================
   INCIDENCIAS: THUMBNAILS & MULTIMEDIA UPLOADER
   ========================================================================== */
.inc-thumb-wrap {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
}
.inc-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inc-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
}
.inc-thumb-empty.danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}
.inc-thumb-empty.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.1);
}
.inc-media-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}
.inc-video-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}
.inc-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
  background: rgba(234, 88, 12, 0.1);
}
.media-uploader-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.media-thumbs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.media-thumb-card {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}
.media-thumb-card img, .media-thumb-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btn-del-media {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

/* Discreet Round Status Card */
.round-status-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.round-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.round-status-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.round-badge-puntos {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.round-badge-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 10px;
}

/* Discreet Timer Pill */
.round-timer-discreet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #141824;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: 14px;
  color: #ffffff;
  font-size: 12.5px;
}
.round-timer-discreet b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: timerPulse 1.8s infinite;
}
@keyframes timerPulse {
  0% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.4; transform: scale(0.85); }
}
.timer-clock-icon {
  color: var(--gold);
  display: flex;
  align-items: center;
}

/* Progress bar slim track */
.round-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.round-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Status Meta */
.round-status-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}
.round-meta-turno {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
}
.round-counts-discreet {
  display: flex;
  align-items: center;
  gap: 8px;
}
.round-counts-discreet .count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
}
.round-counts-discreet .count.ok { color: var(--ok); }
.round-counts-discreet .count.warn { color: var(--warn); }
.round-counts-discreet .count.danger { color: var(--danger); }

/* Netlify Badge & Inject Suppression */
a[href*="netlify.com"],
iframe[src*="netlify"],
#netlify-badge,
.netlify-badge,
[class*="netlify-badge"],
[id*="netlify-badge"],
netlify-drawer,
div:has(> a[href*="netlify.com"]),
div[style*="z-index"][style*="fixed"]:has(a[href*="netlify.com"]) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
