/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --bg-4: #222222;
  --bg-5: #2c2c2c;
  --border-1: #1e1e1e;
  --border-2: #2e2e2e;
  --border-3: #3e3e3e;
  --text-1: #ffffff;
  --text-2: #888888;
  --text-3: #444444;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.05);
  --accent-glow: rgba(255,255,255,0.08);
  --danger: #ffffff;
  --danger-dim: rgba(255,255,255,0.06);
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.6);
  --shadow: 0 4px 20px rgba(0,0,0,0.7);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.9);
  --t: 0.12s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-1);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255,255,255,0.12); color: #fff; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ============================================================
   LOADING
   ============================================================ */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg-0);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; z-index: 9999;
}
.loader-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em;
}
.loader-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border-2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-0);
}

@media (min-width: 860px) {
  .auth-page { grid-template-columns: 1fr 1fr; }
  .auth-left { display: flex !important; }
}

.auth-left {
  display: none;
  position: relative;
  background: var(--bg-0);
  border-right: 1px solid var(--border-1);
  padding: 56px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 40% 40%, rgba(255,255,255,0.025) 0%, transparent 70%);
  pointer-events: none;
}

.auth-left-content { position: relative; z-index: 1; max-width: 420px; }

.auth-brand-mark {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 56px;
}
.auth-brand-mark .logo-box {
  width: 40px; height: 40px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand-mark span {
  font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em;
}

.auth-tagline {
  font-size: 1.9rem; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.03em; margin-bottom: 14px; color: #fff;
}

.auth-desc {
  font-size: 0.9rem; color: var(--text-2); line-height: 1.7; margin-bottom: 48px;
}

.auth-features { display: flex; flex-direction: column; gap: 12px; }
.auth-feature-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.845rem; color: var(--text-2);
}
.auth-feature-dot {
  width: 5px; height: 5px; flex-shrink: 0;
  background: var(--text-3); border-radius: 50%;
}

.auth-preview {
  margin-top: 48px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.preview-col-header {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 10px;
}
.preview-card {
  background: var(--bg-3); border: 1px solid var(--border-1);
  border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 5px;
  font-size: 0.75rem; color: var(--text-2);
}
.preview-card:last-child { margin-bottom: 0; }
.preview-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 7px; background: var(--text-3);
}

/* AUTH RIGHT */
.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px; background: var(--bg-0);
}

.auth-box { width: 100%; max-width: 380px; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-box-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 40px; font-weight: 700; font-size: 1rem;
  letter-spacing: -0.02em;
}
.auth-box-logo .logo-box {
  width: 32px; height: 32px; background: #fff;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.auth-title {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 5px;
}
.auth-subtitle { color: var(--text-2); font-size: 0.845rem; margin-bottom: 28px; }

