/* ============================================================
   Dashboard App – Hauptstylesheet
   Dark UI, Modern Design
   ============================================================ */

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  --bg-primary:     #0d0e14;
  --bg-secondary:   #161821;
  --bg-card:        #1e2030;
  --bg-card-hover:  #252840;
  --bg-input:       #1a1c2a;
  --border:         #2e3048;
  --border-focus:   #6c63ff;
  --accent:         #6c63ff;
  --accent-hover:   #5a52d5;
  --accent-glow:    rgba(108, 99, 255, 0.25);
  --text-primary:   #e2e4f0;
  --text-secondary: #8b8fa8;
  --text-muted:     #555870;
  --success:        #4ade80;
  --warning:        #facc15;
  --danger:         #f87171;
  --info:           #60a5fa;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
  --transition:     0.2s ease;
  --font-main:      'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:      'Fira Code', 'Consolas', monospace;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ─── Layout Utilities ──────────────────────────────────── */
.container       { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container--wide { max-width: 1600px; }
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm          { gap: 8px; }
.gap-md          { gap: 16px; }
.gap-lg          { gap: 24px; }
.mt-auto         { margin-top: auto; }

/* ─── Navbar ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,14,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar__brand .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar__nav a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar__avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ─── Dashboard Layout ──────────────────────────────────── */
.dashboard {
  min-height: calc(100vh - 60px);
  position: relative;
}

.dashboard--with-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.dashboard--with-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 0;
  pointer-events: none;
}

.dashboard__content {
  position: relative;
  z-index: 1;
  padding: 40px 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Search Bar ────────────────────────────────────────── */
.search-section {
  text-align: center;
  margin-bottom: 48px;
}

.search-greeting {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #e2e4f0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-time {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-md);
}

.search-engine-select {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0 16px;
  height: 56px;
  font-size: 0.85rem;
  cursor: pointer;
  border-right: 1px solid var(--border);
  outline: none;
  min-width: 110px;
}

.search-engine-select option { background: var(--bg-card); }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0 20px;
  height: 56px;
  outline: none;
  font-family: var(--font-main);
}

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

.search-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition);
}

.search-btn:hover { background: var(--accent-hover); }

/* ─── Section Headers ───────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Shortcut Grid ─────────────────────────────────────── */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.shortcut-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 110px;
  text-decoration: none;
  color: var(--text-primary);
  user-select: none;
}

.shortcut-tile:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.2);
  color: var(--text-primary);
}

.shortcut-tile.sortable-ghost {
  opacity: 0.4;
  border-color: var(--accent);
}

.shortcut-tile.sortable-chosen {
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  transform: scale(1.05);
}

.shortcut-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg-secondary);
  padding: 4px;
}

.shortcut-icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: white;
}

.shortcut-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}

.shortcut-tile:hover .shortcut-title { color: var(--text-primary); }

.shortcut-tile__actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 4px;
}

.shortcut-tile:hover .shortcut-tile__actions { display: flex; }

.shortcut-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.shortcut-action-btn--edit  { background: rgba(96, 165, 250, 0.2); color: var(--info); }
.shortcut-action-btn--delete{ background: rgba(248, 113, 113, 0.2); color: var(--danger); }
.shortcut-action-btn:hover  { filter: brightness(1.4); }

/* ─── Add-Tile Button ───────────────────────────────────── */
.shortcut-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  min-height: 110px;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.shortcut-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.shortcut-add-btn .add-icon {
  font-size: 1.8rem;
  line-height: 1;
}

/* ─── Suggestions Grid ──────────────────────────────────── */
.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.suggestion-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.suggestion-tile:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.suggestion-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
}

/* ─── Weather Widget ────────────────────────────────────── */
.weather-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.weather-icon { width: 64px; height: 64px; }

