/* ── KANBAN BOARD STYLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DARK (default) ── */
:root {
  --blue: #004aad; --blue-light: #1a6fe8; --accent: #feb311;
  --green: #00c97a; --red: #ef4444; --yellow: #f59e0b; --purple: #8b5cf6;
  --bg: #04091a; --bg2: #060d22; --surface: #0a1530; --surface2: #0e1c3c;
  --col-bg: #080f28; --card-bg: #0d1b38;
  --text: #e8edf8; --muted: #8a9bbf; --border: rgba(0,74,173,.22);
  --gradient: linear-gradient(135deg, #004aad, #1a6fe8);
  --gradient-gold: linear-gradient(135deg, #feb311, #f97316);
  --radius: 14px; --shadow: 0 4px 20px rgba(0,0,0,.45);
  --nav-bg: rgba(4,9,26,.95);
}

/* ── LIGHT ── */
[data-theme="light"] {
  --bg: #f0f4ff; --bg2: #e4ecff; --surface: #ffffff; --surface2: #ebf0ff;
  --col-bg: #e8eeff; --card-bg: #ffffff;
  --text: #0d1a3a; --muted: #5a6a8a; --border: rgba(0,74,173,.15);
  --shadow: 0 4px 20px rgba(0,74,173,.1);
  --nav-bg: rgba(240,244,255,.97);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; transition: background .3s, color .3s; }

/* ── TOP BAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--nav-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; height: 60px;
}
.topbar-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.topbar-logo img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; }
.topbar-brand { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1rem; letter-spacing: .02em; }
.topbar-sub { color: var(--muted); font-weight: 600; }
.topbar-title { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text); }
.board-icon { font-size: 1.1rem; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.tb-btn {
  background: var(--gradient); color: #fff; border: none; border-radius: 50px;
  padding: .48rem 1.2rem; font-weight: 700; font-size: .85rem; cursor: pointer;
  transition: transform .2s, box-shadow .2s; box-shadow: 0 3px 12px rgba(0,74,173,.35);
}
.tb-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(0,74,173,.5); }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
  background: rgba(0,74,173,.08); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
  transition: background .2s, transform .3s;
}
.theme-toggle:hover { background: rgba(0,74,173,.18); transform: rotate(20deg); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.avatar-wrap { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-gold); color: #fff;
  font-weight: 800; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(254,179,17,.35);
}
.avatar-label { font-size: .82rem; font-weight: 600; color: var(--muted); }

/* ── TEAM NAV ── */
.team-nav {
  position: fixed; top: 60px; left: 0; right: 0; z-index: 190;
  background: var(--nav-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; gap: 1rem; height: 52px;
}
.team-tabs { display: flex; gap: .3rem; height: 100%; }
.team-tab {
  display: flex; align-items: center; gap: .45rem;
  padding: 0 1.1rem; border: none; background: none;
  color: var(--muted); font-size: .83rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s; white-space: nowrap;
  position: relative;
}
.team-tab:hover { color: var(--text); }
.team-tab.active { color: var(--blue-light); border-bottom-color: var(--blue-light); }
.tab-icon { font-size: 1rem; }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-badge {
  background: var(--gradient-gold); color: #fff;
  font-size: .6rem; font-weight: 800; padding: .12rem .4rem;
  border-radius: 4px; letter-spacing: .05em;
}
.board-stats { display: flex; gap: 1.2rem; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.stat-item { display: flex; align-items: center; gap: .3rem; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── KANBAN WRAP ── */
.kanban-wrap {
  margin-top: 112px; /* topbar + team nav */
  padding: 1.5rem;
  min-height: calc(100vh - 112px);
  overflow-x: auto;
}
.kanban-board {
  display: flex; gap: 1rem;
  min-width: max-content;
  align-items: flex-start;
  padding-bottom: 2rem;
}

/* ── COLUMN ── */
.k-col {
  width: 280px; flex-shrink: 0;
  background: var(--col-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 150px);
  transition: border-color .3s;
}
.k-col.drag-over { border-color: var(--blue-light); box-shadow: 0 0 0 2px rgba(26,111,232,.2); }
.col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem .8rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.col-title-wrap { display: flex; align-items: center; gap: .5rem; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-name { font-weight: 700; font-size: .88rem; }
.col-count {
  background: rgba(255,255,255,.08); color: var(--muted);
  font-size: .72rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 50px; min-width: 22px; text-align: center;
}
[data-theme="light"] .col-count { background: rgba(0,0,0,.07); }
.col-add-btn {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: none; color: var(--muted); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s; flex-shrink: 0;
}
.col-add-btn:hover { background: rgba(0,74,173,.15); color: var(--blue-light); }

/* ── CARDS LIST ── */
.col-cards {
  flex: 1; overflow-y: auto; padding: .7rem;
  display: flex; flex-direction: column; gap: .6rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.col-cards::-webkit-scrollbar { width: 4px; }
.col-cards::-webkit-scrollbar-track { background: transparent; }
.col-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── CARD ── */
.k-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-light);
  border-radius: 10px; padding: .85rem;
  cursor: grab; transition: transform .2s, box-shadow .2s, border-color .2s;
  user-select: none;
}
.k-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(26,111,232,.4); }
.k-card.dragging { opacity: .4; cursor: grabbing; }
.k-card.priority-low { border-left-color: var(--green); }
.k-card.priority-medium { border-left-color: var(--yellow); }
.k-card.priority-high { border-left-color: var(--red); }
.k-card.priority-critical { border-left-color: #ff00aa; box-shadow: 0 0 0 1px rgba(255,0,170,.15); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; }
.card-title { font-weight: 600; font-size: .85rem; line-height: 1.45; flex: 1; }
.card-menu-btn {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 0 .2rem;
  border-radius: 4px; line-height: 1; flex-shrink: 0;
  transition: color .2s, background .2s;
}
.card-menu-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }

.card-desc { color: var(--muted); font-size: .77rem; line-height: 1.5; margin-bottom: .6rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .65rem; }
.card-tag { background: rgba(0,74,173,.15); border: 1px solid rgba(0,74,173,.25); color: var(--blue-light); font-size: .68rem; font-weight: 600; padding: .15rem .5rem; border-radius: 50px; }
[data-theme="light"] .card-tag { background: rgba(0,74,173,.09); }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.card-priority { font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 50px; }
.card-priority.low { background: rgba(0,201,122,.12); color: var(--green); }
.card-priority.medium { background: rgba(245,158,11,.12); color: var(--yellow); }
.card-priority.high { background: rgba(239,68,68,.12); color: var(--red); }
.card-priority.critical { background: rgba(255,0,170,.12); color: #ff00aa; }

.card-right { display: flex; align-items: center; gap: .4rem; }
.card-due { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.card-due.overdue { color: var(--red); font-weight: 700; }
.card-due.due-soon { color: var(--yellow); }
.card-assignee {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient); color: #fff;
  font-size: .62rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,74,173,.3);
}

/* Drag placeholder */
.drag-placeholder {
  height: 72px; border: 2px dashed rgba(26,111,232,.35);
  border-radius: 10px; background: rgba(26,111,232,.05);
  pointer-events: none;
}

/* ── EXEC OVERVIEW ── */
.exec-overview {
  margin-top: 112px; padding: 2rem 1.5rem;
}
.exec-overview.hidden { display: none; }
.exec-header { margin-bottom: 2rem; }
.exec-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.exec-header p { color: var(--muted); font-size: .9rem; }
.exec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px,1fr)); gap: 1.5rem; }
.exec-team-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: pointer;
}
.exec-team-card:hover { transform: translateY(-4px); border-color: var(--blue-light); box-shadow: 0 8px 30px rgba(0,74,173,.18); }
.exec-team-header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.2rem; }
.exec-team-icon { font-size: 1.8rem; }
.exec-team-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1rem; }
.exec-team-count { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.exec-col-bars { display: flex; flex-direction: column; gap: .5rem; }
.exec-col-bar { display: flex; align-items: center; gap: .7rem; }
.exec-col-label { font-size: .75rem; color: var(--muted); width: 90px; flex-shrink: 0; }
.exec-bar-wrap { flex: 1; height: 7px; background: rgba(255,255,255,.07); border-radius: 50px; overflow: hidden; }
[data-theme="light"] .exec-bar-wrap { background: rgba(0,0,0,.07); }
.exec-bar-fill { height: 100%; border-radius: 50px; transition: width .6s ease; }
.exec-col-num { font-size: .75rem; font-weight: 700; color: var(--muted); width: 20px; text-align: right; flex-shrink: 0; }
.exec-team-footer { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; }
.exec-stat { text-align: center; flex: 1; }
.exec-stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--blue-light); display: block; }
.exec-stat-label { font-size: .72rem; color: var(--muted); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: slideUp .25s ease;
}
.modal-detail { max-width: 560px; }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; }
.modal-close, .btn-edit-task {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; padding: .3rem .5rem;
  border-radius: 6px; transition: background .2s, color .2s;
}
.modal-close:hover, .btn-edit-task:hover { background: rgba(255,255,255,.08); color: var(--text); }
[data-theme="light"] .modal-close:hover, [data-theme="light"] .btn-edit-task:hover { background: rgba(0,0,0,.07); }
.btn-edit-task { font-size: .83rem; font-weight: 600; border: 1px solid var(--border); }
.modal-body { padding: 1.2rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; max-height: 60vh; overflow-y: auto; }
.modal-footer {
  display: flex; gap: .75rem; justify-content: flex-end;
  padding: 1rem 1.5rem 1.3rem;
  border-top: 1px solid var(--border);
}
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 10px; padding: .65rem .9rem; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: .87rem;
  transition: border-color .2s; outline: none;
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea { background: rgba(0,74,173,.04); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--blue-light); background: rgba(0,74,173,.04); }
.form-group textarea { resize: vertical; }
.form-group select { cursor: pointer; }
.btn-cancel {
  padding: .65rem 1.4rem; border-radius: 50px; background: none;
  border: 1px solid var(--border); color: var(--muted); font-weight: 600;
  font-size: .88rem; cursor: pointer; transition: .2s;
}
.btn-cancel:hover { border-color: var(--blue-light); color: var(--text); }
.btn-save {
  padding: .65rem 1.6rem; border-radius: 50px;
  background: var(--gradient); color: #fff; border: none;
  font-weight: 700; font-size: .88rem; cursor: pointer;
  transition: transform .2s, box-shadow .2s; box-shadow: 0 4px 14px rgba(0,74,173,.35);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,74,173,.5); }

