:root {
  --bg: #0c0e14;
  --bg-elevated: #12141d;
  --bg-card: #161927;
  --bg-card-hover: #1b1f30;
  --border: #262b3d;
  --border-light: #2f3550;
  --topbar-bg: rgba(12, 14, 20, 0.92);
  --overlay-bg: rgba(5, 6, 10, 0.65);

  --accent: #7c5cff;
  --accent-2: #4f8dff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-2-soft: rgba(79, 141, 255, 0.14);

  --text: #eef0f7;
  --text-dim: #9aa0b4;
  --text-faint: #5c6178;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #4f8dff;
  --info-soft: rgba(79, 141, 255, 0.14);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html.theme-light {
  --bg: #f5f6fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f8;
  --border: #e2e5ef;
  --border-light: #d0d5e3;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --overlay-bg: rgba(0, 0, 0, 0.35);
  --text: #1a1d2e;
  --text-dim: #5c6178;
  --text-faint: #9aa0b4;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

a { color: var(--accent-2); text-decoration: none; }
.hidden { display: none !important; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.logo small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.navtab {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.navtab svg { width: 16px; height: 16px; opacity: 0.8; }

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

.navtab.active {
  background: var(--accent-soft);
  color: #fff;
  border-color: rgba(124, 92, 255, 0.35);
}

.navtab.active svg { opacity: 1; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s;
}
.user-chip:hover { background: var(--bg-card-hover); border-color: var(--border-light); }

.content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 60px;
  width: 100%;
  flex: 1;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.18s ease; }

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -0.01em; }
.section-head p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-card .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 24px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.01em; }
.stat-card .delta { font-size: 12.5px; font-weight: 600; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.neutral { color: var(--text-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-icon:hover { color: var(--text); background: var(--bg-card-hover); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input, .select-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 13px;
}
.search-input { min-width: 220px; }
.search-input:focus, .select-input:focus { outline: none; border-color: var(--accent); }

.chip-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.chip-filter.active { background: var(--accent-soft); color: #fff; border-color: rgba(124,92,255,0.4); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

.cell-primary { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--text-faint); font-size: 12px; margin-top: 1px; }
.empty-cell { text-align: center; color: var(--text-faint); padding: 40px 16px; font-size: 13px; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.row-flex { display: flex; align-items: center; gap: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-active { background: var(--success-soft); color: var(--success); }
.badge-paused { background: var(--warning-soft); color: var(--warning); }
.badge-completed { background: var(--success-soft); color: var(--success); }
.badge-draft { background: rgba(154, 160, 180, 0.16); color: var(--text-dim); }
.badge-inactive { background: rgba(154, 160, 180, 0.16); color: var(--text-dim); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.entity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color 0.15s ease;
}
.entity-card:hover { border-color: var(--border-light); }

.entity-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entity-id { display: flex; gap: 12px; align-items: center; }

.avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.entity-name { font-weight: 700; font-size: 14.5px; }
.entity-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 1px; }

.entity-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.entity-meta .m-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.entity-meta .m-value { font-size: 13.5px; font-weight: 600; margin-top: 2px; }

.entity-extra { display: none; margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.entity-card.expanded .entity-extra { display: block; }
.entity-card.expanded .expand-btn { transform: rotate(180deg); }

.expand-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}
.expand-btn svg { width: 14px; height: 14px; }

.actions-cell { white-space: nowrap; width: 1%; padding-right: 12px !important; }

.action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  margin-right: 2px;
}
.action-btn:hover { background: var(--bg-elevated); border-color: var(--border); color: var(--text); }
.action-btn.delete-btn:hover { color: var(--danger); border-color: rgba(248,113,113,0.4); background: var(--danger-soft); }
.action-btn.print-btn:hover { color: var(--accent-2); border-color: rgba(79,141,255,0.4); background: var(--info-soft); }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--bg-card-hover); }

.card-actions { display: flex; gap: 2px; }

.entity-card-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-mini {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-mini .m-val { font-size: 18px; font-weight: 700; }
.stat-mini .m-lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.03em; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15.5px; }

.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 13.5px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { display: block; font-size: 11px; color: var(--danger); margin-top: 3px; min-height: 0; }

.app-footer {
  text-align: center;
  padding: 22px 0 30px;
  color: var(--text-faint);
  font-size: 12px;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.login-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-logo { margin-bottom: 20px; }

.login-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0 0 28px;
}

.login-hint {
  background: var(--accent-soft);
  border: 1px solid rgba(124,92,255,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
  transition: opacity 0.2s ease;
}

.login-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.06em;
}
.login-input:focus { outline: none; border-color: var(--accent); }

.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin: 10px 0 0;
  font-weight: 600;
}

.lang-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.lang-select:focus { outline: none; border-color: var(--accent); }

.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(124,92,255,0.35);
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.help-btn:hover { background: rgba(124,92,255,0.28); }

.global-search-wrap { position: relative; flex: 1; max-width: 320px; }

.global-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: border-color 0.15s;
}
.global-search-inner:focus-within { border-color: var(--accent); }

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.global-search-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  width: 100%;
  outline: none;
}
.global-search-input::placeholder { color: var(--text-faint); }

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}

.search-group { margin-bottom: 4px; }
.search-group-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 4px 8px 5px;
}