.weather-info {}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.weather-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.weather-city {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.weather-details {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.weather-demo-badge {
  font-size: 0.7rem;
  background: rgba(250, 204, 21, 0.15);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

/* ─── Cards & Panels ────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ─── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-card); }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }

.btn--secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn--secondary:hover { color: var(--text-primary); border-color: var(--accent); }

.btn--danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.btn--danger:hover { background: rgba(248,113,113,0.25); }

.btn--success { background: rgba(74,222,128,0.15); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }
.btn--success:hover { background: rgba(74,222,128,0.25); }

.btn--sm { padding: 6px 14px; font-size: 0.82rem; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--full { width: 100%; justify-content: center; }

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

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--success { background: rgba(74,222,128,0.15); color: var(--success); }
.badge--danger  { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge--info    { background: rgba(96,165,250,0.15);  color: var(--info); }
.badge--warning { background: rgba(250,204,21,0.15);  color: var(--warning); }

/* ─── Alerts / Flash Messages ───────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert--success { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3); color: var(--success); }
.alert--danger  { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }
.alert--info    { background: rgba(96,165,250,0.1);  border: 1px solid rgba(96,165,250,0.3);  color: var(--info); }
.alert--warning { background: rgba(250,204,21,0.1);  border: 1px solid rgba(250,204,21,0.3);  color: var(--warning); }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.modal-overlay.is-open .modal { transform: scale(1) translateY(0); }

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal__title { font-size: 1.1rem; font-weight: 600; }

.modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.modal__close:hover { color: var(--text-primary); }

/* ─── Auth Pages ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}

.auth-logo h1 { font-size: 1.4rem; font-weight: 700; }
.auth-logo p  { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

.auth-divider {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 20px 0;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--bg-card); }

/* ─── Admin Sidebar ─────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}

.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
}

.admin-sidebar__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.admin-main { padding: 32px; overflow-x: hidden; }

/* ─── Settings ──────────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 32px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.settings-nav {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.settings-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.settings-nav a:hover,
.settings-nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.settings-section { margin-bottom: 32px; }

/* ─── Color Picker ──────────────────────────────────────── */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-picker {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-input);
}

/* ─── Page Title ─────────────────────────────────────────── */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state__icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state__title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state__text { font-size: 0.875rem; color: var(--text-muted); }

/* ─── Loader ─────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard__content { padding: 24px 16px 48px; }

  .search-greeting { font-size: 1.5rem; }

  .shortcut-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
  }

  .shortcut-tile { min-height: 90px; padding: 16px 8px; }

  .weather-widget { flex-wrap: wrap; gap: 12px; }
  .weather-details { margin-left: 0; }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-nav a { padding: 8px 12px; }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .auth-card { padding: 28px 20px; }

  .navbar { padding: 0 16px; }
  .navbar__nav { display: none; }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }

.shortcut-tile { animation: fadeIn 0.3s ease both; }
.shortcut-tile:nth-child(1)  { animation-delay: 0.03s; }
.shortcut-tile:nth-child(2)  { animation-delay: 0.06s; }
.shortcut-tile:nth-child(3)  { animation-delay: 0.09s; }
.shortcut-tile:nth-child(4)  { animation-delay: 0.12s; }
.shortcut-tile:nth-child(5)  { animation-delay: 0.15s; }
.shortcut-tile:nth-child(6)  { animation-delay: 0.18s; }
.shortcut-tile:nth-child(7)  { animation-delay: 0.21s; }
.shortcut-tile:nth-child(8)  { animation-delay: 0.24s; }

/* ─── Drag Handle ────────────────────────────────────── */
.drag-handle {
  position: absolute;
  top: 6px;
  left: 7px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: grab;
  opacity: 0;
  transition: opacity var(--transition);
  line-height: 1;
  user-select: none;
}

.shortcut-tile:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.shortcut-tile { cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   STARTPAGE – neues Layout (passend zum Screenshot)
   ═══════════════════════════════════════════════════════ */

.startpage {
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  display: flex;
  flex-direction: column;
}

.startpage--bg { background-size: cover; background-position: center; background-attachment: fixed; }

.startpage__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

.startpage__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  width: 100%;
}

/* ── Wetter-Bar oben rechts ── */
.weather-bar {
  position: fixed;
  top: 68px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30,32,48,.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 8px 16px;
  font-size: .88rem;
  z-index: 50;
}

.weather-bar__icon  { font-size: 1.3rem; }
.weather-bar__temp  { font-weight: 700; }
.weather-bar__city  { color: var(--text-secondary); }
.weather-bar__desc  { color: var(--text-muted); font-size: .8rem; }
.weather-bar__cached{ font-size: .75rem; opacity: .5; }

/* ── Uhrzeit ── */
.sp-greeting { margin: 20px 0 8px; text-align: center; }
.sp-time {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #e2e4f0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Suchleiste ── */
.sp-search-wrap { position: relative; max-width: 640px; margin: 28px auto 40px; }

.sp-search {
  display: flex;
  align-items: center;
  background: rgba(30,32,48,.9);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.sp-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sp-search__engine-btn {
  background: transparent;
  border: none;
  width: 52px;
  height: 52px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sp-search__engine-btn img { width: 22px; height: 22px; object-fit: contain; }

.sp-search__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-main);
  padding: 0 12px;
  outline: none;
  height: 52px;
}

.sp-search__input::placeholder { color: var(--text-muted); }

.sp-search__btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color .2s;
  flex-shrink: 0;
}
.sp-search__btn:hover { color: var(--accent); }

/* Engine-Dropdown */
.engine-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 200;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.engine-dropdown.is-open { display: block; }

.engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: .88rem;
  font-family: var(--font-main);
  width: 100%;
  transition: background .15s, color .15s;
}
.engine-option img { width: 18px; height: 18px; object-fit: contain; }
.engine-option:hover, .engine-option.is-active { background: var(--bg-card); color: var(--text-primary); }

/* ── Section ── */
.sp-section { margin-bottom: 36px; }

.sp-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sp-section__label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sp-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .82rem;
  font-family: var(--font-main);
  padding: 5px 12px;
  cursor: pointer;
  transition: all .2s;
}
.sp-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Kachel-Grid ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* ── Einzelne Kachel ── */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 10px 14px;
  background: rgba(30,32,48,.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
  min-height: 130px;
  text-align: center;
  user-select: none;
  outline: none;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.15);
  background: rgba(40,43,65,.95);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.tile:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.tile--add { border-style: dashed; border-color: var(--border); }
