/* ===== CSS Variables ===== */
:root {
  --grad-start: #dbeeff;
  --grad-mid: #b8d9f5;
  --grad-end: #cce8ff;
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(80, 140, 210, 0.22);
  --glass-blur: 20px;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-blur: 16px;
  --text-primary: #0d2a4a;
  --text-secondary: rgba(13, 42, 74, 0.52);
  --accent: #1565c0;
  --accent-hover: #1976d2;
  --danger: #dc2626;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(20, 80, 160, 0.15);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { cursor: pointer; border: none; font-family: var(--font); }
input, textarea { font-family: var(--font); }
a { text-decoration: none; color: inherit; }

/* ===== Login Page ===== */
.login-body {
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 38px;
  width: 100%;
  max-width: 420px;
  padding: 80px 44px 72px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(120, 100, 240, 0.12);
  border-radius: 32px;
  box-shadow: 0 32px 80px rgba(48, 43, 99, 0.1);
}

.login-logo {
  width: 240px;
  height: 240px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.login-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.login-title-main {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.5px;
  text-align: center;
}

.login-title-sub {
  font-size: 14px;
  font-weight: 500;
  color: #6b68a8;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.login-input {
  width: 100%;
  padding: 20px 24px;
  border: 1.5px solid rgba(10, 35, 100, 0.22);
  border-radius: 12px;
  font-size: 18px;
  color: #1a1a2e;
  background: #f8f9ff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-input:focus {
  border-color: #0a2364;
  box-shadow: 0 0 0 4px rgba(10, 35, 100, 0.1);
  background: #ffffff;
}

.login-btn {
  padding: 20px;
  background: linear-gradient(135deg, #1a3a8f, #0a2364);
  color: white;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  letter-spacing: 0.3px;
  transition: opacity 150ms ease, transform 100ms ease;
  box-shadow: 0 6px 20px rgba(10, 35, 100, 0.3);
}

.login-btn:hover { opacity: 0.92; }
.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.login-error {
  font-size: 15px;
  color: var(--danger);
  text-align: center;
  min-height: 22px;
}

/* ===== Login Animations ===== */
.animate-item {
  opacity: 0;
  transform: translateY(18px);
}

.animate-item.animate-in {
  animation: loginSlideUp 250ms ease-out forwards;
}

@keyframes loginSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== App Body / Background ===== */
.app-body {
  height: 100vh;
  background: linear-gradient(135deg, var(--grad-start) 0%, var(--grad-mid) 50%, var(--grad-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== Top Navigation Bar ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  flex-shrink: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-bottom: 1px solid rgba(80, 140, 210, 0.18);
  box-shadow: 0 2px 16px rgba(20, 80, 160, 0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.nav-logo {
  height: 34px;
  width: 34px;
  object-fit: contain;
  -webkit-user-drag: none;
}

.nav-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-title-main {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.2px;
}

.nav-title-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: #6b68a8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: all;
}

.nav-user {
  font-size: 13px;
  font-weight: 500;
  color: #2e2a5e;
}

.btn-logout {
  padding: 6px 15px;
  background: transparent;
  border: 1.5px solid rgba(21, 101, 192, 0.4);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1565c0;
  transition: background 150ms, border-color 150ms;
}

.btn-logout:hover {
  background: rgba(21, 101, 192, 0.08);
  border-color: rgba(21, 101, 192, 0.7);
}

/* ===== App Layout (3 columns) ===== */
.app-layout {
  display: grid;
  grid-template-columns: 18% 1fr 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  transition: grid-template-columns 220ms ease;
}

.app-layout.panel-collapsed {
  grid-template-columns: 42px 1fr 1fr;
}

/* ===== Left Panel ===== */
.left-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Panel header row (label + toggle button) */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px 4px 14px;
  flex-shrink: 0;
  gap: 4px;
}

.panel-header-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
}

.btn-panel-toggle {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}

.btn-panel-toggle:hover {
  background: rgba(21,101,192,0.1);
  color: var(--accent);
}

/* Collapsed left panel */
.left-panel.collapsed .panel-header {
  justify-content: center;
  padding: 9px 4px 4px;
}

.left-panel.collapsed .panel-header-label {
  display: none;
}

.left-panel.collapsed .btn-create-project,
.left-panel.collapsed .project-list-hint,
.left-panel.collapsed .project-list,
.left-panel.collapsed .btn-refresh {
  display: none;
}

.btn-refresh {
  flex-shrink: 0;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: background 150ms, color 150ms;
  cursor: pointer;
}

.btn-refresh:hover {
  background: rgba(21,101,192,0.07);
  color: var(--accent);
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes spin {
  from { display: inline-block; transform: rotate(0deg); }
  to   { display: inline-block; transform: rotate(360deg); }
}

.btn-refresh.spinning {
  color: var(--accent);
}

.btn-refresh.spinning::first-letter {
  display: inline-block;
  animation: spin 600ms linear infinite;
}

.btn-create-project {
  margin: 14px 12px 8px;
  padding: 10px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.1px;
  transition: opacity 150ms;
  box-shadow: 0 3px 10px rgba(21, 101, 192, 0.3);
  flex-shrink: 0;
}

.btn-create-project:hover { opacity: 0.88; }

.project-list-hint {
  font-size: 9.5px;
  color: var(--text-secondary);
  padding: 4px 14px 6px;
  line-height: 1.4;
  flex-shrink: 0;
}

.project-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 0 16px;
}

.project-list::-webkit-scrollbar { width: 3px; }
.project-list::-webkit-scrollbar-thumb { background: rgba(21,101,192,0.25); border-radius: 2px; }

.project-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 8px 9px 10px;
  border-left: 3px solid transparent;
  transition: background 120ms, border-color 120ms;
}

.project-item:hover { background: rgba(21,101,192,0.07); }

.project-item.dragging { opacity: 0.4; background: rgba(21,101,192,0.1); cursor: grabbing; }

.project-item.active {
  background: rgba(21, 101, 192, 0.14);
  border-left-color: var(--accent);
}

.project-drag-handle {
  color: rgba(13,42,74,0.55);
  margin-top: 1px;
  flex-shrink: 0;
}

.project-item-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.project-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.35;
}

.project-item-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  word-break: break-word;
  line-height: 1.35;
}

.btn-project-edit {
  background: transparent;
  border: none;
  color: rgba(13,42,74,0.35);
  font-size: 13px;
  padding: 1px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: color 120ms, background 120ms;
}

.btn-project-edit:hover {
  color: var(--accent);
  background: rgba(21,101,192,0.1);
}

/* ===== Middle + Right Panels ===== */
.comment-section,
.milestone-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  min-height: 0;
}

