/* ─────────────────────────────────────────────────────────────────────────────
   Ironvale Network — Task Board + Login
───────────────────────────────────────────────────────────────────────────── */

/* ─── Login Page ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; }

.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #1a0505 0%, #0e0e0e 70%);
  color: #f0f0f0;
}
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card {
  background: #1a1a1a; border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: auto; width: 200px; margin-bottom: 16px; display: block; margin-left: auto; margin-right: auto; }
.login-logo h1 { font-size: 22px; color: #f0f0f0; font-weight: 700; }
.login-sub { color: #777; font-size: 13px; margin-top: 4px; }
.login-form .form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.login-form label { font-size: 12px; color: #aaa; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.login-form input[type="text"],
.login-form input[type="password"] {
  background: #252525; border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px; color: #f0f0f0;
  padding: 9px 12px; font-size: 13px; outline: none; width: 100%;
  transition: border-color .2s;
}
.login-form input:focus { border-color: #c0392b; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .2s; width: auto; }
.btn-primary { background: #c0392b; color: #fff; }
.btn-primary:hover { background: #e74c3c; }
.btn-full { width: 100%; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-danger { background: #3a1a1a; border: 1px solid #6b2020; color: #e74c3c; }

:root {
  --tb-bg:        #080808;
  --tb-nav:       #0d0d0d;
  --tb-col:       #111111;
  --tb-col-head:  #161616;
  --tb-card:      #181818;
  --tb-border:    rgba(255,255,255,.06);
  --tb-border-hi: rgba(229,57,53,.5);
  --tb-red:       #c62828;
  --tb-red-h:     #e53935;
  --tb-gold:      #ffb300;
  --tb-green:     #2e7d32;
  --tb-text:      #f5f5f5;
  --tb-muted:     #666;
  --tb-label:     #999;
  --tb-input:     #1e1e1e;
  --tb-radius:    10px;
  --tb-nav-h:     60px;
  --tb-stats-h:   52px;
  --col-w:        300px;
}

body.board-page {
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.tb-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--tb-nav-h);
  background: var(--tb-nav);
  border-bottom: 1px solid var(--tb-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
}
.tb-nav-left, .tb-nav-center, .tb-nav-right {
  display: flex; align-items: center; gap: 10px;
}
.tb-nav-right { margin-left: auto; }

.tb-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--tb-text);
}
.tb-logo { height: 30px; width: 30px; object-fit: contain; }
.tb-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.tb-brand-name { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.tb-brand-sub  { font-size: 10px; color: var(--tb-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Search */
.tb-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--tb-input);
  border: 1px solid var(--tb-border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: border-color .2s;
  min-width: 220px;
}
.tb-search-wrap:focus-within { border-color: var(--tb-red); }
.tb-search-icon { color: var(--tb-muted); font-size: 13px; }
.tb-search {
  background: transparent; border: none; outline: none;
  color: var(--tb-text); font-size: 13px; width: 100%;
}
.tb-search::placeholder { color: var(--tb-muted); }

/* Filters */
.tb-filters { display: flex; gap: 4px; }
.tb-filter {
  background: transparent; border: 1px solid transparent;
  color: var(--tb-muted); padding: 4px 10px;
  border-radius: 20px; font-size: 12px; cursor: pointer;
  transition: all .2s;
}
.tb-filter:hover  { color: var(--tb-text); border-color: var(--tb-border); }
.tb-filter.active { background: var(--tb-red); color: #fff; border-color: var(--tb-red); }

.tb-nav-divider { width: 1px; height: 24px; background: var(--tb-border); }

/* Buttons */
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .2s; white-space: nowrap;
}
.tb-btn-primary { background: var(--tb-red); color: #fff; }
.tb-btn-primary:hover { background: var(--tb-red-h); transform: translateY(-1px); }
.tb-btn-ghost { background: transparent; color: var(--tb-text); border: 1px solid var(--tb-border); }
.tb-btn-ghost:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.15); }
.tb-btn-danger-ghost { background: transparent; color: var(--tb-red-h); border: 1px solid rgba(231,76,60,.3); }
.tb-btn-danger-ghost:hover { background: rgba(231,76,60,.1); }

