/* ============================================================
   Projects — Liquid Glass UI
   Frosted translucent panels, backdrop blur, layered depth.
   ============================================================ */

:root {
  --bg-1: #dfe9f5;
  --bg-2: #f3e8f7;
  --bg-3: #e3f2ec;
  --ink: #16202e;
  --ink-soft: #4a5a6d;
  --ink-faint: #8296ab;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(31, 55, 90, 0.14), inset 0 1px 0 rgba(255,255,255,0.7);
  --accent: #0a6cff;
  --accent-soft: rgba(10, 108, 255, 0.12);
  --danger: #e5484d;
  --radius: 18px;
  --radius-sm: 12px;
  --p-highest: #d92d20; --p-high: #f79009; --p-medium: #0a6cff;
  --p-low: #12b76a; --p-lowest: #98a2b3;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg-1: #0b1220; --bg-2: #17102b; --bg-3: #0a1f1a;
  --ink: #eef3f9; --ink-soft: #a9bccd; --ink-faint: #63788f;
  --glass-bg: rgba(24, 34, 52, 0.55);
  --glass-bg-strong: rgba(24, 34, 52, 0.85);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.08);
  --accent-soft: rgba(10, 108, 255, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient color orbs behind the glass */
.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.orb-1 { width: 480px; height: 480px; background: #7db4ff; top: -140px; left: -80px; }
.orb-2 { width: 420px; height: 420px; background: #d3a6ff; bottom: -160px; right: 12%; }
.orb-3 { width: 340px; height: 340px; background: #7fe0c3; top: 38%; left: 46%; }
[data-theme="dark"] .orb { opacity: 0.28; }

/* Glass primitives */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.glass-strong {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px rgba(15, 30, 55, 0.28), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Layout */
.app { position: relative; z-index: 1; display: flex; height: 100vh; gap: 14px; padding: 14px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 14px; }

/* Sidebar */
.sidebar { width: 248px; flex-shrink: 0; border-radius: var(--radius); padding: 18px 14px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #0a6cff, #7b5cff); color: #fff; font-size: 17px;
  box-shadow: 0 6px 16px rgba(10, 108, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.45);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11.5px; color: var(--ink-faint); }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); margin: 0 6px 8px; }
.side-section { display: flex; flex-direction: column; gap: 6px; }
.side-foot { margin-top: auto; }

.project-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.project-item:hover { background: rgba(127, 160, 200, 0.14); }
.project-item.active { background: var(--accent-soft); border-color: rgba(10,108,255,0.25); }
.project-avatar {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.project-item .p-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-item .p-count { font-size: 11px; color: var(--ink-faint); }
.team-list { display: flex; flex-direction: column; gap: 7px; padding: 0 6px; }
.team-member { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-soft); }

/* Avatars */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  color: #fff; font-size: 10.5px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(20,40,70,0.25);
}
.avatar.lg { width: 30px; height: 30px; font-size: 12px; }

/* Topbar */
.topbar { border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar-left { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
}
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 15px; pointer-events: none; }
.search-wrap input {
  width: 210px; padding: 8px 12px 8px 30px; border-radius: 999px; border: 1px solid var(--glass-border);
  background: rgba(127,160,200,0.10); color: var(--ink); font-size: 13.5px; outline: none;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--glass-bg-strong); }

/* Controls */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(160deg, #2b7fff, #0a5ce0); color: #fff;
  box-shadow: 0 6px 16px rgba(10,108,255,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(10,108,255,0.45), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-ghost { background: rgba(127,160,200,0.10); color: var(--ink); border-color: var(--glass-border); }
.btn-ghost:hover { background: rgba(127,160,200,0.20); }
.btn-danger { background: rgba(229,72,77,0.12); color: var(--danger); border-color: rgba(229,72,77,0.3); }
.btn-danger:hover { background: rgba(229,72,77,0.22); }
.btn-block { width: 100%; }
.select, .input {
  font: inherit; font-size: 13.5px; color: var(--ink); padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--glass-border); background: rgba(127,160,200,0.10); outline: none;
}
.select:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-btn { font: inherit; background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 15px; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(127,160,200,0.18); color: var(--ink); }

/* Board */
.board { flex: 1; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; align-items: flex-start; }
.column {
  width: 292px; flex-shrink: 0; max-height: 100%; display: flex; flex-direction: column;
  border-radius: var(--radius); padding: 12px;
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; }
.column-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.column-count { font-size: 11.5px; color: var(--ink-faint); background: rgba(127,160,200,0.16); padding: 1px 7px; border-radius: 999px; }
.column-add { margin-left: auto; }
.column-cards { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding: 2px; min-height: 40px; border-radius: var(--radius-sm); }
.column-cards.drag-over { background: var(--accent-soft); outline: 2px dashed rgba(10,108,255,0.45); outline-offset: -2px; }

/* Ticket cards */
.card {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: 14px; padding: 11px 12px;
  box-shadow: 0 4px 14px rgba(25, 45, 80, 0.10), inset 0 1px 0 rgba(255,255,255,0.55);
  cursor: grab; transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(25,45,80,0.16), inset 0 1px 0 rgba(255,255,255,0.55); }
.card.dragging { opacity: 0.45; cursor: grabbing; }
.card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.type-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; }
.type-bug { background: rgba(229,72,77,0.15); color: #d92d20; }
.type-story { background: rgba(18,183,106,0.15); color: #079455; }
.type-task { background: rgba(10,108,255,0.13); color: #0a6cff; }
.type-chore { background: rgba(152,162,179,0.22); color: var(--ink-soft); }
.card-key { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.priority { margin-left: auto; font-size: 12px; font-weight: 800; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.35; margin: 0 0 8px; }
.card-labels { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.label-chip { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; color: #fff; }
.card-foot { display: flex; align-items: center; gap: 8px; }
.card-comments { font-size: 11.5px; color: var(--ink-faint); }
.card-foot .avatar { margin-left: auto; }
.unassigned { margin-left: auto; font-size: 11px; color: var(--ink-faint); border: 1px dashed var(--ink-faint); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; }

.empty { border-radius: var(--radius); padding: 40px; text-align: center; }
.empty h2 { margin: 0 0 6px; }
.empty p { color: var(--ink-soft); margin: 0; }

/* Drawer */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 40, 0.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 40; }
.drawer {
  position: fixed; top: 14px; right: 14px; bottom: 14px; width: min(480px, calc(100vw - 28px));
  border-radius: 22px; z-index: 50; display: flex; flex-direction: column; overflow: hidden;
  animation: slide-in .22s cubic-bezier(.2,.9,.3,1);
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 4px; }
.drawer-body { padding: 8px 18px 20px; overflow-y: auto; }
.drawer-title {
  font: inherit; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; width: 100%;
  border: none; background: transparent; color: var(--ink); outline: none; padding: 6px 0 12px;
  border-bottom: 1px solid var(--glass-border); margin-bottom: 14px;
}
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.drawer-grid label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.field .hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-faint); }
.field .input, .drawer-grid .select { text-transform: none; letter-spacing: 0; font-weight: 500; width: 100%; }
textarea.input { resize: vertical; line-height: 1.45; }
.drawer-actions { display: flex; gap: 8px; margin: 4px 0 20px; }
.drawer-actions .btn-danger { margin-left: auto; }

.comments h3 { font-size: 14px; margin: 0 0 10px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.comment { display: flex; gap: 9px; }
.comment-body { flex: 1; background: rgba(127,160,200,0.10); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 11px; }
.comment-meta { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 3px; }
.comment-meta b { color: var(--ink); }
.comment-text { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.comment-new { display: flex; flex-direction: column; gap: 8px; }
.comment-new .btn { align-self: flex-end; }
.no-comments { font-size: 13px; color: var(--ink-faint); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,20,40,0.3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 60; display: grid; place-items: center; }
.modal { width: min(400px, calc(100vw - 32px)); border-radius: 22px; padding: 22px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(127,160,200,0.35); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 860px) {
  .app { flex-direction: column; overflow-y: auto; }
  .sidebar { width: 100%; }
  body { overflow: auto; }
  .board { overflow-x: auto; }
}
