/* =============================================
   EMM Command Center – Shared Stylesheet
   ============================================= */

/* -- CSS Variables (Dark Mode = Default) -- */
:root {
  --bg: #08090c;
  --bg2: #0e1017;
  --surface: rgba(20, 23, 32, 0.7);
  --surface-solid: #141720;
  --surface2: #1a1e2a;
  --surface-hover: rgba(31, 36, 53, 0.8);
  --border: rgba(35, 40, 56, 0.6);
  --border-solid: #232838;
  --border2: #2d3348;
  --text: #f5f6fa;
  --text2: #c8cdd8;
  --text3: #9ba1b4;
  --accent: #6366f1;
  --accent2: #818cf8;
  --accent-glow: rgba(99,102,241,.15);
  --green: #22c55e;
  --green2: #4ade80;
  --green-bg: rgba(34,197,94,.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,.08);
  --orange: #f59e0b;
  --orange-bg: rgba(245,158,11,.08);
  --blue: #3b82f6;
  --blue-bg: rgba(59,130,246,.08);
  --purple: #a855f7;
  --purple-bg: rgba(168,85,247,.08);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6,182,212,.08);
  --pink: #ec4899;
  --pink-bg: rgba(236,72,153,.08);
  --glass-bg: rgba(20, 23, 32, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-blur: blur(12px);
}

/* -- Light Mode Overrides -- */
:root.light {
  --bg: #f0f2f5;
  --bg2: #e4e7ec;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-solid: #ffffff;
  --surface2: #f7f8fa;
  --surface-hover: rgba(238, 240, 244, 0.8);
  --border: rgba(213, 217, 226, 0.6);
  --border-solid: #d5d9e2;
  --border2: #bfc5d2;
  --text: #111318;
  --text2: #2a2f3d;
  --text3: #4a5066;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --blue: #2563eb;
  --purple: #9333ea;
  --cyan: #0891b2;
  --pink: #db2777;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
html.light body { color: var(--text); background: var(--bg); }
html.light input, html.light select, html.light textarea { color: var(--text); background: var(--surface-solid); }
html.light ::placeholder { color: var(--text3); }

/* -- Base Styles -- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* -- Background Effects (subtile Gradients) -- */
body::before {
  content: '';
  position: fixed;
  top: -30%; left: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(99,102,241,.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%; right: -10%;
  width: 50%; height: 50%;
  background: radial-gradient(ellipse, rgba(168,85,247,.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* -- Portal Background Image (nur Portal-Seite) -- */
.bg-image {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('/bg-portal.jpeg') center/cover no-repeat;
  z-index: 0;
  transition: opacity .3s;
}
.bg-image.off { display: none; }
.bg-image.off + .bg-overlay { display: none; }
.bg-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8,9,12, 0.6);
  z-index: 0;
  transition: background .3s;
}
html.light .bg-overlay { background: rgba(200,205,215, 0.6); }
body.has-bg { background: transparent !important; }
body.has-bg::before, body.has-bg::after { display: none; }

/* -- Shell / Container -- */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 60px;
  position: relative;
  z-index: 1;
}

/* -- Header -- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.header-title p {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}

/* -- Portal Button -- */
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.portal-btn:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}

/* -- Logo Mark (Portal) -- */
.logo-mark {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* -- User Badge + Clock -- */
.header-time {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text2);
  background: var(--surface-solid);
  border: 1px solid var(--border-solid);
  padding: 8px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-time .dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease infinite;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border-solid);
  padding: 6px 14px 6px 6px;
  border-radius: 10px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.user-name { font-size: 13px; font-weight: 500; }
.logout-btn {
  font-size: 12px;
  color: var(--text3);
  background: var(--surface-solid);
  border: 1px solid var(--border-solid);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.logout-btn:hover { color: var(--red); border-color: rgba(239,68,68,.3); }

/* -- Info Button -- */
.info-hint-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 1px solid var(--border-solid);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  line-height: 1;
}
.info-hint-btn:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* -- Glassmorphism Tiles/Cards -- */
.tile, .card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.tile:hover, .card:hover {
  border-color: rgba(255,255,255,0.15);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255,255,255,0.05);
}
html.light .tile:hover, html.light .card:hover {
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 30px rgba(0,0,0,.1);
}

/* Glass shine effect on hover */
.tile::after, .card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transition: left .5s ease;
  pointer-events: none;
}
.tile:hover::after, .card:hover::after {
  left: 100%;
}

/* Top accent line on hover */
.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity .2s;
}
.tile:hover::before { opacity: 1; }

