/* AllScience — Dashboard Styles */

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
    var(--color-bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.8125rem;
  margin-top: 1rem;
  text-align: center;
  display: none;
}

.form-error.visible { display: block; }

.form-success {
  color: var(--color-success);
  font-size: 0.8125rem;
  margin-top: 1rem;
  text-align: center;
  display: none;
}

.form-success.visible { display: block; }

.login-btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

/* ── Dashboard Layout ─────────────────────────────────────────────── */

.dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Tab Navigation */
.topbar-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.admin-only { display: none; }

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg);
}

.main-content-full {
  padding: 0;
}

/* ── Dashboard Stats Row ──────────────────────────────────────────── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
}

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.dash-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Onboarding welcome */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-navbar); animation: fadeIn 0.2s ease;
  transition: opacity 0.3s ease;
}
.onboarding-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 500px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.onboarding-card h2 { margin-bottom: 0.5rem; }
.onboarding-card .onboard-subtitle { color: var(--color-text-muted); margin-bottom: 2rem; }
.onboard-options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.onboard-option {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); cursor: pointer;
  text-align: left; text-decoration: none; color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.onboard-option:hover { border-color: var(--color-primary); transform: translateX(4px); }
.onboard-option-icon { font-size: 1.75rem; flex-shrink: 0; }
.onboard-option-text h4 { font-size: 0.9375rem; margin-bottom: 0.125rem; }
.onboard-option-text p { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0; }
.onboard-skip { font-size: 0.8125rem; color: var(--color-text-dim); cursor: pointer; background: none; border: none; }
.onboard-skip:hover { color: var(--color-text-muted); }

/* ── Tab Content ──────────────────────────────────────────────────── */

.tab-content {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.tab-header h2 { margin: 0; }

.badge-count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
}

.empty-state h3 {
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.error-message {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-danger);
}

/* ── Projects Tab ─────────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.project-card {
  display: block;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.project-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
}

.status-drafted {
  background: rgba(6, 214, 160, 0.15);
  color: var(--color-accent);
}

.status-analyzed {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
}

.status-new {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

.project-star {
  color: #f59e0b;
  font-size: 1rem;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.project-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.project-date {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.project-tags { display: flex; gap: 0.25rem; }

.project-tag {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-dim);
}

/* ── Modules Tab ──────────────────────────────────────────────────── */

.modules-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-header {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
}

.sidebar-search { padding: 0 0.75rem 0.75rem; }

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}

.sidebar-search input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.module-list { list-style: none; }

.module-item {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid transparent;
}

.module-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.module-item.active {
  background: var(--color-primary-glow);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

.module-item .badge {
  font-size: 0.6875rem;
  background: var(--color-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  color: var(--color-text-dim);
}

.modules-main {
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.welcome-message {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
}

.welcome-message h2 {
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

/* Module Detail */
.module-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.module-header h2 {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
}

.module-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Component Cards */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.component-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition);
}

.component-card:hover { border-color: var(--color-primary); }

.component-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
}

.component-role {
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.operations-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.operations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.op-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.1875rem 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.op-tag:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

/* Operation Runner */
.op-runner {
  margin-top: 2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.op-runner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.op-runner-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
}

.op-runner-body { padding: 1.25rem; }

.op-runner textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.op-runner textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.op-runner-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.op-result {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.op-result.visible { display: block; }
.op-result.success { border-color: var(--color-success); }
.op-result.error { border-color: var(--color-danger); }

/* ── Analytics Tab ────────────────────────────────────────────────── */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.summary-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.375rem;
}

.summary-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }

.event-counts {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.event-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.event-type-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text);
}

.event-type-count {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}

.events-table-wrap {
  overflow-x: auto;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.events-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  border-bottom: 2px solid var(--color-border);
}

.events-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.events-table tr:hover td {
  background: var(--color-bg-hover);
}

.td-mono { font-family: var(--font-mono); font-size: 0.75rem; }
.td-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.event-type-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Feedback Tab ─────────────────────────────────────────────────── */

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.feedback-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.feedback-user {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary);
}

.feedback-date {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.feedback-message {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
}

.feedback-context {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-dim);
  word-break: break-word;
}

/* ── System Tab ───────────────────────────────────────────────────── */

.checks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.check-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-ok { background: var(--color-success); }
.dot-fail { background: var(--color-danger); }

.check-detail {
  margin-left: auto;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.last-checked {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  text-align: center;
}

/* ── Loading ──────────────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .topbar-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    height: auto;
  }
  .tab {
    height: auto;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }
  .modules-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 200px;
  }
  .component-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: 1fr !important; }
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-stat-value { font-size: 1.25rem; }
  .onboarding-card { padding: 1.5rem; width: 95%; }
  .onboard-option { padding: 0.75rem; gap: 0.75rem; }
  .onboard-option-icon { font-size: 1.25rem; }
}

/* Tool cards in dashboard */
.tool-card-disabled {
  opacity: 0.6;
  cursor: default;
}

.tool-card-disabled:hover {
  border-color: var(--color-border);
  transform: none;
}

/* Tab header actions */
.tab-header-actions { display: flex; gap: 0.5rem; }

/* Quick actions row */
.dash-quick-actions {
  display: flex; flex-wrap: wrap; gap: 0.625rem; margin-bottom: 2rem;
}
.quick-action-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--color-text); text-decoration: none;
  transition: all 0.15s;
}
.quick-action-btn:hover { border-color: var(--color-primary); background: rgba(59,130,246,0.06); }
.qa-icon { font-size: 1rem; }

/* Tool categories */
.tool-category { margin-bottom: 2rem; }
.tool-category-label {
  font-size: 1rem; font-weight: 700; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--color-text);
}

/* Recent activity */
.dash-recent-activity {
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.dash-recent-activity h3 { margin-bottom: 1rem; font-size: 1rem; }
.recent-activity-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s;
}
.recent-activity-item:hover { border-color: var(--color-primary); }
.rai-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text); }
.rai-meta { font-size: 0.6875rem; color: var(--color-text-dim); margin-top: 0.125rem; }
.rai-status { flex-shrink: 0; }

@media (max-width: 768px) {
  .tab-header-actions { flex-wrap: wrap; }
  .dash-quick-actions { gap: 0.375rem; }
  .quick-action-btn { font-size: 0.75rem; padding: 0.375rem 0.75rem; }
}

/* ── Activity Feed ───────────────────────────────────────────────── */