.auth-switch {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 3px; margin-bottom: 24px;
}
.auth-switch-btn {
  flex: 1; padding: 8px;
  border: none; background: transparent;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.845rem; font-weight: 600;
  cursor: pointer; transition: var(--t);
}
.auth-switch-btn.active { background: #fff; color: #000; }

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group { margin-bottom: 12px; }
.form-label {
  display: block; margin-bottom: 5px;
  font-size: 0.68rem; font-weight: 700;
  color: var(--text-3); letter-spacing: 0.07em; text-transform: uppercase;
}
.form-input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit; font-size: 0.875rem;
  transition: var(--t); outline: none;
}
.form-input:focus { border-color: var(--border-3); background: var(--bg-3); }
.form-input:hover:not(:focus) { border-color: var(--border-2); }
.form-input::placeholder { color: var(--text-3); }
textarea.form-input { resize: vertical; min-height: 76px; line-height: 1.6; }
select.form-input {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23444' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px;
}
select.form-input option { background: var(--bg-2); }
.invite-input {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.14em; font-weight: 700; text-transform: uppercase;
}
.form-hint { margin-top: 4px; font-size: 0.7rem; color: var(--text-3); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.845rem; font-weight: 600;
  cursor: pointer; transition: var(--t);
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  letter-spacing: -0.01em;
}
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e8e8e8; transform: translateY(-1px); }
.btn-primary:active { transform: none; background: #d0d0d0; }
.btn-secondary {
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border-1);
}
.btn-secondary:hover { background: var(--bg-4); color: var(--text-1); border-color: var(--border-2); }
.btn-danger { background: var(--bg-3); color: #888; border: 1px solid var(--border-1); }
.btn-danger:hover { background: var(--bg-4); color: #fff; border-color: var(--border-2); }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-1); }
.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-lg { padding: 11px 20px; font-size: 0.9rem; width: 100%; border-radius: var(--radius); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }
.btn-icon {
  width: 30px; height: 30px; padding: 0;
  background: var(--bg-3); color: var(--text-3);
  border: 1px solid var(--border-1); border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--bg-4); color: var(--text-1); border-color: var(--border-2); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-0);
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border-1);
  font-weight: 700; font-size: 0.9rem; letter-spacing: -0.02em;
  color: var(--text-1); text-decoration: none;
}
.logo-box {
  width: 28px; height: 28px;
  background: #fff;
  border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 8px 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-section-label {
  font-size: 0.62rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.1em; padding: 10px 8px 3px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer; transition: var(--t);
  font-size: 0.82rem; font-weight: 500;
  border: none; background: none; width: 100%;
  text-align: left; text-decoration: none;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active { background: var(--bg-2); color: var(--text-1); font-weight: 600; }
.nav-item .nav-icon { font-size: 0.85rem; width: 14px; text-align: center; flex-shrink: 0; }
.nav-board-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }

.sidebar-footer {
  padding: 8px 6px 10px; border-top: 1px solid var(--border-1);
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--t);
}
.sidebar-user:hover { background: var(--bg-2); }
.sidebar-user-name { font-weight: 600; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-sub { font-size: 0.65rem; color: var(--text-3); margin-top: 1px; }

/* MAIN */
.main-content { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 48px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 20px; gap: 10px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 0.875rem; font-weight: 700; flex: 1; letter-spacing: -0.01em; }

/* AVATAR */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.65rem; color: #000;
  flex-shrink: 0; text-transform: uppercase;
  background: #fff;
}
.avatar-sm { width: 22px; height: 22px; font-size: 0.58rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 0.95rem; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard { padding: 24px 28px; flex: 1; animation: fadeIn 0.2s ease; }

.dashboard-greeting { margin-bottom: 24px; }
.dashboard-greeting h2 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 3px;
}
.dashboard-greeting p { color: var(--text-2); font-size: 0.845rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg); padding: 16px 18px;
  transition: var(--t);
}
.stat-card:hover { border-color: var(--border-2); }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.72rem; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.section-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.section-title { font-size: 0.7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.board-card {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  cursor: pointer; transition: var(--t);
  overflow: hidden; display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.board-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.board-card-banner { height: 3px; flex-shrink: 0; background: var(--border-2); }
.board-card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.board-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.board-card-name { font-size: 0.9rem; font-weight: 700; letter-spacing: -0.01em; }
.board-card-menu { padding: 3px 5px; font-size: 0.9rem; line-height: 1; border-radius: 4px; }
.board-card-desc {
  font-size: 0.78rem; color: var(--text-2); line-height: 1.5; flex: 1; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.board-card-footer { display: flex; align-items: center; justify-content: space-between; }
.board-card-stats { display: flex; align-items: center; gap: 10px; }
.board-card-stat { display: flex; align-items: center; gap: 3px; font-size: 0.7rem; color: var(--text-3); font-weight: 500; }
.board-avatars { display: flex; }
.board-avatars .avatar { margin-left: -4px; border: 1.5px solid var(--bg-2); }
.board-avatars .avatar:first-child { margin-left: 0; }

.board-card-new {
  border-style: dashed; background: transparent;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; min-height: 120px;
  color: var(--text-3); font-size: 0.8rem; font-weight: 500; padding: 24px;
}
.board-card-new:hover { border-color: var(--border-3); color: var(--text-2); background: var(--bg-2); }
.board-card-new .new-icon { font-size: 1.4rem; opacity: 0.4; }

/* ============================================================
   BOARD VIEW
   ============================================================ */
.board-view { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.board-topbar {
  height: 48px; background: var(--bg-0); border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; padding: 0 14px; gap: 8px; flex-shrink: 0;
}
.board-topbar-name {
  font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 7px; margin-right: auto;
}
.board-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }

.member-stack { display: flex; }
.member-stack .avatar { margin-left: -5px; border: 1.5px solid var(--bg-0); }
.member-stack .avatar:first-child { margin-left: 0; }

.board-columns-wrap {
  flex: 1; display: flex;
  overflow-x: auto; overflow-y: hidden;
  padding: 14px 14px 20px; gap: 12px; align-items: flex-start;
}

/* COLUMN */
.column {
  width: 272px; flex-shrink: 0;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 48px - 34px);
  transition: border-color var(--t), box-shadow var(--t);
}
.column.drag-over { border-color: var(--border-3); box-shadow: 0 0 0 1px var(--border-3); }

.column-header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px 8px; flex-shrink: 0;
}
.column-name-wrap { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.column-name {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase;
}
.col-count {
  background: var(--bg-4); color: var(--text-3);
  font-size: 0.62rem; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; flex-shrink: 0;
}
.col-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t); }
.column:hover .col-actions { opacity: 1; }
.col-btn {
  background: none; border: none; color: var(--text-3);
  cursor: pointer; padding: 3px 4px; border-radius: 4px;
  font-size: 0.75rem; transition: var(--t); display: flex; align-items: center;
}
.col-btn:hover { background: var(--bg-4); color: var(--text-1); }
.col-btn.danger:hover { background: var(--bg-4); color: #888; }

.column-cards {
  flex: 1; overflow-y: auto;
  padding: 0 8px; display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 8px;
}

.column-footer { padding: 7px 8px; border-top: 1px solid var(--border-1); flex-shrink: 0; }
.add-card-btn {
  width: 100%; padding: 6px 9px;
  background: none; border: none; color: var(--text-3);
  cursor: pointer; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-family: inherit; font-weight: 500;
  display: flex; align-items: center; gap: 6px; transition: var(--t);
}
.add-card-btn:hover { background: var(--bg-3); color: var(--text-1); }

.quick-add-wrap { display: flex; flex-direction: column; gap: 5px; }
.quick-add-textarea {
  width: 100%; padding: 7px 9px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-family: inherit; font-size: 0.82rem; outline: none; resize: none;
  transition: var(--t);
}
.quick-add-textarea:focus { border-color: var(--border-3); }
.quick-add-actions { display: flex; gap: 5px; }

.column-add-btn {
  width: 272px; flex-shrink: 0; min-height: 72px;
  background: transparent; border: 1px dashed var(--border-1);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; color: var(--text-3);
  font-size: 0.78rem; font-weight: 500; cursor: pointer; transition: var(--t);
}
.column-add-btn:hover { border-color: var(--border-2); color: var(--text-2); background: var(--bg-2); }
.column-add-btn .add-plus { font-size: 1.2rem; font-weight: 300; opacity: 0.5; }

/* CARD */
.card {
  background: var(--bg-3); border: 1px solid var(--border-1);
  border-radius: var(--radius); padding: 10px 11px;
  cursor: pointer; transition: var(--t);
  position: relative; overflow: hidden;
  animation: cardPop 0.15s ease;
}
@keyframes cardPop {
  from { opacity: 0; transform: scale(0.97) translateY(3px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.card.dragging { opacity: 0.3; transform: scale(0.97); }

.card-priority-strip { position: absolute; left: 0; top: 0; bottom: 0; width: 2.5px; }
.strip-low    { background: var(--border-2); }
.strip-medium { background: var(--border-3); }
.strip-high   { background: var(--text-3); }
.strip-critical { background: var(--text-1); }

.card-labels { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.label {
  font-size: 0.58rem; font-weight: 800; padding: 1px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.07em;
  background: var(--bg-4); color: var(--text-2);
  border: 1px solid var(--border-1);
}
.label.urgent { background: #fff; color: #000; border-color: #fff; }

.card-title {
  font-size: 0.82rem; font-weight: 500; line-height: 1.45;
  margin-bottom: 8px; padding-left: 8px; color: var(--text-1);
}

.card-bottom { display: flex; align-items: center; justify-content: space-between; padding-left: 8px; }
.card-meta { display: flex; align-items: center; gap: 6px; }
.card-meta-chip {
  display: flex; align-items: center; gap: 3px;
  font-size: 0.65rem; color: var(--text-3); font-weight: 500;
}
.card-meta-chip.overdue { color: var(--text-2); }
.card-meta-chip svg { width: 9px; height: 9px; }

.priority-pill {
  display: inline-flex; align-items: center;
  font-size: 0.58rem; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-4); color: var(--text-3);
  border: 1px solid var(--border-1);
}
.pill-critical { background: #fff; color: #000; border-color: #fff; }
.pill-high { color: var(--text-2); border-color: var(--border-2); }

.sp-badge {
  display: inline-flex; align-items: center;
  background: var(--bg-4); color: var(--text-3);
  border: 1px solid var(--border-1);
  font-size: 0.58rem; font-weight: 700; padding: 1px 5px; border-radius: 3px;
}

/* ============================================================
   CARD MODAL (SIDE PANEL)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: flex-end;
  transition: opacity 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal-overlay.center-modal { align-items: center; justify-content: center; padding: 20px; }

.modal-panel {
  width: 500px; max-width: 100vw; height: 100vh; overflow-y: auto;
  background: var(--bg-0);
  border-left: 1px solid var(--border-1);
  box-shadow: -16px 0 60px rgba(0,0,0,0.8);
  animation: slideIn 0.2s ease;
  display: flex; flex-direction: column;
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--border-1);
  flex-shrink: 0; background: var(--bg-0);
}
.modal-panel-id { font-size: 0.65rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.modal-panel-actions { display: flex; gap: 5px; margin-left: auto; }

.modal-panel-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 20px; }

.modal-section-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 7px;
}

.card-title-textarea {
  width: 100%; background: transparent; border: 1px solid transparent;
  color: var(--text-1); font-size: 1.05rem; font-weight: 700;
  font-family: inherit; outline: none; resize: none;
  padding: 7px 9px; border-radius: var(--radius-sm);
  transition: var(--t); line-height: 1.35; letter-spacing: -0.015em;
}
.card-title-textarea:hover { background: var(--bg-2); border-color: var(--border-1); }
.card-title-textarea:focus { background: var(--bg-2); border-color: var(--border-2); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-cell {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-sm); padding: 9px 11px; transition: var(--t);
}
.detail-cell:hover { border-color: var(--border-2); }
.detail-cell-label {
  font-size: 0.62rem; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; margin-bottom: 4px;
}
.detail-cell select, .detail-cell input {
  width: 100%; background: none; border: none;
  color: var(--text-1); font-family: inherit; font-size: 0.82rem;
  outline: none; cursor: pointer; font-weight: 500;
}
.detail-cell select option { background: var(--bg-2); }

.desc-area {
  width: 100%; min-height: 80px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-sm); padding: 9px 11px;
  color: var(--text-1); font-family: inherit; font-size: 0.82rem;
  outline: none; resize: vertical; line-height: 1.6; transition: var(--t);
}
.desc-area:focus { border-color: var(--border-2); }
.desc-area::placeholder { color: var(--text-3); }

.label-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.label-chip {
  padding: 3px 10px; border-radius: 3px;
  font-size: 0.65rem; font-weight: 800; cursor: pointer;
  border: 1px solid var(--border-1); transition: var(--t);
  user-select: none; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-3); color: var(--text-3); opacity: 1;
}
.label-chip:hover { border-color: var(--border-2); color: var(--text-2); }
.label-chip.selected { background: #fff; color: #000; border-color: #fff; }

/* Comments */
.comment-thread { display: flex; flex-direction: column; gap: 9px; }
.comment-item { display: flex; gap: 9px; animation: fadeIn 0.15s ease; }
.comment-body { flex: 1; }
.comment-meta-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.comment-author { font-size: 0.78rem; font-weight: 700; }
.comment-time { font-size: 0.65rem; color: var(--text-3); }
.comment-del {
  background: none; border: none; color: var(--text-3);
  cursor: pointer; font-size: 0.65rem; padding: 1px 5px;
  border-radius: 3px; transition: var(--t); margin-left: auto;
}
.comment-del:hover { background: var(--bg-3); color: var(--text-2); }
.comment-bubble {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 8px 11px; font-size: 0.8rem; line-height: 1.55;
  color: var(--text-2); white-space: pre-wrap;
}
.comment-composer { display: flex; gap: 8px; align-items: flex-end; }
.comment-composer-input {
  flex: 1; padding: 8px 11px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-family: inherit; font-size: 0.8rem; outline: none; resize: none;
  min-height: 36px; max-height: 100px; transition: var(--t);
}
.comment-composer-input:focus { border-color: var(--border-2); }

/* Members */
.member-list { display: flex; flex-direction: column; gap: 3px; }
.member-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm); transition: var(--t);
}
.member-row:hover { background: var(--bg-2); }
.member-row-name { font-size: 0.82rem; font-weight: 600; }
.member-row-role { font-size: 0.65rem; color: var(--text-3); margin-top: 1px; }
.member-row-kick {
  margin-left: auto; background: none; border: none; color: var(--text-3);
  cursor: pointer; padding: 3px 7px; border-radius: 4px; font-size: 0.7rem; transition: var(--t);
}
.member-row-kick:hover { background: var(--bg-3); color: var(--text-2); }

/* ============================================================
   CENTER MODAL
   ============================================================ */
.modal-box {
  width: 100%; max-width: 420px;
  background: var(--bg-0);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.16s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-box-wide { max-width: 500px; }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box-header {
  padding: 18px 20px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.modal-box-title { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-box-body { padding: 14px 20px 20px; }
.modal-box-footer { display: flex; justify-content: flex-end; gap: 7px; padding-top: 16px; }

/* COLOR GRID */
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--t);
}
.color-dot:hover { transform: scale(1.12); border-color: rgba(255,255,255,0.3); }
.color-dot.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px rgba(255,255,255,0.4); transform: scale(1.08); }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed; bottom: 18px; right: 18px;
  z-index: 9999; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 220px; max-width: 340px;
  animation: toastIn 0.2s ease;
  font-size: 0.82rem; font-weight: 500; pointer-events: all;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
.toast.fade-out { animation: toastOut 0.2s ease forwards; }
.toast-icon { font-size: 0.82rem; flex-shrink: 0; }
.toast-success { border-left: 2px solid #fff; }
.toast-error   { border-left: 2px solid #666; }
.toast-info    { border-left: 2px solid #444; }
.toast-warning { border-left: 2px solid #555; }

/* ============================================================
   ACTIVITY
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--border-1); font-size: 0.75rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-text { flex: 1; line-height: 1.5; color: var(--text-2); }
.activity-text strong { color: var(--text-1); font-weight: 600; }
.activity-ts { font-size: 0.65rem; color: var(--text-3); white-space: nowrap; margin-top: 1px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; gap: 9px;
}
.empty h3 { font-size: 0.875rem; font-weight: 700; color: var(--text-2); }
.empty p { font-size: 0.78rem; color: var(--text-3); max-width: 240px; line-height: 1.6; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-page { padding: 24px 28px; max-width: 560px; animation: fadeIn 0.2s ease; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.profile-email { font-size: 0.82rem; color: var(--text-2); margin-top: 2px; }
.profile-card {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 12px;
}
.profile-card-title {
  font-size: 0.68rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border-1); margin: 14px 0; }
.text-muted { color: var(--text-3) !important; }