.search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-item:hover { background: var(--bg-card-hover); }

.search-no-results {
  color: var(--text-faint);
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
}

.search-highlight { background: var(--accent-soft) !important; transition: background 0.5s ease; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.chart-container { height: 220px; position: relative; }
.chart-container-sm { height: 200px; position: relative; }

.dash-welcome {
  background: linear-gradient(135deg, rgba(124,92,255,0.12), rgba(79,141,255,0.08));
  border: 1px solid rgba(124,92,255,0.25);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dash-welcome-greeting {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 5px;
}
.dash-welcome-date { font-size: 13px; color: var(--text-dim); margin: 0 0 2px; }
.dash-next-milestone { font-size: 12.5px; color: var(--text-dim); margin: 0; }
.dash-next-label { color: var(--accent-2); font-weight: 600; }
.dash-next-date { color: var(--text-faint); }

.dash-quick-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.dash-qs { text-align: center; }
.dash-qs-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent-2); line-height: 1; margin-bottom: 5px; }
.dash-qs-label { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.dash-qs-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }

.activity-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}
.activity-item:last-child { border-bottom: none; }
.activity-text { color: var(--text); }
.activity-empty { text-align: center; color: var(--text-faint); font-size: 13.5px; padding: 32px 0; }

.stat-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
  .topbar-inner { padding: 12px 16px; }
  .global-search-wrap { max-width: 100%; }
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.notes-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  padding: 60px 0;
}

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}
.note-card:hover { border-color: var(--border-light); }

.note-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.note-card-title { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.3; }
.note-card-actions { display: flex; gap: 2px; flex-shrink: 0; }
.note-card-content { font-size: 13px; color: var(--text-dim); line-height: 1.55; flex: 1; }
.note-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.note-category-tag { font-size: 11px; font-weight: 600; color: var(--text-faint); background: rgba(154,160,180,0.12); padding: 2px 8px; border-radius: 999px; }
.note-card-date { font-size: 11.5px; color: var(--text-faint); font-weight: 600; margin-top: 2px; }

.modal-wide { max-width: 580px; }

.settings-section-title {
  margin: 0 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 700;
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

.theme-options { display: flex; gap: 8px; margin-bottom: 16px; }
.theme-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.12s ease;
}
.theme-option:hover { border-color: var(--border-light); color: var(--text); }
.theme-option input { display: none; }
.theme-option:has(input:checked),
.theme-option.selected { background: var(--accent-soft); border-color: rgba(124,92,255,0.4); color: #fff; }

.pw-success {
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
}

.help-sections { display: flex; flex-direction: column; gap: 16px; }
.help-section h4 { font-size: 13.5px; font-weight: 700; margin: 0 0 5px; color: var(--text); }
.help-section p { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0 0 5px; }
.help-section ul { margin: 5px 0 0; padding-left: 18px; }
.help-section li { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin-bottom: 4px; }
.help-section strong { color: var(--text); }
.help-section code { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; color: var(--accent); }

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-stable { color: var(--text-faint); }

.splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elevated) 50%, var(--bg) 100%);
  background-size: 400% 400%;
  animation: gradientBG 8s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  transition: opacity 0.4s ease;
}
.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.splash-content {
  text-align: center;
  animation: splashPulse 2s ease-in-out infinite alternate;
}

@keyframes splashPulse {
  from { transform: scale(1); opacity: 0.85; }
  to { transform: scale(1.06); opacity: 1; }
}

.splash-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 48px rgba(124, 92, 255, 0.45), 0 0 60px rgba(124, 92, 255, 0.15);
  margin-bottom: 28px;
}

.splash-logo svg { width: 56px; height: 56px; }

.splash-title {
  font-size: 48px;
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  color: var(--text);
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-subtitle {
  font-size: 19px;
  color: var(--text-dim);
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}

.splash-dots {
  margin-top: 28px;
  display: inline-flex;
  gap: 10px;
}

.splash-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: dotPulse 1.4s ease-in-out infinite both;
}

.splash-dot:nth-child(1) { animation-delay: 0s; }
.splash-dot:nth-child(2) { animation-delay: 0.2s; }
.splash-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.splash-brand {
  margin-top: 36px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  font-weight: 400;
  text-transform: uppercase;
}
.splash-logo-img {
  width: 110px;
  height: 110px;
  border-radius: 30px;
  margin-bottom: 16px;
  object-fit: contain;
  box-shadow: 0 12px 48px rgba(124, 92, 255, 0.45), 0 0 60px rgba(124, 92, 255, 0.15);
}

.splash-workspace {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}


.footer-brand {
  color: var(--text-faint) !important;
  font-weight: 600;
  text-decoration: none;
}
.footer-brand:hover { color: var(--accent-2) !important; text-decoration: underline; }

/* Progress bar for milestones */
.progress-bar-wrap { display:inline-flex; align-items:center; gap:6px; background:var(--bg-elevated); border-radius:999px; height:8px; width:80px; padding:0; overflow:hidden; }
.progress-bar { height:8px; border-radius:999px; background:var(--accent); min-width:4px; transition:width .3s; }
.progress-text { font-size:11px; font-weight:600; color:var(--text-dim); min-width:28px; }