/* Detail modal */
.detail-priority { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .9rem; border-radius: 50px; font-weight: 700; font-size: .82rem; margin-bottom: .8rem; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1rem; }
.detail-meta-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: .7rem 1rem; }
.detail-meta-label { font-size: .71rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .2rem; }
.detail-meta-value { font-size: .88rem; font-weight: 600; }
.detail-desc { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; font-size: .87rem; line-height: 1.7; color: var(--muted); }
.detail-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.detail-move-btn {
  padding: .4rem .9rem; border-radius: 50px; border: 1px solid var(--border);
  background: rgba(0,74,173,.08); color: var(--blue-light); font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: .2s;
}
.detail-move-btn:hover { background: rgba(0,74,173,.2); }
.detail-delete-btn {
  padding: .4rem .9rem; border-radius: 50px; border: 1px solid rgba(239,68,68,.3);
  background: rgba(239,68,68,.08); color: var(--red); font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: .2s; margin-left: auto;
}
.detail-delete-btn:hover { background: rgba(239,68,68,.18); }

/* ── EMPTY STATE ── */
.col-empty { padding: 1.2rem; text-align: center; color: var(--muted); font-size: .8rem; opacity: .6; }

/* ── HIDDEN ── */
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .tab-label { display: none; }
  .team-tab { padding: 0 .75rem; }
  .topbar-brand { display: none; }
  .avatar-label { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .board-stats { display: none; }
}