/* -- Tile Variants (accent lines) -- */
.tile-spam::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.tile-todo::before { background: linear-gradient(90deg, var(--orange), #f97316); }
.tile-infotafel::before { background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.tile-notizen::before { background: linear-gradient(90deg, var(--pink), var(--purple)); }
.tile-konten::before { background: linear-gradient(90deg, var(--accent), var(--blue)); }
.tile-firmen::before { background: linear-gradient(90deg, var(--orange), var(--red)); }
.tile-benutzer::before { background: linear-gradient(90deg, var(--purple), var(--accent)); }
.tile-server::before { background: linear-gradient(90deg, var(--green), var(--accent)); }
.tile-projekte::before { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.tile-backends::before { background: linear-gradient(90deg, #d4af37, #f5d76e); }
.tile-netzwerk::before { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.tile-telefonie::before { background: linear-gradient(90deg, var(--blue), var(--cyan)); }

/* -- Tile Inner Elements -- */
.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.tile-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.tile-spam .tile-icon { background: var(--green-bg); }
.tile-todo .tile-icon { background: var(--orange-bg); }
.tile-infotafel .tile-icon { background: var(--cyan-bg); }
.tile-notizen .tile-icon { background: var(--pink-bg); }
.tile-konten .tile-icon { background: var(--accent-glow); }
.tile-firmen .tile-icon { background: var(--orange-bg); }
.tile-benutzer .tile-icon { background: var(--purple-bg); }
.tile-server .tile-icon { background: var(--green-bg); }
.tile-projekte .tile-icon { background: var(--blue-bg); }
.tile-backends .tile-icon { background: rgba(212,175,55,.1); }
.tile-netzwerk .tile-icon { background: rgba(6,182,212,.12); }
.tile-telefonie .tile-icon { background: rgba(59,130,246,.1); }

.tile-status {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 6px;
  display: flex; align-items: center; gap: 5px;
}
.status-live { color: var(--green); background: var(--green-bg); }
.status-coming { color: var(--text3); background: rgba(85,90,110,.15); }
.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.tile-title {
  font-size: 16px; font-weight: 600;
  margin-bottom: 4px; letter-spacing: -0.2px;
}
.tile-desc {
  font-size: 12px; color: var(--text3);
  margin-bottom: 18px; line-height: 1.4;
}
.tile-stats { display: flex; gap: 16px; }
.tile-stat { flex: 1; }
.tile-stat-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 20px; font-weight: 600; letter-spacing: -0.5px;
}
.tile-stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* -- Color utility classes -- */
.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.blue { color: var(--blue); }
.purple { color: var(--purple); }
.cyan { color: var(--cyan); }
.pink { color: var(--pink); }

/* -- Mini Progress Bars -- */
.mini-bar {
  height: 3px; background: var(--border-solid);
  border-radius: 2px; margin-top: 16px; overflow: hidden;
}
.mini-bar-fill {
  height: 100%; border-radius: 2px; transition: width 1s ease;
}
.mini-bar-fill.green { background: var(--green); }
.mini-bar-fill.blue { background: var(--blue); }
.mini-bar-fill.purple { background: var(--purple); }
.mini-bar-fill.orange { background: var(--orange); }

/* -- Section Labels -- */
.section-label {
  font-size: 11px; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  padding-left: 4px;
}

/* -- Tiles Grid -- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .shell { padding: 20px 16px 40px; }
}

/* -- Server Monitor Rows (portal) -- */
.server-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.server-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border-radius: 6px;
  background: rgba(255,255,255,0.03); font-size: 12px;
}
.server-row:hover { background: rgba(255,255,255,0.06); }
.srv-name { font-weight: 600; color: var(--text); min-width: 80px; }
.srv-metrics { display: flex; gap: 12px; }
.srv-metric { display: flex; align-items: center; gap: 4px; color: var(--text2); font-size: 11px; }
.srv-metric .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.srv-metric .val.green { color: var(--green); }
.srv-metric .val.orange { color: var(--orange); }
.srv-metric .val.red { color: var(--red); }
.srv-metric .val.cyan { color: var(--cyan); }
.srv-metric .val.blue { color: var(--blue); }

/* -- Footer -- */
.footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; border-top: 1px solid var(--border-solid); margin-top: 20px;
}
.footer-bar span { font-size: 11px; color: var(--text3); }
.footer-bar a { color: var(--accent2); text-decoration: none; }

/* -- Modals -- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s;
}
.modal-overlay.show, .modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 32px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal-sm { max-width: 480px; }

/* -- Hint Overlay + Page Hint -- */
.hint-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s;
}
.modal-overlay.show, .modal-overlay.open {
  display: flex;
}
.hint-overlay.show { display: flex; }
.hint-header h2 { font-size: 20px; margin-bottom: 6px; }
.hint-header p { color: var(--text2); font-size: 13px; margin-bottom: 24px; }
.hint-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 24px;
}
.hint-card {
  background: var(--bg2); border: 1px solid var(--border-solid);
  border-radius: 12px; padding: 16px;
}
.hint-card.hint-new {
  border-color: var(--accent); background: rgba(99,102,241,.05);
}
.hint-card-icon { font-size: 24px; margin-bottom: 8px; }
.hint-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hint-card-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }
.hint-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.hint-dismiss {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text2); cursor: pointer;
}
.hint-dismiss input { accent-color: var(--accent); }
.hint-close-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 24px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.hint-close-btn:hover { background: var(--accent2); }

.page-hint-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.page-hint-overlay.show { display: flex; }
.page-hint-content {
  font-size: 14px; line-height: 1.7;
  color: var(--text); margin-bottom: 20px;
  text-align: center;
}
@media (max-width: 600px) { .hint-grid { grid-template-columns: 1fr; } }

