:root {
  --bg: #203060;
  --bg-soft: #1a2850;
  --panel: #243568;
  --line: #3d4f83;
  --text: #ffffff;
  --muted: #c9d2ea;
  --brand: #c8a96e;
  --brand-2: #e4d0a8;
  --ok: #16a34a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 15%, #2f437f 0%, var(--bg) 46%);
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  filter: blur(40px);
  opacity: 0.25;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: var(--brand);
  border-radius: 999px;
  top: -80px;
  right: -60px;
}

.orb-b {
  width: 240px;
  height: 240px;
  background: var(--brand-2);
  border-radius: 999px;
  bottom: -100px;
  left: -40px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.brand-mini {
  margin: 0;
  color: var(--brand-2);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: color-mix(in srgb, var(--panel) 92%, #fff 8%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 10px 0 6px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1a2751;
  color: var(--text);
  padding: 11px 12px;
}

select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1a2751;
  color: var(--text);
  padding: 11px 12px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #111;
  font-weight: 800;
  cursor: pointer;
}

.error {
  color: #ff9b9b;
  min-height: 1.25em;
  margin: 12px 0 0;
}

.demo-hint {
  margin-top: 8px;
  color: #8b97a8;
  font-size: 0.84rem;
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  gap: 12px;
  padding: 12px;
}

.sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #0d1224, #121c38);
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 16px;
  box-shadow: 0 10px 28px rgba(6, 12, 30, 0.45);
}

.sidebar-top h2 {
  margin: 8px 0 4px;
  font-size: 1.1rem;
}

.user-mail {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  word-break: break-all;
}

.menu {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.menu details {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text);
  list-style: none;
}

/* Categorias principales: Herramientas internas/externas */
.menu > details > summary {
  font-size: 1.12rem;
  font-weight: 700;
  padding: 10px 6px;
  border-radius: 6px;
}

/* Subnivel (p.ej. Trabajo): mismo estilo que items tipo Gestion */
.menu .menu-block details > summary {
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 8px;
}

/* Opciones dentro de Trabajo: un punto mas compactas */
.menu .menu-block details > .menu-block .menu-btn {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 7px 10px;
}

