:root {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --text: #152235;
  --muted: #69768c;
  --line: rgba(15, 23, 42, 0.08);
  --brand: #8c2f5d;
  --brand-2: #d9a6bf;
  --brand-3: #f8e7ef;
  --blue: #3b82f6;
  --green: #16a34a;
  --gold: #eab308;
  --rose: #ec4899;
  --dark: #0f172a;
  --danger: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #fff1f7, transparent 26%), linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 320px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 24px;
  border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand img { width: 62px; height: 62px; object-fit: contain; border-radius: 16px; background: #fff; }
.brand strong { display: block; font-size: 1rem; }
.brand span { color: var(--muted); font-size: .86rem; }
.menu { display: grid; gap: 10px; }
.menu a {
  padding: 14px 16px; border-radius: 18px; border: 1px solid transparent; background: rgba(255,255,255,.8); box-shadow: 0 4px 18px rgba(15,23,42,.04);
  color: var(--text); font-weight: 700;
}
.menu a:hover, .menu a.active { background: linear-gradient(135deg, #fff, #fff5f9); border-color: rgba(140,47,93,.14); color: var(--brand); }
.content { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.title h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.title p { margin: 0; color: var(--muted); max-width: 880px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions.align-end { align-items: end; }
.actions.wrap form { display: inline-flex; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px;
  padding: 13px 18px; border: 1px solid transparent; cursor: pointer; font-weight: 800; font-size: .95rem;
  box-shadow: 0 10px 24px rgba(15,23,42,.08); background: #fff;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #ef4444, var(--danger)); color: #fff; }
.btn-success { background: linear-gradient(135deg, #22c55e, var(--green)); color: #fff; }
.btn-info { background: linear-gradient(135deg, #60a5fa, var(--blue)); color: #fff; }
.grid { display: grid; gap: 20px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.two-panels { grid-template-columns: 1.1fr .9fr; }
.card {
  background: linear-gradient(180deg, #fff, #fbfcff); border: 1px solid var(--line); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow);
}
.white-card { background: #fff; }
.card h2, .card h3 { margin: 0 0 12px; }
.kpi strong { display: block; font-size: 2.3rem; margin-bottom: 8px; color: var(--brand); }
.kpi span { color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick-card {
  display: block; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: #fff;
  min-height: 118px; transition: transform .15s ease, box-shadow .15s ease;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(15,23,42,.08); }
.quick-card strong { display: block; font-size: 1rem; margin-bottom: 8px; }
.quick-card span { color: var(--muted); font-size: .93rem; line-height: 1.45; }
.quick-card.violet { background: linear-gradient(180deg, #fff, #fff2f8); }
.quick-card.blue { background: linear-gradient(180deg, #fff, #eef6ff); }
.quick-card.green { background: linear-gradient(180deg, #fff, #eefbf1); }
.quick-card.gold { background: linear-gradient(180deg, #fff, #fff8df); }
.quick-card.rose { background: linear-gradient(180deg, #fff, #fff0f7); }
.quick-card.dark { background: linear-gradient(180deg, #fff, #f3f6fb); }
.page-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.page-badge {
  padding: 10px 14px; border-radius: 999px; background: #f7f9fd; border: 1px solid var(--line); font-weight: 700;
}
.page-badge.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.page-list { display: grid; gap: 12px; }
.page-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px;
  border-radius: 18px; border: 1px solid var(--line); background: #fbfcff;
}
.page-list-item.active { border-color: rgba(140,47,93,.25); background: #fff5f9; }
.page-list-item span, .mini-item span, .backup-row span, .small, .dark { color: var(--muted); }
.check-stack { display: grid; gap: 12px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { padding: 8px 12px; border-radius: 999px; background: #f4f7fd; border: 1px solid var(--line); font-size: .85rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid rgba(15,23,42,.08); text-align: left; vertical-align: top; }
.light-table thead th { color: var(--muted); font-size: .88rem; }
input[type=text], input[type=password], input[type=email], input[type=file], textarea, select {
  width: 100%; border-radius: 18px; border: 1px solid rgba(15,23,42,.12); background: #fbfcff;
  color: var(--text); padding: 14px 16px; outline: none;
}
textarea { min-height: 180px; resize: vertical; }
label { display: block; margin-bottom: 8px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full { grid-column: 1 / -1; }
.notice { padding: 14px 18px; border-radius: 18px; margin-bottom: 18px; }
.notice.success { background: #ecfdf3; border: 1px solid #bbf7d0; }
.notice.error { background: #fef2f2; border: 1px solid #fecaca; }
.notice.info { background: #eff6ff; border: 1px solid #bfdbfe; }
.file-code { min-height: 430px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.dark-code { background: #0f172a; color: #e5eefc; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 560px); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.white-media-card { background: #fff; }
.media-card { overflow: hidden; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.media-card img { width: 100%; height: 230px; object-fit: cover; background: #f4f6fb; }
.media-card .body { padding: 14px; }
.media-advanced-grid { grid-template-columns: repeat(2, 1fr); }
.content-editor-grid { grid-template-columns: repeat(2, 1fr); }
.content-item.hero-title textarea { min-height: 90px; font-size: 1.02rem; font-weight: 700; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.item-head.compact { margin-bottom: 4px; }
.tag-badge { display: inline-flex; padding: 6px 10px; background: #f2f5fb; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 800; margin-right: 8px; }
.builder-grid { grid-template-columns: 1fr; }
.builder-card { padding-bottom: 18px; }
.builder-edit-form textarea { min-height: 260px; }
.section-mini-list, .backup-list { display: grid; gap: 12px; }
.mini-item, .backup-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  background: #fbfcff; border: 1px solid var(--line); border-radius: 18px;
}
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.palette-preview { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.palette-preview span { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.page-badge, .page-list-item, .mini-item strong, .backup-row strong { word-break: break-word; }
.sticky-actions { position: sticky; bottom: 16px; padding: 12px; background: rgba(244,246,251,.8); backdrop-filter: blur(12px); border-radius: 18px; }
.white-form input, .white-form textarea, .white-form select { background: #fff; }
@media (max-width: 1260px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid.stats, .action-grid, .two-panels, .gallery-grid, .content-editor-grid, .media-advanced-grid, .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 18px; }
  .grid.stats, .action-grid, .two-panels, .gallery-grid, .content-editor-grid, .media-advanced-grid, .form-grid { grid-template-columns: 1fr; }
  .topbar, .item-head, .page-list-item, .mini-item, .backup-row { flex-direction: column; align-items: flex-start; }
}
