:root {
  /* Chill-Palette: tiefes Blau, Magenta, weiches Blau */
  --magenta: #d946ef;
  --magenta-soft: #e879f9;
  --violet: #a78bfa;
  --blue: #38bdf8;
  --blue-soft: #7dd3fc;

  --bg: #0c0a14;
  --bg-gradient: linear-gradient(145deg, #0c0a14 0%, #12101c 35%, #0f0e1a 70%, #0c0a14 100%);
  --surface: rgba(26, 22, 40, 0.6);
  --surface-solid: #1a1628;
  --surface-hover: rgba(45, 40, 65, 0.7);
  --surface-border: rgba(167, 139, 250, 0.12);
  --text: #f0eef6;
  --text-muted: #9ca3b8;
  --text-soft: #c4b8d9;

  --gradient-main: linear-gradient(135deg, var(--magenta) 0%, var(--violet) 45%, var(--blue) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(217, 70, 239, 0.15) 0%, rgba(56, 189, 248, 0.12) 100%);
  --gradient-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(217, 70, 239, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(56, 189, 248, 0.12), transparent);

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(217, 70, 239, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --positive: #4ade80;
  --negative: #f87171;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-gradient), var(--gradient-glow);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* —— Header: Uhr + Wetter —— */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 560px) {
  .header {
    grid-template-columns: 1fr;
  }
}

.clock-card,
.weather-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--surface-border);
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.clock-card::before,
.weather-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0.5;
  pointer-events: none;
  border-radius: inherit;
}

.clock-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}

.time {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.date {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}

.weather-place {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.weather-icon {
  font-size: 2rem;
  line-height: 1;
}

.weather-temp {
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--text-soft);
}

.weather-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.weather-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* —— Sections —— */
.section {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--surface-border);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0.35;
  pointer-events: none;
  border-radius: inherit;
}

.section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  padding-left: 0.75rem;
  border-left: 3px solid var(--violet);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.section-header h2 {
  margin-bottom: 0;
  padding-left: 0.75rem;
}

/* —— Links —— */
.links-list {
  list-style: none;
  position: relative;
  z-index: 1;
}

.links-list li {
  margin-bottom: 0.5rem;
}

.links-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.links-list a:hover {
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.2);
}

.links-list .link-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.links-list .link-remove {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.links-list .link-remove:hover {
  opacity: 1;
  color: var(--negative);
  background: rgba(248, 113, 113, 0.15);
}

.add-link-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  position: relative;
  z-index: 1;
}

.add-link-form.hidden {
  display: none;
}

.add-link-form input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.6rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.add-link-form input::placeholder {
  color: var(--text-muted);
}

.add-link-form input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* —— Buttons —— */
.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
}

.btn-icon:hover {
  background: rgba(167, 139, 250, 0.2);
  color: var(--violet);
}

.btn-primary {
  padding: 0.6rem 1.15rem;
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 70, 239, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
}

.btn-secondary {
  padding: 0.55rem 1rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.3);
}

/* —— Notes —— */
#notes {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  position: relative;
  z-index: 1;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#notes::placeholder {
  color: var(--text-muted);
}

#notes:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-row a {
  flex: 1;
}

/* —— Google Kalender —— */
.calendar-auth {
  padding: 1rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.calendar-auth button {
  margin-top: 0.5rem;
}

.calendar-events {
  list-style: none;
  position: relative;
  z-index: 1;
}

.calendar-events li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.calendar-events li:last-child {
  border-bottom: none;
}

.calendar-event-time {
  font-size: 0.8rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
}

.calendar-event-title {
  font-weight: 500;
}

.calendar-event-place {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calendar-empty,
.calendar-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* —— Aktien (Spaltenansicht) —— */
.stock-add {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stock-add input {
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  width: 14rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stock-add input::placeholder {
  color: var(--text-muted);
}

.stock-add input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.stock-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.stock-table-wrap {
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stock-table th,
.stock-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
}

.stock-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stock-table tbody tr:hover {
  background: rgba(167, 139, 250, 0.05);
}

.stock-cell-name {
  font-weight: 500;
}

.stock-cell-time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stock-cell-price {
  font-weight: 500;
}

.stock-cell-pct.positive,
.stock-cell-pts.positive {
  color: var(--positive);
}

.stock-cell-pct.negative,
.stock-cell-pts.negative {
  color: var(--negative);
}

.stock-cell-loading,
.stock-cell-error {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stock-cell-error {
  color: var(--negative);
}

.stock-th-actions,
.stock-cell-actions {
  width: 1%;
  white-space: nowrap;
}

.stock-cell-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
}

.stock-move-up-btn,
.stock-move-down-btn {
  padding: 0.25rem 0.4rem !important;
  font-size: 0.9rem !important;
  line-height: 1;
  min-width: 26px;
}

.stock-remove-btn {
  padding: 0.3rem 0.5rem !important;
  font-size: 1.1rem !important;
  line-height: 1;
  min-width: 28px;
}

.hidden {
  display: none !important;
}
