/*
 * Uimovel Shell V2
 *
 * Interface principal do portfólio. `?shell=legacy` preserva o dashboard
 * anterior como rollback durante a migração progressiva.
 */
html.uimovel-shell-v2 {
  --v2-panel: 420px;
  --v2-header: 58px;
  color-scheme: dark;
}

html.uimovel-shell-v2 body {
  --tb-h: var(--v2-header);
  --lw: 0px;
  --rw: var(--v2-panel);
  background: #061522;
}

html.uimovel-shell-v2 #loading {
  background: #061522;
}

html.uimovel-shell-v2 #topbar {
  height: var(--v2-header);
  padding: 0 22px;
  gap: 14px;
  border-color: rgba(142, 177, 207, .18);
  background: rgba(6, 22, 36, .97);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

html.uimovel-shell-v2 .tb-mark-img {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
}

html.uimovel-shell-v2 .tb-name {
  font-size: .86rem;
}

html.uimovel-shell-v2 .tb-sub {
  font-size: .56rem;
  letter-spacing: 1.25px;
}

html.uimovel-shell-v2 .tb-painel-title {
  font-size: .8rem;
}

html.uimovel-shell-v2 .tb-tag {
  display: none;
}

html.uimovel-shell-v2 #app {
  position: relative;
  background: #061522;
}

html.uimovel-shell-v2 #toolbar {
  display: none;
}

html.uimovel-shell-v2 #sidebar {
  order: 1;
  position: relative;
  z-index: 450;
  width: var(--v2-panel);
  min-width: var(--v2-panel);
  padding: 0;
  border-right: 1px solid rgba(142, 177, 207, .25);
  border-left: 0;
  background:
    linear-gradient(180deg, rgba(9, 29, 47, .98), rgba(5, 21, 35, .98));
  box-shadow: 16px 0 40px rgba(0, 0, 0, .22);
}

html.uimovel-shell-v2 #map-wrap {
  order: 2;
}

html.uimovel-shell-v2 .sb-header {
  padding: 22px 24px 13px;
  border-color: rgba(142, 177, 207, .14);
}

html.uimovel-shell-v2 .sb-h-row {
  display: block;
  margin-bottom: 18px;
}

html.uimovel-shell-v2 .sb-title-group {
  display: block;
}

html.uimovel-shell-v2 .sb-title-group::before {
  content: "PORTFÓLIO";
  display: block;
  margin-bottom: 8px;
  color: #68aafc;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .2em;
}

html.uimovel-shell-v2 .sb-h-row h2 {
  font-size: 1.72rem;
  font-weight: 500;
  letter-spacing: -.03em;
}

html.uimovel-shell-v2 .sb-count {
  display: inline-flex;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7f96aa;
  font-size: .76rem;
}

html.uimovel-shell-v2 .v2-organization-filter {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(124, 166, 207, .27);
  border-radius: 9px;
  background: rgba(10, 33, 55, .78);
}

html.uimovel-shell-v2 .v2-organization-filter > span {
  color: #7892a9;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

html.uimovel-shell-v2 .v2-organization-filter select {
  width: 100%;
  min-height: 30px;
  padding: 0 26px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e7f0fa;
  font: 700 .83rem/1.2 var(--font);
  cursor: pointer;
}

html.uimovel-shell-v2 .search-box {
  margin-bottom: 10px;
}

html.uimovel-shell-v2 .search-box input {
  min-height: 42px;
  padding-left: 38px;
  border-color: rgba(124, 166, 207, .27);
  border-radius: 8px;
  background: #0a2137;
  font-size: .82rem;
}

html.uimovel-shell-v2 .filter-row {
  gap: 6px;
}

html.uimovel-shell-v2 .filter-chip {
  padding: 5px 9px;
  border-color: rgba(124, 166, 207, .18);
  background: rgba(14, 41, 65, .8);
  font-size: .66rem;
}

html.uimovel-shell-v2 .sort-row {
  padding: 10px 24px;
  border-color: rgba(142, 177, 207, .14);
}

html.uimovel-shell-v2 #proj-list {
  padding: 8px 18px 14px;
}

