:root {
  --wgl-bg: #1f2329;
  --wgl-panel: #262b33;
  --wgl-panel-soft: #2f3540;
  --wgl-card: #313844;
  --wgl-border: #3c4450;
  --wgl-text: #f3f5f7;
  --wgl-muted: #9aa3ad;
  --wgl-soft: #d9dde2;
  --wgl-orange: #f68b2c;
  --wgl-orange-soft: rgba(246, 139, 44, 0.18);
}

/* Oculta el bloque extra que habíamos inyectado en el sidebar */
.wgl-brand-bar {
  display: none !important;
}

/* Reemplazo visual del cuadro celeste WGL */
.wgl-logo-tile {
  background: var(--wgl-orange) !important;
  border: 1px solid rgba(246, 139, 44, 0.75) !important;
  border-radius: 15px !important;
  overflow: hidden !important;
  color: transparent !important;
  text-indent: -9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
}

.wgl-logo-tile img {
  display: block !important;
  width: 115% !important;
  height: 115% !important;
  object-fit: cover !important;
  object-position: left center !important;
  transform: scale(1.08);
}

/* Fallback: si el logo no carga, queda naranja en vez de celeste */
.wgl-logo-tile::after {
  content: "";
}

/* Ajustes generales flat */
body {
  background: var(--wgl-bg) !important;
  color: var(--wgl-text) !important;
  overflow-x: hidden !important;
}

button,
select,
input,
textarea {
  font: inherit !important;
}

button,
.btn,
.button,
[role="button"] {
  background: var(--wgl-panel-soft) !important;
  color: var(--wgl-text) !important;
  border: 1px solid var(--wgl-border) !important;
  border-radius: 14px !important;
}

button:hover,
.btn:hover,
.button:hover,
[role="button"]:hover {
  border-color: var(--wgl-orange) !important;
}

/* Selectores, filtros y tarjetas */
select,
input,
textarea {
  background: var(--wgl-panel-soft) !important;
  color: var(--wgl-text) !important;
  border: 1px solid var(--wgl-border) !important;
  border-radius: 14px !important;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--wgl-orange) !important;
  box-shadow: 0 0 0 3px var(--wgl-orange-soft) !important;
}

/* Responsivo sin romper el kanban */
@media (max-width: 1100px) {
  body {
    min-width: 0 !important;
  }

  main,
  .main,
  .content,
  .container,
  .app-content,
  .page,
  .board-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  aside,
  .sidebar,
  .side-nav {
    max-width: 230px !important;
  }
}

@media (max-width: 820px) {
  aside,
  .sidebar,
  .side-nav {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--wgl-border) !important;
    border-radius: 0 0 22px 22px !important;
  }

  main,
  .main,
  .content,
  .container,
  .app-content,
  .page {
    margin-left: 0 !important;
    padding: 14px !important;
  }

  header,
  .header,
  .topbar,
  .app-header {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  .tabs,
  nav,
  .nav,
  .filters,
  .toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .kanban,
  .board,
  .columns,
  .task-columns {
    display: flex !important;
    gap: 14px !important;
    overflow-x: auto !important;
    padding-bottom: 14px !important;
    scroll-snap-type: x proximity;
  }

  .column,
  .kanban-column,
  .board-column {
    min-width: 280px !important;
    scroll-snap-align: start;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 24px !important;
  }

  h2 {
    font-size: 20px !important;
  }

  .wgl-logo-tile {
    width: 44px !important;
    height: 44px !important;
  }

  button,
  select,
  input,
  textarea {
    width: 100%;
  }
}

/* Final WGL polish */
.wgl-final-logo-tile {
  background: #f68b2c !important;
  border-color: rgba(246, 139, 44, 0.8) !important;
  color: transparent !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.wgl-final-logo-tile img {
  width: 120% !important;
  height: 120% !important;
  object-fit: cover !important;
  object-position: left center !important;
  transform: scale(1.08);
  text-indent: 0 !important;
}

/* Fallback: cambia cualquier badge de marca azul/celeste a naranja */
[class*="logo"],
[class*="brand"] {
  --brand-accent: #f68b2c;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden !important;
  }

  .kanban,
  .board,
  [class*="kanban"],
  [class*="board"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  [class*="column"] {
    min-width: 280px !important;
  }
}

@media (max-width: 640px) {
  aside,
  [class*="sidebar"] {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
  }

  main,
  [class*="main"],
  [class*="content"] {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 14px !important;
  }

  h1 {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }
}

/* Final: WGL text tile, no logo image */
.wgl-logo-tile,
.wgl-final-logo-tile {
  background: #f68b2c !important;
  border-color: rgba(246, 139, 44, 0.85) !important;
  color: #ffffff !important;
  text-indent: 0 !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  letter-spacing: -0.03em !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.wgl-logo-tile img,
.wgl-final-logo-tile img {
  display: none !important;
}


/* Wise Management: remove login WGL icon */
.login-logo {
  display: none !important;
}

.login-brand {
  gap: 0;
}


/* Wise Management: manual task form feedback */
.form-status {
  min-height: 20px;
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--wgl-muted, #9aa3ad);
}

.form-status.success {
  color: #d9dde2;
}

.form-status.error {
  color: #ffb4a8;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}


/* Wise Management admin users module */
.admin-header,
.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
}

.admin-user-form,
.admin-users-card {
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 18px;
}

.admin-user-form h3,
.admin-users-card h3 {
  margin: 0 0 12px;
}

.admin-user-form label {
  display: block;
  margin: 12px 0 6px;
  color: #dbe3ef;
  font-weight: 700;
}

.admin-user-form input,
.admin-user-form select,
.admin-role-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  padding: 11px 12px;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  vertical-align: middle;
}

.admin-users-table th {
  color: #aeb8c8;
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-cell span {
  display: block;
  color: #8f9bad;
  font-size: 0.82rem;
  margin-top: 3px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f68b2c, #7c3aed);
  color: white;
  font-weight: 900;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-badge.active {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.admin-badge.inactive {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.btn.small {
  padding: 8px 10px;
  font-size: 0.85rem;
}

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

  .admin-header,
  .admin-table-header {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Wise Management user project assignments */
.project-assignment-dialog {
  width: min(680px, calc(100vw - 32px));
}

.project-assignment-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  max-height: 420px;
  overflow: auto;
}

.project-assignment-item {
  display: grid;
  grid-template-columns: auto 14px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.38);
  cursor: pointer;
}

.project-assignment-item input {
  width: 18px;
  height: 18px;
}

.project-assignment-item strong,
.project-assignment-item small {
  display: block;
}

.project-assignment-item small {
  color: #9aa6b8;
  margin-top: 2px;
}

.project-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