/* User menu */
.tb-user-menu { position: relative; }
.tb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--tb-red), #8e1a12);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s;
}
.tb-user-menu:hover .tb-avatar { border-color: var(--tb-red); }
.tb-user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: #1c1c1c; border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  min-width: 180px; padding: 8px;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: all .2s; z-index: 200;
}
.tb-user-menu:hover .tb-user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tb-user-info { padding: 8px 10px 10px; border-bottom: 1px solid var(--tb-border); margin-bottom: 6px; }
.tb-user-info strong { display: block; font-size: 13px; }
.tb-user-role {
  font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-top: 3px; display: inline-block;
}
.role-owner  { background: rgba(240,165,0,.15);  color: var(--tb-gold); }
.role-admin  { background: rgba(127,143,244,.15); color: #7f8ff4; }
.role-helper { background: rgba(39,174,96,.15);   color: #2ecc71; }
.tb-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--tb-text); text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.tb-dropdown-item:hover { background: rgba(255,255,255,.05); }
.tb-dropdown-danger { color: var(--tb-red-h); }
.tb-dropdown-danger:hover { background: rgba(231,76,60,.1); }

/* ─── Stats bar ──────────────────────────────────────────────────────────── */
.tb-stats-bar {
  position: fixed; top: var(--tb-nav-h); left: 0; right: 0; z-index: 90;
  height: var(--tb-stats-h);
  background: rgba(14,14,14,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tb-border);
  display: flex; align-items: center; gap: 0;
  padding: 0 18px;
}
.tb-stat {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px; border-right: 1px solid var(--tb-border);
}
.tb-stat:last-child { border-right: none; }
.tb-stat-num { font-size: 20px; font-weight: 700; line-height: 1; }
.tb-stat-label { font-size: 11px; color: var(--tb-muted); text-transform: uppercase; letter-spacing: .5px; }
.tb-stat-red   { color: var(--tb-red-h); }
.tb-stat-gold  { color: var(--tb-gold); }
.tb-stat-green { color: var(--tb-green); }

/* ─── Board ──────────────────────────────────────────────────────────────── */
.tb-board-wrap {
  position: fixed;
  top: calc(var(--tb-nav-h) + var(--tb-stats-h));
  left: 0; right: 0;
  bottom: 0;
  overflow-x: auto; overflow-y: hidden;
  padding: 20px;
}
.tb-board {
  display: flex; gap: 14px; height: 100%;
  align-items: flex-start; min-width: max-content;
}
.tb-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  color: var(--tb-muted); margin: auto;
}
.tb-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--tb-border);
  border-top-color: var(--tb-red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Columns ────────────────────────────────────────────────────────────── */
.tb-column {
  width: var(--col-w); min-width: var(--col-w);
  background: var(--tb-col);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  display: flex; flex-direction: column;
  max-height: 100%;
}
.tb-col-head {
  padding: 12px 14px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--tb-border);
  border-radius: var(--tb-radius) var(--tb-radius) 0 0;
  position: relative; overflow: hidden;
}
.tb-col-head::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--col-accent, var(--tb-red));
}
.tb-col-title-row { display: flex; align-items: center; gap: 8px; }
.tb-col-emoji { font-size: 16px; }
.tb-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.tb-col-badge {
  background: rgba(255,255,255,.08); color: var(--tb-muted);
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  font-weight: 600;
}
.tb-col-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.tb-column:hover .tb-col-actions { opacity: 1; }
.tb-col-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--tb-muted); padding: 4px; border-radius: 5px;
  transition: all .15s; display: flex; align-items: center;
}
.tb-col-btn:hover { color: var(--tb-text); background: rgba(255,255,255,.08); }
.tb-col-btn.danger:hover { color: var(--tb-red-h); background: rgba(231,76,60,.1); }

