:root {
  --primary: #06264b;
  --primary-2: #0a4d91;
  --dark: #03152c;
  --gold: #d89518;
  --gold-2: #f4ba4f;
  --ink: #10243f;
  --text: #5d7087;
  --line: #dfe8f4;
  --soft: #f5f8fc;
  --white: #ffffff;
  --danger: #c93535;
  --success: #0d8750;
  --shadow: 0 22px 56px rgba(6, 38, 75, .10);
  --shadow-lg: 0 36px 90px rgba(6, 38, 75, .16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at 100% 0%, rgba(216,149,24,.12), transparent 25%), linear-gradient(180deg, #f7faff 0%, #edf4fb 100%);
  color: var(--ink);
  line-height: 1.56;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
.admin-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; color: #dcecff; background: radial-gradient(circle at 18% 0%, rgba(216,149,24,.20), transparent 28%), linear-gradient(180deg, var(--dark), #041425); padding: 24px; z-index: 20; }
.admin-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-brand img { width: 66px; height: 66px; object-fit: contain; flex: 0 0 66px; border-radius: 22px; background: #fff; padding: 7px; box-shadow: 0 14px 35px rgba(0,0,0,.16); }
.admin-brand strong { display: block; color: #fff; font-size: 22px; line-height: 1; font-weight: 900; letter-spacing: -.045em; }
.admin-brand small { display: block; margin-top: 5px; color: var(--gold-2); font-weight: 900; }
.admin-nav { display: grid; gap: 7px; }
.nav-group-title { margin: 12px 8px 4px; color: rgba(220,236,255,.62); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.admin-nav a { display: flex; align-items: center; gap: 10px; min-height: 45px; color: #dcecff; border: 1px solid transparent; border-radius: 16px; padding: 11px 13px; font-weight: 850; transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease; }
.admin-nav a span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 9px; background: rgba(255,255,255,.09); color: var(--gold-2); font-size: 12px; }
.admin-nav a:hover, .admin-nav a.is-active { transform: translateX(3px); border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.10); color: #fff; }
.sidebar-backdrop { display: none; }
.admin-main { min-width: 0; padding: 28px; }
.admin-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 24px; }
.admin-menu-btn { display: none; width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--primary); color: #fff; cursor: pointer; box-shadow: 0 14px 30px rgba(6,38,75,.18); }
.admin-kicker { display: inline-flex; color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.admin-top h1 { margin: 4px 0 4px; color: var(--primary); font-size: clamp(30px, 3vw, 44px); line-height: 1; letter-spacing: -.06em; }
.admin-top p { margin: 0; color: var(--text); font-weight: 700; }
.view-site, .btn, button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border: 0; border-radius: 15px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; cursor: pointer; font-weight: 900; padding: 12px 18px; box-shadow: 0 14px 30px rgba(6,38,75,.18); transition: filter .18s ease, transform .18s ease; }
.view-site:hover, .btn:hover, button:hover { filter: brightness(1.03); transform: translateY(-1px); }
.muted { background: #e7eef7; color: var(--primary); box-shadow: none; }
.panel, .metric, .login-card, .welcome-panel { border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.welcome-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; background: radial-gradient(circle at 92% 10%, rgba(216,149,24,.14), transparent 26%), #fff; }
.welcome-panel h2 { margin: 6px 0 8px; color: var(--primary); font-size: clamp(28px, 3vw, 40px); line-height: 1.07; letter-spacing: -.055em; }
.welcome-panel p { margin: 0; color: var(--text); font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.metric { position: relative; overflow: hidden; margin: 0; min-height: 150px; display: grid; align-content: center; }
.metric::after { content: ""; position: absolute; right: -34px; top: -34px; width: 98px; height: 98px; border-radius: 32px; background: rgba(216,149,24,.12); }
.metric span { display: block; color: var(--text); font-weight: 900; }
.metric strong { display: block; margin: 8px 0 6px; color: var(--primary); font-size: 42px; line-height: 1; font-weight: 900; letter-spacing: -.055em; }
.metric small { color: #7f8fa4; font-weight: 800; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { margin: 4px 0 0; color: var(--primary); font-size: 26px; line-height: 1.1; letter-spacing: -.045em; }
.count-pill { display: inline-flex; min-height: 36px; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary); font-size: 13px; font-weight: 900; padding: 7px 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; border-bottom: 1px solid #edf2f8; padding: 14px; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #60738b; background: #f8fbff; }
tr:hover td { background: #fbfdff; }
.badge { display: inline-flex; border-radius: 999px; background: #e7f7ef; color: #0c7740; padding: 5px 9px; font-weight: 900; font-size: 12px; }
.badge.gray { background: #eef2f7; color: #637387; }
.status-new { background: #fff5df; color: #9a6200; }
.status-contacted { background: #e8f2ff; color: #0a4d91; }
.status-converted { background: #e7f7ef; color: #0c7740; }
.status-closed { background: #f0f2f5; color: #5f6f84; }
.table-actions { white-space: nowrap; }
.table-actions a { display: inline-flex; margin-right: 10px; font-weight: 900; }
.table-actions .danger { color: var(--danger); }
.admin-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form label { color: var(--primary); font-weight: 900; }
.admin-form label > span:not(.checkline) { display: block; margin-bottom: 7px; }
.admin-form input, .admin-form textarea, .admin-form select, .inline-form input, .inline-form select { width: 100%; border: 1px solid #dbe6f2; border-radius: 15px; background: #fbfdff; color: var(--ink); outline: 0; padding: 13px 14px; }
.admin-form textarea { resize: vertical; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus, .inline-form input:focus, .inline-form select:focus { border-color: rgba(10,77,145,.50); background: #fff; box-shadow: 0 0 0 4px rgba(10,77,145,.10); }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; margin-top: 18px; }
.section-editor-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.edit-block { border: 1px solid #e6edf6; border-radius: 22px; padding: 20px; background: linear-gradient(180deg, #fbfdff, #fff); }
.edit-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.edit-block-head span { color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.edit-block-head strong { color: var(--primary); font-size: 19px; letter-spacing: -.03em; }
.checkline { display: inline-flex; gap: 9px; align-items: center; min-height: 43px; border: 1px solid #dbe6f2; border-radius: 15px; background: #fbfdff; padding: 10px 12px; }
.checkline input { width: auto; }
.inline-form { display: grid; gap: 8px; min-width: 250px; }
.inline-form button { min-height: 40px; padding: 9px 13px; border-radius: 13px; }
.alert { border-radius: 16px; margin-bottom: 16px; padding: 14px 16px; font-weight: 900; }
.success { background: #e9fff4; color: #09713c; border: 1px solid #c9f5dd; }
.error { background: #fff0f0; color: #a82222; border: 1px solid #ffd5d5; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 12% 16%, rgba(216,149,24,.22), transparent 28%), radial-gradient(circle at 82% 10%, rgba(39,128,222,.18), transparent 30%), linear-gradient(135deg, var(--dark), var(--primary-2)); padding: 20px; }
.login-card { width: min(460px, 100%); display: grid; gap: 15px; margin: 0; text-align: left; }
.login-logo-wrap { width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 4px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.login-card img { width: 78px; height: 78px; object-fit: contain; }
.login-card .admin-kicker, .login-card h1, .login-card p, .login-card small { text-align: center; justify-content: center; }
.login-card h1 { color: var(--primary); margin: 0; font-size: 36px; line-height: 1; letter-spacing: -.055em; }
.login-card p { color: var(--text); margin: 0; font-weight: 700; }
.login-card small { color: #748399; }
.login-card label { color: var(--primary); font-weight: 900; }
.login-card label span { display: block; margin-bottom: 7px; }
.login-card input { width: 100%; padding: 14px; border: 1px solid #dbe6f2; border-radius: 15px; background: #fbfdff; }
.login-card button { width: 100%; min-height: 50px; }

@media (max-width: 1120px) {
  .admin-shell { grid-template-columns: 280px 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(315px, 88vw); height: 100vh; transform: translateX(-104%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(3,21,44,.48); backdrop-filter: blur(3px); }
  .admin-main { padding: 18px; }
  .admin-menu-btn { display: inline-flex; }
  .admin-top { grid-template-columns: auto 1fr; align-items: start; }
  .view-site { grid-column: 1 / -1; justify-self: start; }
  .welcome-panel { align-items: flex-start; flex-direction: column; }
  .admin-form .form-grid, .settings-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 620px) {
  .admin-main { padding: 14px; }
  .admin-top h1 { font-size: 32px; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel, .metric, .welcome-panel { border-radius: 22px; padding: 18px; }
  .panel-head, .edit-block-head { align-items: flex-start; flex-direction: column; }
  .view-site, .btn, button, .form-actions .btn { width: 100%; }
  .form-actions { flex-direction: column; }
  .inline-form { min-width: 100%; }
  table { min-width: 820px; }
}
