:root {
  --ink: #17151f;
  --paper: #f5f2ec;
  --white: #fff;
  --muted: #716b79;
  --line: rgba(23,21,31,.14);
  --accent: #6546d9;
  --violet: #4f34ba;
  --green: #1d8b59;
  --red: #b83232;
  --sidebar: 280px;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f3f1ed; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--sidebar); flex-direction: column; padding: 26px 20px; background: var(--ink); color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 13px; padding: 0 10px 26px; border-bottom: 1px solid rgba(255,255,255,.1); letter-spacing: .14em; }
.admin-brand span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); font-size: 20px; font-weight: 900; }
.admin-brand strong { font-size: 15px; }
.admin-sidebar nav { display: grid; gap: 7px; margin-top: 28px; }
.admin-sidebar nav a { position: relative; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 11px 13px; border-radius: 11px; color: #aaa5b1; font-size: 14px; font-weight: 750; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.is-active { background: rgba(255,255,255,.09); color: #fff; }
.admin-sidebar nav a > span { width: 22px; color: var(--accent); font-size: 18px; text-align: center; }
.admin-sidebar nav b { display: grid; place-items: center; min-width: 24px; height: 24px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; }
.admin-sidebar__bottom { display: grid; gap: 12px; margin-top: auto; padding: 22px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.admin-sidebar__bottom a, .admin-sidebar__bottom button { padding: 0; border: 0; background: none; color: #aaa5b1; font-size: 13px; text-align: left; }
.admin-sidebar__bottom a:hover, .admin-sidebar__bottom button:hover { color: #fff; }
.admin-main { min-height: 100vh; margin-left: var(--sidebar); }
.admin-topbar { display: flex; min-height: 114px; align-items: center; gap: 18px; padding: 22px clamp(28px, 4vw, 64px); background: #fff; border-bottom: 1px solid var(--line); }
.admin-topbar span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.admin-topbar h1 { margin: 4px 0 0; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; }
.admin-menu { display: none; border: 0; background: transparent; font-size: 24px; }
.admin-content { padding: clamp(26px, 4vw, 60px); }
.admin-alert { margin: 24px clamp(28px, 4vw, 64px) 0; padding: 15px 18px; border-radius: 11px; font-weight: 700; }
.admin-alert--success { background: #e6f6ed; color: #176d48; }
.admin-alert--error { background: #fdebea; color: #9b2828; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.admin-stats article { display: grid; min-height: 190px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(23,21,31,.05); }
.admin-stats span { color: var(--muted); font-size: 13px; font-weight: 800; }
.admin-stats strong { align-self: center; font-size: 58px; line-height: 1; letter-spacing: -.06em; }
.admin-stats a { align-self: end; color: var(--violet); font-size: 13px; font-weight: 850; }
.admin-panel { margin-top: 26px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(23,21,31,.04); }
.admin-panel--flush { padding: 0; overflow: hidden; }
.admin-panel__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.admin-panel__head span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.admin-panel__head h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.03em; }
.admin-link { color: var(--violet); font-size: 13px; font-weight: 850; }
.admin-empty { padding: 52px 24px; text-align: center; }
.admin-empty strong { font-size: 20px; }
.admin-empty p { margin: 7px 0 0; color: var(--muted); }
.message-table { border-top: 1px solid var(--line); }
.message-row { display: grid; grid-template-columns: 14px minmax(170px,.65fr) minmax(260px,1.35fr) 130px; gap: 20px; align-items: center; min-height: 82px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.message-table--full .message-row { padding-inline: 24px; }
.message-row:hover { background: #faf9f6; }
.message-row--new { background: #fffaf4; }
.message-row > div { display: grid; }
.message-row strong { font-size: 15px; }
.message-row small { color: var(--muted); font-size: 12px; }
.message-row p { margin: 0; color: var(--muted); font-size: 13px; }
.message-row time { color: var(--muted); font-size: 12px; text-align: right; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b5b0ba; }
.status-dot--new { background: var(--accent); box-shadow: 0 0 0 5px rgba(255,107,53,.13); }
.status-dot--archived { background: #aaa5b1; }
.admin-help-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 26px; }
.admin-help-grid article { padding: 26px; border-radius: 18px; background: var(--ink); color: #fff; }
.admin-help-grid span { color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.admin-help-grid h3 { margin: 28px 0 10px; font-size: 21px; }
.admin-help-grid p { margin: 0; color: #aaa5b1; font-size: 14px; }
.admin-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 11px 18px; border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); color: #fff; font-weight: 800; cursor: pointer; }
.admin-button:hover { background: var(--accent); border-color: var(--accent); }
.admin-button--ghost { background: #fff; color: var(--ink); }
.admin-button--danger { background: #fff; border-color: #d9b3b3; color: var(--red); }
.admin-button--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.inbox-toolbar { display: flex; justify-content: space-between; margin-bottom: 20px; }
.inbox-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 800; }
.inbox-tabs a.is-active { background: var(--ink); color: #fff; }
.inbox-tabs b { font-size: 11px; }
.message-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.message-status { padding: 8px 12px; border-radius: 999px; background: #e7f6ee; color: var(--green); font-size: 12px; font-weight: 900; }
.message-status--archived { background: #eceaec; color: var(--muted); }
.message-detail { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 14px 40px rgba(23,21,31,.05); }
.message-detail > header { display: flex; align-items: center; gap: 20px; padding: 30px; border-bottom: 1px solid var(--line); }
.message-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 25px; font-weight: 900; }
.message-detail header span, .message-body > span { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.message-detail h2 { margin: 4px 0; font-size: 25px; letter-spacing: -.03em; }
.message-detail time { color: var(--muted); font-size: 12px; }
.message-contact-grid { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.message-contact-grid > div { display: grid; gap: 6px; min-height: 100px; padding: 24px 30px; border-right: 1px solid var(--line); }
.message-contact-grid > div:last-child { border-right: 0; }
.message-contact-grid span { color: var(--muted); font-size: 11px; font-weight: 850; }
.message-contact-grid a, .message-contact-grid strong, .message-contact-grid em { font-size: 14px; font-style: normal; }
.message-contact-grid a { color: var(--violet); font-weight: 800; }
.message-body { padding: 38px 30px; }
.message-body p { max-width: 900px; margin: 14px 0 0; font-size: 18px; line-height: 1.75; }
.message-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 22px 30px; background: #f8f6f2; border-top: 1px solid var(--line); }
.message-actions form { margin: 0; }
.content-editor { display: grid; gap: 14px; }
.editor-toolbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 12px 32px rgba(23,21,31,.08); backdrop-filter: blur(12px); }
.editor-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.editor-toolbar--bottom { position: static; margin-top: 10px; }
.editor-section { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.editor-section > summary { display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 18px 22px; list-style: none; font-size: 18px; font-weight: 850; cursor: pointer; }
.editor-section > summary::-webkit-details-marker { display: none; }
.editor-section > summary i { font-style: normal; font-size: 24px; transition: transform .2s; }
.editor-section[open] > summary { border-bottom: 1px solid var(--line); }
.editor-section[open] > summary i { transform: rotate(45deg); }
.editor-section__body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding: 22px; }
.editor-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f6; }
.editor-group legend { padding: 0 9px; font-size: 13px; font-weight: 900; }
.editor-group--depth-1, .editor-group--depth-2, .editor-group--depth-3 { background: #fff; }
.editor-item { grid-column: 1 / -1; padding: 14px; border: 1px dashed rgba(23,21,31,.18); border-radius: 12px; }
.editor-item__title { margin-bottom: 12px; color: var(--violet); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.editor-field { min-width: 0; }
.editor-field > label { display: grid; gap: 7px; }
.editor-field label > span { color: #46404b; font-size: 12px; font-weight: 850; }
.editor-field input, .editor-field textarea, .auth-card input { width: 100%; padding: 12px 13px; border: 1px solid rgba(23,21,31,.2); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; }
.editor-field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.editor-field input:focus, .editor-field textarea:focus, .auth-card input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(117,100,232,.12); outline: 0; }
.editor-field--image { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 14px 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.editor-preview { grid-column: 2; grid-row: 1 / span 2; width: 180px; height: 120px; border-radius: 9px; object-fit: cover; background: #eee; }
.upload-field { align-self: end; }
.upload-field input { padding: 8px; }
.editor-field--image > small { grid-column: 1; color: var(--muted); font-size: 11px; }
.editor-hint { color: var(--muted); font-size: 13px; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.auth-card { width: min(100%, 500px); padding: clamp(28px,5vw,48px); border-radius: 22px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.auth-logo { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 24px; font-weight: 900; }
.auth-kicker { margin: 26px 0 8px !important; color: var(--violet) !important; font-size: 11px !important; font-weight: 900; letter-spacing: .14em; }
.auth-card h1 { margin: 0; font-size: clamp(34px,6vw,48px); line-height: 1.05; letter-spacing: -.05em; }
.auth-card > p { color: var(--muted); }
.auth-card form { display: grid; gap: 17px; margin-top: 28px; }
.auth-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 850; }
.auth-card .admin-button { width: 100%; min-height: 52px; }
.auth-card small { display: block; margin-top: 18px; color: var(--muted); font-size: 12px; }
.auth-back { display: inline-block; margin-top: 22px; color: var(--violet); font-size: 13px; font-weight: 800; }
code { padding: 2px 5px; border-radius: 4px; background: #eee; }
@media (max-width: 1100px) {
  :root { --sidebar: 240px; }
  .admin-stats, .admin-help-grid { grid-template-columns: 1fr 1fr; }
  .admin-help-grid article:last-child { grid-column: 1 / -1; }
  .message-row { grid-template-columns: 12px 1fr 120px; }
  .message-row p { display: none; }
  .editor-section__body, .editor-group { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-sidebar { transform: translateX(-105%); transition: transform .25s; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-menu { display: block; }
  .admin-topbar { min-height: 92px; padding: 16px 20px; }
  .admin-content { padding: 20px; }
  .admin-alert { margin-inline: 20px; }
  .admin-stats, .admin-help-grid { grid-template-columns: 1fr; }
  .admin-help-grid article:last-child { grid-column: auto; }
  .message-row { grid-template-columns: 12px 1fr; gap: 14px; padding: 16px; }
  .message-row time { grid-column: 2; text-align: left; }
  .message-contact-grid { grid-template-columns: 1fr; }
  .message-contact-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .message-contact-grid > div:last-child { border-bottom: 0; }
  .message-detail > header { align-items: flex-start; padding: 24px 20px; }
  .message-avatar { width: 48px; height: 48px; }
  .message-detail h2 { font-size: 20px; }
  .message-body, .message-actions { padding-inline: 20px; }
  .editor-toolbar { position: static; align-items: stretch; flex-direction: column; }
  .editor-toolbar .admin-button { width: 100%; }
  .editor-section__body { padding: 16px; }
  .editor-field--image { grid-template-columns: 1fr; }
  .editor-preview { grid-column: 1; grid-row: auto; width: 100%; height: 190px; }
  .editor-field--image > small { grid-column: 1; }
}

.color-picker { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 12px; min-height: 48px; padding: 7px 10px; border: 1px solid rgba(23,21,31,.2); border-radius: 9px; background: #fff; }
.color-picker input[type="color"] { width: 64px; height: 34px; padding: 0; border: 0; border-radius: 7px; cursor: pointer; }
.color-picker output { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 800; }