html.uimovel-shell-v2 .proj-card {
  margin-bottom: 4px;
  padding: 14px 14px 13px;
  border: 1px solid transparent;
  border-bottom-color: rgba(142, 177, 207, .14);
  border-left: 3px solid transparent;
  border-radius: 9px;
  background: transparent;
}

html.uimovel-shell-v2 .proj-card:hover,
html.uimovel-shell-v2 .proj-card.selected {
  border-color: rgba(77, 145, 231, .34);
  background: rgba(23, 60, 96, .68);
}

html.uimovel-shell-v2 .pc-type-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

html.uimovel-shell-v2 .pc-name {
  font-size: .91rem;
}

html.uimovel-shell-v2 .pc-location,
html.uimovel-shell-v2 .pc-meta-item {
  font-size: .73rem;
}

html.uimovel-shell-v2 .pc-header {
  align-items: center;
  margin-bottom: 0;
}

html.uimovel-shell-v2 .pc-status {
  align-self: flex-start;
}

html.uimovel-shell-v2 .v2-project-compact-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 9px;
  color: #7fa1bf;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

html.uimovel-shell-v2 .v2-project-expanded {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(142, 177, 207, .17);
}

html.uimovel-shell-v2 .v2-project-operational-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

html.uimovel-shell-v2 .v2-project-operational-grid > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(124, 166, 207, .13);
  border-radius: 8px;
  background: rgba(4, 23, 39, .56);
}

