* { box-sizing: border-box; }
body.admin-body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f6f5f8; color: #1f1b2e;
}
a { color: #6b4fe0; }

.admin-topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; background: #1f1b2e; color: #fff; }
.admin-brand { color: #fff; font-weight: 700; text-decoration: none; }
.admin-nav a { color: #cfc9e6; text-decoration: none; margin-left: 22px; font-size: 14px; }
.admin-nav a:hover { color: #fff; }

.admin-main { max-width: 1000px; margin: 0 auto; padding: 32px 24px 80px; }

.flash { padding: 12px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.flash-success { background: #e4f7ec; color: #1c6b40; }
.flash-error { background: #fbe6e6; color: #a12727; }

.auth-card { max-width: 380px; margin: 60px auto; background: #fff; padding: 36px; border-radius: 16px; box-shadow: 0 2px 20px rgba(0,0,0,.06); }
.auth-card h1 { margin-top: 0; font-size: 1.4rem; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.stack-form { display: grid; gap: 18px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #4a4560; font-weight: 600; }
.stack-form input[type=text], .stack-form input[type=email], .stack-form input[type=password],
.stack-form input[type=number], .stack-form input[type=date], .stack-form input[type=file],
.stack-form select, .stack-form textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #ddd8ea; border-radius: 8px; background: #fff; color: #1f1b2e;
}
.stack-form textarea { resize: vertical; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }

fieldset { border: 1px solid #e4e0f0; border-radius: 14px; padding: 20px 22px; margin: 0; background: #fff; }
legend { font-weight: 700; padding: 0 8px; font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.btn { display: inline-block; border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: #6b4fe0; color: #fff; }
.btn-primary:hover { background: #5a3fd0; }
.btn-secondary { background: #efecfa; color: #4a3caa; }
.btn-secondary:hover { background: #e2ddf7; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.table-wrap { overflow-x: auto; background: #fff; border-radius: 14px; box-shadow: 0 2px 20px rgba(0,0,0,.05); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0eef7; white-space: nowrap; }
.admin-table th { color: #8a84a3; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.row-actions a { margin-right: 12px; font-size: 13px; }
.danger-link { color: #c0392b !important; }

.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.badge-draft { background: #f0eef7; color: #6a637f; }
.badge-approved { background: #e4f7ec; color: #1c6b40; }

.theme-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.theme-swatch { flex-direction: row !important; align-items: center; gap: 8px !important; border: 1px solid #ddd8ea; border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer; font-size: 13px; font-weight: 400 !important; }
.theme-swatch input { margin: 0; }
.swatch-dots { display: inline-flex; gap: 2px; }
.swatch-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.1); }

.repeat-row, .item-row, .gallery-block { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.item-row { grid-template-columns: 1fr 90px auto; }
.item-row-3 { grid-template-columns: 1fr 70px 1.4fr auto; }
.gallery-block { grid-template-columns: 110px 130px 1fr 1fr auto; }
.gallery-block .gal-upload-status { grid-column: span 1; font-size: 12px; color: #6a637f; }
@media (max-width: 800px) { .gallery-block { grid-template-columns: 1fr 1fr; } }

.btn-remove-row { background: #fbe6e6; color: #a12727; border: none; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 1; }

.event-block { border: 1px solid #e4e0f0; border-radius: 12px; padding: 16px; margin-bottom: 16px; background: #fbfaff; }
.event-block-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.event-block-head .ev-type { flex: 1; padding: 10px 12px; border: 1px solid #ddd8ea; border-radius: 8px; font: inherit; }
.sub-block { margin-top: 14px; }
.sub-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #8a84a3; margin: 0 0 8px; }
.items-list input[type=text] { padding: 8px 10px; border: 1px solid #ddd8ea; border-radius: 6px; font: inherit; }
.items-list input[type=number] { padding: 8px 10px; border: 1px solid #ddd8ea; border-radius: 6px; font: inherit; }

.logo-preview { max-height: 50px; margin-top: 8px; display: block; }
.muted { color: #8a84a3; }
.settings-form fieldset { display: grid; gap: 14px; }
