:root {
  --bg: #0b0f19;
  --bg-2: #111827;
  --panel: #17212f;
  --panel-2: #202b3c;
  --card: #223047;
  --card-hover: #2a3a54;
  --text: #e6edf7;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.16);
  --blue: #60a5fa;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --purple: #a78bfa;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: linear-gradient(180deg, #0a0f18 0%, #0f172a 100%);
  color: var(--text);
}

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

.label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1f2d44;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  cursor: help;
  border: 1px solid rgba(96, 165, 250, .25);
  flex: 0 0 auto;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(12px, -50%);
  width: min(240px, 42vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(11, 17, 29, 0.98);
  border: 1px solid rgba(148, 163, 184, .18);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 120;
  white-space: normal;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translate(16px, -50%);
}

@media (max-width: 900px) {
  .help-tip::after {
    left: 50%;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: min(240px, 70vw);
  }

  .help-tip:hover::after,
  .help-tip:focus-visible::after {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(96, 165, 250, .16), transparent 22%),
    radial-gradient(circle at 82% 24%, rgba(34, 197, 94, .12), transparent 20%),
    radial-gradient(circle at 70% 78%, rgba(167, 139, 250, .10), transparent 22%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(180deg, #08101a 0%, #0b1220 42%, #0f172a 100%);
  background-size: auto, auto, auto, 32px 32px, 32px 32px, auto;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(23, 33, 47, 0.95);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
  animation: scaleIn .2s ease both;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.45;
}

.login-logo {
  display: block;
  max-height: 72px;
  width: auto;
  object-fit: contain;
  margin: 0 auto 18px;
}

.login-subcard {
  background: rgba(13, 21, 36, 0.86);
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.login-footer-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: #cbd5e1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #0d1524;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, opacity .16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--blue);
  color: #081120;
}

.btn-secondary {
  background: #334155;
  color: white;
}

.btn-success {
  background: var(--green);
  color: #052e24;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.96);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand h1 {
  font-size: 19px;
  margin: 0;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.brand-accent {
  display: inline-block;
  width: 54px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mc-grass) 0%, var(--blue) 100%);
  margin-top: 8px;
}

.brand-logo {
  display: block;
  max-height: 51px;
  width: auto;
  object-fit: contain;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #162132;
  border: 1px solid var(--line);
  color: #dbe7f5;
  font-size: 11px;
  font-weight: 700;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, .35);
}

