/* ---------- Sidebar ---------- */
.sidebar {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 360px;
  max-width: calc(100vw - 28px);
  /*height: calc(100vh - 28px); determina si queda recordado abajo o no */
  height: 100vh; 
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(229, 231, 235, .9);
  border-radius: var(--radius);
	border-radius: 0;
  /*box-shadow: var(--shadow);determina si queda recordado abajo o no */
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}
.sidebar.collapsed {
  height: 60px;
  width: 60px;
  min-width: 60px;
}
.sidebar.collapsed .sb-body,
.sidebar.collapsed .sb-footer {
  display: none;
}

.sb-top {
  position: relative;
  background: linear-gradient(135deg, var(--bg2), #0a3d7a);
  color: #fff;
  padding: 12px 12px 10px;
  display: flex;
  align-items: center;
  gap: 0px;
}
.sb-top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  
}
.sb-top img {
  width: 38px; height: 38px; object-fit: contain;
  background: rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 6px;
}
.sb-top .title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}
.sb-top .title b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-top .title span {
  font-size: 11px;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iconbtn {
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .15s;
}


.iconbtn:hover { background: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.iconbtn:active { transform: translateY(0px); }

.sb-body {
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}
.card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #0f172a;
  letter-spacing: .2px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * { flex: 1; }
.row.tight > * { flex: 0; }

.input, select {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #fff;
  font-size: 13px;
}
.input:focus, select:focus {
  border-color: rgba(31, 111, 178, .55);
  box-shadow: 0 0 0 4px rgba(31, 111, 178, .12);
}

.btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(31, 111, 178, .18);
}
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(0px); }
.btn.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.danger {
  background: #b91c1c;
  box-shadow: 0 8px 16px rgba(185, 28, 28, .18);
}

.muted { color: var(--muted); font-size: 12px; }

/* Layers list */
.layers { display: flex; flex-direction: column; gap: 8px; }
.layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.layer .name {
  flex: 1; min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid rgba(229, 231, 235, .8);
  color: #334155;
  white-space: nowrap;
}
.mini {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .12s;
}
.mini:hover { background: #f8fafc; transform: translateY(-1px); }
.mini:active { transform: translateY(0px); }

.sb-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

/* collapsed behavior */
.sidebar.collapsed .sb-top .title,
.sidebar.collapsed .sb-body,
.sidebar.collapsed .sb-footer .muted,
.sidebar.collapsed .sb-footer .btn.secondary {
  display: none;
}
.sidebar.collapsed .sb-top img { width: 34px; height: 34px; }
.sidebar.collapsed .sb-top { justify-content: space-between; }