/* V1 · Capa visual ligera para las obras abiertas y su navegación. */
.builder-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 3%, rgba(83, 207, 179, .14), transparent 25rem),
    radial-gradient(circle at 17% 85%, rgba(87, 151, 198, .09), transparent 28rem),
    linear-gradient(145deg, #f8fbfc 0%, #eef8f6 55%, #f7fbfa 100%);
}

.builder-sidebar {
  border-right-color: #d4e6e3 !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 8px 0 27px rgba(21, 71, 81, .055);
}

.builder-sidebar > .builder-brand {
  padding-bottom: 23px;
}

.builder-sidebar > .builder-brand b { color: #15476d; }
.builder-sidebar > .builder-brand b .brand-metra { color: #249b88; }

.project-card {
  position: relative;
  overflow: visible;
  border-color: rgba(123, 201, 184, .35) !important;
  border-radius: 13px !important;
  background:
    radial-gradient(circle at 105% -20%, rgba(145, 235, 214, .34), transparent 9rem),
    linear-gradient(135deg, #123f69, #176272 72%, #19796f) !important;
  box-shadow: 0 12px 24px rgba(19, 77, 94, .16);
}

.project-card > span {
  background: rgba(255, 255, 255, .16) !important;
  color: #c4faeb !important;
}

.project-card b { color: #fff !important; }
.project-card small { color: #cfe9e6 !important; }
.project-card > button { color: #d7f5ee !important; }

.builder-nav > p {
  margin-top: 20px;
  color: #849da7 !important;
  font-size: 9px;
  letter-spacing: .14em;
}

.builder-nav > button {
  margin-block: 1px;
  border: 1px solid transparent;
  color: #506d7a;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.builder-nav > button:hover {
  border-color: #d5e9e5;
  background: #f1faf7;
  color: #176e66;
  transform: translateX(2px);
}

.builder-nav > button > span { color: #538093; }

.builder-nav > button > em {
  background: #edf5f4;
  color: #408172;
}

.builder-nav > button.active {
  border-color: #bde5da;
  background: linear-gradient(100deg, #e8f8f4, #f6fcfa) !important;
  color: #17776c !important;
  box-shadow: inset 3px 0 #54cdb5, 0 5px 12px rgba(38, 128, 110, .06) !important;
}

.builder-nav > button.active > span { color: #17776c; }
.builder-nav > button.active > em { background: #d6f1e9; color: #17776c; }

.sidebar-help {
  border-color: #d6e9e5 !important;
  background: #f3faf8 !important;
}

.sidebar-help > span {
  background: #ddf4ed !important;
  color: #17776c !important;
}

.builder-workspace { background: transparent; }

.builder-topbar {
  height: 76px;
  border-bottom-color: #d7e9e6 !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: 0 6px 20px rgba(25, 78, 88, .045);
}

.builder-topbar b { color: #17476b; }
.builder-topbar span { color: #6c8791; }

.builder-topbar .plain-button {
  border: 1px solid #d5e7e4;
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  color: #53717e;
}

.builder-topbar .plain-button:hover {
  border-color: #a7dacd;
  background: #f5fcfa;
  color: #176e66;
}

.builder-topbar .main-action,
.builder-page .main-action {
  border-color: #17776c;
  background: linear-gradient(120deg, #17776c, #249b88);
  box-shadow: 0 8px 17px rgba(27, 128, 109, .18);
}

.builder-topbar .main-action:hover,
.builder-page .main-action:hover {
  background: linear-gradient(120deg, #12685f, #1f8d7d);
}

.builder-page { background: transparent; }

.page-title > div > span { color: #17776c; }
.page-title h1 { color: #173f60; }
.page-title p { color: #6b8390; }

.structure-tip {
  border-color: #cfe7e2 !important;
  background: linear-gradient(100deg, #effaf7, #f9fdfc) !important;
  box-shadow: 0 8px 18px rgba(30, 108, 96, .05);
}

.structure-tip > span {
  background: #dff5ee !important;
  color: #17776c !important;
}

.project-fields {
  border-color: #d7e8e5 !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 0 11px 25px rgba(22, 76, 87, .055);
}

.project-fields input,
.project-fields select {
  border-color: #d7e6e4 !important;
  background: #fcfefd !important;
}

.project-fields input:focus,
.project-fields select:focus {
  border-color: #83cdbd !important;
  box-shadow: 0 0 0 3px rgba(83, 207, 179, .13);
  outline: 0;
}

.floor-card {
  border-color: #d5e7e3 !important;
  border-radius: 15px;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 10px 24px rgba(24, 78, 88, .07);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.floor-card:hover {
  border-color: #a6d9cc !important;
  box-shadow: 0 16px 30px rgba(24, 78, 88, .11);
  transform: translateY(-2px);
}

/* Ordenación directa de plantas, unidades, zonas y estancias con el ratón. */
.civi-sortable {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.civi-sortable:active { cursor: default; }
body.civi-sorting,
body.civi-sorting * {
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.civi-sortable.is-dragging {
  opacity: .24;
  transform: scale(.975);
}
.civi-sortable.is-drag-over {
  outline: 2px solid #2f7ca6;
  outline-offset: -2px;
  background-color: #eef7fb !important;
}
.civi-sortable[data-civi-axis="x"].is-drop-before {
  box-shadow: inset 4px 0 #2f7ca6 !important;
}
.civi-sortable[data-civi-axis="x"].is-drop-after {
  box-shadow: inset -4px 0 #2f7ca6 !important;
}
.civi-sortable[data-civi-axis="y"].is-drop-before {
  box-shadow: inset 0 4px #2f7ca6 !important;
}
.civi-sortable[data-civi-axis="y"].is-drop-after {
  box-shadow: inset 0 -4px #2f7ca6 !important;
}
.civi-drag-ghost {
  position: fixed !important;
  z-index: 2147483645 !important;
  margin: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: .97 !important;
  border: 1px solid #75a9c7 !important;
  background: #fff !important;
  color: #183b62 !important;
  box-shadow: 0 20px 42px rgba(24, 59, 98, .28) !important;
  transform: rotate(1.2deg) scale(1.025) !important;
  transform-origin: center !important;
  transition: none !important;
  cursor: default !important;
}
.civi-drag-ghost::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #2f7ca6, #54cdb5);
}
.civi-drag-ghost input,
.civi-drag-ghost button {
  pointer-events: none !important;
}
.floor-card.civi-sortable input {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.compact-work-row.civi-sortable input,
.compact-work-row.civi-sortable select {
  user-select: text;
  -webkit-user-select: text;
}
.compact-work-row.civi-sortable input { cursor: text; }
.template-list-row.civi-sortable,
.compact-work-row.civi-sortable {
  transition: opacity .15s ease, transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.template-list-row.civi-sortable.is-dragging,
.compact-work-row.civi-sortable.is-dragging {
  transform: scale(.985);
}
.civi-floor-context-menu {
  position: fixed;
  z-index: 2147483646;
  min-width: 132px;
  padding: 5px;
  border: 1px solid #e3e7ec;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 43, 68, .2);
}
.civi-floor-context-menu button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c23e4c;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: default;
}
.civi-floor-context-menu button:hover,
.civi-floor-context-menu button:focus-visible {
  background: #fff0f2;
  outline: 0;
}

/* Información útil y compacta en cada obra de Mis mediciones. */
.project-list article > div > .portfolio-project-dates {
  display: block;
  margin-top: 5px;
  color: #708296 !important;
  font-size: 9px !important;
  line-height: 1.35;
  white-space: normal;
}
.portfolio-project-sharing {
  display: inline-flex !important;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px !important;
  font-weight: 850;
  line-height: 1.25;
  white-space: normal;
}
.portfolio-project-sharing.is-private {
  background: #edf3f7;
  color: #5d7186 !important;
}
.portfolio-project-sharing.is-shared {
  background: #e5f6f0;
  color: #17745f !important;
}

.floor-number {
  background: #e5f6f1 !important;
  color: #17776c !important;
}

.floor-kind { color: #458477 !important; }

.add-floor-card {
  border-color: #afd8ce !important;
  border-radius: 14px;
  background: rgba(249, 253, 252, .8) !important;
}

.add-floor-card > span,
.add-floor-card b { color: #17776c !important; }

.floor-tabs {
  border-color: #d6e8e5 !important;
  background: rgba(255, 255, 255, .62);
}

.floor-tabs button { color: #64808d; }
.floor-tabs button:hover { color: #17776c; background: #f2faf8; }
.floor-tabs button.active { color: #17776c; }
.floor-tabs button.active::after { background: #54cdb5 !important; }
.floor-tabs span { background: #e4f5f0 !important; color: #287c70; }

.room-list-panel,
.room-editor {
  border-color: #d6e7e4 !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 12px 27px rgba(24, 78, 88, .07) !important;
}

.room-list-panel > header,
.room-editor-head {
  border-bottom-color: #dcebe8 !important;
  background: linear-gradient(100deg, #f5fbfa, #fff);
}

.room-list-panel > header button {
  border-radius: 9px;
  background: #17776c !important;
}

.large-room-list > button:hover { background: #f0faf7 !important; }
.large-room-list > button.active { background: #e6f7f1 !important; }
.large-room-list > button > span { background: #edf6f4 !important; color: #418173 !important; }
.large-room-list > button.active > span { background: #17776c !important; color: #fff !important; }

.room-editor-head > div > span,
.editor-section-title > span {
  background: #e5f6f1 !important;
  color: #17776c !important;
}

.room-editor-actions .main-action { background: #17776c !important; }

.editor-section { border-bottom-color: #e0eeeb !important; }
.editor-section-title h2 { color: #1b4666; }

.action-card-grid > button {
  border-color: #d8e7e5 !important;
  background: #fff !important;
}

.action-card-grid > button:hover {
  border-color: #9fd6c9 !important;
  background: #f5fcfa !important;
}

.action-card-grid > button > span {
  background: #e8f6f2 !important;
  color: #17776c !important;
}

.budget-page .budget-summary,
.catalog-intro-card,
.settings-hero,
.export-new > header {
  border-color: #d3e8e3 !important;
  box-shadow: 0 13px 28px rgba(24, 78, 88, .07) !important;
}

.budget-page .budget-grand-total {
  min-height: 68px;
  border-color: #173f63 !important;
  background: linear-gradient(105deg, #173f63, #2f557f) !important;
  color: #fff !important;
  box-shadow: 0 13px 27px rgba(23, 63, 99, .20) !important;
}

.budget-page .budget-grand-total b {
  color: #fff !important;
  font-size: 13px !important;
}

.budget-page .budget-grand-total strong {
  color: #fff !important;
  font-size: 20px !important;
}

@media (max-width: 760px) {
  .builder-topbar { height: 68px; }
  .floor-card:hover,
  .builder-nav > button:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .builder-shell *,
  .builder-shell *::before,
  .builder-shell *::after { transition: none !important; }
}

/* El selector de obra vive sobre una tarjeta oscura, pero su menú es claro. */
.project-card .project-switcher > summary {
  grid-template-columns: 1fr;
  gap: 0;
  width: 36px !important;
  min-width: 36px;
  padding: 0;
  border-color: #c9e4de !important;
  background: #f1faf7 !important;
  color: #176e66 !important;
}

.project-card .project-switcher > summary:hover,
.project-card .project-switcher[open] > summary {
  border-color: #8ad3c1 !important;
  background: #fff !important;
  box-shadow: 0 5px 14px rgba(4, 48, 59, .2) !important;
}

.project-card .project-switcher > summary > b { color: #176e66 !important; }

/* Tarjeta de la obra: texto oscuro sobre fondo claro, independientemente del menú. */
.builder-sidebar .project-card {
  border-color: #cfe5df !important;
  background: #fff !important;
  box-shadow: 0 10px 21px rgba(20, 77, 86, .1) !important;
}

.builder-sidebar .project-card > span {
  background: linear-gradient(145deg, #174c80, #258a7e) !important;
  color: #fff !important;
}

.builder-sidebar .project-card > div > b {
  color: #183e5b !important;
}

.builder-sidebar .project-card > div > small {
  color: #18756c !important;
}

.project-card .project-switcher-menu {
  z-index: 70;
  border-color: #c9e4de !important;
  background: #fff !important;
  box-shadow: 0 18px 42px rgba(20, 75, 86, .2) !important;
}

.project-card .project-switcher-menu > small {
  color: #65808b !important;
}

.project-card .project-switcher-menu > button {
  color: #244d62 !important;
  background: transparent !important;
}

.project-card .project-switcher-menu > button:hover {
  background: #f0faf7 !important;
}

.project-card .project-switcher-menu > button.is-active {
  background: #e5f7f1 !important;
  color: #176e66 !important;
}

.project-card .project-switcher-menu > button > b {
  color: #244d62 !important;
}

.project-card .project-switcher-menu > button.is-active > b {
  color: #176e66 !important;
}

.project-card .project-switcher-menu > button > span {
  color: #6a8290 !important;
}

.project-card .project-switcher-menu > button.is-active > span {
  color: #258373 !important;
}