.jira-subtle {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  padding: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.5fr 220px auto;
  gap: 10px;
  margin-bottom: 14px;
  background: rgba(19, 29, 44, .75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}

.toolbox {
  background: rgba(13, 21, 36, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-left: 2px;
}

.toolbox input,
.toolbox select {
  background: transparent;
  border: 0;
  padding: 4px 2px;
}

.toolbox select {
  color: var(--text);
}

.toolbox select option,
.toolbox select optgroup {
  background: #131d2c;
  color: var(--text);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  background: rgba(23, 33, 47, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.stat .value {
  font-size: 22px;
  font-weight: 800;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.column {
  background: rgba(23, 33, 47, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 500px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.column-header {
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.column-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: #132033;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
}

.column-body {
  padding: 10px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}

.column-body.drag-over {
  background: rgba(96, 165, 250, .08);
  outline: 2px dashed rgba(96, 165, 250, .35);
  outline-offset: -6px;
  border-radius: 14px;
}

.task-card {
  background: linear-gradient(180deg, var(--card) 0%, #1a2638 100%);
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  padding: 11px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  cursor: pointer;
}

.task-card.dragging {
  opacity: .45;
  transform: rotate(1deg);
}

.task-card:hover {
  background: linear-gradient(180deg, var(--card-hover) 0%, #21314a 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, .24);
  border-color: rgba(96, 165, 250, .18);
}

.task-card h3 {
  font-size: 14px;
  margin: 0 0 7px;
  line-height: 1.3;
}

.task-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pill {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #152133;
}

.issue-key {
  font-size: 11px;
  font-weight: 800;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.pill.priority-Alta {
  color: #fecaca;
}

.pill.priority-Media {
  color: #fde68a;
}

.pill.priority-Baja {
  color: #bbf7d0;
}

.task-desc {
  color: #c6d3e4;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #bfdbfe;
  margin-top: 7px;
}

.mc-head {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #0d1524;
  flex: 0 0 auto;
}

.mc-head.lg {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.mc-head.xl {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 18px 0 10px;
}

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

.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mini-task {
  padding: 8px 10px;
  border-radius: 10px;
  background: #1a2638;
  margin-bottom: 8px;
  font-size: 13px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 4px;
}

.error {
  color: #fecaca;
  margin-top: 10px;
}

.success {
  color: #86efac;
  margin-top: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, .72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 24px;
  animation: fadeInUp .14s ease both;
}

.modal-shell {
  width: min(1000px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: rgba(23, 33, 47, 0.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: scaleIn .18s ease both;
}

.modal-shell.narrow {
  width: min(760px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(23, 33, 47, .98);
  z-index: 1;
}

.modal-body {
  padding: 16px 18px 20px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.users-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.admin-sidebar {
  background: #101826;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: 0;
}

.admin-nav-btn {
  width: 100%;
  text-align: left;
  background: #182235;
  color: var(--text);
  border: 1px solid var(--line);
}

.admin-nav-btn.active {
  border-color: rgba(96,165,250,.4);
  background: #1d2a40;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.stack-grid {
  display: grid;
  gap: 18px;
}

.panel-box {
  background: #131d2c;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.panel-box input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
  border-radius: 10px;
  background: #0d1524;
  border: 1px solid var(--line);
}

.clickable-row {
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease;
}

.clickable-row:hover {
  transform: translateY(-1px);
  background: #1a2638;
}

.clickable-row.active {
  border-color: var(--blue);
}

.mc-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: #182235;
  border: 1px solid rgba(148, 163, 184, .12);
}

.permission-row input {
  margin-top: 3px;
}

.permission-title {
  font-weight: 700;
  font-size: 13px;
}

.permission-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.35;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
  display: inline-block;
  margin-left: 6px;
}

.online-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .12);
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #162132;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 14px;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.profile-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, .35);
  background: #1a2638;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.profile-meta small {
  color: var(--muted);
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 260px;
  background: rgba(19, 29, 44, .98);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 60;
  animation: scaleIn .18s ease both;
  transform-origin: top right;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  background: #111a29;
  margin-bottom: 10px;
}

.profile-dropdown .menu-btn {
  width: 100%;
  text-align: left;
  background: #1a2638;
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 8px;
}

.qr-wrap {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
}

.qr-image {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}

.subtle-grid {
  display: grid;
  gap: 14px;
}

.detail-block {
  background: #101826;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.detail-block h4 {
  margin: 0 0 10px;
}

.comment {
  padding: 10px;
  background: #182235;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .12);
  margin-bottom: 8px;
}

.comment-meta {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.activity-item {
  padding: 8px 10px;
  border-left: 2px solid rgba(96, 165, 250, .3);
  margin-bottom: 8px;
  background: #141f31;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
}

.activity-log {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.attachment-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: #182235;
  border: 1px solid rgba(148, 163, 184, .12);
  color: #bfdbfe;
  text-decoration: none;
  margin-bottom: 8px;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.attachment-link:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, .35);
  background: #1d2a40;
}

.lock-banner {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, .12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, .22);
  margin-bottom: 12px;
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 80;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(19, 29, 44, .96);
  box-shadow: var(--shadow);
  animation: scaleIn .18s ease both;
}

.toast.success { border-color: rgba(52, 211, 153, .35); }
.toast.error { border-color: rgba(248, 113, 113, .35); }
.toast.info { border-color: rgba(96, 165, 250, .35); }

.toast-title { font-weight: 800; margin-bottom: 4px; }
.toast-text { color: var(--muted); font-size: 12px; }

.board-loading {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, .18);
  pointer-events: none;
  z-index: 20;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1400px) {
  .kanban {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

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

  .modal-grid,
  .users-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .kanban {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .form-2 {
    grid-template-columns: 1fr;
  }

  .qr-wrap {
    grid-template-columns: 1fr;
  }
}