:root {
  --bg: #f3f6f9;
  --surface: #fff;
  --ink: #152234;
  --muted: #718096;
  --line: #dfe6ed;
  --navy: #071421;
  --navy-2: #10243a;
  --red: #db343b;
  font-family: "Inter", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #235f99; outline-offset: 2px; }
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 250px;
  padding: 25px 18px;
  flex-direction: column;
  color: #d4deea;
  background: var(--navy);
}
.admin-brand { display: flex; align-items: center; gap: 11px; font: 700 16px/1 "Manrope",sans-serif; }
.admin-brand span { display: grid; width: 31px; height: 31px; place-items: center; color: #fff; background: var(--red); }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 45px; }
.admin-sidebar nav a { padding: 11px 13px; color: #95a9bd; border-left: 2px solid transparent; transition: .15s; }
.admin-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.045); }
.admin-sidebar nav a.active { color: #fff; border-left-color: var(--red); background: var(--navy-2); }
.sidebar-bottom { display: flex; flex-direction: column; gap: 9px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-bottom a, .sidebar-bottom button { padding: 5px 0; color: #8fa3b7; border: 0; cursor: pointer; background: none; font-size: 12px; text-align: left; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: #fff; }
.admin-shell { width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; }
.admin-topbar { display: flex; min-height: 62px; align-items: center; justify-content: flex-end; padding: 0 35px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fff; font-size: 12px; }
.admin-menu { display: none; }
.admin-main { width: min(1180px, calc(100% - 60px)); margin: 0 auto; padding: 45px 0 90px; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 31px; }
.admin-page-head p { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.admin-page-head p a:hover { color: var(--ink); }
.admin-page-head h1 { margin: 0; font: 700 34px/1.1 "Manrope",sans-serif; letter-spacing: -.03em; }
.admin-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  color: #24364a;
  border: 1px solid #cfd9e2;
  cursor: pointer;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  transition: .15s;
}
.admin-button:hover { border-color: #aabac9; background: #f9fbfc; }
.admin-button.primary { color: #fff; border-color: var(--red); background: var(--red); }
.admin-button.primary:hover { background: #c9252d; }
.admin-button.danger { color: #bd2d35; }
.admin-button.wide { width: 100%; }
.admin-panel { border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 24px rgba(23,41,59,.035); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.panel-head h2, .form-panel > h2 { margin: 0 0 5px; font: 700 18px/1.2 "Manrope",sans-serif; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-head > a { color: #356b9d; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 25px; }
.stats-grid article { position: relative; display: flex; min-height: 170px; padding: 24px; flex-direction: column; border: 1px solid var(--line); background: #fff; }
.stats-grid article.attention { border-top: 3px solid var(--red); }
.stats-grid span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stats-grid strong { margin: 13px 0 auto; font: 700 46px/1 "Manrope",sans-serif; }
.stats-grid a { color: #356b9d; font-size: 11px; font-weight: 600; }
.admin-panel > .panel-head { padding: 24px 24px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f8fafc; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 17px 18px; color: #44566a; border-bottom: 1px solid #edf1f5; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 13px; }
td small { display: block; color: #8a9aad; }
.status { display: inline-flex; padding: 4px 8px; color: #326a4c; background: #e9f7ef; font-size: 10px; font-weight: 700; }
.status-new { color: #a6262d; background: #fff0f0; }
.status-in_progress { color: #8a5b0c; background: #fff7df; }
.status-closed { color: #326a4c; background: #e9f7ef; }
.status-draft { color: #66788b; background: #eef2f5; }
.table-actions { display: flex; justify-content: flex-end; gap: 14px; white-space: nowrap; }
.table-actions a, .table-actions button { padding: 0; color: #356b9d; border: 0; cursor: pointer; background: none; font-size: 11px; }
.table-actions button { color: #b8333a; }
.table-empty { padding: 45px !important; color: var(--muted); text-align: center; }
.admin-flash { margin-bottom: 20px; padding: 13px 16px; border-left: 3px solid #4aa777; background: #edf8f2; }
.admin-flash.error { color: #9d272e; border-left-color: var(--red); background: #fff0f0; }

.admin-form-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 22px; align-items: start; }
.admin-form-main { display: flex; flex-direction: column; gap: 22px; }
.admin-form-side { position: sticky; top: 25px; display: flex; flex-direction: column; gap: 22px; }
.form-panel { display: flex; padding: 25px; flex-direction: column; gap: 19px; }
.form-panel > .panel-head { padding: 0; margin-bottom: 5px; }
.form-panel label { display: flex; flex-direction: column; gap: 7px; color: #536579; font-size: 11px; font-weight: 650; }
.form-panel input, .form-panel textarea, .form-panel select {
  width: 100%;
  color: var(--ink);
  border: 1px solid #ced8e1;
  border-radius: 0;
  outline: 0;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
}
.form-panel input, .form-panel select { min-height: 43px; padding: 0 11px; }
.form-panel textarea { padding: 11px; resize: vertical; line-height: 1.55; }
.form-panel input:focus, .form-panel textarea:focus, .form-panel select:focus { border-color: #5c87b0; box-shadow: 0 0 0 2px rgba(53,107,157,.08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-panel .check-label { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 9px; }
.form-panel .check-label input { width: 17px; min-height: 17px; accent-color: var(--red); }
.admin-cover-preview { width: 100%; max-height: 260px; object-fit: cover; border: 1px solid var(--line); }
.admin-gallery { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.admin-gallery div { position: relative; }
.admin-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.admin-gallery button { position: absolute; right: 5px; bottom: 5px; padding: 5px 7px; color: #fff; border: 0; cursor: pointer; background: rgba(143,26,34,.9); font-size: 9px; }
.service-admin-grid, .settings-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; align-items: start; }
.service-edit-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.service-edit-head strong { color: var(--red); font: 700 22px/1 "Manrope",sans-serif; }
.service-edit-head span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.new-service { border-style: dashed; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; }
.sticky-save { position: sticky; z-index: 5; bottom: 15px; display: flex; justify-content: flex-end; margin-top: 22px; padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
.admin-filters { display: flex; gap: 8px; margin-bottom: 22px; }
.admin-filters a { padding: 8px 13px; color: var(--muted); border: 1px solid var(--line); background: #fff; font-size: 11px; }
.admin-filters a.active { color: #fff; border-color: var(--navy-2); background: var(--navy-2); }
.lead-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.lead-card { padding: 23px; }
.lead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.lead-top > div > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lead-top h2 { margin: 7px 0 3px; font: 700 20px/1.2 "Manrope",sans-serif; }
.lead-top p { margin: 0; color: var(--muted); font-size: 11px; }
.lead-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 19px 0; }
.lead-card dl div { min-width: 0; }
.lead-card dt { color: #8b9aab; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.lead-card dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #35485b; font-size: 11px; }
.lead-message { margin-bottom: 18px; padding: 14px; color: #44596e; background: #f6f8fa; font-size: 12px; line-height: 1.6; white-space: pre-line; }
.lead-card form { display: flex; align-items: flex-end; gap: 10px; }
.lead-card form label { display: flex; flex: 1; flex-direction: column; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.lead-card select { min-height: 42px; padding: 0 10px; border: 1px solid #ced8e1; background: #fff; }

.login-body { display: grid; min-height: 100vh; padding: 25px; place-items: center; color: #e8eef5; background: var(--navy); }
.login-body::before { position: fixed; inset: 0; content: ""; opacity: .2; background-image: linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(circle at center,black,transparent 72%); }
.login-card { position: relative; width: min(440px,100%); padding: 42px; border: 1px solid rgba(255,255,255,.15); background: #0b1b2d; box-shadow: 0 35px 90px rgba(0,0,0,.35); }
.login-brand { margin-bottom: 50px; }
.login-kicker { margin: 0 0 9px; color: #8296aa; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1 { margin: 0 0 30px; font: 700 30px/1.15 "Manrope",sans-serif; letter-spacing: -.03em; }
.login-card form { display: flex; flex-direction: column; gap: 18px; }
.login-card label { display: flex; flex-direction: column; gap: 7px; color: #a8b8c8; font-size: 11px; font-weight: 600; }
.login-card input { min-height: 47px; padding: 0 12px; color: #fff; border: 1px solid rgba(255,255,255,.2); outline: 0; background: #071421; }
.login-card input:focus { border-color: #7893ad; }
.login-card .admin-button { margin-top: 6px; }
.back-site { display: inline-block; margin-top: 25px; color: #8296aa; font-size: 11px; }

@media (max-width: 980px) {
  .admin-sidebar { width: 220px; }
  .admin-shell { width: calc(100% - 220px); margin-left: 220px; }
  .admin-form-layout { grid-template-columns: 1fr; }
  .admin-form-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .lead-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-sidebar { width: 250px; visibility: hidden; transform: translateX(-100%); transition: .2s; }
  .admin-sidebar.open { visibility: visible; transform: translateX(0); }
  .admin-shell { width: 100%; margin-left: 0; }
  .admin-topbar { justify-content: space-between; padding: 0 18px; }
  .admin-menu { display: inline-flex; padding: 6px 9px; color: var(--ink); border: 1px solid var(--line); background: #fff; }
  .admin-main { width: calc(100% - 28px); padding-top: 28px; }
  .admin-page-head { align-items: flex-start; flex-direction: column; }
  .admin-page-head h1 { font-size: 29px; }
  .stats-grid, .service-admin-grid, .settings-grid, .admin-form-side { grid-template-columns: 1fr; }
  .stats-grid article { min-height: 145px; }
  .field-row { grid-template-columns: 1fr; }
  .admin-gallery { grid-template-columns: repeat(2,1fr); }
  .lead-card dl { grid-template-columns: 1fr; }
  .login-card { padding: 30px 22px; }
}
