/* Briveon HQ (admin). Colors, fonts and buttons come from ../css/tokens.css. */

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(139, 198, 65, 0.07), transparent 70%),
    var(--bg);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.small {
  font-size: 14px;
}

code {
  font: 500 0.88em var(--f-mono);
  color: var(--lime-hi);
}

.btn-small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  border-color: rgba(255, 107, 94, 0.45);
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  color: #ff8f85;
}

/* ---------- Sign-in / setup ---------- */

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

.auth-card {
  width: min(100%, 400px);
  display: grid;
  gap: 14px;
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 40px 120px -40px rgba(139, 198, 65, 0.25);
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.auth-card h1 {
  margin: -6px 0 6px;
  font: 700 2.1rem/1 var(--f-display);
  text-transform: uppercase;
}

.auth-card p {
  margin: 0;
}

.setup-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 15px;
}

.back-link {
  justify-self: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--lime);
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font: 600 11.5px/1.2 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: 400 16px/1.4 var(--f-body);
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(139, 198, 65, 0.2);
}

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

/* ---------- Top bar ---------- */

.hq-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 5, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hq-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 600 18px/1 var(--f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hq-brand img {
  border-radius: 5px;
}

.hq-brand b {
  color: var(--lime);
}

.hq-tabs {
  display: flex;
  gap: 4px;
}

.hq-tab {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font: 600 13px/1 var(--f-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.hq-tab[aria-current='page'] {
  background: rgba(139, 198, 65, 0.12);
  color: var(--lime-hi);
}

.hq-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.hq-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-size: 14px;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.sync i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.sync.live {
  color: var(--lime);
}

.sync.live i {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

@media (max-width: 760px) {
  .hq-top {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .hq-tabs {
    order: 3;
    width: 100%;
  }

  .hq-email {
    display: none;
  }
}

/* ---------- Board ---------- */

.hq-main {
  padding: 28px var(--gutter) 60px;
  max-width: 1440px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.toolbar h1 {
  margin: 0;
  font: 700 2rem/1 var(--f-display);
  text-transform: uppercase;
}

.chips {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 600 13px/1 var(--f-body);
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
}

.chip[aria-pressed='true'] {
  background: var(--lime);
  color: var(--on-lime);
}

.select-wrap select {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  width: auto;
}

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

.col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.col-head h2 {
  margin: 0;
  font: 600 13px/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.col-todo h2 {
  color: var(--text);
}

.col-doing h2 {
  color: var(--lime-hi);
}

.col-done h2 {
  color: var(--dim);
}

.col-count {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font: 500 12px/1.2 var(--f-mono);
  text-align: center;
}

.col-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  margin: 0;
  padding: 4px 10px 10px;
  list-style: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.col-list.drop-target {
  background: rgba(139, 198, 65, 0.06);
}

.empty {
  padding: 22px 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 14px;
  text-align: center;
}

.col-list:has(.task) .empty {
  display: none;
}

.task {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  transition: border-color 0.15s, transform 0.15s, opacity 0.15s;
}

.task:hover {
  border-color: var(--line-strong);
}

.task.dragging {
  opacity: 0.35;
}

.task-open {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px 14px 13px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: grab;
}

.task-open:active {
  cursor: grabbing;
}

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 11px/1.2 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
}

.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font: 700 11px/1 var(--f-body);
}

.avatar-bris {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.avatar-rog {
  background: #3d4a2a;
  border-color: #6a7f45;
  color: #e9f5d4;
}

.task h3 {
  margin: 0;
  font: 600 15.5px/1.35 var(--f-body);
}

.col-done .task h3 {
  color: var(--muted);
}

.task-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.45;
}

.col-add {
  margin: 0 10px 10px;
  min-height: 38px;
  border: 1px dashed transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--dim);
  font: 600 14px/1 var(--f-body);
  text-align: left;
  padding: 0 8px;
  cursor: pointer;
}

.col-add:hover {
  border-color: var(--line);
  color: var(--lime);
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(86vw, 340px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }

  .col {
    scroll-snap-align: start;
  }
}

/* ---------- Dialog ---------- */

.task-dialog {
  width: min(100% - 32px, 560px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.task-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.task-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px 24px 20px;
}

.task-dialog header,
.task-dialog footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-dialog h2 {
  margin: 0;
  font: 700 1.6rem/1 var(--f-display);
  text-transform: uppercase;
}

.icon-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.spacer {
  flex: 1;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #141a0e;
  color: var(--text);
  font-size: 14.5px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