.menu summary::marker {
  content: "";
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary:hover {
  border-color: var(--brand);
  background: rgba(200, 169, 110, 0.18);
  color: #f3e8d2;
}

.menu details > summary::before {
  content: "▸";
  width: 14px;
  text-align: center;
  opacity: 0.9;
}

.menu details[open] > summary::before {
  content: "▾";
}

.menu-block {
  display: grid;
  gap: 4px;
  padding: 0 8px 10px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: 9px 10px;
  border-radius: 8px;
}

.menu-btn:hover,
.menu-btn.active {
  border-color: var(--brand);
  background: rgba(200, 169, 110, 0.18);
  color: #f3e8d2;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.brand-wrap {
  min-height: 48px;
}

.brand-logo {
  width: 190px;
  max-width: 100%;
  display: block;
  filter: brightness(0) invert(1);
}

.brand-fallback {
  display: none;
  margin: 0;
  color: var(--brand-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-search input {
  background: #0c1225;
  border-color: #2d3d6c;
  color: #99a8cb;
  height: 38px;
}

.menu-search input:focus,
.menu-search input:focus-visible {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: inset 0 0 0 1px var(--brand-2);
}

.menu-btn-home {
  background: rgba(200, 169, 110, 0.1);
  border-color: rgba(200, 169, 110, 0.45);
}

.menu-icon {
  width: 18px;
  text-align: center;
  opacity: 0.9;
}

.btn-secondary {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  background: #0f152a;
}

.account-card {
  background: #ffffff;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(20, 31, 53, 0.08);
  padding: 16px;
  width: min(100%, 1020px);
  margin-inline: auto;
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-form input,
.account-form select {
  height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
}

.account-group {
  display: grid;
  gap: 10px;
}

.account-group-basic {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.account-group-password {
  grid-template-columns: minmax(280px, 520px);
}

.account-group-actions {
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px);
  align-items: end;
}

.account-group-actions button[type="submit"] {
  align-self: end;
}

.account-msg {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.account-password-wrap {
  display: grid;
  gap: 8px;
}

.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #425280;
}

.account-toggle input {
  width: auto;
  margin: 0;
}

.account-password-wrap input:disabled {
  background: #e8edf5;
  color: #7b89a8;
  border-color: #d2dbea;
}

.account-form input:disabled {
  background: #e8edf5;
  color: #7b89a8;
  border-color: #d2dbea;
}

@media (max-width: 900px) {
  .account-group-basic,
  .account-group-password,
  .account-group-actions {
    grid-template-columns: 1fr;
  }
}

.content {
  padding: 22px;
  background: #f4f6f8;
  border-radius: 14px;
  border: 1px solid #e3e8ef;
}

.content-head h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #203060;
}

.content-head p {
  margin: 6px 0 0;
  color: #c8a96e;
  font-weight: 600;
}

.tool-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.tool-grid.tool-grid-categorized {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.tool-category-block {
  background: #f4f6f8;
  border: 1px solid #dde3ec;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(20, 31, 53, 0.10);
}

.tool-category-block.is-dragging {
  opacity: 0.45;
}

.tool-category-block.drag-over {
  border-color: #203060;
  box-shadow: 0 0 0 2px rgba(32, 48, 96, 0.14);
}

.tool-category-title {
  margin: 0 0 10px;
  color: #203060;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category-title-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.72rem;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
  background: #fff;
}

.category-drag-handle:active {
  cursor: grabbing;
}

.category-title-controls {
  display: inline-flex;
  gap: 6px;
}

.category-admin-bar {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.hub-category-inline {
  width: min(520px, 100%);
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.hub-category-inline input {
  width: 100%;
}

.hub-category-inline-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.tool-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.category-empty {
  margin: 4px 0;
}

.tool-grid.account-mode {
  grid-template-columns: 1fr;
}

.tool-card-shell {
  display: grid;
  gap: 8px;
}

.tool-card {
  border: 1px solid #e5e9f0;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  min-height: 120px;
  display: grid;
  gap: 10px;
  text-decoration: none;
  color: #203060;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 31, 53, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card-btn {
  width: 100%;
  text-align: left;
}

.tool-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid #dbe3ee;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #111;
  overflow: hidden;
  position: relative;
}

.tool-logo span {
  line-height: 1;
}

.tool-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  position: absolute;
}

.tool-name {
  margin: 0;
  font-size: 1.02rem;
}

.tool-card:hover {
  border-color: #d6deea;
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(20, 31, 53, 0.14);
}

.tool-card-disabled {
  pointer-events: none;
}

.tool-card-placeholder {
  cursor: default;
}

.tool-card-shell.inactive .tool-card {
  background: #f1f3f6;
  border-color: #d9dee7;
  color: #8a94a8;
  box-shadow: none;
}

.tool-card-shell.inactive .tool-logo {
  opacity: 0.55;
}

.placeholder-add-btn {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.placeholder-add-btn:hover {
  background: rgba(120, 130, 150, 0.12);
}

.tool-card-shell.inactive .tool-card:hover {
  transform: none;
  box-shadow: none;
  border-color: #d9dee7;
}

.tool-toggle {
  position: relative;
  width: 30px;
  height: 18px;
  display: inline-block;
  justify-self: end;
}

.tool-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.tool-edit-btn {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid #cad4e5;
  background: #f8fafc;
  color: #1f2e57;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tool-edit-btn:hover {
  border-color: #9fb1ce;
}

.tool-toggle-spacer {
  visibility: hidden;
  pointer-events: none;
}

.tool-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tool-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d8dfe9;
  border: 2px solid #1a3345;
  border-radius: 999px;
  transition: 0.2s ease;
}

.tool-toggle-slider::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s ease;
}

.tool-toggle input:checked + .tool-toggle-slider {
  background: #103244;
}

.tool-toggle input:checked + .tool-toggle-slider::before {
  transform: translateX(12px);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: grid;
  place-items: center;
  padding: 14px;
  z-index: 1000;
}

.modal-panel {
  width: min(760px, 100%);
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 14px;
  padding: 14px;
}

.modal-panel h2 {
  margin: 0 0 10px;
  color: #1f2e57;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.modal-panel label {
  color: #1f2e57;
}

.modal-panel input {
  background: #fff;
  color: #1f2e57;
  border: 1px solid #d9e0ea;
  padding: 9px 10px;
}

.modal-panel input[type="color"] {
  padding: 2px;
  height: 40px;
}

.modal-panel input[type="file"] {
  padding: 8px;
}

.modal-panel .small {
  margin: 4px 0 0;
  color: #6f7fa4;
  font-size: 0.86rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
}

.small-btn {
  border: 1px solid #cad4e5;
  background: #f8fafc;
  color: #1f2e57;
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 7px;
  padding: 4px 8px;
  line-height: 1.1;
}

.msg {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.internal-embed-wrap {
  display: grid;
  gap: 8px;
  min-height: calc(100vh - 180px);
  grid-column: 1 / -1;
  width: 100%;
}

.internal-back-btn {
  justify-self: start;
}

.internal-embed-frame {
  width: 100%;
  min-height: calc(100vh - 230px);
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #fff;
}

.permissions {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #111822;
}

.permissions-table {
  margin-top: 10px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.status-ok {
  color: var(--ok);
  font-size: 0.92rem;
  margin-top: 8px;
}

.btn-delete-user {
  width: auto;
  padding: 7px 10px;
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 280px minmax(0, 1fr);
    padding: 8px;
  }

  .sidebar {
    border-right: 1px solid var(--line);
  }

  .brand-logo {
    width: 165px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }
}



.color-select {
  width: 100%;
  min-width: 0;
}


.color-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.color-swatch-grid {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #c9d3e2;
  background: var(--swatch, #ffffff);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-swatch.is-selected {
  border-color: #203060;
  box-shadow: 0 0 0 2px rgba(32, 48, 96, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}