/* -- Buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border-solid);
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer; transition: all .2s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border2); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-danger { color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--red-bg); }

/* -- Form Elements -- */
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* -- Theme Toggle + BG Toggle (injected by theme.js) -- */
#themeToggle, #bgToggle {
  background: none; border: none;
  color: var(--text2);
  font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
  transition: all .2s; line-height: 1;
}
#themeToggle:hover, #bgToggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* -- Animations -- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.tile { animation: fadeUp .4s ease backwards; }
.tile:nth-child(1) { animation-delay: .05s; }
.tile:nth-child(2) { animation-delay: .1s; }
.tile:nth-child(3) { animation-delay: .15s; }
.tile:nth-child(4) { animation-delay: .2s; }
.tile:nth-child(5) { animation-delay: .25s; }
.tile:nth-child(6) { animation-delay: .3s; }
.tile:nth-child(7) { animation-delay: .35s; }
.tile:nth-child(8) { animation-delay: .4s; }
.tile:nth-child(9) { animation-delay: .45s; }

/* -- Tile Color Tints (Portal) -- */
.tile-spam { box-shadow: inset 0 0 60px rgba(34,197,94,0.07); }
.tile-todo { box-shadow: inset 0 0 60px rgba(245,158,11,0.07); }
.tile-infotafel { box-shadow: inset 0 0 60px rgba(6,182,212,0.07); }
.tile-notizen { box-shadow: inset 0 0 60px rgba(236,72,153,0.07); }
.tile-konten { box-shadow: inset 0 0 60px rgba(99,102,241,0.07); }
.tile-firmen { box-shadow: inset 0 0 60px rgba(245,158,11,0.07); }
.tile-benutzer { box-shadow: inset 0 0 60px rgba(168,85,247,0.07); }
.tile-server { box-shadow: inset 0 0 60px rgba(34,197,94,0.07); }
.tile-projekte { box-shadow: inset 0 0 60px rgba(59,130,246,0.07); }
.tile-backends { box-shadow: inset 0 0 60px rgba(212,175,55,0.07); }
.tile-netzwerk { box-shadow: inset 0 0 60px rgba(6,182,212,0.07); }
.tile-telefonie { box-shadow: inset 0 0 60px rgba(59,130,246,0.07); }
html.light .tile-spam { box-shadow: inset 0 0 60px rgba(34,197,94,0.12); }
html.light .tile-todo { box-shadow: inset 0 0 60px rgba(245,158,11,0.12); }
html.light .tile-infotafel { box-shadow: inset 0 0 60px rgba(6,182,212,0.12); }
html.light .tile-notizen { box-shadow: inset 0 0 60px rgba(236,72,153,0.12); }
html.light .tile-konten { box-shadow: inset 0 0 60px rgba(99,102,241,0.12); }
html.light .tile-firmen { box-shadow: inset 0 0 60px rgba(245,158,11,0.12); }
html.light .tile-benutzer { box-shadow: inset 0 0 60px rgba(168,85,247,0.12); }
html.light .tile-server { box-shadow: inset 0 0 60px rgba(34,197,94,0.12); }
html.light .tile-projekte { box-shadow: inset 0 0 60px rgba(59,130,246,0.12); }
html.light .tile-backends { box-shadow: inset 0 0 60px rgba(212,175,55,0.12); }
html.light .tile-netzwerk { box-shadow: inset 0 0 60px rgba(6,182,212,0.12); }
html.light .tile-telefonie { box-shadow: inset 0 0 60px rgba(59,130,246,0.12); }

/* -- Tile Color Picker (Portal) -- */
.tile-color-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, transform 0.15s;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--surface-solid);
  line-height: 1;
}
html.light .tile-color-btn {
  border-color: rgba(0,0,0,0.1);
}
.tile:hover .tile-color-btn { opacity: 1; }
.tile-color-btn:hover {
  transform: scale(1.15);
  border-color: var(--accent);
}

.tile-color-picker {
  position: absolute;
  top: 40px;
  right: 8px;
  z-index: 50;
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 8px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: fadeIn .15s;
}
html.light .tile-color-picker {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.tile-color-picker.open {
  display: grid;
}

.tile-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.tile-color-swatch:hover {
  transform: scale(1.15);
}
.tile-color-swatch.active {
  border-color: var(--accent);
}
.tile-color-swatch.swatch-none {
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text3);
}

/* Tinted tile background */
.tile.tinted {
  background: linear-gradient(var(--tile-tint), var(--tile-tint)), var(--glass-bg);
}
html.light .tile.tinted {
  background: linear-gradient(var(--tile-tint), var(--tile-tint)), var(--glass-bg);
}

/* -- Page Tint (Sub-pages accent from tile color) -- */
.page-tinted {
  background: linear-gradient(var(--page-tint) 0%, var(--page-tint-low) 80%), var(--bg) !important;
}
.page-tinted::before {
  background: radial-gradient(ellipse at top left, var(--page-tint) 0%, transparent 70%) !important;
}