.comment-section {
  border-right: 1px solid var(--glass-border);
}

/* ===== Empty State ===== */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 40px;
  text-align: center;
}

/* ===== Comments Container ===== */
.comments-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.btn-page {
  width: 100%;
  padding: 9px;
  background: rgba(21, 101, 192, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--glass-border);
  transition: background 150ms;
  flex-shrink: 0;
}

.btn-page:hover { background: rgba(21, 101, 192, 0.16); }

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.comments-list::-webkit-scrollbar { width: 3px; }
.comments-list::-webkit-scrollbar-thumb { background: rgba(21,101,192,0.25); border-radius: 2px; }

/* ===== Comment Item ===== */
.comment-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.comment-author {
  font-size: 11.5px;
  font-weight: 600;
  color: #1565c0;
  padding-left: 2px;
}

.comment-bubble {
  position: relative;
  background: rgba(220, 230, 242, 0.72);
  border: 1.5px solid rgba(80, 120, 180, 0.45);
  border-radius: var(--radius-sm);
  padding: 11px 34px 11px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
}

.comment-text {
  white-space: pre-wrap;
}

.comment-bubble.deleted {
  color: var(--text-secondary);
  font-style: italic;
  background: rgba(255,255,255,0.45);
}

.comment-bubble.editing {
  padding-bottom: 38px;
}

.comment-edit-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
  resize: none;
  outline: none;
  min-height: 56px;
}

.comment-edit-actions {
  position: absolute;
  bottom: 7px;
  right: 9px;
  display: flex;
  gap: 5px;
}

.btn-save-edit, .btn-cancel-edit {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
}

.btn-save-edit {
  background: #1565c0;
  color: white;
}