.tile--add:hover { border-color: var(--accent); }

.tile.sortable-ghost   { opacity: .35; }
.tile.sortable-chosen  { transform: scale(1.04); box-shadow: 0 16px 48px rgba(0,0,0,.5); }

/* Logo-Bereich */
.tile__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  flex-shrink: 0;
}

.tile__logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.tile__letter {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tile__label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}

.tile:hover .tile__label { color: var(--text-primary); }

/* Actions (Edit/Delete) */
.tile__actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
}
.tile:hover .tile__actions { display: flex; }

.tile__action-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  color: var(--text-secondary);
  transition: background .15s;
}
.tile__action-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.tile__action-btn--del:hover { background: rgba(248,113,113,.25); color: var(--danger); }

/* Drag-Handle */
.tile__drag-handle {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1;
}
.tile:hover .tile__drag-handle { opacity: 1; }
.tile__drag-handle:active { cursor: grabbing; }

/* ── Vorschläge ── */
.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(30,32,48,.8);
  border: 1px solid var(--border);
  border-radius: 40px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  transition: all .18s;
}
.suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(40,43,65,.9);
  transform: translateY(-2px);
}
.suggestion-chip__icon { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }

/* ── Modal Footer ── */
.modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .sp-time { font-size: 2.4rem; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .tile { min-height: 110px; padding: 12px 8px 10px; }
  .tile__logo { width: 56px; height: 56px; }
  .tile__logo img { width: 42px; height: 42px; }
  .weather-bar { font-size: .78rem; top: 66px; right: 12px; padding: 6px 12px; }
  .weather-bar__desc { display: none; }
}

/* ─── Clock / Date ─────────────────────────────────────── */
.sp-date {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: .02em;
  margin-top: 4px;
}

/* ─── Clock-Option Radio-Cards ─────────────────────────── */
.clock-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  transition: border-color .15s, background .15s;
}
.clock-option:hover   { border-color: var(--accent); }
.clock-option.is-active,
.clock-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}



/* ═══════════════════════════════════════════════════════
   COLOR VARIABLE OVERRIDES
   Diese ans Ende der style.css anhängen
   ═══════════════════════════════════════════════════════ */

/* Kacheln – nutzen jetzt --tile-bg */
.tile {
  background: var(--tile-bg, rgba(30,32,48,0.8));
  border: 1px solid rgba(255,255,255,0.07);
}
.tile:hover {
  background: color-mix(in srgb, var(--tile-bg, rgba(30,32,48,0.8)) 85%, white 15%);
  border-color: rgba(255,255,255,0.15);
}
.tile--add {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
}
.tile--add:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* Vorschläge-Chips */
.suggestion-chip {
  background: var(--suggestion-bg, rgba(30,32,48,0.85));
  border: 1px solid rgba(255,255,255,0.07);
}
.suggestion-chip:hover {
  background: color-mix(in srgb, var(--suggestion-bg, rgba(30,32,48,0.85)) 85%, white 15%);
  border-color: var(--accent);
}

/* Suchleiste */
.sp-search {
  background: var(--search-bg, rgba(30,32,48,0.9));
  border: 1px solid rgba(255,255,255,0.07);
}
.sp-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Opacity-Slider Styling */
.opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, transparent, var(--accent));
  outline: none;
  cursor: pointer;
}
.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.opacity-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* Color-Picker Grid */
.color-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .color-settings-grid { grid-template-columns: 1fr; }
}

.color-setting-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.color-setting-item label.form-label {
  margin-bottom: 10px;
  display: block;
}
.color-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-preview-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  transition: background .15s;
}
/* ─── Remember-Me Label ────────────────────────────────── */
.remember-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--text-secondary);
}
.remember-label:hover { color: var(--text-primary); }