.tb-col-body {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.tb-col-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 24px 10px; color: var(--tb-muted);
  font-size: 12px; text-align: center;
}
.tb-col-empty-icon { font-size: 24px; opacity: .4; }
.tb-col-add {
  width: 100%; background: transparent;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 7px; color: var(--tb-muted);
  padding: 9px; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .2s; margin-top: 2px;
}
.tb-col-add:hover { border-color: var(--tb-red); color: var(--tb-red); background: rgba(192,57,43,.05); }

/* drop zone highlight */
.tb-col-body.drag-over {
  background: rgba(192,57,43,.06);
  border-radius: 0 0 var(--tb-radius) var(--tb-radius);
  outline: 2px dashed rgba(192,57,43,.4);
  outline-offset: -4px;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.tb-card {
  background: var(--tb-card);
  border: 1px solid var(--tb-border);
  border-radius: 8px; padding: 12px;
  cursor: pointer; transition: all .2s;
  position: relative;
}
.tb-card:hover {
  border-color: rgba(192,57,43,.5);
  box-shadow: 0 4px 20px rgba(192,57,43,.15);
  transform: translateY(-2px);
}
.tb-card.dragging { opacity: .35; transform: scale(.97); }

.tb-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tb-card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.tb-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .3px;
}
.badge-task     { background: rgba(41,128,185,.2);  color: #5dade2; }
.badge-feedback { background: rgba(39,174,96,.2);   color: #52be80; }
.badge-bug      { background: rgba(231,76,60,.2);   color: #e74c3c; }
.badge-low      { background: rgba(39,174,96,.15);  color: #2ecc71; }
.badge-medium   { background: rgba(243,156,18,.15); color: #f39c12; }
.badge-high     { background: rgba(230,126,34,.15); color: #e67e22; }
.badge-critical { background: rgba(231,76,60,.2);   color: #e74c3c; border: 1px solid rgba(231,76,60,.4); }

.tb-card-title {
  font-size: 13px; font-weight: 500; line-height: 1.4;
  color: var(--tb-text); word-break: break-word;
}
.tb-card-desc {
  font-size: 12px; color: var(--tb-muted); margin: 6px 0;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.5;
}
.tb-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--tb-border);
  gap: 8px;
}
.tb-card-reporter {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--tb-muted);
}
.tb-card-reporter img {
  width: 16px; height: 16px; border-radius: 50%; object-fit: cover;
}
.tb-discord-icon { font-size: 11px; }
.tb-card-date { font-size: 11px; color: var(--tb-muted); margin-left: auto; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.tb-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.tb-modal[hidden] { display: none; }
.tb-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
}
.tb-modal-dialog {
  position: relative; z-index: 1;
  background: #181818; border: 1px solid var(--tb-border);
  border-radius: 12px; width: 560px; max-width: calc(100vw - 32px);
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { transform: scale(.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}
.tb-modal-sm .tb-modal-dialog { width: 380px; }
.tb-modal-lg .tb-modal-dialog { width: 620px; }
.tb-modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--tb-border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.tb-modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.tb-modal-type-icon { font-size: 20px; }
.tb-modal-header h2 { font-size: 16px; font-weight: 600; }
.tb-modal-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--tb-muted); padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: all .15s;
}
.tb-modal-close:hover { color: var(--tb-red-h); background: rgba(231,76,60,.1); }
.tb-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.tb-modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--tb-border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.tb-modal-footer-right { display: flex; gap: 8px; margin-left: auto; }

/* Form elements inside modal */
.tb-form-group { margin-bottom: 16px; }
.tb-form-group label {
  display: block; font-size: 11px; color: var(--tb-label);
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.tb-form-row { display: flex; gap: 14px; }
.tb-form-row .tb-form-group { flex: 1; }
.tb-form-group input[type="text"],
.tb-form-group input[type="password"],
.tb-select,
.tb-form-group textarea {
  width: 100%; background: var(--tb-input);
  border: 1px solid var(--tb-border);
  border-radius: 8px; color: var(--tb-text);
  padding: 9px 12px; font-size: 13px; outline: none;
  transition: border-color .2s; resize: vertical;
  font-family: inherit;
}
.tb-form-group input:focus, .tb-select:focus, .tb-form-group textarea:focus {
  border-color: var(--tb-red);
}
.tb-readonly { color: var(--tb-muted); cursor: default; }

/* Type pills */
.tb-type-pills, .tb-priority-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.tb-type-pill, .tb-prio-pill {
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--tb-border);
  transition: all .15s; user-select: none;
}
.tb-type-pill input, .tb-prio-pill input { display: none; }
.tb-type-task:has(input:checked)     { background: rgba(41,128,185,.2);  border-color: #2980b9; color: #5dade2; }
.tb-type-feedback:has(input:checked) { background: rgba(39,174,96,.2);   border-color: #27ae60; color: #52be80; }
.tb-type-bug:has(input:checked)      { background: rgba(231,76,60,.2);   border-color: #e74c3c; color: #e74c3c; }
.prio-low:has(input:checked)      { background: rgba(39,174,96,.2);   border-color: #27ae60; color: #2ecc71; }
.prio-medium:has(input:checked)   { background: rgba(243,156,18,.2);  border-color: #f39c12; color: #f39c12; }
.prio-high:has(input:checked)     { background: rgba(230,126,34,.2);  border-color: #e67e22; color: #e67e22; }
.prio-critical:has(input:checked) { background: rgba(231,76,60,.2);   border-color: #e74c3c; color: #e74c3c; }

/* Reporter */
.tb-reporter { margin-bottom: 16px; }
.tb-reporter label {
  display: block; font-size: 11px; color: var(--tb-label);
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.tb-reporter-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--tb-input); border: 1px solid var(--tb-border);
  border-radius: 8px; padding: 10px 12px;
}
.tb-reporter-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.tb-reporter-name { font-size: 13px; font-weight: 500; display: block; }
.tb-reporter-badge {
  font-size: 10px; background: rgba(88,101,242,.2); color: #7289da;
  padding: 1px 6px; border-radius: 4px; font-weight: 600;
}

/* Divider */
.tb-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--tb-muted); font-size: 12px; margin: 20px 0;
}
.tb-divider::before, .tb-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--tb-border);
}

/* User list */
.tb-user-list { display: flex; flex-direction: column; gap: 8px; }
.tb-user-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--tb-input); border: 1px solid var(--tb-border);
  border-radius: 8px; padding: 10px 14px;
}
.tb-user-row-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--tb-red), #8e1a12);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.tb-user-row-info { flex: 1; }
.tb-user-row-name { font-size: 13px; font-weight: 500; }
.tb-user-row-username { font-size: 11px; color: var(--tb-muted); }
.tb-user-row-actions { display: flex; gap: 6px; }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */
.tb-toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
}
.tb-toast {
  background: #1e1e1e; border: 1px solid var(--tb-border);
  border-radius: 8px; padding: 12px 16px; font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: toastIn .2s ease; max-width: 300px;
  display: flex; align-items: center; gap: 8px;
}
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.tb-toast-success { border-left: 3px solid var(--tb-green); }
.tb-toast-danger  { border-left: 3px solid var(--tb-red-h); }
.tb-toast-info    { border-left: 3px solid #3498db; }

/* Column accent colors */
.tb-column[data-slug="backlog"]     { --col-accent: #7f8c8d; }
.tb-column[data-slug="feedback"]    { --col-accent: #27ae60; }
.tb-column[data-slug="bugs"]        { --col-accent: #e74c3c; }
.tb-column[data-slug="in-progress"] { --col-accent: #f39c12; }
.tb-column[data-slug="completed"]   { --col-accent: #2ecc71; }
