/* AllHigher CMS admin */
:root {
  --bg: #07111f;
  --bg-2: #0a1728;
  --panel: #0d1c2e;
  --panel-2: #101f33;
  --line: #22364d;
  --line-2: #2b4059;
  --text: #e6edf8;
  --muted: #8298b2;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --sidebar: 236px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.25; }
.eyebrow { display: inline-block; color: #7dd3fc; font-size: 9.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.alert { border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 12px; }
.alert.success { background: #0d3a2c; color: #a7f3d0; border: 1px solid #145c45; }
.alert.error { background: #3b1722; color: #fecdd3; border: 1px solid #7f1d1d; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 8px; border: 1px solid transparent; font-size: 12px; font-weight: 700; transition: .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.btn-ghost { border-color: var(--line-2); color: #a9bfd8; background: #0b1828; }
.btn.full { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: #7dd3fc; font-size: 11px; font-weight: 700; }
.mini-btn { display: inline-flex; align-items: center; justify-content: center; height: 27px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: #0b1828; color: #a9bfd8; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.mini-btn:hover { border-color: #3b82f6; color: #bfdbfe; }
.mini-btn.danger { color: #fda4af; border-color: #4a2230; }
.mini-btn.danger:hover { background: #3b1722; }
.inline { display: inline; }
form.inline { display: inline; }
.mono { font-family: var(--mono); font-size: 10px; color: #89a3c0; }
.muted { color: var(--muted); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #123246; color: #8ec5ff; font-size: 10px; font-weight: 700; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--bg); }
.login-visual { position: relative; overflow: hidden; padding: 42px; background: radial-gradient(circle at 20% 20%, rgba(37,99,235,.38), transparent 45%), radial-gradient(circle at 80% 80%, rgba(34,211,238,.16), transparent 40%), #07111f; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.login-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(125,211,252,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(125,211,252,.06) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 40% 40%, #000, transparent 75%); }
.login-brand { position: relative; display: flex; align-items: center; gap: 12px; }
.login-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #07111f; background: linear-gradient(145deg, #7dd3fc, #3b82f6); font-size: 20px; font-weight: 900; }
.login-brand b { display: block; font-size: 18px; letter-spacing: -.03em; }
.login-brand small { display: block; color: #7e95ae; font-size: 10px; letter-spacing: .12em; margin-top: 2px; }
.login-copy { position: relative; max-width: 540px; }
.login-copy h1 { font-size: clamp(40px, 4.4vw, 68px); color: #fff; margin: 14px 0 20px; }
.login-copy p { color: #9fb4cc; font-size: 14px; line-height: 1.9; max-width: 440px; }
.login-points { position: relative; display: flex; gap: 18px; flex-wrap: wrap; color: #7dd3fc; font-size: 10px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px; background: #081422; }
.login-card { width: min(390px, 100%); background: rgba(13,28,46,.82); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 40px 80px -40px #000; }
.login-card h2 { font-size: 27px; margin: 8px 0 5px; }
.login-card > p { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.login-form label { display: block; margin-bottom: 14px; font-size: 11px; color: #a9bfd8; font-weight: 600; }
.login-form input { display: block; width: 100%; margin-top: 6px; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: #07111f; color: var(--text); padding: 0 12px; outline: 0; }
.login-form input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.login-form .btn { width: 100%; height: 43px; margin-top: 6px; }
.back-site { display: block; text-align: center; margin-top: 18px; color: #6f86a1; font-size: 11px; }
.back-site:hover { color: #7dd3fc; }

/* shell */
.admin-body { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #081422; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 21px 20px; border-bottom: 1px solid rgba(34,54,77,.6); }
.admin-brand > span { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #7dd3fc, #3b82f6); color: #07111f; font-weight: 900; font-size: 17px; }
.admin-brand b { display: block; font-size: 15px; line-height: 1; }
.admin-brand small { display: block; color: #6f86a1; font-size: 9px; letter-spacing: .12em; margin-top: 4px; }
.admin-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 10px; height: 39px; padding: 0 11px; border-radius: 8px; color: #8298b2; font-size: 12px; font-weight: 600; }
.admin-nav a:hover { color: #dbeafe; background: #0d1f33; }
.admin-nav a.active { color: #bfdbfe; background: linear-gradient(90deg, #12345c, #0f2744); box-shadow: inset 2px 0 #3b82f6; }
.admin-nav a svg { flex: none; }
.admin-nav a em { margin-left: auto; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; background: #b91c1c; color: #fff; font-size: 9px; font-style: normal; }
.admin-side-foot { padding: 13px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.admin-side-foot a, .admin-side-foot button { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; background: none; color: #7188a2; font-size: 10.5px; padding: 7px 9px; border-radius: 6px; text-align: left; }
.admin-side-foot a:hover, .admin-side-foot button:hover { background: #0d1f33; color: #bfdbfe; }
.admin-main { margin-left: var(--sidebar); min-height: 100vh; }
.admin-topbar { height: 82px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(8,20,34,.75); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 8; }
.admin-topbar h1 { font-size: 22px; margin: 3px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 33px; height: 33px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; color: #8fa7c2; }
.icon-btn:hover { border-color: #3b82f6; color: #bfdbfe; }
.topbar-user { font-size: 11px; color: #8fa7c2; padding-left: 10px; border-left: 1px solid var(--line); }
.admin-content { padding: 24px 30px 50px; max-width: 1500px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 16px; overflow: hidden; }
.panel.narrow { max-width: 620px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid rgba(34,54,77,.7); }
.panel-head h2 { font-size: 16px; margin: 2px 0 0; }
.panel-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.panel-body { padding: 18px 19px; }
.panel-body.flush { padding: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.stat-card { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 17px; }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -30px; top: -34px; border-radius: 50%; background: rgba(59,130,246,.12); }
.stat-card span { font-size: 10px; color: var(--muted); }
.stat-card b { display: block; margin-top: 5px; font-size: 28px; letter-spacing: -.04em; }
.stat-card small { display: block; color: #6f86a1; font-size: 9.5px; margin-top: 3px; }
.stat-card.accent b { color: #7dd3fc; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 5px; transition: .18s; }
.quick-card:hover { border-color: #31547c; transform: translateY(-2px); }
.quick-card > span { color: #7dd3fc; margin-bottom: 3px; }
.quick-card b { font-size: 12px; }
.quick-card small { font-size: 10px; color: var(--muted); }

/* tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: #6f86a1; font-weight: 700; padding: 11px 14px; background: #0a1727; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(34,54,77,.55); font-size: 11.5px; color: #b9cbe0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(18,52,92,.18); }
.data-table td b { display: block; color: #e6edf8; font-size: 12px; font-weight: 650; }
.data-table td small { display: block; margin-top: 2px; }
.data-table .right { text-align: right; white-space: nowrap; }
.data-table .right .mini-btn { margin-left: 4px; }
.status { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.status.new { background: #3b2a10; color: #fbbf24; }
.status.read { background: #123246; color: #7dd3fc; }
.status.archived, .status.muted { background: #1a2636; color: #7088a2; }
.status.active { background: #0e3a2c; color: #6ee7b7; }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.form-grid .full { grid-column: 1 / -1; }
.admin-form label, .inline-form label, .settings-sections label { display: block; font-size: 10.5px; font-weight: 650; color: #a9bfd8; }
.admin-form input, .admin-form textarea, .admin-form select, .inline-form input, .inline-form select, .settings-sections input, .settings-sections textarea, .settings-sections select {
  display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 7px; background: #081522; color: var(--text); padding: 9px 10px; font-size: 11.5px; outline: 0;
}
.admin-form textarea, .settings-sections textarea { resize: vertical; line-height: 1.65; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus, .inline-form input:focus, .inline-form select:focus, .settings-sections input:focus, .settings-sections textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.admin-form input[type=file] { padding: 7px; color: #8fa7c2; }
.admin-form label.check, .inline-form label.check { display: flex; align-items: center; gap: 6px; padding-top: 21px; }
.admin-form label.check input, .inline-form label.check input { width: auto; margin: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form label { flex: 1 1 130px; }
.inline-form label.wide { flex: 2 1 240px; }
.inline-form .btn { height: 36px; flex: none; }
.image-preview { margin-top: 14px; width: 150px; height: 105px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.hint { display: block; margin-top: 4px; color: #6f86a1; font-size: 9.5px; font-weight: 400; }

/* settings */
.settings-sections { display: flex; flex-direction: column; gap: 24px; }
.setting-block { padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.setting-block:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-block h3 { font-size: 13px; margin: 0 0 14px; color: #cfe0f5; }
.setting-block .form-grid label { margin: 0; }

/* messages */
.message-list { display: flex; flex-direction: column; gap: 10px; }
.message-card { background: #0b1828; border: 1px solid var(--line); border-radius: 10px; padding: 14px 15px; }
.message-card.unread { border-color: #3b5f88; box-shadow: inset 2px 0 #3b82f6; }
.message-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.message-head > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.message-head b { font-size: 12.5px; }
.message-head span { color: #7088a2; font-size: 10px; }
.message-head time { color: #607891; font-size: 9.5px; white-space: nowrap; }
.message-contact { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; color: #7dd3fc; font-size: 10.5px; }
.message-card > p { margin: 8px 0 10px; color: #c4d4e6; font-size: 11.5px; line-height: 1.75; }
.message-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* AI */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 14px; align-items: start; }
.ai-chat-panel { min-height: 590px; display: flex; flex-direction: column; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; color: #fb7185; font-size: 9.5px; white-space: nowrap; }
.ai-status i { width: 6px; height: 6px; border-radius: 50%; background: #fb7185; }
.ai-status.ready { color: #6ee7b7; }
.ai-status.ready i { background: #34d399; box-shadow: 0 0 8px #34d399; }
.ai-messages { flex: 1; min-height: 330px; max-height: 490px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ai-empty { margin: auto; text-align: center; color: var(--muted); max-width: 260px; }
.ai-empty > span { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #123246; color: #7dd3fc; margin-bottom: 10px; }
.ai-empty b { display: block; color: #cfe0f5; font-size: 13px; margin-bottom: 4px; }
.ai-empty p { font-size: 10.5px; line-height: 1.7; }
.ai-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.ai-msg.user { align-self: flex-end; align-items: flex-end; }
.ai-msg-label { font-size: 9px; color: #607891; }
.ai-bubble { padding: 10px 12px; border-radius: 10px; background: #102338; border: 1px solid var(--line); color: #d5e3f3; font-size: 11.5px; line-height: 1.75; white-space: pre-wrap; }
.ai-msg.user .ai-bubble { background: #1d4ed8; border-color: #2563eb; color: #eff6ff; }
.ai-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 10px; }
.ai-quick button { border: 1px solid var(--line); background: #0b1828; color: #8ec5ff; border-radius: 999px; padding: 5px 9px; font-size: 9.5px; }
.ai-quick button:hover { border-color: #3b82f6; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.ai-form textarea { flex: 1; min-height: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #081522; color: var(--text); padding: 9px 10px; resize: vertical; outline: 0; }
.ai-form textarea:focus { border-color: #3b82f6; }
.ai-form .btn { height: 44px; flex: none; }
.ai-error { padding: 0 18px 12px; color: #fda4af; font-size: 10.5px; }
.ai-config-panel .panel-body { display: flex; flex-direction: column; gap: 14px; }
.ai-config-panel .btn.full { margin-top: 6px; }
.ai-clear-form { border-top: 1px solid var(--line); padding-top: 12px; }
.ai-tip { background: #0b1828; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: #6f86a1; font-size: 9.5px; line-height: 1.7; }
.ai-form .btn svg { flex: none; }

@media (max-width: 1100px) {
  :root { --sidebar: 205px; }
  .admin-content { padding: 20px; }
  .ai-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 280px; padding: 28px; }
  .login-copy h1 { font-size: 38px; }
  .login-points { display: none; }
  .admin-sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 240px; }
  .admin-sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 0 18px; }
  .admin-content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .data-table { min-width: 700px; }
  .panel-body.flush { overflow-x: auto; }
  .inline-form label, .inline-form label.wide { flex: 1 1 100%; }
}