.btn-save-edit:hover { background: #1976d2; }

.btn-cancel-edit {
  background: #e5e7eb;
  color: #4b5563;
}

.btn-cancel-edit:hover { background: #d1d5db; }

/* ===== Three-dot menu ===== */
.comment-menu-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background 120ms, color 120ms;
}

.comment-menu-btn:hover {
  background: rgba(21,101,192,0.1);
  color: #1565c0;
}

.comment-menu-dropdown {
  position: absolute;
  top: 28px;
  right: 5px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(80,140,210,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  min-width: 195px;
  z-index: 50;
  box-shadow: var(--shadow);
  display: none;
}

.comment-menu-dropdown.open { display: block; }

.comment-menu-meta {
  font-size: 11px;
  color: #374151;
  line-height: 1.8;
}

.comment-menu-meta span { display: block; }

/* ===== Comment Action Row ===== */
.comment-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-left: 2px;
  flex-wrap: wrap;
}

.comment-timestamp {
  text-align: right;
  font-size: 10.5px;
  font-weight: 300;
  color: rgba(13,42,74,0.38);
  padding-right: 2px;
  margin-top: 2px;
}

.btn-action {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  background: #e0eeff;
  color: #1565c0;
  border: 1px solid rgba(21,101,192,0.22);
  transition: background 120ms, color 120ms;
}

.btn-action:hover {
  background: #c7deff;
  color: #0d47a1;
}

/* Edit button — teal */
.btn-edit-comment {
  background: #e0f5f8;
  color: #0891b2;
  border-color: rgba(8,145,178,0.25);
}
.btn-edit-comment:hover { background: #c7eef5; color: #0e7490; }

/* Add/Remove checklist button — green / amber */
.btn-checklist-toggle {
  background: #dcfce7;
  color: #059669;
  border-color: rgba(5,150,105,0.25);
}
.btn-checklist-toggle:hover { background: #bbf7d0; color: #047857; }
.btn-checklist-toggle.removing {
  background: #fef3c7;
  color: #d97706;
  border-color: rgba(217,119,6,0.25);
}

/* Remove comment button — red */
.btn-action.danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: rgba(220,38,38,0.25);
}
.btn-action.danger:hover { background: #fecaca; color: #b91c1c; }

.confirm-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.confirm-row span {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-action.danger-confirm {
  background: #fecaca;
  color: #b91c1c;
  border-color: rgba(185,28,28,0.35);
}

/* ===== Attachment Display ===== */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(80,140,210,0.15);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  font-size: 10.5px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.btn-view-img, .btn-download {
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
}

.btn-view-img {
  background: rgba(21, 101, 192, 0.1);
  color: var(--accent);
  border: 1px solid rgba(21, 101, 192, 0.22);
}

.btn-view-img:hover { background: rgba(21, 101, 192, 0.18); }

.btn-download {
  display: inline-flex;
  align-items: center;
  background: rgba(21, 101, 192, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(21, 101, 192, 0.15);
}

.btn-download:hover { background: rgba(21, 101, 192, 0.12); color: var(--text-primary); }

/* ===== Comment Input Area ===== */
.comment-input-area {
  flex-shrink: 0;
  padding: 10px 14px 13px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.35);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.comment-input-area textarea {
  width: 100%;
  min-height: 68px;
  max-height: 160px;
  padding: 9px 11px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(80,140,210,0.28);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 150ms;
}

.comment-input-area textarea:focus {
  border-color: rgba(21, 101, 192, 0.55);
}

.comment-input-area textarea::placeholder {
  color: rgba(13,42,74,0.35);
}

.staged-files {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.staged-file-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(21, 101, 192, 0.1);
  border: 1px solid rgba(21, 101, 192, 0.22);
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent);
}

.staged-file-chip button {
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  padding: 0 1px;
  border: none;
}

.staged-file-chip button:hover { color: var(--text-primary); }

.comment-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-attach-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms;
}

.btn-attach-label:hover { background: rgba(255,255,255,0.9); }

.btn-send {
  padding: 7px 18px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: opacity 150ms;
  box-shadow: 0 3px 10px rgba(21, 101, 192, 0.3);
}

.btn-send:hover { opacity: 0.88; }
.btn-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Milestone Panel ===== */
.milestones-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.milestone-add {
  display: flex;
  gap: 7px;
  padding: 13px 14px 9px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.milestone-add input {
  flex: 1;
  padding: 8px 11px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(80,140,210,0.28);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 150ms;
}

.milestone-add input:focus { border-color: rgba(21,101,192,0.55); }
.milestone-add input::placeholder { color: rgba(13,42,74,0.35); }

.milestone-add button {
  padding: 8px 13px;
  background: var(--accent);
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: opacity 150ms;
}

.milestone-add button:hover { opacity: 0.88; }

.milestone-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 6px 0 16px;
  min-height: 0;
}

.milestone-list::-webkit-scrollbar { width: 3px; }
.milestone-list::-webkit-scrollbar-thumb { background: rgba(21,101,192,0.25); border-radius: 2px; }

/* ===== Milestone Item ===== */
.milestone-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(80,140,210,0.1);
  transition: background 120ms;
}

.milestone-item:hover { background: rgba(21,101,192,0.05); }
.milestone-item.dragging { opacity: 0.4; background: rgba(21,101,192,0.1); }

.milestone-main-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  position: relative;
}

.drag-handle {
  color: rgba(13,42,74,0.5);
  font-size: 13px;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  padding: 2px 3px;
  margin-top: 1px;
  line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

.milestone-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}

.milestone-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.milestone-text.checked {
  text-decoration: line-through;
  color: var(--text-secondary);
}

/* Milestone three-dot button */
.milestone-menu-btn {
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
  border: none;
}

.milestone-menu-btn:hover {
  background: rgba(21,101,192,0.1);
  color: #1565c0;
}

/* Milestone dropdown */
.milestone-menu-dropdown {
  position: absolute;
  top: 24px;
  right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(80,140,210,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  min-width: 210px;
  z-index: 50;
  box-shadow: var(--shadow);
  display: none;
}

.milestone-menu-dropdown.open { display: block; }

.milestone-menu-meta {
  font-size: 11px;
  color: #374151;
  line-height: 1.8;
}

.milestone-menu-meta span { display: block; }

/* Milestone action row (Edit / Delete) */
.milestone-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-left: 44px;
}

/* Milestone inline edit input */
.milestone-edit-input {
  flex: 1;
  padding: 3px 7px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(21,101,192,0.4);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: var(--font);
}

.milestone-edit-input:focus {
  border-color: rgba(21,101,192,0.7);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

/* ===== Project Header (above search bar) ===== */
.project-header {
  flex-shrink: 0;
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.project-header-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.project-header-desc {
  font-size: 12px;
  color: rgba(13, 42, 74, 0.72);
  margin-top: 3px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.desc-link {
  color: #5b9bd5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.desc-link:hover {
  color: #3a7fc1;
}

/* ===== Comment Search ===== */
.comment-search-row {
  flex-shrink: 0;
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--glass-border);
}

.comment-search-row input {
  width: 100%;
  padding: 7px 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(80,140,210,0.28);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: var(--font);
  transition: border-color 150ms;
}

.comment-search-row input:focus {
  border-color: rgba(21,101,192,0.55);
  background: #fff;
}

.comment-search-row input::placeholder {
  color: rgba(13,42,74,0.35);
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.open { display: flex; }

.modal {
  background: rgba(240, 248, 255, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.modal input, .modal textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(80,140,210,0.28);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms;
}

.modal input:focus, .modal textarea:focus { border-color: rgba(21,101,192,0.55); }
.modal input::placeholder, .modal textarea::placeholder { color: rgba(13,42,74,0.35); }
.modal textarea { min-height: 76px; resize: vertical; }

.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}

.btn-modal-cancel {
  padding: 8px 17px;
  background: rgba(255,255,255,0.8);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  transition: background 150ms;
  cursor: pointer;
}

.btn-modal-cancel:hover { background: rgba(255,255,255,1); }

.btn-modal-confirm {
  padding: 8px 17px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  transition: opacity 150ms;
  cursor: pointer;
}

.btn-modal-confirm:hover { opacity: 0.88; }

/* ===== Wide Modal (Edit Project) ===== */
.modal.modal-wide {
  max-width: 860px;
  width: 90vw;
  padding: 40px 44px 36px;
  gap: 20px;
}

.modal.modal-wide h2 {
  font-size: 24px;
}

.modal.modal-wide input {
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 10px;
}

.modal.modal-wide textarea {
  padding: 14px 16px;
  font-size: 13.5px;
  border-radius: 10px;
  min-height: 200px;
  resize: vertical;
}

.modal.modal-wide .modal-actions {
  gap: 12px;
  margin-top: 6px;
}

.modal.modal-wide .btn-modal-cancel,
.modal.modal-wide .btn-modal-confirm {
  padding: 13px 28px;
  font-size: 15px;
  border-radius: 10px;
}

/* ===== Image Modal ===== */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
}

.image-modal-overlay.open { display: flex; }

.image-modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
}

.image-modal-inner img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: block;
}

.image-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.13);
  color: white;
  font-size: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: background 120ms;
  cursor: pointer;
}

.image-modal-close:hover { background: rgba(255,255,255,0.25); }

/* ===== Notifications ===== */
.notif-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.notif-bell-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 150ms;
  color: var(--text-primary);
}

.notif-bell-btn:hover { background: rgba(21,101,192,0.1); }

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #dc2626;
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(80,140,210,0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 150;
  overflow: hidden;
}

.notif-dropdown-header {
  padding: 10px 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(80,140,210,0.15);
}

.notif-window-hint {
  font-weight: 400;
  color: var(--text-secondary);
}

.notif-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0;
}

.notif-item {
  padding: 9px 14px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.45;
  border-bottom: 1px solid rgba(80,140,210,0.08);
}

.notif-item:last-child { border-bottom: none; }

.notif-actor {
  font-weight: 700;
  margin-right: 3px;
}

.notif-time {
  display: block;
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notif-empty {
  padding: 18px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Utility ===== */
.hidden { display: none !important; }