html.uimovel-shell-v2 .v2-project-operational-grid span,
html.uimovel-shell-v2 .v2-project-activity span {
  display: block;
  margin-bottom: 4px;
  color: #718ba2;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

html.uimovel-shell-v2 .v2-project-operational-grid strong {
  display: block;
  overflow: hidden;
  color: #e5edf5;
  font-size: .74rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

html.uimovel-shell-v2 .v2-project-activity,
html.uimovel-shell-v2 .v2-project-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html.uimovel-shell-v2 .v2-project-activity {
  margin-top: 11px;
}

html.uimovel-shell-v2 .v2-project-activity span {
  margin: 0;
}

html.uimovel-shell-v2 .v2-project-activity strong {
  color: #bfd0df;
  font-size: .72rem;
}

html.uimovel-shell-v2 .v2-project-context {
  margin-top: 8px;
  color: #7693ac;
  font-size: .66rem;
}

html.uimovel-shell-v2 .v2-project-description {
  margin: 10px 0 0;
  color: #91a7ba;
  font-size: .7rem;
  line-height: 1.5;
}

html.uimovel-shell-v2 .proj-card button {
  min-height: 36px;
  border-radius: 7px !important;
  background: linear-gradient(135deg, #2f7bea, #2465d2) !important;
  color: #fff !important;
}

html.uimovel-shell-v2 .v2-project-open {
  width: 100%;
  margin-top: 13px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #448af0 !important;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
}

html.uimovel-shell-v2 .new-project-btn {
  order: 20;
  flex: 0 0 auto;
  width: auto;
  min-height: 48px;
  margin: 0 18px 18px;
  border-color: #3d8af4;
  border-radius: 9px;
  background: linear-gradient(135deg, #347fef, #2365d4);
  color: #fff;
  font-size: .9rem;
  box-shadow: 0 12px 28px rgba(25, 89, 190, .24);
}

html.uimovel-shell-v2 .v2-settings-action {
  order: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  margin: -8px 18px 16px;
  border: 1px solid rgba(124, 166, 207, .2);
  border-radius: 8px;
  color: #829db5;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

html.uimovel-shell-v2 .v2-settings-action:hover {
  border-color: rgba(77, 145, 231, .42);
  background: rgba(23, 60, 96, .46);
  color: #c8d8e7;
}

html.uimovel-shell-v2 .analyzer-card {
  display: none !important;
}

html.uimovel-shell-v2 .map-stats {
  top: 16px;
  right: 16px;
}

html.uimovel-shell-v2 .map-legend {
  right: 14px;
  bottom: 18px;
  left: auto;
}

html.uimovel-shell-v2 .project-hub,
html.uimovel-shell-v2 .project-hub-backdrop {
  display: none !important;
}

html.uimovel-shell-v2 .project-dialog {
  width: min(900px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  border-color: rgba(130, 169, 207, .38);
  border-radius: 11px;
  background: #071a2c;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .62);
}

html.uimovel-shell-v2 .project-dialog::backdrop {
  background: rgba(2, 10, 18, .6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

html.uimovel-shell-v2 .pd-header {
  padding: 24px 28px 20px;
  background: linear-gradient(145deg, rgba(33, 89, 154, .34), rgba(7, 31, 52, .4));
}

html.uimovel-shell-v2 .pd-step {
  margin-bottom: 7px;
  font-size: .67rem;
  letter-spacing: .16em;
}

html.uimovel-shell-v2 .pd-header h2 {
  margin-bottom: 7px;
  font-size: 1.28rem;
  letter-spacing: -.02em;
}

html.uimovel-shell-v2 .pd-header p {
  max-width: 660px;
  font-size: .8rem;
}

html.uimovel-shell-v2 .pd-close {
  width: 38px;
  height: 38px;
  border-color: rgba(130, 169, 207, .26);
  border-radius: 8px;
}

html.uimovel-shell-v2 .v2-project-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 15px 28px;
  border-bottom: 1px solid rgba(142, 177, 207, .15);
  background: rgba(4, 19, 33, .72);
}

html.uimovel-shell-v2 .v2-project-progress::before {
  content: "";
  position: absolute;
  top: 29px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: rgba(124, 166, 207, .22);
}

html.uimovel-shell-v2 .v2-project-progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #617d95;
}

html.uimovel-shell-v2 .v2-project-progress-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 166, 207, .28);
  border-radius: 50%;
  background: #071a2c;
  font-size: .67rem;
  font-weight: 850;
}

html.uimovel-shell-v2 .v2-project-progress-label {
  overflow: hidden;
  max-width: 100%;
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.uimovel-shell-v2 .v2-project-progress-step.current {
  color: #91c0ff;
}

html.uimovel-shell-v2 .v2-project-progress-step.current .v2-project-progress-number {
  border-color: #4d91e7;
  background: #174d87;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(45, 123, 224, .12);
}

html.uimovel-shell-v2 .v2-project-progress-step.completed {
  color: #79cba6;
}

html.uimovel-shell-v2 .v2-project-progress-step.completed .v2-project-progress-number {
  border-color: rgba(45, 190, 124, .5);
  background: #0c4b38;
  color: #a7f3d0;
}

html.uimovel-shell-v2 .pd-body {
  max-height: calc(100vh - 285px);
  padding: 25px 28px 28px;
}

html.uimovel-shell-v2 .pd-label {
  margin-bottom: 8px;
  color: #9bb0c3;
  font-size: .72rem;
}

html.uimovel-shell-v2 .pd-select,
html.uimovel-shell-v2 .wizard-input,
html.uimovel-shell-v2 .wizard-textarea {
  min-height: 44px;
  border-color: rgba(124, 166, 207, .26);
  border-radius: 8px;
  background: #0a2137;
  font-size: .82rem;
}

html.uimovel-shell-v2 .wizard-textarea {
  min-height: 110px;
}

html.uimovel-shell-v2 .org-context,
html.uimovel-shell-v2 .location-pane,
html.uimovel-shell-v2 .review-row {
  border-color: rgba(124, 166, 207, .18);
  background: rgba(9, 32, 53, .74);
}

html.uimovel-shell-v2 .org-context {
  padding: 17px;
}

html.uimovel-shell-v2 .org-name {
  font-size: .94rem;
}

html.uimovel-shell-v2 .location-methods {
  gap: 11px;
}

html.uimovel-shell-v2 .location-method {
  min-height: 128px;
  padding: 16px;
  border-color: rgba(124, 166, 207, .2);
  border-radius: 9px;
  background: rgba(9, 32, 53, .78);
}

html.uimovel-shell-v2 .location-method strong {
  font-size: .8rem;
}

html.uimovel-shell-v2 .location-method small {
  font-size: .67rem;
  line-height: 1.5;
}

html.uimovel-shell-v2 .location-method.active {
  border-color: #4d91e7;
  background: rgba(35, 92, 153, .38);
}

html.uimovel-shell-v2 .location-pane {
  padding: 18px;
}

html.uimovel-shell-v2 .location-pane-title {
  font-size: .84rem;
}

html.uimovel-shell-v2 .location-pane-copy,
html.uimovel-shell-v2 .location-file-status {
  font-size: .7rem;
}

html.uimovel-shell-v2 .location-upload {
  min-height: 88px;
  padding: 18px;
  border-color: rgba(77, 145, 231, .5);
  background: rgba(28, 74, 121, .18);
}

html.uimovel-shell-v2 .location-upload strong {
  font-size: .78rem;
}

html.uimovel-shell-v2 .location-upload span {
  font-size: .67rem;
}

html.uimovel-shell-v2 .ocr-progress {
  padding: 14px;
}

html.uimovel-shell-v2 .ocr-results {
  gap: 10px;
}

html.uimovel-shell-v2 .ocr-result {
  min-height: 66px;
  padding: 11px 12px;
  background: rgba(6, 24, 41, .8);
}

html.uimovel-shell-v2 .module-grid {
  gap: 11px;
}

html.uimovel-shell-v2 .module-card {
  min-height: 82px;
  padding: 15px;
  border-color: rgba(124, 166, 207, .18);
  background: rgba(9, 32, 53, .74);
}

html.uimovel-shell-v2 .module-card strong {
  font-size: .8rem;
}

html.uimovel-shell-v2 .module-card span {
  font-size: .68rem;
}

html.uimovel-shell-v2 .pd-actions {
  padding: 15px 28px;
  background: rgba(4, 19, 33, .94);
}

html.uimovel-shell-v2 .pd-btn {
  min-width: 112px;
  min-height: 41px;
  padding: 9px 17px;
  border-radius: 8px;
}

html.uimovel-shell-v2 .pd-btn.primary {
  border-color: #4d91e7;
  background: linear-gradient(135deg, #347fef, #2365d4);
}

html.uimovel-shell-v2 .leaflet-control-zoom {
  border: 1px solid rgba(116, 148, 177, .35) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
}

@media (max-width: 900px) {
  html.uimovel-shell-v2 { --v2-panel: min(390px, 88vw); }
  html.uimovel-shell-v2 .tb-painel-title,
  html.uimovel-shell-v2 .tb-sep { display: none; }
  html.uimovel-shell-v2 #sidebar { position: absolute; inset: 0 auto 0 0; }

  html.uimovel-shell-v2 .project-dialog {
    width: min(760px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  html.uimovel-shell-v2 .pd-header,
  html.uimovel-shell-v2 .pd-body,
  html.uimovel-shell-v2 .pd-actions {
    padding-right: 20px;
    padding-left: 20px;
  }

  html.uimovel-shell-v2 .v2-project-progress {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 620px) {
  html.uimovel-shell-v2 .v2-project-progress-label { display: none; }
  html.uimovel-shell-v2 .pd-body { max-height: calc(100vh - 250px); }
  html.uimovel-shell-v2 .pd-actions { gap: 6px; }
  html.uimovel-shell-v2 .pd-btn { min-width: 0; flex: 1; }
}
