:root {
  --sun-yellow: #FFE566;
  --coral: #FF8B7B;
  --mint: #7DDFC3;
  --sky: #6EC1E4;
  --lavender: #B8A9E8;
  --white: #FFFEF9;
  --ink: #2D2D2D;
  --muted: #666;
  --line: rgba(45, 45, 45, 0.1);
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(165deg, #FFF9E6 0%, #FFE8F0 35%, #E8F4FF 70%, #F0E8FF 100%);
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 229, 102, 0.3) 0%, transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(184, 169, 232, 0.25) 0%, transparent 25%),
    radial-gradient(circle at 60% 80%, rgba(125, 223, 195, 0.3) 0%, transparent 25%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: 3.5rem;
}

.hero h1 {
  font-family: "Fredoka One", cursive;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--ink);
  text-shadow:
    3px 3px 0 var(--sun-yellow),
    6px 6px 0 var(--coral),
    9px 9px 0 var(--mint);
  line-height: 1.1;
  animation: float 3s ease-in-out infinite;
}

.hero .sub {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-weight: 600;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.card {
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 40px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border: 3px solid transparent;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px var(--shadow-hover);
}

.card:nth-child(1) { border-color: rgba(255, 139, 123, 0.4); }
.card:nth-child(2) { border-color: rgba(125, 223, 195, 0.4); }
.card:nth-child(3) { border-color: rgba(184, 169, 232, 0.4); }
.card:nth-child(4) { border-color: rgba(255, 139, 123, 0.5); }
.card:nth-child(5) { border-color: rgba(255, 229, 102, 0.5); }
.card:nth-child(6) { border-color: rgba(110, 193, 228, 0.5); }
.card:nth-child(7) { border-color: rgba(125, 223, 195, 0.5); }
.card:nth-child(8) { border-color: rgba(255, 139, 123, 0.5); }

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: linear-gradient(135deg, #f8fbff, #eef6f8);
}

.card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-title {
  font-family: "Fredoka One", cursive;
  font-size: 1.35rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.card-more .card-image,
.card-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--lavender), #D4C8F0);
  font-size: 3rem;
  color: white;
  font-weight: 800;
}

footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: #888;
}

.admin-page {
  background: #f7f8fb;
}

.admin-page::before {
  display: none;
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.admin-header,
.panel-heading,
.form-row,
.actions,
.project-name {
  display: flex;
  align-items: center;
}

.admin-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-kicker {
  color: #697386;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-header h1 {
  font-size: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.panel-heading h2 {
  font-size: 1.1rem;
}

.project-form {
  padding-bottom: 20px;
}

.project-form label {
  display: grid;
  gap: 7px;
  padding: 14px 20px 0;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 700;
}

.project-form input,
.project-form select,
.project-form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
  color: #111827;
  background: #fff;
}

.project-form textarea {
  resize: vertical;
}

.form-row {
  gap: 12px;
  padding-right: 20px;
}

.form-row label {
  flex: 1;
  padding-right: 0;
}

.checkbox-field {
  align-self: end;
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  gap: 8px !important;
  min-height: 43px;
}

.checkbox-field input {
  width: auto;
}

.button {
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-form > .button {
  margin: 18px 20px 0;
  width: calc(100% - 40px);
}

.button-secondary {
  background: #e5e7eb;
  color: #111827;
}

.button-small {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 7px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.stat-card span {
  display: block;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.stat-card strong {
  color: #111827;
  font-size: 1.75rem;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
}

th {
  color: #6b7280;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.project-name {
  gap: 10px;
}

.project-name img {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  background: #f3f4f6;
}

.project-name small {
  display: block;
  color: #6b7280;
  margin-top: 2px;
}

.muted-text {
  display: block;
  color: #6b7280;
  font-size: 0.78rem;
  margin-top: 2px;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-running {
  background: #dcfce7;
  color: #166534;
}

.status-stopped {
  background: #fee2e2;
  color: #991b1b;
}

.actions {
  gap: 8px;
}

.actions form {
  margin: 0;
}

@media (max-width: 880px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

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