.activity-feed {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.activity-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.activity-feed-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.activity-feed-filters {
  display: flex;
  gap: 0.25rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.1875rem;
}

.af-filter-btn {
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.af-filter-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.af-filter-btn.active {
  color: var(--color-primary);
  background: var(--color-bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.af-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.af-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

.af-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.af-icon-analyze { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.af-icon-draft   { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.af-icon-export  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.af-icon-publish { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.af-icon-source  { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }

.af-body {
  flex: 1;
  min-width: 0;
}

.af-desc {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.af-time {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.af-action {
  flex-shrink: 0;
  align-self: center;
}

.af-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.af-action-link:hover {
  background: rgba(59, 130, 246, 0.08);
}

.af-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-muted);
}

.af-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.af-empty h4 {
  color: var(--color-text);
  margin-bottom: 0.375rem;
  font-size: 1rem;
}

.af-empty p {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.af-load-more {
  display: block;
  width: 100%;
  padding: 0.625rem;
  margin-top: 0.75rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.af-load-more:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.af-load-more:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 768px) {
  .activity-feed-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .activity-feed-filters { width: 100%; overflow-x: auto; }
  .af-item { padding: 0.75rem; gap: 0.625rem; }
  .af-icon { width: 32px; height: 32px; font-size: 1rem; }
  .af-action-link { padding: 0.25rem 0.5rem; font-size: 0.6875rem; }
}

/* ── Quick Actions FAB ──────────────────────────────────────────────── */

.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 4500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fab-backdrop.fab-open {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .fab-backdrop {
  background: rgba(0, 0, 0, 0.2);
}

.fab-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 4600;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.75rem;
}

/* Push above onboarding widget when it exists */
.ob-widget ~ .fab-container,
.fab-container.fab-above-widget {
  bottom: 6rem;
}

.fab-main-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
}

.fab-main-btn:hover {
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.fab-main-btn .fab-icon-plus,
.fab-main-btn .fab-icon-close {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.fab-main-btn .fab-icon-plus {
  opacity: 1;
  transform: rotate(0deg);
}

.fab-main-btn .fab-icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}

.fab-container.fab-open .fab-main-btn .fab-icon-plus {
  opacity: 0;
  transform: rotate(90deg);
}

.fab-container.fab-open .fab-main-btn .fab-icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

/* Action items stack */
.fab-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.625rem;
  pointer-events: none;
}

.fab-container.fab-open .fab-actions {
  pointer-events: auto;
}

.fab-action {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  flex-direction: row-reverse;
}

.fab-container.fab-open .fab-action {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Staggered delays for each action button */
.fab-container.fab-open .fab-action:nth-child(1) { transition-delay: 0.04s; }
.fab-container.fab-open .fab-action:nth-child(2) { transition-delay: 0.08s; }
.fab-container.fab-open .fab-action:nth-child(3) { transition-delay: 0.12s; }
.fab-container.fab-open .fab-action:nth-child(4) { transition-delay: 0.16s; }
.fab-container.fab-open .fab-action:nth-child(5) { transition-delay: 0.20s; }

/* Reset delays on close so they collapse fast */
.fab-action:nth-child(5) { transition-delay: 0s; }
.fab-action:nth-child(4) { transition-delay: 0.02s; }
.fab-action:nth-child(3) { transition-delay: 0.04s; }
.fab-action:nth-child(2) { transition-delay: 0.06s; }
.fab-action:nth-child(1) { transition-delay: 0.08s; }

.fab-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.fab-action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fab-action-btn.fab-color-blue   { background: #3b82f6; }
.fab-action-btn.fab-color-green  { background: #10b981; }
.fab-action-btn.fab-color-teal   { background: #14b8a6; }
.fab-action-btn.fab-color-purple { background: #8b5cf6; }
.fab-action-btn.fab-color-orange { background: #f59e0b; }

.fab-action-label {
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid var(--color-border);
}

/* Quick Analyze Modal */
.fab-analyze-modal {
  max-width: 560px;
  width: 90%;
}

.fab-analyze-textarea {
  width: 100%;
  min-height: 140px;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}

.fab-analyze-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.fab-analyze-actions {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.fab-analyze-results {
  display: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.fab-analyze-results.visible {
  display: block;
}

.fab-analyze-results h4 {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.fab-finding-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

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

.fab-finding-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
  margin-top: 0.125rem;
}

.fab-save-project-btn {
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .fab-container {
    bottom: 1rem;
    right: 1rem;
  }
  .ob-widget ~ .fab-container,
  .fab-container.fab-above-widget {
    bottom: 5rem;
  }
  .fab-main-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .fab-action-btn {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }
  .fab-action-label {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ── Dashboard Widgets ──────────────────────────────────────────────── */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.dashboard-widget {
  background: var(--color-bg-card, #1a2233);
  border: 1px solid var(--color-border, #2a3a52);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-widget:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border, #2a3a52);
}

.widget-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.widget-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
  flex: 1;
}

.widget-drag-handle {
  cursor: grab;
  color: var(--color-text-dim, #5a6a80);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0.25rem;
}

.dashboard-widget:hover .widget-drag-handle {
  opacity: 1;
}

.widget-remove {
  background: none;
  border: none;
  color: var(--color-text-dim, #5a6a80);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.12s;
}

.dashboard-widget:hover .widget-remove {
  opacity: 1;
}

.widget-remove:hover {
  color: var(--color-danger, #ef4444);
}

.widget-body {
  padding: 1rem;
}

/* Recent Projects Widget */
.widget-project-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.widget-project-title {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--color-text, #e2e8f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-project-meta {
  font-size: 0.625rem;
  color: var(--color-text-dim, #5a6a80);
  white-space: nowrap;
}

/* Writing Streak Widget */
.widget-streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.widget-streak-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.widget-streak-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.widget-streak-count {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.widget-streak-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #e2e8f0);
  line-height: 1;
}

.widget-streak-label {
  font-size: 0.5625rem;
  color: var(--color-text-dim, #5a6a80);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.widget-streak-stats {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.widget-streak-stat {
  font-size: 0.75rem;
  color: var(--color-text-muted, #8896ab);
}

.widget-streak-stat strong {
  color: var(--color-text, #e2e8f0);
}

/* Quick Actions Widget */
.widget-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.widget-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 0.5rem;
  background: var(--color-bg-secondary, #111827);
  border: 1px solid var(--color-border, #2a3a52);
  border-radius: var(--radius-md, 10px);
  color: var(--color-text-muted, #8896ab);
  font-size: 0.625rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
  text-align: center;
}

.widget-action-btn:hover {
  border-color: var(--color-primary, #3b82f6);
  color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
}

.widget-action-icon {
  font-size: 1.25rem;
}

/* Deadlines Widget */
.widget-deadline-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.widget-deadline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.widget-deadline-dot.urgent {
  background: var(--color-danger, #ef4444);
}

.widget-deadline-dot.soon {
  background: var(--color-warning, #f59e0b);
}

.widget-deadline-dot.normal {
  background: var(--color-accent, #06d6a0);
}

.widget-deadline-title {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--color-text, #e2e8f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-deadline-countdown {
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Word Count Chart Widget */
.widget-sparkline-canvas {
  width: 100%;
  height: 60px;
  display: block;
}

.widget-sparkline-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.625rem;
  color: var(--color-text-dim, #5a6a80);
}

/* Activity Feed Widget */
.widget-activity-item {
  display: flex;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.widget-activity-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.widget-activity-text {
  flex: 1;
  font-size: 0.75rem;
  color: var(--color-text-muted, #8896ab);
  line-height: 1.4;
}

.widget-activity-time {
  font-size: 0.625rem;
  color: var(--color-text-dim, #5a6a80);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Customize Dashboard Button */
.customize-dashboard-btn {
  padding: 0.375rem 0.75rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-sm, 6px);
  color: var(--color-primary, #3b82f6);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.customize-dashboard-btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

/* Widget empty state */
.widget-empty {
  text-align: center;
  padding: 1.5rem 0.75rem;
  color: var(--color-text-dim, #5a6a80);
  font-size: 0.75rem;
}

.widget-empty-icon {
  font-size: 1.5rem;
  opacity: 0.4;
  margin-bottom: 0.375rem;
}

[data-theme="light"] .dashboard-widget {
  background: #fff;
  border-color: #e2e8f0;
}

[data-theme="light"] .dashboard-widget:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .widget-action-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
}

@media (max-width: 768px) {
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }
  .widget-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Project Archive & Trash ────────────────────────────────────────── */
.archive-header,
.trash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.archive-title,
.trash-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
}

.archive-count,
.trash-count {
  font-size: 0.75rem;
  color: var(--color-text-dim, #5a6a80);
  margin-left: 0.5rem;
}

.empty-trash-btn {
  padding: 0.375rem 0.75rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm, 6px);
  color: var(--color-danger, #ef4444);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.empty-trash-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

.archive-grid,
.trash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.archive-card,
.trash-card {
  background: var(--color-bg-card, #1a2233);
  border: 1px solid var(--color-border, #2a3a52);
  border-radius: var(--radius-md, 10px);
  padding: 1rem;
  transition: border-color 0.12s;
}

.archive-card:hover,
.trash-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.trash-card {
  border-left: 3px solid var(--color-danger, #ef4444);
}

.archive-card {
  border-left: 3px solid var(--color-text-dim, #5a6a80);
}

.archive-card-title,
.trash-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-card-meta,
.trash-card-meta {
  font-size: 0.6875rem;
  color: var(--color-text-dim, #5a6a80);
  margin-bottom: 0.625rem;
}

.trash-card-warning {
  font-size: 0.625rem;
  color: var(--color-danger, #ef4444);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.archive-card-actions,
.trash-card-actions {
  display: flex;
  gap: 0.375rem;
}

.archive-action-btn,
.trash-action-btn {
  flex: 1;
  padding: 0.3125rem 0.5rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}

.restore-btn {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--color-primary, #3b82f6);
}

.restore-btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

.delete-permanent-btn {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
  color: var(--color-danger, #ef4444);
}

.delete-permanent-btn:hover {
  background: rgba(239, 68, 68, 0.12);
}

.move-trash-btn {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.12);
  color: var(--color-warning, #fbbf24);
}

.move-trash-btn:hover {
  background: rgba(251, 191, 36, 0.12);
}

/* Project context menu */
.project-context-menu {
  position: fixed;
  z-index: 6000;
  background: var(--color-bg-card, #1a2233);
  border: 1px solid var(--color-border, #2a3a52);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 160px;
  padding: 0.375rem;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.12s, transform 0.12s;
}

.project-context-menu.context-visible {
  opacity: 1;
  transform: scale(1);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted, #8896ab);
  font-size: 0.8125rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s;
}

.context-menu-item:hover {
  background: rgba(59, 130, 246, 0.06);
  color: var(--color-text, #e2e8f0);
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.06);
  color: var(--color-danger, #ef4444);
}

.context-menu-divider {
  height: 1px;
  background: var(--color-border, #2a3a52);
  margin: 0.25rem 0.5rem;
}

/* Empty states */
.archive-empty,
.trash-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-dim, #5a6a80);
}

.archive-empty-icon,
.trash-empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
  margin-bottom: 0.75rem;
}

.archive-empty-text,
.trash-empty-text {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.archive-empty-sub,
.trash-empty-sub {
  font-size: 0.75rem;
  color: var(--color-text-dim, #5a6a80);
}

/* Project context trigger button */
.project-card-wrapper {
  position: relative;
}

.project-context-trigger {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted, #8896ab);
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
  z-index: 2;
}

.project-card-wrapper:hover .project-context-trigger {
  opacity: 1;
}

.project-context-trigger:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-text, #e2e8f0);
}

[data-theme="light"] .archive-card,
[data-theme="light"] .trash-card {
  background: #fff;
  border-color: #e2e8f0;
}

[data-theme="light"] .project-context-menu {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .project-context-trigger {
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
  .archive-grid,
  .trash-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Dashboard Stats Cards ─────────────────────────────────────── */
.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--color-bg-card, #1a2233);
  border: 1px solid var(--color-border, #2a3a52);
  border-radius: 12px;
  padding: 1.125rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.15s, box-shadow 0.15s;
}
.stat-card-visible { opacity: 1; transform: translateY(0); }
.stat-card:hover { border-color: var(--color-primary, #3b82f6); box-shadow: 0 0 0 1px rgba(59,130,246,0.2); }

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-card-blue .stat-card-icon { background: rgba(59, 130, 246, 0.12); }
.stat-card-green .stat-card-icon { background: rgba(16, 185, 129, 0.12); }
.stat-card-orange .stat-card-icon { background: rgba(245, 158, 11, 0.12); }
.stat-card-purple .stat-card-icon { background: rgba(139, 92, 246, 0.12); }

.stat-card-body { flex: 1; min-width: 0; }
.stat-card-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted, #8896ab);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.125rem;
}
.stat-card-value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text, #e2e8f0);
}
.stat-trend {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 0.125rem;
}
.stat-trend-up { color: var(--color-success, #10b981); }
.stat-trend-down { color: var(--color-danger, #ef4444); }

@media (max-width: 1024px) {
  .stats-cards-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stats-cards-row { grid-template-columns: 1fr; }
}

/* ── Recent Activity Timeline ─────────────────────────────────── */
.activity-timeline {
  margin: 1.5rem 0;
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}
.at-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.at-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text, #e2e8f0);
  margin: 0;
}
.at-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.at-filter-select {
  background: var(--color-bg, #0f172a);
  color: var(--color-text, #e2e8f0);
  border: 1px solid var(--color-border, #334155);
  border-radius: 0.375rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.at-clear-btn {
  background: transparent;
  color: var(--color-text-muted, #94a3b8);
  border: 1px solid var(--color-border, #334155);
  border-radius: 0.375rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.at-clear-btn:hover {
  color: var(--color-danger, #ef4444);
  border-color: var(--color-danger, #ef4444);
}
.at-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 1.75rem;
}
.at-list::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: var(--color-border, #334155);
  border-radius: 1px;
}
.at-event {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  position: relative;
  animation: atFadeIn 0.25s ease;
}
@keyframes atFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.at-event-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.7rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg, #0f172a);
  border: 2px solid var(--color-border, #334155);
  color: var(--color-text-muted, #94a3b8);
  flex-shrink: 0;
}
.at-dot-writing { border-color: var(--color-primary, #6366f1); color: var(--color-primary, #6366f1); }
.at-dot-research { border-color: var(--color-success, #10b981); color: var(--color-success, #10b981); }
.at-dot-review { border-color: var(--color-warning, #f59e0b); color: var(--color-warning, #f59e0b); }
.at-dot-publish { border-color: #8b5cf6; color: #8b5cf6; }
.at-event-content {
  flex: 1;
  min-width: 0;
}
.at-event-action {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
  line-height: 1.3;
}
.at-event-detail {
  font-size: 0.8rem;
  color: var(--color-text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.at-event-time {
  font-size: 0.7rem;
  color: var(--color-text-muted, #64748b);
  margin-top: 0.125rem;
}
.at-empty {
  text-align: center;
  color: var(--color-text-muted, #64748b);
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

[data-theme="light"] .activity-timeline {
  background: var(--color-surface, #ffffff);
  border-color: var(--color-border, #e2e8f0);
}
[data-theme="light"] .at-filter-select {
  background: var(--color-bg, #f8fafc);
  color: var(--color-text, #1e293b);
}
[data-theme="light"] .at-event-dot {
  background: var(--color-bg, #f8fafc);
}

@media (max-width: 640px) {
  .activity-timeline { padding: 1rem; }
  .at-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}

/* ── Quick Actions Widget ────────────────────────────────────────── */

.quick-actions-section {
  background: var(--color-bg-card, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.qa-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
  margin: 0;
}

.qa-customize-btn {
  background: transparent;
  border: 1px solid var(--color-border, #475569);
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
  font-family: var(--font-sans, inherit);
}

.qa-customize-btn:hover {
  border-color: var(--color-primary, #3b82f6);
  color: var(--color-primary, #3b82f6);
}

.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.qa-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.5rem;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.qa-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.qa-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.qa-icon-circle svg {
  width: 22px;
  height: 22px;
}

.qa-tile:hover .qa-icon-circle {
  transform: scale(1.1);
}

.qa-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text, #e2e8f0);
  text-align: center;
  line-height: 1.25;
}

/* Customize Modal */

.qa-customize-body {
  max-height: 60vh;
  overflow-y: auto;
}

.qa-customize-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.qa-customize-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--color-bg, #0f172a);
  border: 1px solid var(--color-border, #334155);
  transition: opacity 0.2s ease;
}

.qa-customize-item--active {
  border-color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
}

.qa-customize-item-dragging {
  opacity: 0.4;
}

.qa-customize-drag {
  font-size: 1rem;
  color: var(--color-text-dim, #64748b);
  cursor: grab;
  min-width: 1.25rem;
  text-align: center;
  user-select: none;
}

.qa-customize-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--color-primary, #3b82f6);
}

.qa-customize-icon {
  display: flex;
  align-items: center;
}

.qa-customize-icon svg {
  width: 18px;
  height: 18px;
}

.qa-customize-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text, #e2e8f0);
}

.qa-customize-order {
  font-size: 0.75rem;
  color: var(--color-text-muted, #94a3b8);
  font-weight: 600;
  min-width: 1.5rem;
  text-align: right;
}

.qa-customize-preview {
  border-top: 1px solid var(--color-border, #334155);
  padding-top: 1rem;
}

.qa-customize-preview h4 {
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

/* Light theme overrides */

[data-theme="light"] .quick-actions-section {
  background: var(--color-surface, #ffffff);
  border-color: var(--color-border, #e2e8f0);
}

[data-theme="light"] .qa-title {
  color: var(--color-text, #1e293b);
}

[data-theme="light"] .qa-label {
  color: var(--color-text, #1e293b);
}

[data-theme="light"] .qa-tile:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .qa-customize-item {
  background: var(--color-bg, #f8fafc);
  border-color: var(--color-border, #e2e8f0);
}

[data-theme="light"] .qa-customize-item--active {
  background: rgba(59, 130, 246, 0.04);
}

[data-theme="light"] .qa-customize-label {
  color: var(--color-text, #1e293b);
}

[data-theme="light"] .qa-customize-preview {
  border-color: var(--color-border, #e2e8f0);
}

/* Responsive */

@media (max-width: 768px) {
  .qa-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .qa-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions-section {
    padding: 1rem;
  }
  .qa-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* ── Pinned Projects Widget ──────────────────────────────────────── */

.pinned-projects-section {
  background: var(--card-bg, #1e1e2e);
  border: 1px solid var(--border-color, #2d2d3d);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pp-header .pp-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
}

.pp-manage-btn {
  background: transparent;
  border: 1px solid var(--accent-color, #6c63ff);
  color: var(--accent-color, #6c63ff);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pp-manage-btn:hover {
  background: var(--accent-color, #6c63ff);
  color: #fff;
}

.pp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.pp-card {
  position: relative;
  background: var(--card-inner-bg, #262637);
  border: 1px solid var(--border-color, #2d2d3d);
  border-radius: 10px;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pp-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #e0e0e0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
  padding-right: 1.5rem;
}

.pp-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin-bottom: 0.6rem;
}

.pp-progress {
  width: 100%;
  height: 6px;
  background: var(--progress-bg, #333);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.pp-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.pp-progress-fill.pp-progress-red {
  background: #e74c3c;
}

.pp-progress-fill.pp-progress-yellow {
  background: #f39c12;
}

.pp-progress-fill.pp-progress-green {
  background: #2ecc71;
}

.pp-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-bottom: 0.4rem;
}

.pp-card-time {
  font-size: 0.75rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.6rem;
}

.pp-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pp-open-btn {
  display: inline-block;
  background: var(--accent-color, #6c63ff);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pp-open-btn:hover {
  opacity: 0.85;
}

.pp-unpin-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted, #666);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.pp-card:hover .pp-unpin-btn {
  opacity: 1;
}

.pp-unpin-btn:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.pp-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted, #888);
}

.pp-empty p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.pp-empty-cta {
  background: var(--accent-color, #6c63ff);
  color: #fff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pp-empty-cta:hover {
  opacity: 0.85;
}

/* Manage Pins Modal */

.pp-modal-content {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.pp-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pp-modal-action-btn {
  background: transparent;
  border: 1px solid var(--border-color, #2d2d3d);
  color: var(--text-primary, #e0e0e0);
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.pp-modal-action-btn:hover {
  background: var(--card-inner-bg, #262637);
}

.pp-modal-limit {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-left: auto;
}

.pp-modal-list {
  overflow-y: auto;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pp-modal-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.pp-modal-row:hover {
  background: var(--card-inner-bg, #262637);
}

.pp-modal-cb {
  flex-shrink: 0;
}

.pp-modal-title {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary, #e0e0e0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-modal-wc {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  flex-shrink: 0;
}

.pp-modal-footer {
  margin-top: 0.75rem;
  text-align: right;
}

.pp-modal-save-btn {
  background: var(--accent-color, #6c63ff);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pp-modal-save-btn:hover {
  opacity: 0.85;
}

/* Light theme overrides */

[data-theme="light"] .pinned-projects-section {
  background: #ffffff;
  border-color: #e0e0e0;
}

[data-theme="light"] .pp-header .pp-title {
  color: #1a1a2e;
}

[data-theme="light"] .pp-card {
  background: #f8f9fa;
  border-color: #e0e0e0;
}

[data-theme="light"] .pp-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .pp-card-title {
  color: #1a1a2e;
}

[data-theme="light"] .pp-card-meta,
[data-theme="light"] .pp-progress-label,
[data-theme="light"] .pp-card-time {
  color: #666;
}

[data-theme="light"] .pp-progress {
  background: #e0e0e0;
}

[data-theme="light"] .pp-unpin-btn {
  color: #999;
}

[data-theme="light"] .pp-empty {
  color: #666;
}

[data-theme="light"] .pp-modal-row:hover {
  background: #f0f0f0;
}

[data-theme="light"] .pp-modal-action-btn {
  border-color: #e0e0e0;
  color: #1a1a2e;
}

[data-theme="light"] .pp-modal-action-btn:hover {
  background: #f0f0f0;
}

[data-theme="light"] .pp-modal-title {
  color: #1a1a2e;
}

[data-theme="light"] .pp-modal-wc {
  color: #666;
}

/* Responsive: Pinned Projects */

@media (max-width: 768px) {
  .pp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pp-grid {
    grid-template-columns: 1fr;
  }
  .pinned-projects-section {
    padding: 1rem;
  }
  .pp-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* ── Notifications Center ──────────────────────────────────────── */

.notif-center-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.nc-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.nc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.nc-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--color-primary, #3b82f6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.nc-filters {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.nc-filter {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.nc-filter:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.nc-filter-active {
  background: var(--color-primary, #3b82f6);
  color: #fff;
  border-color: var(--color-primary, #3b82f6);
}

.nc-filter-active:hover {
  background: var(--color-primary, #3b82f6);
  color: #fff;
}

.nc-bulk-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nc-bulk-btn {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.nc-bulk-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.nc-bulk-btn-danger:hover {
  background: var(--color-danger, #ef4444);
  color: #fff;
  border-color: var(--color-danger, #ef4444);
}

.nc-feed {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nc-notif {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: default;
  position: relative;
}

.nc-notif:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nc-notif-unread {
  background: rgba(59, 130, 246, 0.06);
}

.nc-notif-unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  border-radius: 2px;
  background: var(--color-primary, #3b82f6);
}

.nc-notif-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.nc-notif-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.nc-notif-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-notif-message {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nc-notif-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.nc-notif-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.nc-notif-delete {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
  padding: 0;
  line-height: 1;
}

.nc-notif:hover .nc-notif-delete {
  opacity: 1;
}

.nc-notif-delete:hover {
  color: var(--color-danger, #ef4444);
}

.nc-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Light theme overrides */
[data-theme="light"] .notif-center-section {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .nc-notif:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .nc-notif-unread {
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .nc-bulk-btn:hover {
  background: var(--color-bg);
}

/* Responsive: stack bulk actions at 640px */
@media (max-width: 640px) {
  .nc-bulk-actions {
    flex-direction: column;
  }
  .nc-bulk-btn {
    width: 100%;
    text-align: center;
  }
  .nc-notif {
    gap: 0.5rem;
  }
  .nc-notif-title {
    white-space: normal;
  }
}

/* ── Project Templates ────────────────────────────────────────────── */

.pt-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  margin-bottom: 1rem;
  background: var(--accent, #6c63ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.pt-trigger-btn:hover {
  background: var(--accent-hover, #5a52e0);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.35);
}

.pt-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.pt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--card-bg, #1e1e2e);
  border: 1px solid var(--border, #2e2e3e);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pt-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.pt-card-icon {
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.pt-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #e0e0e0);
  margin-bottom: 0.35rem;
}

.pt-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.pt-card-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}
.pt-card-meta span {
  background: var(--badge-bg, rgba(108, 99, 255, 0.15));
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* Detail view */

.pt-detail {
  max-width: 540px;
  margin: 0 auto;
}

.pt-back-btn {
  background: none;
  border: none;
  color: var(--accent, #6c63ff);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0.2rem 0;
  margin-bottom: 0.75rem;
}
.pt-back-btn:hover {
  text-decoration: underline;
}

.pt-detail-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.pt-detail-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text, #e0e0e0);
}

.pt-name-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #aaa);
  margin: 0.9rem 0 0.3rem;
}

.pt-name-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #2e2e3e);
  border-radius: 8px;
  background: var(--input-bg, #16161e);
  color: var(--text, #e0e0e0);
  font-size: 0.92rem;
  box-sizing: border-box;
}
.pt-name-input:focus {
  outline: none;
  border-color: var(--accent, #6c63ff);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.25);
}

.pt-section-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.pt-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border, #2e2e3e);
  transition: background 0.15s;
}
.pt-section-item:last-child {
  border-bottom: none;
}
.pt-section-item:hover {
  background: var(--hover-bg, rgba(108, 99, 255, 0.06));
}
.pt-section-item.pt-dragging {
  opacity: 0.4;
}
.pt-section-item.pt-drag-over {
  border-top: 2px solid var(--accent, #6c63ff);
}

.pt-section-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex: 1;
}

.pt-section-handle {
  cursor: grab;
  color: var(--text-muted, #666);
  font-size: 1.1rem;
  margin-right: 0.4rem;
  user-select: none;
}

.pt-section-title {
  font-size: 0.88rem;
  color: var(--text, #e0e0e0);
}

.pt-section-words {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  white-space: nowrap;
}

.pt-estimate {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent, #6c63ff);
  margin-left: 0.5rem;
}

.pt-create-btn {
  display: block;
  width: 100%;
  padding: 0.65rem;
  background: var(--accent, #6c63ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.pt-create-btn:hover {
  background: var(--accent-hover, #5a52e0);
}

/* Light theme overrides */

[data-theme="light"] .pt-card {
  background: #fff;
  border-color: #e0e0e0;
}
[data-theme="light"] .pt-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .pt-card-name {
  color: #1a1a2e;
}
[data-theme="light"] .pt-card-desc {
  color: #666;
}
[data-theme="light"] .pt-name-input {
  background: #f8f8fc;
  color: #1a1a2e;
  border-color: #ddd;
}
[data-theme="light"] .pt-section-title {
  color: #1a1a2e;
}
[data-theme="light"] .pt-section-item {
  border-color: #eee;
}

/* Responsive */

@media (max-width: 768px) {
  .pt-gallery {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .pt-card {
    padding: 1rem 0.75rem;
  }
  .pt-card-icon {
    font-size: 1.8rem;
  }
  .pt-card-name {
    font-size: 0.92rem;
  }
  .pt-card-desc {
    font-size: 0.75rem;
  }
}

/* ── Quick Actions Palette (Command Palette) ─────────────────────── */

.qap-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.qap-trigger-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}

.qap-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-popover);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.qap-overlay.qap-visible {
  display: flex;
}

.qap-modal {
  width: 480px;
  max-height: 70vh;
  background: #1e2030;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qap-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.qap-search-icon {
  font-size: 1.1rem;
  opacity: 0.5;
  flex-shrink: 0;
}
.qap-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: 1rem;
  font-family: inherit;
}
.qap-search::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.qap-action-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0;
  max-height: calc(70vh - 110px);
}
.qap-action-list::-webkit-scrollbar {
  width: 5px;
}
.qap-action-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.qap-category-label {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
}

.qap-recent-label {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a78bfa;
}

.qap-action-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.12s;
}
.qap-action-item:hover {
  background: rgba(99, 102, 241, 0.08);
}
.qap-action-item.qap-highlighted {
  background: rgba(99, 102, 241, 0.18);
}

.qap-action-icon {
  font-size: 1.15rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  flex-shrink: 0;
}

.qap-action-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.qap-action-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: #e2e8f0;
}
.qap-action-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qap-footer {
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.qap-kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: monospace;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}

.qap-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.88rem;
}

/* Light theme overrides */
[data-theme="light"] .qap-trigger-btn {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.2);
}
[data-theme="light"] .qap-trigger-btn:hover {
  background: rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .qap-modal {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .qap-search-wrap {
  border-bottom-color: #e2e8f0;
}
[data-theme="light"] .qap-search {
  color: #1a1a2e;
}
[data-theme="light"] .qap-search::placeholder {
  color: #94a3b8;
}
[data-theme="light"] .qap-category-label {
  color: #64748b;
}
[data-theme="light"] .qap-recent-label {
  color: #6d28d9;
}
[data-theme="light"] .qap-action-item:hover {
  background: rgba(99, 102, 241, 0.06);
}
[data-theme="light"] .qap-action-item.qap-highlighted {
  background: rgba(99, 102, 241, 0.12);
}
[data-theme="light"] .qap-action-icon {
  background: #f1f5f9;
}
[data-theme="light"] .qap-action-label {
  color: #1e293b;
}
[data-theme="light"] .qap-action-desc {
  color: #64748b;
}
[data-theme="light"] .qap-footer {
  border-top-color: #e2e8f0;
  color: #94a3b8;
}
[data-theme="light"] .qap-kbd {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .qap-empty {
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 640px) {
  .qap-overlay {
    padding-top: 0;
    align-items: stretch;
  }
  .qap-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ── Activity Feed ──────────────────────────────────────────────── */
.af-section {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}
.af-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.af-filter-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}
.af-filter-select:focus {
  border-color: #6366f1;
}
.af-clear-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f87171;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.af-clear-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
}
.af-timeline {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}
.af-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
}
.af-date-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0 10px 0;
  padding-left: 4px;
}
.af-date-header:first-child {
  margin-top: 0;
}
.af-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  position: relative;
  transition: background 0.15s;
  cursor: default;
}
.af-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.af-item-dot {
  position: absolute;
  left: -24px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #1e1e2e;
  flex-shrink: 0;
  z-index: 1;
}
.af-item-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  line-height: 1;
  margin-top: 2px;
}
.af-item-content {
  flex: 1;
  min-width: 0;
}
.af-item-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: #e2e8f0;
}
.af-item-detail {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 4px 0 0 0;
  line-height: 1.45;
}
.af-item-time {
  font-size: 0.75rem;
  color: #64748b;
}
.af-item-link {
  font-size: 0.75rem;
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}
.af-item-link:hover {
  text-decoration: underline;
}
.af-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.af-stats {
  display: flex;
  gap: 24px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.af-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.af-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
}
.af-stat-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.af-load-more {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.af-load-more:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
.af-empty {
  text-align: center;
  color: #64748b;
  padding: 32px 16px;
  font-size: 0.9rem;
}

/* Activity Feed — Light theme */
[data-theme="light"] .af-section {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .af-filter-select {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}
[data-theme="light"] .af-clear-btn {
  border-color: #e2e8f0;
}
[data-theme="light"] .af-timeline::before {
  background: #e2e8f0;
}
[data-theme="light"] .af-item:hover {
  background: rgba(99, 102, 241, 0.04);
}
[data-theme="light"] .af-item-dot {
  border-color: #ffffff;
}
[data-theme="light"] .af-item-title {
  color: #1e293b;
}
[data-theme="light"] .af-item-detail {
  color: #64748b;
}
[data-theme="light"] .af-date-header {
  color: #64748b;
}
[data-theme="light"] .af-stats {
  background: #f8fafc;
}
[data-theme="light"] .af-stat-value {
  color: #1e293b;
}
[data-theme="light"] .af-load-more {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .af-load-more:hover {
  background: #f1f5f9;
  color: #1e293b;
}
[data-theme="light"] .af-empty {
  color: #94a3b8;
}

/* Activity Feed — Responsive */
@media (max-width: 640px) {
  .af-section {
    padding: 16px;
    margin-top: 16px;
  }
  .af-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .af-stats {
    gap: 16px;
    padding: 12px 14px;
  }
  .af-timeline {
    padding-left: 22px;
  }
  .af-item-dot {
    left: -18px;
    width: 8px;
    height: 8px;
  }
  .af-item {
    padding: 10px 8px;
  }
}

/* ── Project Timeline (Gantt) ─────────────────────────────────── */
.ptl-section {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 24px;
}
.ptl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.ptl-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}
.ptl-zoom-btns {
  display: flex;
  gap: 4px;
}
.ptl-zoom-btn {
  background: #334155;
  color: #94a3b8;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ptl-zoom-btn:hover {
  background: #475569;
  color: #e2e8f0;
}
.ptl-zoom-btn.ptl-active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.ptl-canvas-wrap {
  position: relative;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
}
.ptl-canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}
.ptl-tooltip {
  display: none;
  position: absolute;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  max-width: 240px;
}
.ptl-add-btn, .ptl-export-btn {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.ptl-add-btn:hover, .ptl-export-btn:hover {
  background: #475569;
}
.ptl-add-btn {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.ptl-add-btn:hover {
  background: #4f46e5;
}
.ptl-task-table {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ptl-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid #1e293b;
  font-size: 0.85rem;
  color: #cbd5e1;
}
.ptl-task-row:hover {
  background: #1e293b;
}
.ptl-task-name {
  flex: 1 1 160px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ptl-task-dates {
  flex: 0 0 200px;
  color: #94a3b8;
  font-size: 0.8rem;
}
.ptl-task-progress {
  flex: 0 0 160px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ptl-progress-bar {
  flex: 1;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}
.ptl-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s;
}
.ptl-prog-input {
  width: 48px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 2px 4px;
  text-align: center;
}
.ptl-task-actions {
  flex: 0 0 32px;
  text-align: center;
}
.ptl-del-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.ptl-del-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}
.ptl-today-label {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Project Timeline — Light theme */
[data-theme="light"] .ptl-section {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .ptl-title {
  color: #1e293b;
}
[data-theme="light"] .ptl-zoom-btn {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}
[data-theme="light"] .ptl-zoom-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}
[data-theme="light"] .ptl-zoom-btn.ptl-active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
[data-theme="light"] .ptl-canvas-wrap {
  border-color: #e2e8f0;
  background: #f8fafc;
}
[data-theme="light"] .ptl-tooltip {
  background: #fff;
  color: #1e293b;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
[data-theme="light"] .ptl-add-btn {
  background: #6366f1;
  color: #fff;
}
[data-theme="light"] .ptl-export-btn {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
[data-theme="light"] .ptl-export-btn:hover {
  background: #e2e8f0;
}
[data-theme="light"] .ptl-task-row {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
[data-theme="light"] .ptl-task-row:hover {
  background: #f1f5f9;
}
[data-theme="light"] .ptl-task-name {
  color: #1e293b;
}
[data-theme="light"] .ptl-task-dates {
  color: #64748b;
}
[data-theme="light"] .ptl-progress-bar {
  background: #e2e8f0;
}
[data-theme="light"] .ptl-prog-input {
  background: #fff;
  border-color: #e2e8f0;
  color: #1e293b;
}
[data-theme="light"] .ptl-del-btn {
  color: #94a3b8;
}

/* Project Timeline — Responsive */
@media (max-width: 640px) {
  .ptl-section {
    padding: 16px;
    margin-top: 16px;
  }
  .ptl-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ptl-task-row {
    flex-wrap: wrap;
  }
  .ptl-task-dates {
    flex: 1 1 100%;
    font-size: 0.75rem;
  }
  .ptl-task-progress {
    flex: 1 1 100%;
  }
}

/* ── Storage Manager ─────────────────────────────────────────────── */
.stm-section {
  background: var(--card-bg, #1e1e2e);
  border: 1px solid var(--border, #2e2e3e);
  border-radius: 12px;
  margin-top: 24px;
  overflow: hidden;
}
.stm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.stm-header:hover { background: rgba(255,255,255,0.03); }
.stm-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
}
.stm-chevron {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  transition: transform 0.2s;
}
.stm-section--open .stm-chevron { transform: rotate(180deg); }
.stm-body {
  display: none;
  padding: 0 20px 20px;
}
.stm-section--open .stm-body { display: block; }

/* Overview bar */
.stm-overview { margin-bottom: 16px; }
.stm-usage-bar {
  width: 100%;
  height: 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}
.stm-usage-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s;
}
.stm-fill-green { background: #00b894; }
.stm-fill-yellow { background: #fdcb6e; }
.stm-fill-red { background: #d63031; }
.stm-usage-text {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted, #aaa);
  text-align: right;
}

/* Category breakdown */
.stm-categories { margin-bottom: 16px; }
.stm-cat-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.stm-cat-segment {
  height: 100%;
  min-width: 4px;
  transition: width 0.3s;
}
.stm-cat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.stm-cat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted, #aaa);
}
.stm-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Items list */
.stm-items { margin-bottom: 16px; }
.stm-items-header {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #2e2e3e);
  margin-bottom: 4px;
}
.stm-sort-btn {
  font-size: 0.75rem;
  color: var(--text-muted, #aaa);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.stm-sort-btn:hover { background: rgba(255,255,255,0.06); }
.stm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stm-item:last-child { border-bottom: none; }
.stm-item-name {
  flex: 0 0 180px;
  font-size: 0.82rem;
  color: var(--text, #e0e0e0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stm-item-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.stm-item-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.stm-item-size {
  flex: 0 0 70px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted, #aaa);
  font-variant-numeric: tabular-nums;
}
.stm-item-delete {
  flex: 0 0 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stm-item-delete:hover { background: rgba(214,48,49,0.15); color: #d63031; }

/* Action buttons */
.stm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border, #2e2e3e);
}
.stm-action-btn {
  padding: 8px 16px;
  border: 1px solid var(--border, #2e2e3e);
  background: rgba(255,255,255,0.05);
  color: var(--text, #e0e0e0);
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.stm-action-btn:hover { background: rgba(255,255,255,0.1); }
.stm-action-btn--danger { color: #d63031; border-color: rgba(214,48,49,0.3); }
.stm-action-btn--danger:hover { background: rgba(214,48,49,0.12); }
.stm-import-input { display: none; }

/* Light theme overrides */
[data-theme="light"] .stm-section { background: #fff; border-color: #e0e0e0; }
[data-theme="light"] .stm-header:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .stm-title { color: #1a1a2e; }
[data-theme="light"] .stm-usage-bar { background: #f0f0f0; }
[data-theme="light"] .stm-usage-text { color: #666; }
[data-theme="light"] .stm-cat-bar { background: #f0f0f0; }
[data-theme="light"] .stm-cat-item { color: #666; }
[data-theme="light"] .stm-sort-btn { color: #666; }
[data-theme="light"] .stm-sort-btn:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .stm-item { border-bottom-color: #eee; }
[data-theme="light"] .stm-item-name { color: #1a1a2e; }
[data-theme="light"] .stm-item-bar { background: #f0f0f0; }
[data-theme="light"] .stm-item-size { color: #666; }
[data-theme="light"] .stm-item-delete { color: #999; }
[data-theme="light"] .stm-actions { border-top-color: #e0e0e0; }
[data-theme="light"] .stm-action-btn { background: #f8f8f8; color: #1a1a2e; border-color: #e0e0e0; }
[data-theme="light"] .stm-action-btn:hover { background: #f0f0f0; }

/* Responsive */
@media (max-width: 640px) {
  .stm-item-name { flex: 0 0 120px; font-size: 0.75rem; }
  .stm-item-size { flex: 0 0 55px; font-size: 0.72rem; }
  .stm-actions { flex-direction: column; }
  .stm-action-btn { width: 100%; text-align: center; }
  .stm-cat-legend { gap: 6px; }
  .stm-cat-item { font-size: 0.72rem; }
}

/* ── Quick Notes Widget ──────────────────────────────────────────── */
.qn-widget {
  margin-top: 1.5rem;
  background: var(--color-bg-card, #1e1e2e);
  border: 1px solid var(--color-border, #2a2a3e);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.qn-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border, #2a2a3e);
}
.qn-header-left { display: flex; align-items: center; gap: 0.5rem; }
.qn-header-right { display: flex; align-items: center; gap: 0.5rem; }

.qn-toggle-btn {
  background: none; border: none; color: var(--color-text-muted, #888);
  cursor: pointer; font-size: 0.75rem; padding: 2px 4px;
}
.qn-title { font-size: 0.95rem; font-weight: 600; color: var(--color-text, #e0e0e0); margin: 0; }
.qn-counter { font-size: 0.75rem; color: var(--color-text-muted, #888); }

.qn-add-btn {
  background: var(--color-primary, #3b82f6); color: #fff; border: none;
  border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 0.8rem;
  cursor: pointer; font-weight: 500;
}
.qn-add-btn:hover { opacity: 0.9; }

.qn-export-btn {
  background: transparent; border: 1px solid var(--color-border, #2a2a3e);
  color: var(--color-text-muted, #888); border-radius: 6px;
  padding: 0.35rem 0.65rem; font-size: 0.78rem; cursor: pointer;
}
.qn-export-btn:hover { background: rgba(255,255,255,0.05); }

.qn-toolbar { padding: 0.5rem 1rem; }
.qn-search-input {
  width: 100%; padding: 0.45rem 0.75rem; font-size: 0.85rem;
  background: var(--color-bg, #12121e); color: var(--color-text, #e0e0e0);
  border: 1px solid var(--color-border, #2a2a3e); border-radius: 6px;
  outline: none;
}
.qn-search-input:focus { border-color: var(--color-primary, #3b82f6); }

.qn-body { padding: 0.75rem 1rem 1rem; }

.qn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.qn-card {
  border-radius: 8px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem;
  border-left: 4px solid transparent; background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border, #2a2a3e);
}
.qn-card.qn-pinned { box-shadow: 0 0 0 1px rgba(59,130,246,0.4); }
.qn-card-yellow  { border-left-color: #facc15; }
.qn-card-green   { border-left-color: #22c55e; }
.qn-card-blue    { border-left-color: #3b82f6; }
.qn-card-pink    { border-left-color: #ec4899; }
.qn-card-orange  { border-left-color: #f97316; }
.qn-card-purple  { border-left-color: #a855f7; }

.qn-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.qn-card-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

.qn-title-input {
  flex: 1; background: transparent; border: none; color: var(--color-text, #e0e0e0);
  font-size: 0.88rem; font-weight: 600; outline: none; padding: 2px 0;
}
.qn-title-input::placeholder { color: var(--color-text-muted, #666); }

.qn-body-input {
  width: 100%; min-height: 60px; resize: vertical;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: var(--color-text, #e0e0e0); font-size: 0.82rem; font-family: inherit;
  padding: 0.35rem; outline: none; line-height: 1.45;
}
.qn-body-input:focus { border-color: var(--color-border, #2a2a3e); }

.qn-pin-btn, .qn-delete-btn {
  background: none; border: none; cursor: pointer; font-size: 0.85rem;
  padding: 2px 4px; color: var(--color-text-muted, #888); border-radius: 4px;
}
.qn-pin-btn:hover { background: rgba(59,130,246,0.15); }
.qn-delete-btn:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

.qn-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }

.qn-color-picker { display: flex; gap: 5px; align-items: center; }
.qn-color-dot {
  width: 14px; height: 14px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.1s;
}
.qn-color-dot:hover { transform: scale(1.25); }
.qn-color-active { border-color: #fff; }
.qn-dot-yellow { background: #facc15; }
.qn-dot-green  { background: #22c55e; }
.qn-dot-blue   { background: #3b82f6; }
.qn-dot-pink   { background: #ec4899; }
.qn-dot-orange { background: #f97316; }
.qn-dot-purple { background: #a855f7; }

.qn-timestamps { display: flex; flex-direction: column; gap: 1px; }
.qn-ts { font-size: 0.68rem; color: var(--color-text-muted, #666); }

.qn-empty { text-align: center; padding: 2rem 1rem; color: var(--color-text-muted, #888); }
.qn-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.qn-empty-hint { font-size: 0.82rem; margin-top: 0.5rem; }

/* Quick Notes — Light theme */
[data-theme="light"] .qn-widget { background: #fff; border-color: #e0e0e0; }
[data-theme="light"] .qn-header { border-bottom-color: #e0e0e0; }
[data-theme="light"] .qn-title { color: #1a1a2e; }
[data-theme="light"] .qn-search-input { background: #f8f8f8; color: #1a1a2e; border-color: #e0e0e0; }
[data-theme="light"] .qn-card { background: #fafafa; border-color: #e0e0e0; }
[data-theme="light"] .qn-title-input { color: #1a1a2e; }
[data-theme="light"] .qn-body-input { color: #1a1a2e; }
[data-theme="light"] .qn-body-input:focus { border-color: #ccc; }
[data-theme="light"] .qn-color-active { border-color: #333; }
[data-theme="light"] .qn-export-btn { border-color: #e0e0e0; color: #666; }
[data-theme="light"] .qn-export-btn:hover { background: #f0f0f0; }

/* Quick Notes — Responsive */
@media (max-width: 640px) {
  .qn-grid { grid-template-columns: 1fr; }
  .qn-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .qn-header-right { width: 100%; justify-content: flex-end; }
  .qn-card-footer { flex-direction: column; align-items: flex-start; }
}

/* ── Project Health Score ───────────────────────────────────────── */
.phs-widget {
  margin-top: 1.5rem;
  background: var(--color-bg-card, #1e1e2e);
  border: 1px solid var(--color-border, #2e2e3e);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.phs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border, #2e2e3e);
  cursor: default;
}

.phs-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #e2e8f0);
}

.phs-toggle-btn {
  background: none;
  border: none;
  color: var(--color-text-muted, #888);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  transition: background 0.15s;
}
.phs-toggle-btn:hover { background: rgba(255,255,255,0.06); }

.phs-body { padding: 1.25rem; }

.phs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.phs-project-select {
  background: var(--color-bg, #0f0f1a);
  color: var(--color-text, #e2e8f0);
  border: 1px solid var(--color-border, #2e2e3e);
  border-radius: var(--radius-sm, 6px);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  min-width: 180px;
  cursor: pointer;
}
.phs-project-select:focus { outline: 2px solid #3b82f6; outline-offset: 1px; }

.phs-toolbar-btns { display: flex; gap: 0.5rem; }

.phs-btn {
  background: var(--color-bg, #0f0f1a);
  color: var(--color-text, #e2e8f0);
  border: 1px solid var(--color-border, #2e2e3e);
  border-radius: var(--radius-sm, 6px);
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.phs-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.phs-card {
  background: var(--color-bg, #0f0f1a);
  border: 1px solid var(--color-border, #2e2e3e);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
}

.phs-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.phs-overall { display: flex; align-items: baseline; gap: 0.15rem; }
.phs-overall-num { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.phs-overall-max { font-size: 1rem; color: var(--color-text-muted, #888); }

.phs-meta { display: flex; align-items: center; gap: 0.5rem; }
.phs-label-text { font-size: 0.9375rem; font-weight: 600; }

.phs-trend { font-size: 0.875rem; }
.phs-trend--up { color: #22c55e; }
.phs-trend--down { color: #ef4444; }
.phs-trend--stable { color: #94a3b8; }

.phs-radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.phs-radar-canvas { max-width: 100%; height: auto; }

.phs-breakdown {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phs-dim-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.phs-dim-label {
  flex: 0 0 140px;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #aaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phs-dim-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.phs-dim-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.phs-dim-val {
  flex: 0 0 30px;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 700;
}

.phs-tip {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #aaa);
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid #3b82f6;
  padding: 0.6rem 0.9rem;
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
  line-height: 1.5;
}

/* Project Health Score — Light theme */
[data-theme="light"] .phs-widget { background: #fff; border-color: #e0e0e0; }
[data-theme="light"] .phs-header { border-bottom-color: #e0e0e0; }
[data-theme="light"] .phs-title { color: #1a1a2e; }
[data-theme="light"] .phs-toggle-btn { color: #666; }
[data-theme="light"] .phs-toggle-btn:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .phs-project-select { background: #f8f8f8; color: #1a1a2e; border-color: #e0e0e0; }
[data-theme="light"] .phs-btn { background: #f8f8f8; color: #1a1a2e; border-color: #e0e0e0; }
[data-theme="light"] .phs-btn:hover { background: #eef2ff; border-color: #3b82f6; }
[data-theme="light"] .phs-card { background: #fafafa; border-color: #e0e0e0; }
[data-theme="light"] .phs-overall-max { color: #888; }
[data-theme="light"] .phs-dim-label { color: #555; }
[data-theme="light"] .phs-dim-bar-wrap { background: rgba(0,0,0,0.06); }
[data-theme="light"] .phs-tip { background: rgba(59, 130, 246, 0.05); color: #555; }

/* Project Health Score — Responsive */
@media (max-width: 640px) {
  .phs-toolbar { flex-direction: column; align-items: stretch; }
  .phs-project-select { min-width: 0; width: 100%; }
  .phs-toolbar-btns { justify-content: flex-end; }
  .phs-score-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .phs-dim-label { flex: 0 0 110px; font-size: 0.75rem; }
  .phs-radar-canvas { width: 260px; height: 230px; }
}

/* ── Recent Activity Feed ─────────────────────────────────────────── */

/* Trigger button — fixed position */
.raf-trigger-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 6.5rem;
  z-index: var(--z-popover);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.raf-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}
.raf-trigger-icon { font-size: 1rem; }

/* Panel — slide-in from right */
.raf-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border-left: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: hidden;
}
.raf-panel.raf-open { transform: translateX(0); }

/* Header */
.raf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  flex-shrink: 0;
}
.raf-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f59e0b;
}
.raf-header-actions { display: flex; gap: 0.5rem; align-items: center; }
.raf-clear-btn,
.raf-close-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ccc;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.raf-clear-btn:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.raf-close-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Bar chart */
.raf-chart-wrap {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.raf-bar-chart .raf-bar { fill: rgba(245, 158, 11, 0.6); }
.raf-bar-chart .raf-bar:hover { fill: #f59e0b; }
.raf-bar-chart .raf-bar-label { fill: #888; font-size: 8px; font-family: inherit; }
.raf-bar-chart .raf-bar-count { fill: #f59e0b; font-size: 8px; font-weight: 600; font-family: inherit; }

/* Filter tabs */
.raf-filters {
  display: flex;
  gap: 0.25rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  overflow-x: auto;
}
.raf-filter-tab {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #999;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.raf-filter-tab:hover { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border-color: rgba(245, 158, 11, 0.25); }
.raf-filter-tab.active { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: #f59e0b; font-weight: 600; }

/* Timeline list */
.raf-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
  position: relative;
}
/* Vertical timeline line */
.raf-list::before {
  content: '';
  position: absolute;
  left: 2.05rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.05));
  pointer-events: none;
}

/* Activity entry */
.raf-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  position: relative;
}
.raf-entry + .raf-entry { border-top: 1px solid rgba(255, 255, 255, 0.04); }

/* Timeline dot */
.raf-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #1a1a2e;
  flex-shrink: 0;
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}

/* Entry content */
.raf-entry-content { flex: 1; min-width: 0; }
.raf-entry-header { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.2rem; }
.raf-entry-icon { font-size: 0.875rem; flex-shrink: 0; }
.raf-entry-desc { font-size: 0.8125rem; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.raf-entry-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.6875rem; }
.raf-entry-project { color: #f59e0b; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.raf-entry-time { color: #777; white-space: nowrap; }

/* Empty state */
.raf-empty {
  text-align: center;
  color: #777;
  padding: 2rem 1rem;
  font-size: 0.875rem;
}

/* Load More */
.raf-load-more {
  display: block;
  width: calc(100% - 2.5rem);
  margin: 0.5rem 1.25rem 1rem;
  padding: 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.raf-load-more:hover { background: rgba(245, 158, 11, 0.2); }

/* ── Light theme overrides ── */
[data-theme="light"] .raf-panel { background: #fff; border-left-color: rgba(217, 119, 6, 0.2); box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1); }
[data-theme="light"] .raf-header { border-bottom-color: #e5e7eb; }
[data-theme="light"] .raf-title { color: #d97706; }
[data-theme="light"] .raf-clear-btn,
[data-theme="light"] .raf-close-btn { color: #666; border-color: #e0e0e0; }
[data-theme="light"] .raf-clear-btn:hover { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
[data-theme="light"] .raf-close-btn:hover { background: rgba(0, 0, 0, 0.05); color: #333; }
[data-theme="light"] .raf-chart-wrap { border-bottom-color: #e5e7eb; }
[data-theme="light"] .raf-bar-chart .raf-bar { fill: rgba(217, 119, 6, 0.5); }
[data-theme="light"] .raf-bar-chart .raf-bar:hover { fill: #d97706; }
[data-theme="light"] .raf-bar-chart .raf-bar-label { fill: #999; }
[data-theme="light"] .raf-bar-chart .raf-bar-count { fill: #b45309; }
[data-theme="light"] .raf-filters { border-bottom-color: #e5e7eb; }
[data-theme="light"] .raf-filter-tab { color: #666; border-color: #e0e0e0; }
[data-theme="light"] .raf-filter-tab:hover { background: rgba(217, 119, 6, 0.08); color: #d97706; border-color: rgba(217, 119, 6, 0.3); }
[data-theme="light"] .raf-filter-tab.active { background: rgba(217, 119, 6, 0.1); color: #b45309; border-color: #d97706; }
[data-theme="light"] .raf-list::before { background: linear-gradient(to bottom, rgba(217, 119, 6, 0.25), rgba(217, 119, 6, 0.05)); }
[data-theme="light"] .raf-entry + .raf-entry { border-top-color: #f3f4f6; }
[data-theme="light"] .raf-timeline-dot { background: #d97706; border-color: #fff; }
[data-theme="light"] .raf-entry-desc { color: #1a1a2e; }
[data-theme="light"] .raf-entry-project { color: #b45309; }
[data-theme="light"] .raf-entry-time { color: #999; }
[data-theme="light"] .raf-empty { color: #999; }
[data-theme="light"] .raf-load-more { background: rgba(217, 119, 6, 0.08); color: #b45309; border-color: rgba(217, 119, 6, 0.25); }
[data-theme="light"] .raf-load-more:hover { background: rgba(217, 119, 6, 0.15); }

/* Recent Activity Feed — Responsive */
@media (max-width: 480px) {
  .raf-panel { width: 100vw; }
  .raf-entry-project { max-width: 120px; }
  .raf-trigger-label { display: none; }
}

/* ── Storage Usage Meter ──────────────────────────────────────────── */

/* Trigger button */
.sum-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: var(--z-popover);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  font-family: inherit;
}
.sum-trigger:hover {
  background: #1e293b;
  border-color: #0ea5e9;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}
.sum-trigger-icon { flex-shrink: 0; }

/* Panel */
.sum-panel {
  position: fixed;
  bottom: 72px;
  left: 24px;
  z-index: var(--z-popover);
  width: 420px;
  max-height: calc(100vh - 120px);
  background: #0f172a;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}
.sum-panel.sum-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sum-panel-inner {
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  padding: 20px;
}

/* Header */
.sum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sum-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38bdf8;
}
.sum-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}
.sum-close-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}
.sum-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

/* Progress section */
.sum-progress-section {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.12);
}
.sum-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.sum-progress-pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: #38bdf8;
}
.sum-progress-abs {
  font-size: 0.8125rem;
  color: #94a3b8;
}
.sum-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}
.sum-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.4s ease;
}

/* Warning states */
.sum-warn-green .sum-progress-pct { color: #34d399; }
.sum-warn-green .sum-progress-fill { background: linear-gradient(90deg, #059669, #34d399); }
.sum-warn-green { border-color: rgba(16, 185, 129, 0.2); background: rgba(16, 185, 129, 0.06); }

.sum-warn-amber .sum-progress-pct { color: #fbbf24; }
.sum-warn-amber .sum-progress-fill { background: linear-gradient(90deg, #d97706, #fbbf24); }
.sum-warn-amber { border-color: rgba(245, 158, 11, 0.2); background: rgba(245, 158, 11, 0.06); }

.sum-warn-red .sum-progress-pct { color: #f87171; }
.sum-warn-red .sum-progress-fill { background: linear-gradient(90deg, #dc2626, #f87171); }
.sum-warn-red { border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.06); }

/* Tip */
.sum-tip {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
}
.sum-tip.sum-warn-red {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
}

/* Stacked bar section */
.sum-bar-section {
  margin-bottom: 16px;
}
.sum-bar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}
.sum-stacked-wrap {
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}
.sum-stacked-svg { display: block; }
.sum-stacked-bar-empty {
  padding: 8px;
  text-align: center;
  font-size: 0.8125rem;
  color: #475569;
}

/* Legend */
.sum-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.sum-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #94a3b8;
}
.sum-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sum-legend-size {
  color: #64748b;
}

/* Actions */
.sum-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sum-action-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.08);
  color: #38bdf8;
  transition: all 0.15s;
  font-family: inherit;
}
.sum-action-btn:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.4);
}
.sum-purge-btn {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}
.sum-purge-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Clear feature section */
.sum-clear-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sum-clear-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.sum-clear-select {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}
.sum-clear-select:focus {
  outline: none;
  border-color: #0ea5e9;
}
.sum-clear-go-btn {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}
.sum-clear-go-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Key list section */
.sum-list-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}
.sum-list-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 10px;
}
.sum-key-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}
.sum-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.12s;
}
.sum-key-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.sum-key-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sum-key-name {
  flex: 1;
  font-size: 0.75rem;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.sum-key-size {
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.sum-key-overflow {
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #475569;
  text-align: center;
}
.sum-empty-list {
  padding: 16px 8px;
  text-align: center;
  color: #475569;
  font-size: 0.8125rem;
}

/* ── Storage Usage Meter — Light theme ──────────────────────────── */

[data-theme="light"] .sum-trigger {
  background: #ffffff;
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .sum-trigger:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
}
[data-theme="light"] .sum-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .sum-title { color: #0f172a; }
[data-theme="light"] .sum-close-btn { color: #94a3b8; }
[data-theme="light"] .sum-close-btn:hover { background: rgba(0, 0, 0, 0.05); color: #334155; }
[data-theme="light"] .sum-progress-section { background: rgba(14, 165, 233, 0.04); border-color: rgba(14, 165, 233, 0.1); }
[data-theme="light"] .sum-progress-abs { color: #64748b; }
[data-theme="light"] .sum-progress-track { background: #f1f5f9; }
[data-theme="light"] .sum-warn-green { background: rgba(16, 185, 129, 0.04); border-color: rgba(16, 185, 129, 0.15); }
[data-theme="light"] .sum-warn-amber { background: rgba(245, 158, 11, 0.04); border-color: rgba(245, 158, 11, 0.15); }
[data-theme="light"] .sum-warn-red { background: rgba(239, 68, 68, 0.04); border-color: rgba(239, 68, 68, 0.15); }
[data-theme="light"] .sum-tip { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.12); color: #b45309; }
[data-theme="light"] .sum-tip.sum-warn-red { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .sum-bar-title { color: #94a3b8; }
[data-theme="light"] .sum-stacked-wrap { background: #f8fafc; }
[data-theme="light"] .sum-stacked-bar-empty { color: #94a3b8; }
[data-theme="light"] .sum-legend-item { color: #475569; }
[data-theme="light"] .sum-legend-size { color: #94a3b8; }
[data-theme="light"] .sum-action-btn { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.15); color: #0284c7; }
[data-theme="light"] .sum-action-btn:hover { background: rgba(14, 165, 233, 0.1); border-color: rgba(14, 165, 233, 0.3); }
[data-theme="light"] .sum-purge-btn { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .sum-purge-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }
[data-theme="light"] .sum-clear-section { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .sum-clear-label { color: #94a3b8; }
[data-theme="light"] .sum-clear-select { background: #ffffff; border-color: #e2e8f0; color: #334155; }
[data-theme="light"] .sum-clear-go-btn { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .sum-clear-go-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }
[data-theme="light"] .sum-list-section { border-top-color: #e2e8f0; }
[data-theme="light"] .sum-list-title { color: #94a3b8; }
[data-theme="light"] .sum-key-row:hover { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .sum-key-name { color: #334155; }
[data-theme="light"] .sum-key-size { color: #94a3b8; }
[data-theme="light"] .sum-key-overflow { color: #94a3b8; }
[data-theme="light"] .sum-empty-list { color: #94a3b8; }

/* Storage Usage Meter — Responsive */
@media (max-width: 480px) {
  .sum-panel { width: calc(100vw - 16px); left: 8px; }
  .sum-trigger-label { display: none; }
  .sum-actions { flex-direction: column; }
  .sum-clear-section { flex-wrap: wrap; }
}

/* ── Deadline Tracker ───────────────────────────────────────────── */

/* Trigger Button */
.dlt-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: var(--z-popover);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.dlt-trigger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}
.dlt-trigger svg { flex-shrink: 0; }

/* Panel */
.dlt-panel {
  position: fixed;
  bottom: 72px;
  left: 24px;
  z-index: var(--z-tooltip);
  width: 400px;
  max-height: calc(100vh - 100px);
  background: #1a1a2e;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 68, 68, 0.25) transparent;
}
.dlt-panel-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Panel Header */
.dlt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dlt-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}
.dlt-panel-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.dlt-panel-close:hover { color: #f87171; background: rgba(239, 68, 68, 0.1); }

/* Stats */
.dlt-stats {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dlt-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dlt-stat-num {
  font-size: 1.125rem;
  font-weight: 700;
  color: #f1f5f9;
}
.dlt-stat-overdue .dlt-stat-num { color: #ef4444; }
.dlt-stat-label {
  font-size: 0.6875rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Filter Tabs */
.dlt-filters {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dlt-filter-tab {
  flex: 1;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.dlt-filter-tab:hover { background: rgba(239, 68, 68, 0.08); color: #f87171; }
.dlt-filter-active {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Add Form */
.dlt-add-form {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dlt-form-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.dlt-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.8125rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.dlt-input:focus { border-color: rgba(239, 68, 68, 0.4); }
.dlt-input::placeholder { color: #475569; }
.dlt-textarea { resize: vertical; min-height: 40px; }
.dlt-add-btn {
  width: 100%;
  padding: 9px 0;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.dlt-add-btn:hover { background: #dc2626; }

/* Calendar */
.dlt-calendar {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dlt-cal-header {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 10px;
  text-align: center;
}
.dlt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dlt-cal-label {
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
  text-transform: uppercase;
}
.dlt-cal-blank { padding: 4px; }
.dlt-cal-day {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 4px 0 2px;
  border-radius: 6px;
  position: relative;
}
.dlt-cal-today {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-weight: 700;
}
.dlt-cal-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 1px;
}
.dlt-cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.dlt-cal-dot.dlt-urgency-red { background: #ef4444; }
.dlt-cal-dot.dlt-urgency-amber { background: #f59e0b; }
.dlt-cal-dot.dlt-urgency-green { background: #22c55e; }

/* Deadline Cards */
.dlt-list { padding: 10px 20px 16px; }
.dlt-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
  border-left: 3px solid transparent;
}
.dlt-card.dlt-urgency-red { border-left-color: #ef4444; }
.dlt-card.dlt-urgency-amber { border-left-color: #f59e0b; }
.dlt-card.dlt-urgency-green { border-left-color: #22c55e; }
.dlt-card.dlt-completed { opacity: 0.55; }
.dlt-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.dlt-card-info { flex: 1; min-width: 0; }
.dlt-card-project {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dlt-card-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}
.dlt-card-date {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 8px;
}
.dlt-card-countdown {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 2px;
}
.dlt-urgency-red .dlt-card-countdown { color: #f87171; }
.dlt-urgency-amber .dlt-card-countdown { color: #f59e0b; }
.dlt-urgency-green .dlt-card-countdown { color: #22c55e; }
.dlt-card-notes {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.4;
}
.dlt-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.dlt-btn-complete, .dlt-btn-delete {
  flex: 1;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid;
  text-align: center;
}
.dlt-btn-complete {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}
.dlt-btn-complete:hover { background: rgba(34, 197, 94, 0.15); }
.dlt-btn-delete {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.dlt-btn-delete:hover { background: rgba(239, 68, 68, 0.12); }

/* Progress Ring */
.dlt-ring { flex-shrink: 0; }
.dlt-ring-text {
  font-size: 9px;
  fill: #94a3b8;
  font-weight: 600;
}

/* Empty State */
.dlt-empty {
  text-align: center;
  padding: 24px 0;
  color: #64748b;
  font-size: 0.8125rem;
}

/* ── Deadline Tracker — Light Theme ──────────────────────────────── */
[data-theme="light"] .dlt-panel {
  background: #ffffff;
  border-color: rgba(239, 68, 68, 0.12);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .dlt-panel-header { border-bottom-color: #e2e8f0; }
[data-theme="light"] .dlt-panel-title { color: #1e293b; }
[data-theme="light"] .dlt-panel-close { color: #94a3b8; }
[data-theme="light"] .dlt-panel-close:hover { color: #ef4444; background: rgba(239, 68, 68, 0.06); }
[data-theme="light"] .dlt-stats { border-bottom-color: #e2e8f0; }
[data-theme="light"] .dlt-stat-num { color: #1e293b; }
[data-theme="light"] .dlt-stat-overdue .dlt-stat-num { color: #ef4444; }
[data-theme="light"] .dlt-stat-label { color: #94a3b8; }
[data-theme="light"] .dlt-filters { border-bottom-color: #e2e8f0; }
[data-theme="light"] .dlt-filter-tab {
  background: rgba(0, 0, 0, 0.02);
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .dlt-filter-tab:hover { background: rgba(239, 68, 68, 0.04); color: #dc2626; }
[data-theme="light"] .dlt-filter-active {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}
[data-theme="light"] .dlt-add-form { border-bottom-color: #e2e8f0; }
[data-theme="light"] .dlt-form-title { color: #94a3b8; }
[data-theme="light"] .dlt-input {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}
[data-theme="light"] .dlt-input:focus { border-color: rgba(239, 68, 68, 0.4); }
[data-theme="light"] .dlt-input::placeholder { color: #94a3b8; }
[data-theme="light"] .dlt-calendar { border-bottom-color: #e2e8f0; }
[data-theme="light"] .dlt-cal-header { color: #1e293b; }
[data-theme="light"] .dlt-cal-day { color: #64748b; }
[data-theme="light"] .dlt-cal-today { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
[data-theme="light"] .dlt-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: #e2e8f0;
}
[data-theme="light"] .dlt-card-project { color: #1e293b; }
[data-theme="light"] .dlt-card-badge { background: rgba(239, 68, 68, 0.06); color: #dc2626; }
[data-theme="light"] .dlt-card-date { color: #94a3b8; }
[data-theme="light"] .dlt-card-notes { color: #64748b; }
[data-theme="light"] .dlt-ring circle:first-child { stroke: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .dlt-ring-text { fill: #64748b; }
[data-theme="light"] .dlt-btn-complete { background: rgba(34, 197, 94, 0.04); border-color: rgba(34, 197, 94, 0.15); }
[data-theme="light"] .dlt-btn-delete { background: rgba(239, 68, 68, 0.03); border-color: rgba(239, 68, 68, 0.1); }
[data-theme="light"] .dlt-empty { color: #94a3b8; }

/* Deadline Tracker — Responsive */
@media (max-width: 480px) {
  .dlt-panel { width: calc(100vw - 16px); left: 8px; }
  .dlt-trigger-label { display: none; }
  .dlt-trigger { padding: 10px 12px; }
}
