:root {
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --green: #10b981;
  --purple: #8b5cf6;
  --orange: #f59e0b;
  --red: #ef4444;
  --ink: #10223e;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f5f8fc;
  --shadow: 0 12px 35px rgba(30, 64, 175, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #6180aa; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.eyebrow.light { color: #bfdbfe; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; opacity: .35; pointer-events: none;
  background-image: linear-gradient(rgba(59,130,246,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 75%);
}
.ambient { position: fixed; z-index: -2; width: 470px; height: 470px; border-radius: 50%; filter: blur(3px); opacity: .48; pointer-events: none; }
.ambient-one { top: -260px; left: 16%; background: radial-gradient(circle, rgba(59,130,246,.28), transparent 68%); animation: drift 12s ease-in-out infinite alternate; }
.ambient-two { right: -210px; top: 30%; background: radial-gradient(circle, rgba(139,92,246,.16), transparent 69%); animation: drift 15s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(45px, 28px) scale(1.08); } }

.office-shell { display: grid; grid-template-columns: 84px 1fr; min-height: 100vh; }
.side-rail { position: fixed; inset: 0 auto 0 0; width: 84px; z-index: 10; display: flex; align-items: center; flex-direction: column; padding: 24px 12px; background: rgba(255,255,255,.86); border-right: 1px solid rgba(226,232,240,.9); backdrop-filter: blur(18px); }
.brand-mark { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #60a5fa, #2563eb 58%, #1d4ed8); box-shadow: 0 9px 24px rgba(37,99,235,.3); }
.brand-mark span { font-weight: 800; font-size: 21px; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
.rail-nav { display: flex; flex: 1; flex-direction: column; gap: 12px; margin-top: 46px; }
.rail-button { width: 56px; height: 58px; border: 0; border-radius: 14px; background: transparent; color: #8291a8; cursor: default; transition: .2s ease; }
.rail-button span { display: block; font-size: 20px; line-height: 20px; }
.rail-button small { display: block; margin-top: 5px; font-size: 10px; }
.rail-button.active { color: var(--blue-dark); background: #eaf2ff; box-shadow: inset 3px 0 var(--blue); }
.system-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(16,185,129,.11), 0 0 17px rgba(16,185,129,.8); }

.public-main { grid-column: 2; width: min(1180px, calc(100vw - 124px)); margin: 0 auto; padding: 26px 0 70px; }
.topbar, .admin-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; margin-bottom: 26px; }
.topbar h1, .admin-topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 12px; border: 1px solid #d8f3e9; border-radius: 99px; color: #087a5c; background: #f0fdf9; font-size: 12px; font-weight: 700; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.hero-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 34px 40px; color: white; border-radius: 24px; background: linear-gradient(118deg, #174cb7 0%, #2f73e8 52%, #6b5de5 100%); box-shadow: 0 18px 45px rgba(29,78,216,.22); }
.hero-card::after { content: ""; position: absolute; width: 300px; height: 300px; right: 17%; top: -220px; border-radius: 50%; border: 45px solid rgba(255,255,255,.075); }
.hero-label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 99px; background: rgba(255,255,255,.14); color: #dbeafe; font-size: 11px; font-weight: 700; }
.hero-label span { width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; }
.hero-card h2 { position: relative; z-index: 1; margin: 16px 0 8px; font-size: clamp(22px, 4vw, 34px); letter-spacing: -.035em; word-break: break-all; }
.hero-card p { margin: 0; color: #dbeafe; font-size: 14px; }
.hero-metric { position: relative; z-index: 1; min-width: 130px; padding-left: 32px; border-left: 1px solid rgba(255,255,255,.2); text-align: center; }
.hero-metric strong { display: block; font-size: 38px; line-height: 1; }
.hero-metric span { display: block; margin-top: 8px; color: #dbeafe; font-size: 12px; }
.module-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 18px 0; }
.module-strip article { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid rgba(226,232,240,.85); border-radius: 15px; background: rgba(255,255,255,.78); box-shadow: 0 5px 20px rgba(15,23,42,.035); backdrop-filter: blur(12px); }
.module-strip b, .module-strip small { display: block; }
.module-strip b { font-size: 13px; }
.module-strip small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.module-icon { width: 39px; height: 39px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 12px; font-weight: 800; }
.module-icon.blue { color: #2563eb; background: #e9f2ff; }
.module-icon.green { color: #059669; background: #e7faf4; }
.module-icon.purple { color: #7c3aed; background: #f1ebff; }
.module-icon.orange { color: #d97706; background: #fff5dc; }
.content-card, .state-card { border: 1px solid rgba(226,232,240,.88); border-radius: var(--radius); background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.mailbox-card { min-height: 350px; padding: 25px 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; font-size: 13px; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button.primary { color: white; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.button.secondary { border-color: var(--line); color: #334155; background: white; }
.button.ghost { min-height: 34px; padding: 0 12px; border-color: #e7edf5; color: #527098; background: #f8fafc; }
.button.danger { color: white; background: var(--red); }
.button.wide { width: 100%; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: #64748b; background: #fff; cursor: pointer; font-size: 22px; }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 190px; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid #dbeafe; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state > div { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 19px; color: var(--blue); background: #edf5ff; font-size: 26px; }
.empty-state h3 { margin: 0 0 7px; color: #334155; font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }
.message-list { overflow: hidden; border-top: 1px solid #edf1f6; }
.message-item { display: grid; grid-template-columns: 48px minmax(150px, .7fr) minmax(250px, 1.6fr) auto; align-items: center; gap: 14px; width: 100%; padding: 17px 8px; border: 0; border-bottom: 1px solid #edf1f6; background: transparent; text-align: left; cursor: pointer; transition: background .18s; }
.message-item:hover { background: #f8fbff; }
.message-item .avatar { width: 42px; height: 42px; }
.message-sender, .message-copy { min-width: 0; }
.message-sender b, .message-copy b, .message-sender small, .message-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-sender b, .message-copy b { font-size: 13px; }
.message-sender small, .message-copy small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.message-time { color: #8391a6; font-size: 11px; white-space: nowrap; }
.avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #285fb7; background: linear-gradient(135deg, #e5f0ff, #f0edff); font-weight: 800; }
.avatar.small { width: 38px; height: 38px; border-radius: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 20px; color: var(--muted); font-size: 12px; }
.state-card { width: min(560px, 100%); margin: 12vh auto 0; padding: 55px 40px; text-align: center; }
.state-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 24px; color: var(--blue); background: #eaf3ff; font-size: 35px; }
.state-card h2 { margin: 0 0 10px; }
.state-card p { margin: 0 auto; max-width: 420px; color: var(--muted); line-height: 1.7; }
.drawer-backdrop, .dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: rgba(15,23,42,.35); backdrop-filter: blur(3px); }
.message-drawer { width: min(720px, 94vw); height: 100%; overflow-y: auto; padding: 28px 32px; background: white; box-shadow: -20px 0 60px rgba(15,23,42,.15); animation: slide-in .23s ease-out; }
@keyframes slide-in { from { transform: translateX(60px); opacity: 0; } }
.message-drawer > header { display: flex; align-items: start; justify-content: space-between; gap: 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.message-drawer h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.mail-meta { display: flex; align-items: center; gap: 13px; padding: 20px 0; color: #334155; }
.mail-meta > div:nth-child(2) { min-width: 0; flex: 1; }
.mail-meta strong, .mail-meta small { display: block; overflow: hidden; text-overflow: ellipsis; }
.mail-meta small { margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.mail-meta time { color: var(--muted); font-size: 11px; }
.mail-content { padding: 18px 3px 40px; color: #26364e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-frame { width: 100%; min-height: 450px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.toast { position: fixed; z-index: 300; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: min(480px, 90vw); padding: 12px 18px; border-radius: 12px; color: white; background: #17325b; box-shadow: 0 12px 40px rgba(15,23,42,.25); font-size: 13px; }
.toast.error { background: #b4233a; }
.mobile-nav { display: none; }

/* Admin login */
.login-layout { display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(430px, .9fr); min-height: 100vh; }
.login-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: clamp(38px, 6vw, 82px); color: white; background: linear-gradient(145deg, #123b88, #1d5fcb 60%, #5648cc); }
.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.login-intro::before { width: 530px; height: 530px; right: -230px; bottom: -150px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.login-intro::after { width: 210px; height: 210px; left: -90px; top: 34%; }
.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.brand-lockup b, .brand-lockup small { display: block; }
.brand-lockup b { font-size: 17px; }
.brand-lockup small { margin-top: 3px; color: #bfdbfe; font-size: 9px; letter-spacing: .13em; }
.intro-copy { position: relative; z-index: 1; margin: auto 0; }
.intro-copy h1 { margin: 10px 0 20px; font-size: clamp(36px, 4vw, 57px); line-height: 1.22; letter-spacing: -.05em; }
.intro-copy > p:last-child { max-width: 560px; color: #dbeafe; line-height: 1.8; }
.intro-features { position: relative; z-index: 1; display: flex; gap: 28px; color: #dbeafe; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 32px; background: rgba(248,250,252,.8); }
.login-card { width: min(410px, 100%); padding: 40px; border: 1px solid rgba(226,232,240,.8); border-radius: 23px; background: rgba(255,255,255,.9); box-shadow: 0 25px 70px rgba(30,64,175,.12); }
.login-card h2 { margin: 0 0 8px; font-size: 27px; }
.login-card > p.muted { margin: 0 0 28px; font-size: 13px; }
label { display: block; color: #43536a; font-size: 12px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #dce4ee; border-radius: 11px; outline: none; color: #20314a; background: #fbfdff; transition: border .2s, box-shadow .2s; }
input { height: 45px; padding: 0 13px; }
textarea { padding: 13px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: #7aaff8; box-shadow: 0 0 0 3px rgba(59,130,246,.11); background: white; }
.login-card label { margin: 18px 0; }
.login-card input { margin-top: 8px; }
.security-note { margin: 20px 0 0; color: #8a99ad; text-align: center; font-size: 10px; }
.form-error { margin: 10px 0 !important; padding: 10px 12px; border-radius: 9px; color: #b4233a; background: #fff0f2; font-size: 12px !important; }

/* Admin app */
.admin-shell { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 238px; display: flex; flex-direction: column; padding: 24px 16px; color: #dbeafe; background: linear-gradient(180deg, #102a57, #173b72 60%, #18345f); box-shadow: 8px 0 30px rgba(15,23,42,.1); }
.brand-lockup.inverse { padding: 2px 7px 27px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-lockup.inverse .brand-mark { box-shadow: none; }
.brand-lockup.inverse b { color: white; font-size: 14px; }
.brand-lockup.inverse small { color: #86a6d4; letter-spacing: .05em; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 7px; padding-top: 25px; }
.admin-nav { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 45px; padding: 0 14px; border: 0; border-radius: 10px; color: #a9c0e2; background: transparent; font-size: 13px; text-align: left; cursor: pointer; }
.admin-nav span { width: 20px; font-size: 17px; text-align: center; }
.admin-nav:hover, .admin-nav.active { color: white; background: rgba(96,165,250,.16); }
.admin-nav.active { box-shadow: inset 3px 0 #60a5fa; }
.sidebar-status { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 15px 13px; border-radius: 11px; background: rgba(255,255,255,.06); }
.sidebar-status i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.sidebar-status b, .sidebar-status small { display: block; }
.sidebar-status b { color: #d8e8ff; font-size: 11px; }
.sidebar-status small { margin-top: 3px; color: #829fc7; font-size: 9px; }
.admin-nav.logout { margin-top: 8px; }
.admin-main { grid-column: 2; min-width: 0; padding: 0 34px 50px; }
.admin-topbar { position: sticky; top: 0; z-index: 10; margin: 0 -34px 26px; padding: 14px 34px; border-bottom: 1px solid rgba(226,232,240,.8); background: rgba(248,250,252,.86); backdrop-filter: blur(16px); }
.admin-topbar h1 { font-size: 20px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user b, .admin-user small { display: block; }
.admin-user b { font-size: 12px; }
.admin-user small { color: var(--muted); font-size: 10px; }
.menu-button { display: none; }
.admin-panel { max-width: 1350px; margin: auto; }
.welcome-banner { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; min-height: 166px; padding: 27px 35px; border-radius: 20px; color: white; background: linear-gradient(110deg, #2358bd, #347fe7 62%, #6b63dc); box-shadow: 0 15px 40px rgba(29,78,216,.18); }
.welcome-banner::after { content: ""; position: absolute; width: 260px; height: 260px; right: 11%; bottom: -220px; border: 38px solid rgba(255,255,255,.08); border-radius: 50%; }
.welcome-banner p { margin: 0 0 8px; color: #dbeafe; font-size: 12px; }
.welcome-banner h2 { margin: 0 0 10px; font-size: 25px; }
.welcome-banner span { color: #dbeafe; font-size: 12px; }
.pulse-chart { position: relative; z-index: 2; display: flex; align-items: end; gap: 7px; height: 70px; padding-right: 10px; }
.pulse-chart i { width: 9px; border-radius: 9px; background: rgba(255,255,255,.35); animation: pulse-bars 2s ease-in-out infinite alternate; }
.pulse-chart i:nth-child(1), .pulse-chart i:nth-child(6) { height: 24px; }.pulse-chart i:nth-child(2) { height: 42px; }.pulse-chart i:nth-child(3) { height: 32px; }.pulse-chart i:nth-child(4) { height: 61px; }.pulse-chart i:nth-child(5) { height: 48px; }.pulse-chart i:nth-child(7) { height: 55px; }
@keyframes pulse-bars { to { opacity: .65; transform: scaleY(.82); } }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 19px 0; }
.stats-grid article { padding: 19px 20px; border: 1px solid rgba(226,232,240,.86); border-radius: 15px; background: white; box-shadow: 0 7px 25px rgba(15,23,42,.04); transition: transform .2s, box-shadow .2s; }
.stats-grid article:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-head { display: flex; align-items: center; gap: 11px; }
.stat-head .module-icon { width: 35px; height: 35px; border-radius: 10px; }
.stat-head small { color: var(--muted); }
.stats-grid strong { display: block; margin: 13px 0 7px; font-size: 27px; }
.stats-grid p { margin: 0; color: #8794a7; font-size: 10px; }
.stats-grid .up { color: var(--green); font-style: normal; font-size: 8px; }
.overview-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; }
.quick-actions, .system-card { padding: 23px; }
.quick-actions > button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 6px; border: 0; border-top: 1px solid #edf1f6; background: transparent; text-align: left; cursor: pointer; }
.quick-actions > button:hover { background: #f8fbff; }
.quick-actions > button div { flex: 1; }.quick-actions b, .quick-actions small { display: block; }.quick-actions b { font-size: 12px; }.quick-actions small { margin-top: 4px; color: var(--muted); font-size: 10px; }.quick-actions em { color: #94a3b8; font-style: normal; }
.system-row { display: flex; justify-content: space-between; padding: 16px 2px; border-top: 1px solid #edf1f6; color: var(--muted); font-size: 12px; }.system-row b { color: #059669; }
.page-grid { display: grid; gap: 18px; }
.import-grid { grid-template-columns: minmax(460px, 1.2fr) minmax(360px, .8fr); }
.upstream-grid { grid-template-columns: minmax(340px, .65fr) minmax(580px, 1.35fr); }
.import-card, .result-card { padding: 26px; }
.upstream-form { align-self: start; padding: 26px; }
.upstream-form > label { margin: 19px 0; }
.upstream-form label input { margin-top: 8px; }
.config-hint { margin: 15px 0 0; padding: 11px 12px; border-radius: 10px; color: #6b7e98; background: #f4f7fb; font-size: 11px; line-height: 1.55; }
.config-hint.warning { color: #98600b; background: #fff8e8; }
.upstream-list-card { min-height: 360px; }
.import-card > label { margin: 19px 0; }
.import-card label input, .import-card label textarea { margin-top: 8px; }
label small { display: block; margin-top: 7px; color: #8694a6; font-weight: 400; line-height: 1.5; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-button input { display: none; }
.result-card { display: flex; flex-direction: column; min-height: 580px; }
.result-card pre { flex: 1; overflow: auto; margin: 0 0 15px; padding: 16px; border: 1px solid #e3eaf3; border-radius: 12px; color: #4e6687; background: #f7faff; font-size: 11px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.table-card { overflow: hidden; padding: 25px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.table-toolbar h2 { margin: 0; font-size: 18px; }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 280px; padding-left: 11px; border: 1px solid #dce4ee; border-radius: 11px; color: #94a3b8; background: #fbfdff; }
.search-box input { height: 39px; padding-left: 0; border: 0; background: transparent; box-shadow: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px; color: #8090a6; background: #f7f9fc; font-size: 10px; text-align: left; white-space: nowrap; }
th:first-child { border-radius: 9px 0 0 9px; } th:last-child { border-radius: 0 9px 9px 0; }
td { padding: 15px 12px; border-bottom: 1px solid #edf1f6; color: #43526a; }
td code { color: #245bb5; font-family: inherit; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; color: #06785a; background: #eafaf5; font-size: 10px; font-weight: 700; }.status-badge.off { color: #7b8797; background: #edf1f5; }.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.row-actions { display: flex; gap: 6px; }.row-actions button { min-height: 30px; padding: 0 9px; border: 1px solid #dfe7f0; border-radius: 8px; color: #41638f; background: white; cursor: pointer; font-size: 10px; }.row-actions button:hover { color: #1d4ed8; border-color: #a9c9fa; }.row-actions button.warning { color: #a45a08; }
.message-list.compact { margin-top: 15px; }.message-list.compact .message-item { grid-template-columns: 44px minmax(120px,.7fr) minmax(190px,1.5fr) auto; }
.admin-message-detail > .button { margin: 18px 0; }.admin-message-detail > h2 { margin: 8px 0; }
.dialog-backdrop { align-items: center; justify-content: center; }
.confirm-card { width: min(420px, 90vw); padding: 26px; border-radius: 17px; background: white; box-shadow: 0 25px 70px rgba(15,23,42,.22); }.confirm-card h3 { margin: 0 0 10px; }.confirm-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }.confirm-card > div { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .import-grid, .upstream-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 380px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 720px) {
  .office-shell { display: block; }.side-rail { display: none; }
  .public-main { width: auto; padding: 18px 15px 92px; }.topbar { margin-bottom: 18px; }.topbar h1 { font-size: 18px; }.status-pill { padding: 7px 9px; font-size: 10px; }
  .hero-card { align-items: flex-start; padding: 25px 22px; }.hero-card h2 { font-size: 21px; }.hero-card p { max-width: 75%; font-size: 11px; }.hero-metric { min-width: 80px; padding-left: 15px; }.hero-metric strong { font-size: 27px; }
  .module-strip { grid-template-columns: repeat(3, 1fr); gap: 7px; }.module-strip article { justify-content: center; padding: 12px 5px; text-align: center; }.module-strip .module-icon { display: none; }.module-strip b { font-size: 11px; }.module-strip small { font-size: 9px; }
  .mailbox-card { padding: 20px 15px; }.message-item { grid-template-columns: 42px 1fr auto; gap: 10px; }.message-copy { display: none; }.message-time { font-size: 9px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 20; display: flex; justify-content: space-around; padding: 9px 4px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(15px); }.mobile-nav span { color: #8a99ad; text-align: center; font-size: 18px; }.mobile-nav span.active { color: var(--blue); }.mobile-nav small { display: block; margin-top: 2px; font-size: 9px; }
  .message-drawer { width: 100vw; padding: 20px 17px; }.mail-meta time { display: none; }
  .admin-shell { display: block; }.admin-sidebar { transform: translateX(-100%); transition: transform .22s; }.admin-sidebar.open { transform: translateX(0); }.admin-main { padding: 0 14px 40px; }.admin-topbar { margin: 0 -14px 19px; padding: 11px 14px; }.menu-button { display: block; }.admin-topbar .eyebrow { display: none; }.admin-topbar h1 { font-size: 17px; }.admin-user div { display: none; }
  .welcome-banner { min-height: 145px; padding: 24px 22px; }.welcome-banner h2 { font-size: 20px; }.welcome-banner span { display: block; max-width: 75%; }.pulse-chart { display: none; }
  .stats-grid { gap: 9px; }.stats-grid article { padding: 15px; }.stats-grid strong { font-size: 23px; }
  .quick-actions, .system-card, .import-card, .result-card, .table-card { padding: 18px 15px; }
  .form-actions { align-items: stretch; flex-direction: column; }.form-actions .button { width: 100%; }
  .table-toolbar { align-items: stretch; flex-direction: column; }.search-box { min-width: 0; }
  .admin-mail-drawer { padding: 18px 15px; }.message-list.compact .message-item { grid-template-columns: 42px 1fr auto; }.message-list.compact .message-copy { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
