:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f8;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3538cd;
  --green: #067647;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --red: #b42318;
  --red-soft: #fef3f2;
  --violet: #6941c6;
  --violet-soft: #f4f3ff;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --gray-soft: #f2f4f7;
  --sidebar: #0b1220;
  --sidebar-2: #101b31;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #7f8ea6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px rgba(16, 24, 40, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
::selection { background: #c7d2fe; }
:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.muted { color: var(--muted); }

/* ---------- boot ---------- */
.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; color: var(--muted);
}
.boot-mark { display: flex; gap: 6px; }
.boot-mark span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  animation: boot-bounce 1s infinite ease-in-out;
}
.boot-mark span:nth-child(2) { animation-delay: .12s; opacity: .7; }
.boot-mark span:nth-child(3) { animation-delay: .24s; opacity: .45; }
.boot-text { margin: 0; font-size: 13px; letter-spacing: .02em; }
@keyframes boot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 14px 16px; color: var(--sidebar-text);
  background: radial-gradient(120% 80% at 0% 0%, #1c2a4a 0%, var(--sidebar) 48%, #080d18 100%);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 20px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
  flex: 0 0 auto;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: -.01em; }
.brand-copy span { font-size: 11px; color: var(--sidebar-muted); margin-top: 3px; letter-spacing: .18em; }
.sidebar-label {
  padding: 8px 12px; font-size: 10px; letter-spacing: .16em;
  color: var(--sidebar-muted); text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 9px; color: #b9c4d6; font-size: 13.5px;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active { background: rgba(99, 102, 241, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .2); }
.nav-icon { display: grid; place-items: center; color: #8fa0ba; }
.nav-item.is-active .nav-icon { color: #a5b4fc; }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px;
  background: #4f46e5; color: #fff; font-size: 11px; text-align: center;
}
.sidebar-spacer { flex: 1; }
.sidebar-note {
  margin: 18px 8px; padding: 12px; border-radius: 11px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06);
  display: flex; gap: 9px; color: #94a3b8; font-size: 11.5px; line-height: 1.55;
}
.sidebar-note-icon { color: #818cf8; flex: 0 0 auto; margin-top: 1px; }
.sidebar-note p { margin: 0; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sidebar-user-meta strong { font-size: 12.5px; color: #e2e8f0; font-weight: 600; }
.sidebar-user-meta span { font-size: 10.5px; color: var(--sidebar-muted); margin-top: 2px; }
.sidebar-logout { margin-left: auto; color: #8fa0ba; }
.sidebar-logout:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.sidebar-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 72px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: rgba(244, 246, 249, .86);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-menu { display: none; }
.page-heading { min-width: 0; }
.page-heading h1 {
  margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-heading p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.version-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  font-size: 10.5px; color: var(--muted); letter-spacing: .04em;
}
.version-dot { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.page { width: 100%; max-width: 1400px; margin: 0 auto; padding: 26px 30px 56px; }

/* ---------- common ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 550;
  line-height: 1.3; transition: border-color .16s, background .16s, color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn:hover { border-color: #98a2b3; background: #fbfcfe; }
.btn .icon { flex: 0 0 auto; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .2); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #912018; border-color: #912018; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 11px 16px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.is-spinning .icon { animation: spin .8s linear infinite; }
.btn-primary:disabled { background: #a5b4fc; border-color: #a5b4fc; }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.link-btn {
  border: 0; background: transparent; color: var(--accent-text);
  font-size: 12.5px; padding: 8px 0; margin: 0 auto; display: block;
}
.link-btn:hover { text-decoration: underline; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.card-hint { margin: 14px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.card-hint code, .login-dev-hint code, .credential-hint code {
  font-family: var(--mono); font-size: 10.5px; background: var(--surface-3);
  padding: 1px 5px; border-radius: 4px; color: var(--text-2);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; padding: 9px 11px; font-size: 13px; color: var(--text);
  min-height: 38px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.65; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input-code { font-family: var(--mono); font-size: 18px; letter-spacing: .35em; text-align: center; }
.form-error {
  padding: 9px 11px; border-radius: 8px; background: var(--red-soft); border: 1px solid #fecdca;
  color: var(--red); font-size: 12px; line-height: 1.5;
}
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-heading { display: flex; flex-direction: column; gap: 2px; }
.form-heading strong { font-size: 12.5px; }
.form-heading span { font-size: 11.5px; color: var(--muted); }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.check-row input { margin-top: 2px; accent-color: var(--accent); }

/* ---------- pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 99px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-blue { background: var(--blue-soft); color: var(--blue); border-color: #b2ddff; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: #fedf89; }
.pill-violet { background: var(--violet-soft); color: var(--violet); border-color: #d9d6fe; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: #abefc6; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: #fecdca; }
.pill-gray { background: var(--gray-soft); color: #475467; border-color: var(--border); }
.badge { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.badge-gray { background: var(--gray-soft); color: var(--muted); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.priority { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.priority-dot { width: 6px; height: 6px; border-radius: 50%; background: #98a2b3; }
.priority-red .priority-dot { background: #f04438; }
.priority-amber .priority-dot { background: #f79009; }
.priority-gray .priority-dot { background: #98a2b3; }
.tag-row { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; max-width: 100%; }
.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px;
  border-radius: 5px; background: var(--surface-3); color: #475467;
  font-size: 10.5px; white-space: nowrap;
}
.tag-more { color: var(--muted); background: transparent; }
.tag-editable { background: var(--accent-soft); color: var(--accent-text); padding: 3px 8px; gap: 5px; }
.tag-remove { border: 0; background: transparent; color: var(--accent-text); padding: 0; display: grid; place-items: center; opacity: .65; }
.tag-remove:hover { opacity: 1; }
.count-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-green { background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.dot-gray { background: #98a2b3; }

/* ---------- toolbar / inbox ---------- */
.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-toolbar-text { min-width: 0; }
.section-kicker { display: block; font-size: 9.5px; letter-spacing: .18em; color: var(--accent-text); font-weight: 700; margin-bottom: 5px; }
.page-toolbar h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; font-weight: 680; }
.page-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.page-toolbar-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.inbox-card { overflow: hidden; }
.tabs {
  display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: 0; background: transparent; padding: 14px 11px 12px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.tab-count {
  min-width: 19px; padding: 1px 5px; border-radius: 99px; background: var(--surface-3);
  color: var(--muted); font-size: 10px; text-align: center;
}
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent-text); }
.tab-count.is-hot { background: var(--red-soft); color: var(--red); }
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fcfdff;
}
.search-box { position: relative; flex: 1 1 250px; min-width: 200px; }
.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); display: grid; }
.search-box input {
  width: 100%; border: 1px solid var(--border-strong); background: #fff; border-radius: 8px;
  padding: 8px 11px 8px 33px; font-size: 12.5px; min-height: 36px;
}
.search-box input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.filter-select select {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 8px;
  padding: 8px 28px 8px 10px; font-size: 12.5px; min-height: 36px;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.filter-select select:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.date-range { display: inline-flex; align-items: center; gap: 5px; }
.date-range input {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 8px;
  padding: 7px 8px; font-size: 11.5px; min-height: 36px; color: var(--text-2);
}
.date-sep { color: var(--faint); font-size: 11px; }
.list-meta {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border);
}
.list-meta-dot { width: 2px; height: 2px; border-radius: 50%; background: var(--faint); }
.list-meta-spacer { flex: 1; }
.list-refresh-note { color: var(--faint); font-size: 10.5px; }
.table-area { min-height: 180px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 14px; font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--faint); font-weight: 650;
  background: #fbfcfe; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
  padding: 13px 14px; border-bottom: 1px solid #eef1f5;
  font-size: 12.5px; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.message-table { min-width: 900px; table-layout: fixed; }
.col-app { width: 16%; }
.col-user { width: 13%; }
.col-message { width: 31%; }
.col-status { width: 10%; }
.col-priority { width: 8%; }
.col-tags { width: 14%; }
.col-time { width: 8%; }
.message-row { cursor: pointer; transition: background .13s; }
.message-row:hover { background: #fafbff; }
.message-row.is-unread { background: #fcfdff; }
.message-row.is-unread .message-text { font-weight: 600; color: var(--text); }
.message-row:focus-visible { outline: 2px solid #a5b4fc; outline-offset: -2px; }
.th-time { text-align: right; }
.time-cell { text-align: right; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.app-cell { display: flex; align-items: center; gap: 9px; }
.app-avatar {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(145deg, #eef2ff, #e0e7ff); color: var(--accent-text);
  font-size: 12px; font-weight: 700; flex: 0 0 auto;
  border: 1px solid #e0e7ff;
}
.app-avatar-lg { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
.app-cell-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.app-cell-text strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.app-cell-text span { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.user-cell { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.user-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 550; color: var(--text-2); }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.user-ext, .user-contact { font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.message-summary { display: flex; flex-direction: column; gap: 4px; max-width: 100%; min-width: 0; }
.message-text {
  color: var(--text-2); font-size: 12.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.message-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--faint); }
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted);
}
.pagination-actions { display: flex; gap: 6px; }

/* ---------- empty / errors / skeletons ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px; gap: 8px;
}
.empty-icon {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 6px;
}
.empty h3 { margin: 0; font-size: 15px; font-weight: 650; }
.empty p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; max-width: 380px; line-height: 1.6; }
.inline-error {
  display: flex; align-items: center; gap: 12px; padding: 18px;
  background: var(--red-soft); border: 1px solid #fecdca; border-radius: 10px; margin: 14px;
}
.inline-error-icon { color: var(--red); display: grid; }
.inline-error strong { display: block; font-size: 12.5px; color: #912018; }
.inline-error p { margin: 2px 0 0; color: #b42318; font-size: 11.5px; }
.inline-error .btn { margin-left: auto; flex: 0 0 auto; }
.error-panel {
  max-width: 460px; margin: 80px auto; text-align: center;
  padding: 32px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.error-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 auto 14px; }
.error-panel h2 { margin: 0 0 6px; font-size: 17px; }
.error-panel p { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
.page-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 80px 0; color: var(--muted); font-size: 12.5px; }
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid #d0d5dd; border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fc 37%, #eef1f5 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.skeleton-stack { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.skeleton-avatar { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.skeleton-line { height: 11px; }
.skeleton-w-30 { width: 30%; }
.skeleton-w-50 { width: 50%; }
.skeleton-w-15 { width: 15%; margin-left: auto; }
.skeleton-card { height: 170px; }
.skeleton-title { width: 40%; height: 24px; margin-bottom: 18px; }
.skeleton-block { height: 100px; margin-bottom: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- detail ---------- */
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--text); }
.detail-top-right { display: flex; align-items: center; gap: 8px; }
.detail-id { font-family: var(--mono); font-size: 10px; color: var(--faint); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-heading { margin-bottom: 22px; }
.detail-heading-main { display: flex; flex-direction: column; gap: 10px; }
.detail-app-row { display: flex; align-items: center; gap: 10px; }
.detail-app-row > div { display: flex; flex-direction: column; line-height: 1.3; }
.detail-app-row strong { font-size: 12px; font-weight: 600; }
.detail-app-row span { font-size: 10.5px; color: var(--muted); }
.detail-heading h2 { margin: 2px 0 0; font-size: 25px; letter-spacing: -.03em; font-weight: 680; }
.detail-heading p { margin: 0; color: var(--muted); font-size: 11.5px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-side { position: sticky; top: 92px; }
.content-card { padding: 20px 22px; }
.content-user { display: flex; align-items: center; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.content-user-meta { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.content-user-meta strong { font-size: 13px; font-weight: 600; }
.content-user-meta span { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.content-time { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 1px; }
.content-time time { font-size: 11.5px; color: var(--text-2); }
.content-time span { font-size: 10px; color: var(--faint); }
.message-content {
  padding: 20px 2px; font-size: 14px; line-height: 1.85; color: var(--text-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
}
.meta-item { background: var(--surface-2); padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.meta-item span { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.meta-item strong { font-size: 11.5px; color: var(--text-2); font-weight: 550; word-break: break-word; }
.content-info {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; padding-top: 15px;
  border-top: 1px solid var(--border);
}
.content-info > div { display: flex; flex-direction: column; gap: 2px; }
.content-info span { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.content-info strong { font-size: 11px; font-weight: 550; color: var(--text-2); }
.timeline-card, .reply-card { padding: 20px 22px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-marker {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); position: relative; z-index: 1;
}
.timeline-marker-admin { background: var(--accent-soft); color: var(--accent); }
.timeline-note .timeline-marker { background: #fef0c7; color: var(--amber); }
.timeline-body { min-width: 0; padding-top: 2px; }
.timeline-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.timeline-author { font-size: 12px; font-weight: 600; color: var(--text-2); }
.timeline-head time { margin-left: auto; font-size: 10px; color: var(--faint); }
.timeline-text { margin: 5px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-empty { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--muted); font-size: 12px; }
.timeline-empty-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; }
.timeline-empty p { margin: 0; }
.reply-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.reply-hint { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
.side-card { padding: 17px 18px; }
.side-card .card-head { margin-bottom: 13px; }
.side-card .field { margin-bottom: 13px; }
.side-card .field:last-child { margin-bottom: 0; }
.side-summary { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.side-empty { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.side-divider { height: 1px; background: var(--border); margin: 13px 0; }
.delivery-box { display: flex; flex-direction: column; gap: 7px; }
.delivery-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.delivery-line strong { color: var(--text-2); font-weight: 550; text-align: right; word-break: break-all; }
.delivery-error { margin: 3px 0 0; padding: 7px 9px; border-radius: 7px; background: var(--red-soft); color: var(--red); font-size: 10.5px; line-height: 1.5; word-break: break-word; }
.delivery-box .btn { margin-top: 5px; }
.danger-card { border-color: #fecdca; }
.danger-card .card-head h3 { color: var(--red); }
.tag-editor { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; margin-bottom: 7px; }
.tag-add { display: flex; gap: 5px; }
.tag-add .input { min-height: 32px; padding: 6px 9px; font-size: 11.5px; }
.tag-add .btn { flex: 0 0 auto; }

/* ---------- apps ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.app-card { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.app-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-card-title > div { min-width: 0; }
.app-card-title h3 { margin: 0; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card-title p { margin: 3px 0 0; font-size: 10.5px; color: var(--muted); }
.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.app-stats > div { background: var(--surface-2); padding: 9px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-stats span { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.app-stats strong { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-capabilities { display: flex; flex-wrap: wrap; gap: 6px; }
.capability {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px;
  border-radius: 6px; background: var(--gray-soft); color: var(--muted);
  font-size: 10.5px;
}
.capability.is-on { background: var(--green-soft); color: var(--green); }
.capability .icon { opacity: .8; }
.app-callback { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-callback-label { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.app-callback .mono { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.app-card-actions .btn { flex: 1 1 auto; }

/* ---------- app detail / integration guide ---------- */
.badge-green { background: var(--green-soft); color: var(--green); }
.app-avatar-xl { width: 56px; height: 56px; border-radius: 15px; font-size: 20px; }
.app-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 22px; margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 65%, #eef2ff 100%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.app-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-hero-main > div { min-width: 0; }
.app-hero h2 { margin: 2px 0 4px; font-size: 23px; letter-spacing: -.03em; font-weight: 680; overflow-wrap: anywhere; }
.app-hero p { margin: 0; color: var(--muted); font-size: 11.5px; }
.app-hero p .mono { color: var(--text-2); }
.app-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.app-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.app-detail-main, .app-detail-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.guide-card { padding: 22px; }
.guide-note {
  padding: 10px 12px; border-radius: 9px; background: var(--amber-soft);
  border: 1px solid #fedf89; color: #93370d; font-size: 11.5px; line-height: 1.65;
}
.guide-note strong { color: #7a2e0e; }
.guide-note-green { background: var(--green-soft); border-color: #abefc6; color: #05603a; }
.guide-note-green strong { color: #054f31; }
.guide-note-red { background: var(--red-soft); border-color: #fecdca; color: var(--red); }
.guide-note-red strong { color: #912018; }
.integration-steps { list-style: none; margin: 12px 0 0; padding: 0; }
.integration-step {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px;
  padding: 22px 0; border-top: 1px solid var(--border);
}
.integration-step:first-child { border-top: 0; padding-top: 12px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700;
  border: 1px solid #e0e7ff;
}
.step-body { min-width: 0; }
.step-body h4 { margin: 1px 0 6px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.step-body > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.code-inline {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 5px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-2); overflow-wrap: anywhere;
}
.code-block {
  margin: 10px 0 0; border-radius: 10px; overflow: hidden;
  background: #0b1220; border: 1px solid #1e293b;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 11px; background: #101b31; border-bottom: 1px solid #1e293b;
  color: #8fa0ba; font-size: 10px; letter-spacing: .06em;
}
.code-copy {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; color: #cbd5e1; font-size: 10.5px;
  padding: 2px 5px; border-radius: 4px;
}
.code-copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.code-block pre {
  margin: 0; padding: 13px 14px; overflow-x: auto;
  color: #dbe7f5; font-family: var(--mono); font-size: 11px; line-height: 1.7;
}
.code-block code { font-family: inherit; white-space: pre; }
.code-hint { margin: 8px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.check-list li { position: relative; padding-left: 22px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 13px; height: 13px;
  border: 1px solid var(--border-strong); border-radius: 4px; background: #fff;
}
.check-list-dot li::before { border: 0; border-radius: 50%; background: var(--accent); width: 7px; height: 7px; top: 7px; left: 2px; box-shadow: 0 0 0 3px var(--accent-soft); }
.guide-text { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.guide-subhead { margin: 20px 0 9px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field-table { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.field-row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px;
  padding: 8px 11px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 11.5px; color: var(--text-2); align-items: baseline;
}
.field-row:first-child { border-top: 0; }
.field-row span { color: var(--muted); line-height: 1.55; }
.app-meta-list { margin: 0; display: flex; flex-direction: column; }
.app-meta-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.app-meta-list > div:last-child { border-bottom: 0; }
.app-meta-list dt { color: var(--muted); font-size: 11.5px; }
.app-meta-list dd { margin: 0; color: var(--text-2); font-size: 11.5px; text-align: right; }
.credential-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.credential-line:first-of-type { border-top: 1px solid var(--border); }
.credential-line > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.credential-line span { font-size: 10px; color: var(--faint); }
.credential-line code { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credential-line .badge { align-self: flex-start; }
.credential-line .btn { flex: 0 0 auto; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-card { padding: 20px 22px; }
.settings-wide { grid-column: 1 / -1; }
.security-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 18px; }
.security-summary > div { background: var(--surface-2); padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; }
.security-summary span { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.security-summary strong { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.session-box { display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 14px; }
.session-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.session-box > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.session-box strong { font-size: 12.5px; }
.session-box span { font-size: 10.5px; color: var(--muted); }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.data-row:last-of-type { border-bottom: 0; }
.data-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.data-row strong { font-size: 12px; font-weight: 600; }
.data-row span { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.system-list { margin: 0; display: flex; flex-direction: column; }
.system-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.system-list > div:last-child { border-bottom: 0; }
.system-list dt { color: var(--muted); font-size: 11.5px; }
.system-list dd { margin: 0; font-size: 11.5px; color: var(--text-2); text-align: right; }
.audit-table { min-width: 720px; }
.audit-meta { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-family: var(--mono); font-size: 10px; }

/* ---------- modal ---------- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 23, 42, .48); backdrop-filter: blur(3px);
  animation: fade-in .16s ease-out;
}
.modal {
  width: min(640px, 100%); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
  animation: modal-in .18s ease-out;
}
.modal-md { width: min(560px, 100%); }
.modal-sm { width: min(430px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fcfdff; }
.confirm-text { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.credential-warning { display: flex; gap: 10px; padding: 11px 12px; background: var(--amber-soft); border: 1px solid #fedf89; border-radius: 9px; margin-bottom: 16px; }
.credential-warning-icon { color: var(--amber); flex: 0 0 auto; margin-top: 1px; }
.credential-warning p { margin: 0; font-size: 11.5px; line-height: 1.6; color: #93370d; }
.credential-block { margin-bottom: 14px; }
.credential-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.credential-row { display: flex; gap: 7px; align-items: stretch; }
.credential-row code {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 8px; background: var(--surface-3);
  border: 1px solid var(--border); font-family: var(--mono); font-size: 11px;
  word-break: break-all; color: var(--text-2);
}
.credential-row .btn { flex: 0 0 auto; }
.credential-hint { margin: 14px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.clipboard-fallback { position: fixed; left: -9999px; top: 0; }

/* ---------- toast ---------- */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 8px; max-width: 360px;
  padding: 11px 13px; border-radius: 10px; background: #101828; color: #f8fafc;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .25); font-size: 12px; line-height: 1.5;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-icon { flex: 0 0 auto; margin-top: 1px; color: #6ee7b7; }
.toast-error .toast-icon { color: #fda29b; }
.toast-info .toast-icon { color: #a5b4fc; }
.toast-text { word-break: break-word; }

/* ---------- login ---------- */
.login-mode { min-height: 100vh; }
.login-page { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); min-height: 100vh; }
.login-brand-panel {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 38px 46px 30px; color: #fff;
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(99, 102, 241, .38), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(14, 165, 233, .18), transparent 55%),
    linear-gradient(150deg, #0b1220 0%, #101b31 52%, #0b1220 100%);
}
.login-brand-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 85%);
}
.login-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.login-brand-top img { border-radius: 10px; box-shadow: 0 8px 26px rgba(79, 70, 229, .4); }
.login-brand-top div { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand-top strong { font-size: 15px; letter-spacing: -.01em; }
.login-brand-top span { font-size: 10px; color: #94a3b8; letter-spacing: .2em; margin-top: 3px; }
.login-brand-copy { position: relative; z-index: 1; margin: auto 0 0; max-width: 560px; }
.eyebrow { font-size: 10px; letter-spacing: .2em; color: #a5b4fc; font-weight: 700; }
.login-brand-copy h1 { margin: 14px 0 16px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.24; letter-spacing: -.035em; font-weight: 680; }
.login-brand-copy p { margin: 0; max-width: 440px; color: #aebbd0; font-size: 14px; line-height: 1.7; }
.login-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; margin: 34px 0 auto; max-width: 470px; }
.login-feature { display: flex; gap: 11px; align-items: flex-start; }
.feature-icon {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  color: #c7d2fe; flex: 0 0 auto;
}
.login-feature div { display: flex; flex-direction: column; gap: 2px; }
.login-feature strong { font-size: 12.5px; font-weight: 600; color: #e2e8f0; }
.login-feature span { font-size: 11.5px; color: #93a4bd; line-height: 1.5; }
.login-brand-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; padding-top: 24px; color: #64748b; font-size: 10px; letter-spacing: .08em; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; background: #fff; position: relative; }
.login-card { width: min(390px, 100%); }
.login-card-head { margin-bottom: 24px; }
.login-mobile-logo { display: none; margin-bottom: 14px; border-radius: 11px; }
.login-card-head h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.03em; font-weight: 680; }
.login-card-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn-block { margin-top: 4px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; color: var(--faint); font-size: 10px; letter-spacing: .08em; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.login-dev-hint { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; }
.login-dev-hint p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.login-copyright { margin-top: 26px; color: var(--faint); font-size: 10px; letter-spacing: .02em; }
.shake { animation: shake .34s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------- animations ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .page { padding: 24px 24px 48px; }
  .topbar { padding: 0 24px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 980px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; width: 248px;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 24px 0 60px rgba(15, 23, 42, .2);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar-menu { display: inline-grid; }
  .page { padding: 22px 20px 44px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .app-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .app-detail-side { display: grid; grid-template-columns: 1fr 1fr; }
  .app-detail-side > .side-card:last-child { grid-column: 1 / -1; }
  .danger-card { grid-column: 1 / -1; }
  .toast-root { right: 14px; bottom: 14px; left: 14px; }
  .toast { max-width: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px; }
  .login-mobile-logo { display: block; }
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 14px; }
  .page { padding: 18px 14px 38px; }
  .page-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-toolbar h2 { font-size: 21px; }
  .topbar-right .version-badge { display: none; }
  .topbar-action span { display: none; }
  .topbar-action { padding: 7px; }
  .filters { padding: 12px 14px; }
  .search-box { flex-basis: 100%; }
  .filter-select { flex: 1 1 calc(50% - 4px); }
  .filter-select select { width: 100%; }
  .date-range { flex: 1 1 100%; }
  .date-range input { flex: 1; }
  .list-meta { padding: 9px 14px; }
  .tabs { padding: 0 10px; }
  .tab { padding: 12px 8px 10px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
  .app-grid { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: 1fr; }
  .danger-card { grid-column: auto; }
  .app-hero { align-items: flex-start; flex-direction: column; }
  .app-hero-actions { width: 100%; }
  .app-detail-side { grid-template-columns: 1fr; }
  .app-detail-side > .side-card:last-child { grid-column: auto; }
  .field-row { grid-template-columns: 1fr; gap: 3px; }
  .detail-heading h2 { font-size: 21px; }
  .detail-id { display: none; }
  .content-card, .timeline-card, .reply-card { padding: 16px; }
  .content-user { flex-wrap: wrap; }
  .content-time { width: 100%; margin-left: 51px; align-items: flex-start; text-align: left; }
  .content-info { gap: 12px; }
  .reply-foot { flex-direction: column; align-items: stretch; }
  .reply-foot .btn { width: 100%; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 14px; }
  .pagination { flex-direction: column; gap: 8px; align-items: stretch; }
  .pagination-actions { justify-content: space-between; }
  .app-card-actions .btn span { display: inline; }
}
@media (max-width: 480px) {
  .page-heading p { display: none; }
  .tab-count { display: none; }
  .message-table { min-width: 900px; }
  .security-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
