:root {
  --bg: #08121f;
  --bg-soft: #0e1b2d;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --text: #132033;
  --muted: #58708a;
  --accent: #2c7be5;
  --accent-2: #15b8a6;
  --line: rgba(15, 23, 42, 0.10);
  --shadow: 0 18px 50px rgba(8, 18, 31, 0.16);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(44, 123, 229, 0.20), transparent 30%),
    radial-gradient(circle at top right, rgba(21, 184, 166, 0.18), transparent 24%),
    linear-gradient(180deg, #f4f8fc 0%, #e8eef7 100%);
  font-family: "Trebuchet MS", "Gill Sans", "Verdana", sans-serif;
}

a { color: inherit; }

.cms-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.cms-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 0;
  padding: 16px 24px;
  background: linear-gradient(180deg, #0b1627 0%, #10213a 100%);
  color: #eef6ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  box-shadow: 0 18px 40px rgba(8, 18, 31, 0.22);
}

.cms-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 4px 0;
  border-bottom: 0;
  margin-bottom: 0;
  flex: 0 0 270px;
}

.cms-brand svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
}

.logo-fallback {
  fill: url(#logoGradient);
  letter-spacing: 1px;
  font-weight: 700;
  animation: logoPulse 3.2s ease-in-out infinite;
}

.cms-tagline {
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(238, 246, 255, 0.82);
}

.cms-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 540px;
  justify-content: center;
}

.cms-menu a {
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.cms-menu a:hover,
.cms-menu a:focus-visible {
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.16);
}

.cms-menu a.active {
  background: linear-gradient(135deg, rgba(44, 123, 229, 0.96), rgba(21, 184, 166, 0.92));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.cms-account {
  margin-top: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.95rem;
  flex: 0 0 260px;
}

.cms-main {
  padding: 22px 24px 24px;
}

.cms-main-inner {
  max-width: 1300px;
  margin: 0 auto;
}

.cms-hero,
.cms-card,
.cms-status {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.cms-hero {
  padding: 22px 24px;
  margin-bottom: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.cms-hero h1,
.cms-hero h2,
.cms-card h2,
.cms-status h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.cms-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.cms-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.cms-card,
.cms-status {
  padding: 22px;
}

.cms-card + .cms-card,
.cms-status + .cms-status {
  margin-top: 18px;
}

.cms-content h2,
.cms-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin-top: 0;
}

.cms-content p,
.cms-content li {
  line-height: 1.65;
}

.cms-form,
.cms-form-inline {
  display: grid;
  gap: 14px;
}

.cms-form label,
.cms-form-inline label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.cms-form input[type="text"],
.cms-form input[type="url"],
.cms-form input[type="file"],
.cms-form textarea,
.cms-form-inline input[type="text"],
.cms-form-inline textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.cms-form textarea,
.cms-form-inline textarea {
  min-height: 220px;
  resize: vertical;
}

.cms-btn,
.cms-btn-secondary,
.cms-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.cms-btn {
  color: white;
  background: linear-gradient(135deg, var(--accent), #1859a7);
  box-shadow: 0 12px 24px rgba(44, 123, 229, 0.25);
}

.cms-btn-secondary {
  color: var(--text);
  background: #eef3fa;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.cms-btn-danger {
  color: white;
  background: linear-gradient(135deg, #da4453, #89216b);
}

.cms-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.cms-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(44, 123, 229, 0.12);
  color: #144b91;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.cms-map {
  width: 100%;
  height: 470px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(8, 18, 31, 0.10);
}

.cms-chatbox {
  display: grid;
  gap: 16px;
}

.cms-chat-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6fe1ff 0%, #2c7be5 52%, #0d294b 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(44, 123, 229, 0.22);
  animation: avatarFloat 4.2s ease-in-out infinite;
}

.cms-chat-avatar::before,
.cms-chat-avatar::after {
  content: '';
  position: absolute;
  top: 26px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 8px rgba(255,255,255,0.12);
}

.cms-chat-avatar::before { left: 20px; }
.cms-chat-avatar::after { right: 20px; }

.cms-chat-avatar span {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 34px;
  height: 12px;
  border-radius: 0 0 30px 30px;
  border: 3px solid rgba(255,255,255,0.92);
  border-top: 0;
  transform: translateX(-50%);
}

.cms-chat-answer,
.cms-chat-history {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 14px;
}

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

.cms-table th,
.cms-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: top;
}

.cms-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.92rem;
}

.cms-table tr:hover td {
  background: rgba(44, 123, 229, 0.04);
}

.cms-note {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: rgba(44, 123, 229, 0.06);
  border-radius: 14px;
}

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

@keyframes logoPulse {
  0%, 100% { opacity: .85; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

@media (max-width: 992px) {
  .cms-shell { grid-template-columns: 1fr; }
  .cms-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-start;
  }
  .cms-brand,
  .cms-account,
  .cms-menu { flex: 1 1 100%; }
  .cms-menu { justify-content: flex-start; }
  .cms-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cms-main { padding: 12px; }
  .cms-hero,
  .cms-card,
  .cms-status,
  .cms-sidebar { border-radius: 18px; }
  .cms-hero { flex-direction: column; align-items: flex-start; }
}
