:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --panel-alt: #181818;
  --border: #333;
  --accent: #00e676;
  --accent-soft: #00c85333;
  --text: #eee;
  --muted: #aaa;
  --danger: #ff5252;
  --radius: 14px;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c1c1c, #0b0b0b 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.drag-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.btn-simple {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-simple:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: minmax(160px, auto);
  gap: 1rem;
  align-items: start;
}

.tile {
  background: linear-gradient(145deg, var(--panel), var(--panel-alt));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  position: relative;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    border-color 0.15s ease-out;
}

.tile.dragging {
  opacity: 0.7;
  transform: scale(1.02);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.7);
  border-style: dashed;
}

.tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.7rem 0.4rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.tile-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tile-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

.tile-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.tile-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
  min-width: 1.3rem;
  text-align: center;
}

.tile-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

.tile-body {
  padding: 0.7rem 0.9rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
}

.pill-accent {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: #e8ffe8;
}

.pill-danger {
  border-color: rgba(255, 82, 82, 0.4);
  background: rgba(255, 82, 82, 0.1);
  color: #ffc3c3;
}

.pill-muted {
  color: var(--muted);
}

/* Minimized állapot */
.tile.minimized .tile-body {
  display: none;
}

.tile.minimized {
  grid-row: auto;
  min-height: 0;
}

/* Maximized: teljes sor */
.tile.maximized {
  grid-column: 1 / -1;
  min-height: 280px;
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.tile-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tile-titles {
  display: flex;
  flex-direction: column;
}

.btn-drag {
  cursor: grab;
}
.btn-drag:active {
  cursor: grabbing;
}


@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  /* Mobilon mindig 1 oszlop */
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Gombok legyenek egy kicsit nagyobbak ujjra */
  .tile-btn {
    padding: 0.25rem 0.45rem;
    min-width: 1.8rem;
    font-size: 1rem;
  }

  /* Maximalizálás gomb mobilon nem kell látszódjon */
  .btn-max {
    display: none;
  }
}

