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

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0b0b0b;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0b0b0b;
  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;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}


header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 11, 11, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0.8rem;
  border-radius: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

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.8rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-user {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
}

.header-user-name {
  font-size: 0.85rem;
  color: var(--text);
}

.header-user-meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.header-sep {
  opacity: 0.6;
}

.header-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.header-buttons form {
  margin: 0;
}

.header-password {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.5rem 0.7rem;
  align-items: end;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  min-width: 320px;
}

.header-password label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.header-password input {
  background: #111;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
}

.header-password-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.header-password-status {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .header-user {
    text-align: left;
  }
  .header-password {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.btn-simple {
  border: 1px solid rgba(0, 230, 118, 0.55);
  background: rgba(0, 230, 118, 0.18);
  color: #e8ffe8;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-simple:hover {
  border-color: var(--accent-hover);
  background: rgba(178, 255, 89, 0.22);
  color: #f2ffe0;
}

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

.btn-danger {
  border-color: rgba(255, 82, 82, 0.7);
  background: rgba(255, 82, 82, 0.18);
  color: #ffd6d6;
}

.btn-danger:hover {
  border-color: var(--danger-hover);
  background: rgba(255, 23, 68, 0.28);
  color: #fff1f1;
}

.btn-save {
  border-color: rgba(255, 183, 77, 0.7);
  background: rgba(255, 183, 77, 0.2);
  color: #fff5d6;
}

.btn-save:hover {
  border-color: var(--warn-hover);
  background: rgba(255, 224, 130, 0.3);
  color: #fffbe6;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.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;
  z-index: 0;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    border-color 0.15s ease-out;
  width: 100%;
  margin-bottom: 0;
}

.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-left .tile-actions {
  flex-direction: column;
  gap: 0.1rem;
}

.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 {
  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;
  }

  /* 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,
  .btn-popout {
    display: none;
  }
}
