* { box-sizing: border-box; font-family: "Segoe UI", Arial, sans-serif; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(191, 219, 254, 0.25), transparent 38%),
    radial-gradient(circle at 90% 0%, rgba(216, 180, 254, 0.22), transparent 42%),
    #f7f9fc;
  color: #1f2937;
}

.app-shell { max-width: 1280px; margin: 0 auto; padding: 24px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}
.topbar h1 { font-size: 14px; margin: 0; font-weight: 700; color: #111827; }

.card {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.04);
}

.grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }

label { display: block; font-size: 12px; color: #6b7280; margin: 10px 0 5px; font-weight: 600; }
input {
  width: 100%;
  border: 1px solid #d6deea;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  background: #fcfdff;
  color: #111827;
}
input:focus {
  outline: none;
  border-color: #7c93ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.link-row { display: flex; gap: 8px; margin-top: 10px; }

.btn {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 8px 10px; font-size: 12px; }
.btn-ghost {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #dbe3ef;
  box-shadow: none;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.2);
}

.muted { color: #6b7280; font-size: 12px; }
.error { color: #b91c1c; font-size: 12px; min-height: 16px; }
.hidden { display: none; }

.metric-list p { margin: 4px 0; font-size: 13px; color: #374151; }
.list-box {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 8px;
  background: #fbfdff;
}
.user-item { border-bottom: 1px solid #eef2f7; padding: 8px 4px; font-size: 12px; }
.user-item:last-child { border-bottom: 0; }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
h2, h3 { color: #111827; margin-top: 0; }

#loginView { max-width: 460px; margin: 26px auto 0; padding: 20px; }
#adminView .grid .card:first-child .metric-list { min-height: 140px; }

/* Bridal management redesign */
#categoriesBox { margin-top: 12px; }

.cat {
  border: 1px solid #e5ebf5;
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
  background: #fcfdff;
}

.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cat-title-wrap { display: flex; align-items: center; gap: 8px; }
.cat-emoji { font-size: 18px; }
.cat-title { font-size: 20px; color: #111827; }

.cat-controls {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
}

.field { min-width: 0; }
.field label {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-emoji input { text-align: center; }
.field-actions { display: flex; justify-content: flex-end; }

.upload-card {
  border: 1px dashed #d6deea;
  background: #f8fbff;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.upload-card input[type="file"] { padding: 8px; background: #fff; }

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

.img-card {
  border: 1px solid #e9eef6;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.img-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f7;
}

.img-info { padding: 10px; }
.img-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}
.img-url {
  margin: 0;
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-actions {
  margin-top: auto;
  padding: 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (min-width: 1100px) {
  #moodboardMgmtView .card {
    max-width: 1160px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .app-shell { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .card-head { flex-direction: column; align-items: flex-start; }
  #loginView { max-width: 100%; margin-top: 8px; }

  .cat-controls { grid-template-columns: 1fr; }
  .upload-card { grid-template-columns: 1fr; }
  .field-actions { justify-content: stretch; }
  .field-actions .btn,
  .upload-card .btn { width: 100%; }

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