:root {
  --ink: #192126;
  --muted: #6f7c82;
  --line: #dde5e4;
  --canvas: #f4f7f6;
  --panel: #ffffff;
  --nav: #122827;
  --nav-soft: #1b3735;
  --teal: #0c806f;
  --teal-dark: #086557;
  --teal-pale: #dff3ef;
  --amber: #d69635;
  --danger: #b84d4d;
  --shadow: 0 18px 50px rgba(26, 51, 48, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1.05fr) minmax(460px, .95fr); background: #edf3f1; }
.login-art { position: relative; overflow: hidden; display: grid; place-content: center; color: white; background: radial-gradient(circle at 28% 28%, #287c70 0, #174a45 42%, #102d2b 100%); }
.login-art::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 48px 48px; }
.pet-mark { position: relative; z-index: 2; display: grid; place-items: center; width: 130px; height: 130px; margin: auto; border: 1px solid rgba(255,255,255,.42); border-radius: 35px; color: #dff8f2; font: 700 66px/1 Georgia, serif; background: rgba(255,255,255,.09); box-shadow: 0 22px 70px rgba(0,0,0,.22); transform: rotate(-4deg); }
.login-art p { position: relative; z-index: 2; margin: 35px 0 0; color: rgba(255,255,255,.7); font: 600 14px/1.7 ui-monospace, monospace; letter-spacing: .28em; text-align: center; }
.orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(157,231,217,.22); border-radius: 50%; transform: translate(-50%,-50%) rotate(-20deg); }
.orbit-one { width: 440px; height: 210px; }
.orbit-two { width: 600px; height: 330px; transform: translate(-50%,-50%) rotate(35deg); }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(430px, 100%); padding: 48px; border: 1px solid rgba(20,60,55,.08); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.login-card h1 { margin: 10px 0 9px; font-size: 31px; letter-spacing: -.04em; }
.muted { margin: 0 0 30px; color: var(--muted); line-height: 1.7; }
label { display: grid; gap: 8px; color: #39474b; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #d7e0de; border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s; }
input, select { height: 44px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #65ad9f; box-shadow: 0 0 0 3px rgba(12,128,111,.11); }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.icon-button { position: absolute; right: 6px; top: 6px; height: 32px; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 700; }
.primary, .secondary, .quiet, .text-button { border: 0; border-radius: 9px; font-weight: 700; }
.primary { min-height: 40px; padding: 0 17px; color: white; background: var(--teal); box-shadow: 0 8px 22px rgba(12,128,111,.15); }
.primary:hover { background: var(--teal-dark); }
.secondary { min-height: 38px; padding: 0 15px; border: 1px solid var(--line); color: #38504d; background: white; }
.secondary:hover { border-color: #9fbbb5; background: #f8fbfa; }
.quiet { padding: 9px 12px; color: var(--muted); background: transparent; }
.quiet:hover { color: var(--danger); background: #fff1f1; }
.wide { width: 100%; height: 46px; margin-top: 20px; }
.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.security-note { margin-top: 18px; color: #7c898d; font-size: 11px; text-align: center; }
.security-note span { color: #2da98f; }
.remember-login { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: #657276; font-size: 12px; font-weight: 550; }
.remember-login input { width: 16px; height: 16px; accent-color: var(--teal); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #e5f1ef; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.brand small { display: block; margin-top: 3px; color: #779b96; font-size: 8px; letter-spacing: .14em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; color: var(--nav); background: #9be0d2; font: 700 22px Georgia, serif; }
nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; color: #a9bfbc; background: transparent; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item span { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #36524f; border-radius: 8px; font-size: 11px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.04); }
.nav-item.active { color: white; background: var(--nav-soft); }
.nav-item.active span { border-color: #5ba99b; color: #b5eee3; background: #245047; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid #29403e; color: #b0c3c0; font-size: 11px; }
.sidebar-foot small { display: block; margin-top: 4px; color: #65817d; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #63d5a7; box-shadow: 0 0 0 4px rgba(99,213,167,.12); }
.workspace { min-width: 0; }
.topbar { min-height: 118px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 38px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(12px); }
.topbar h1 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.03em; }
.breadcrumb { margin: 0; color: #8a9698; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.breadcrumb span { color: var(--teal); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.mobile-menu { display: none; }
.content { padding: 30px 38px 55px; }
.view { display: none; }
.view.active-view { display: block; animation: reveal .2s ease-out; }
@keyframes reveal { from { opacity: .45; transform: translateY(4px); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 16px; }
.stat-card { display: flex; align-items: center; gap: 15px; min-height: 132px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 7px 25px rgba(23,53,50,.035); }
.stat-card .stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 47px; height: 47px; border-radius: 13px; font-weight: 800; }
.stat-card span { display: block; color: #758084; font-size: 12px; font-weight: 650; }
.stat-card strong { display: block; margin: 4px 0 2px; font-size: 29px; line-height: 1; }
.stat-card small { color: #9aa3a6; font-size: 10px; }
.stat-card.teal .stat-icon { color: #087263; background: #dcf2ee; }
.stat-card.violet .stat-icon { color: #7359a8; background: #eee9f8; }
.stat-card.amber .stat-icon { color: #a56c19; background: #faedd7; }
.stat-card.blue .stat-icon { color: #42728e; background: #e1eef4; }
.overview-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 7px 25px rgba(23,53,50,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 25px 17px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.02em; }
.text-button { color: var(--teal); background: transparent; font-size: 12px; }
.quick-actions { display: grid; gap: 10px; padding: 0 20px 22px; }
.quick-actions button { display: grid; grid-template-columns: 43px 1fr; grid-template-rows: auto auto; column-gap: 13px; padding: 14px; border: 1px solid #e3e9e8; border-radius: 12px; color: var(--ink); background: #fbfcfc; text-align: left; }
.quick-actions button:hover { border-color: #a8c7c1; background: #f5faf9; transform: translateY(-1px); }
.quick-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--teal); background: var(--teal-pale); font-size: 20px; }
.quick-actions b { align-self: end; font-size: 13px; }
.quick-actions small { align-self: start; margin-top: 3px; color: #899396; font-size: 10px; }
.activity-list { padding: 0 25px 20px; }
.activity { display: grid; grid-template-columns: 9px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f0; }
.activity:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #59ae9e; }
.activity b { display: block; font-size: 12px; }
.activity small, .activity time { color: #909a9c; font-size: 10px; }
.empty { padding: 28px; color: #8b9799; text-align: center; }

.data-panel { overflow: hidden; }
.toolbar-heading { padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 10px; padding: 17px 24px; background: #fbfcfc; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 15px; color: #778487; background: #f7f9f8; font-size: 10px; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid #edf1f0; color: #344246; vertical-align: middle; white-space: nowrap; }
tbody tr:hover { background: #fbfdfc; }
.actions-col { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: #526364; background: white; font-size: 10px; }
.row-button:hover { border-color: #82b0a7; color: var(--teal); }
.row-button.danger:hover { border-color: #dca5a5; color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.published, .badge.success { color: #177a64; background: #e2f4ef; }
.badge.blocked { color: #a36c1e; background: #faedd9; }
.badge.revoked, .badge.failure { color: #ad4d4d; background: #fae7e7; }
.badge.draft { color: #657478; background: #eaf0ef; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.subtext { display: block; margin-top: 3px; color: #929c9e; font-size: 9px; }
.install-id { max-width: 320px; white-space: normal; overflow-wrap: anywhere; user-select: all; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); color: #748083; font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 10px; }
.info-strip { margin: 17px 24px; padding: 11px 14px; border-left: 3px solid var(--teal); color: #526462; background: #edf7f5; font-size: 11px; }
.upload-panel { margin-bottom: 18px; overflow: hidden; }
.upload-zone { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 24px; padding: 25px; border: 1px dashed #9fc5bd; border-radius: 13px; color: #40534f; background: #f7fbfa; }
.upload-zone.dragging { border-color: var(--teal); background: #ebf7f4; }
.upload-symbol { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 13px; color: var(--teal); background: var(--teal-pale); font-size: 12px; font-weight: 850; }
.upload-zone b, .upload-zone small { display: block; }
.upload-zone small { margin-top: 5px; color: #84918f; font-size: 10px; }
.upload-progress { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; margin: 20px 24px; padding: 17px; border-radius: 11px; background: #f3f8f7; }
.upload-progress > div { grid-column: 1 / 3; display: flex; justify-content: space-between; font-size: 11px; }
.upload-progress progress { align-self: center; width: 100%; height: 8px; accent-color: var(--teal); }
.artifact-heading { display: flex; align-items: center; justify-content: space-between; padding: 6px 24px 12px; }
.artifact-heading h3 { margin: 0; font-size: 13px; }
.announcement-grid { display: grid; grid-template-columns: minmax(430px, 1.1fr) minmax(330px, .9fr); gap: 18px; }
.editor-form { display: grid; gap: 17px; padding: 22px 25px 25px; }
.editor-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; align-items: center; }
.danger-text { color: var(--danger); }
.announcement-preview-panel { overflow: hidden; }
.phone-preview { margin: 0 25px 18px; padding: 18px; border-radius: 22px; color: #e6f3f0; background: linear-gradient(145deg, #183532, #0f2422); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.phone-bar { display: flex; justify-content: space-between; padding: 0 4px 15px; color: #83aaa4; font-size: 9px; font-weight: 750; }
.preview-dialog { padding: 20px; border-radius: 14px; color: var(--ink); background: white; box-shadow: 0 16px 35px rgba(0,0,0,.25); }
.preview-dialog h3 { margin: 0 0 12px; font-size: 17px; }
.preview-content { color: #526064; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-content a, .preview-link { color: var(--teal); text-decoration: underline; }
.preview-link { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; }
.preview-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); }
.preview-actions button { padding: 6px 8px; border: 0; color: var(--teal); background: transparent; font-size: 10px; font-weight: 750; }
.published-summary { margin: 0 25px 24px; padding: 13px; border-radius: 9px; color: #647471; background: #f1f5f4; font-size: 11px; line-height: 1.6; }

dialog { width: min(510px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 17px; color: var(--ink); box-shadow: 0 30px 90px rgba(13,39,36,.25); }
dialog::backdrop { background: rgba(10,28,27,.55); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 17px; padding: 25px; }
.wide-dialog { width: 100%; }
.dialog-form header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.dialog-form h2 { margin: 5px 0 0; font-size: 20px; }
.dialog-close { width: 32px; height: 32px; border: 0; border-radius: 8px; color: #788486; background: #f0f4f3; font-size: 21px; }
.dialog-form footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 7px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-tip { margin: 0; padding: 11px; border-radius: 8px; color: #765a2e; background: #fff5df; font-size: 11px; line-height: 1.55; }
.check-row { display: flex; gap: 24px; }
.check-row label { display: flex; align-items: center; gap: 7px; }
.check-row input { width: 16px; height: 16px; }
.result-dialog pre { max-height: 310px; overflow: auto; margin: 0; padding: 16px; border-radius: 9px; color: #d8f8f0; background: #142b29; font: 12px/1.8 ui-monospace, monospace; user-select: all; }
.success-line { margin: 0; color: #3c7167; font-size: 12px; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 420px; padding: 13px 15px; border: 1px solid #cfe2de; border-radius: 10px; color: #21423c; background: white; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { border-color: #ebc9c9; color: #8f3838; }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .announcement-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { padding: 20px; }
  .login-card { padding: 31px 24px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; left: 0; width: 244px; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .topbar { min-height: 96px; padding: 18px 18px; }
  .mobile-menu { display: inline-block; margin-right: 9px; border: 0; color: var(--teal); background: transparent; }
  .topbar > div:first-child { position: relative; }
  .topbar h1 { display: inline; font-size: 20px; }
  .top-actions .secondary { display: none; }
  .content { padding: 19px 14px 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 108px; }
  .filters { grid-template-columns: 1fr; }
  .toolbar-heading { align-items: flex-start; }
  .form-grid.two { grid-template-columns: 1fr; }
}
