:root {
  --brand: #d92820;
  --brand-dark: #a81714;
  --ink: #202327;
  --muted: #747a84;
  --line: #e9eaec;
  --canvas: #f5f6f8;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
[hidden] { display: none !important; }
.logout-form { margin: 0; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); background: #fff; }
.login-story { position: relative; overflow: hidden; min-height: 100vh; background: linear-gradient(145deg, #9f1714 0%, #d3261f 48%, #ee4938 100%); color: #fff; padding: clamp(36px, 6vw, 88px); display: flex; align-items: center; }
.login-story::before { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(rgba(255,255,255,.26) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.26) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(135deg, #000, transparent 72%); }
.story-glow { position: absolute; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.story-glow-one { width: 550px; height: 550px; right: -220px; top: -170px; box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025); }
.story-glow-two { width: 360px; height: 360px; left: -210px; bottom: -190px; box-shadow: 0 0 0 56px rgba(255,255,255,.04); }
.login-brand-card { position: relative; z-index: 1; max-width: 650px; width: 100%; }
.login-logo-wrap { display: inline-flex; padding: 16px 20px; background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(78, 5, 3, .23); }
.login-logo { width: clamp(230px, 26vw, 360px); height: auto; display: block; }
.story-copy { margin-top: clamp(48px, 7vw, 84px); }
.eyebrow, .banner-kicker, .section-kicker { font-size: 11px; letter-spacing: .2em; font-weight: 700; }
.eyebrow { color: rgba(255,255,255,.72); }
.story-copy h1 { font-size: clamp(40px, 5vw, 70px); line-height: 1.12; margin: 20px 0 20px; letter-spacing: -.04em; }
.story-copy p { margin: 0; color: rgba(255,255,255,.82); font-size: clamp(16px, 1.5vw, 21px); line-height: 1.85; }
.story-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 64px; }
.story-features div { border-top: 1px solid rgba(255,255,255,.28); padding-top: 18px; display: flex; flex-direction: column; gap: 7px; }
.story-features strong { font: 700 12px/1 Arial; letter-spacing: .15em; color: rgba(255,255,255,.55); }
.story-features span { font-size: 14px; font-weight: 600; }
.login-panel { padding: 48px clamp(42px, 7vw, 110px); display: flex; align-items: center; justify-content: center; background: #fff; }
.login-form-wrap { width: min(100%, 430px); }
.mobile-logo-wrap { display: none; }
.login-heading { display: flex; align-items: center; gap: 9px; color: var(--brand); font-size: 13px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px rgba(217,40,32,.09); }
.login-form-wrap h2 { margin: 22px 0 10px; font-size: 36px; letter-spacing: -.04em; }
.login-subtitle { margin: 0 0 36px; color: var(--muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; }
.login-form > label { font-size: 13px; font-weight: 700; margin: 0 0 9px; }
.input-shell { height: 52px; display: flex; align-items: center; gap: 13px; border: 1px solid #dadde1; border-radius: 8px; padding: 0 15px; margin-bottom: 20px; transition: border .2s, box-shadow .2s; }
.input-shell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(217,40,32,.08); }
.input-shell > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; background: #f4f4f5; color: #71757b; font-size: 11px; font-weight: 700; }
.input-shell input, .input-shell select { min-width: 0; flex: 1; outline: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.input-shell input::placeholder { color: #b1b5bb; }
.select-shell select { cursor: pointer; }
.form-options { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 26px; }
.remember-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; cursor: pointer; }
.remember-row input { accent-color: var(--brand); }
.text-button { padding: 0; background: transparent; color: var(--brand); font-size: 13px; cursor: pointer; }
.login-button { height: 54px; padding: 0 20px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(135deg, var(--brand), #b91d18); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 14px 30px rgba(197,31,25,.23); transition: transform .2s, box-shadow .2s; }
.login-button:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(197,31,25,.28); }
.login-button:disabled { opacity: .68; cursor: wait; transform: none; }
.login-error { margin: -5px 0 18px; padding: 10px 12px; border-radius: 6px; background: #fff0ef; color: #b31f1a; font-size: 12px; line-height: 1.5; }
.managed-account { color: #93989f; font-size: 12px; }
.security-note { margin: 20px 0 0; padding: 12px 14px; border-radius: 7px; background: #f6f7f8; color: #777d85; font-size: 12px; line-height: 1.6; }
.copyright { margin: 30px 0 0; color: #b0b4ba; font-size: 12px; }
.app-loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: #fff; color: #8a8f96; font-size: 13px; }
.app-loading img { width: 250px; height: auto; animation: loading-pulse 1.6s ease-in-out infinite; }
@keyframes loading-pulse { 50% { opacity: .5; transform: scale(.985); } }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 0 18px 22px; display: flex; flex-direction: column; z-index: 5; }
.sidebar::before { content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: var(--brand); }
.sidebar-brand { height: 86px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); padding: 0 8px; }
.sidebar-brand img { width: 90px; height: 34px; object-fit: contain; }
.sidebar-brand div { border-left: 1px solid #e1e2e4; padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-brand strong { font-size: 14px; }
.sidebar-brand span { font-size: 11px; color: var(--brand); letter-spacing: .08em; font-weight: 700; }
.main-nav { padding: 24px 0; display: flex; flex-direction: column; gap: 6px; }
.nav-label { color: #aaaeb4; font-size: 10px; letter-spacing: .12em; padding: 0 13px 7px; }
.nav-section { margin-top: 19px; }
.nav-item { position: relative; width: 100%; height: 45px; border-radius: 7px; display: flex; align-items: center; gap: 12px; padding: 0 13px; background: transparent; color: #5f646c; cursor: pointer; text-align: left; font-size: 13px; transition: background .18s, color .18s; }
.nav-item:hover { background: #faf1f0; color: var(--brand); }
.nav-item.active { background: #fff0ef; color: var(--brand); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 23px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.035); font-size: 12px; font-style: normal; }
.nav-item.active .nav-icon { background: rgba(217,40,32,.1); }
.nav-item em { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: #f1f2f3; display: grid; place-items: center; font-size: 10px; font-style: normal; color: #8a8f96; }
.nav-link { text-decoration: none; }
.sidebar-security { margin-top: auto; border: 1px solid #f0d5d2; background: #fff8f7; border-radius: 9px; padding: 14px; display: flex; align-items: center; gap: 10px; }
.shield { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50% 50% 46% 46%; font-size: 12px; }
.sidebar-security div { display: flex; flex-direction: column; gap: 3px; }
.sidebar-security strong { font-size: 12px; }
.sidebar-security span:last-child { font-size: 10px; color: #a07c78; }
.portal-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; height: 72px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 0 38px; display: flex; align-items: center; justify-content: space-between; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #a3a7ad; }
.breadcrumb i { font-style: normal; color: #d7d9dc; }
.breadcrumb strong { color: #565b62; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.admin-shortcut { color: #7b8087; font-size: 11px; text-decoration: none; transition: color .18s; }
.admin-shortcut:hover { color: var(--brand); }
.role-pill { padding: 6px 10px; background: #fff2f1; color: var(--brand); border: 1px solid #f5d5d2; border-radius: 14px; font-size: 11px; font-weight: 700; }
.user-menu { display: flex; align-items: center; gap: 10px; background: transparent; padding: 4px; cursor: pointer; color: #777c83; }
.avatar { width: 34px; height: 34px; border-radius: 7px; background: linear-gradient(135deg, #e34538, #a71915); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.user-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.user-copy strong { color: #30343a; font-size: 12px; }
.user-copy small { color: #aaaeb5; font-size: 9px; }
.mobile-brand { display: none; }
.portal-content { padding: 30px clamp(24px, 3.2vw, 52px) 24px; max-width: 1580px; margin: 0 auto; }
.welcome-banner { position: relative; min-height: 230px; overflow: hidden; border-radius: 12px; padding: 36px 42px; background: linear-gradient(118deg, #9f1714 0%, #ce251e 52%, #e64234 100%); color: #fff; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 16px 38px rgba(147,23,19,.16); }
.welcome-banner::before, .welcome-banner::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); }
.welcome-banner::before { width: 360px; height: 360px; right: -90px; top: -220px; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.welcome-banner::after { width: 180px; height: 180px; left: 47%; bottom: -150px; box-shadow: 0 0 0 35px rgba(255,255,255,.025); }
.banner-copy { position: relative; z-index: 1; max-width: 670px; }
.banner-kicker { color: rgba(255,255,255,.64); }
.banner-copy h1 { margin: 14px 0 10px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; }
.banner-copy p { margin: 0; max-width: 610px; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.8; }
.date-label { display: inline-block; margin-top: 23px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); border-radius: 4px; font-size: 11px; color: rgba(255,255,255,.78); }
.banner-metrics { position: relative; z-index: 1; display: flex; align-items: stretch; margin-right: 40px; background: rgba(96,0,0,.14); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; backdrop-filter: blur(8px); }
.banner-metrics div { min-width: 114px; padding: 21px 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.banner-metrics div + div { border-left: 1px solid rgba(255,255,255,.13); }
.banner-metrics strong { font-size: 28px; line-height: 1; }
.banner-metrics span { color: rgba(255,255,255,.66); font-size: 10px; }
.banner-mark { position: absolute; right: -6px; bottom: -27px; color: rgba(255,255,255,.055); font: 900 126px/1 Arial; letter-spacing: -.12em; }
.workspace-section { margin-top: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section-kicker { color: var(--brand); }
.section-heading h2 { font-size: 23px; margin: 8px 0 5px; }
.section-heading p { margin: 0; color: #989da4; font-size: 12px; }
.search-box { width: min(330px, 34vw); height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid #dfe1e4; border-radius: 7px; background: #fff; padding: 0 13px; }
.search-box > span { color: #a5aab1; font-size: 18px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #b1b5bb; }
.category-tabs { margin-top: 24px; border-bottom: 1px solid #dedfe2; display: flex; gap: 30px; }
.category-tabs button { position: relative; padding: 0 2px 13px; background: transparent; color: #81868d; font-size: 12px; cursor: pointer; }
.category-tabs button.active { color: var(--brand); font-weight: 700; }
.category-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.system-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.system-card { position: relative; min-height: 278px; overflow: hidden; background: #fff; border: 1px solid #e4e5e7; border-radius: 9px; padding: 26px 25px 22px; box-shadow: 0 7px 22px rgba(38,39,41,.04); transition: transform .22s, box-shadow .22s, border-color .22s; }
.system-card:hover { transform: translateY(-4px); border-color: #edc4c1; box-shadow: 0 14px 30px rgba(80,31,28,.09); }
.card-topline { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.system-icon { width: 47px; height: 47px; border-radius: 9px; display: grid; place-items: center; font: 800 16px/1 Arial, sans-serif; }
.availability { height: 23px; padding: 0 8px; border-radius: 12px; display: flex; align-items: center; gap: 5px; font-size: 10px; }
.availability i { width: 5px; height: 5px; border-radius: 50%; }
.availability.online { color: #28804f; background: #ecf8f1; }
.availability.online i { background: #32a765; }
.availability.restricted { color: #8d9299; background: #f1f2f3; }
.availability.restricted i { background: #a4a8ae; }
.system-category { display: inline-block; margin-top: 22px; color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.system-card h3 { margin: 7px 0 9px; font-size: 18px; letter-spacing: -.02em; }
.system-card p { margin: 0; color: #858a91; font-size: 12px; line-height: 1.75; min-height: 43px; }
.card-footer { margin-top: 24px; padding-top: 17px; border-top: 1px solid #eff0f1; }
.card-footer a, .card-footer button { width: 100%; display: flex; align-items: center; justify-content: space-between; color: #45494f; background: transparent; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.card-footer a span:last-child { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #fff0ef; color: var(--brand); transition: background .18s, color .18s; }
.card-footer a:hover { color: var(--brand); }
.card-footer a:hover span:last-child { background: var(--brand); color: #fff; }
.system-card.locked { background: #fafafa; box-shadow: none; }
.system-card.locked:hover { transform: none; border-color: #e4e5e7; }
.system-card.locked .system-icon, .system-card.locked h3, .system-card.locked p, .system-card.locked .system-category { filter: grayscale(1); opacity: .62; }
.card-footer button:disabled { color: #a2a6ac; cursor: not-allowed; }
.empty-state { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #d9dbdf; border-radius: 9px; color: #a1a5ab; }
.empty-state strong { color: #777c83; font-size: 14px; }
.empty-state span { font-size: 12px; }
.error-state { border-color: #efcecb; background: #fffafa; }
.error-state strong { color: #b32a24; }
.security-strip { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.security-strip div { position: relative; padding: 19px 24px 19px 73px; min-height: 80px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.security-strip div + div { border-left: 1px solid var(--line); }
.security-strip div > span { position: absolute; left: 24px; top: 22px; width: 36px; height: 36px; border-radius: 8px; background: #fff2f1; color: var(--brand); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.security-strip strong { font-size: 12px; }
.security-strip small { color: #a0a4aa; font-size: 10px; }
.portal-footer { padding: 25px 2px 8px; display: flex; justify-content: space-between; color: #a8acb2; font-size: 10px; }

.admin-page { min-height: 100vh; background: #f5f6f8; }
.admin-header { height: 74px; position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-brand { display: flex; align-items: center; gap: 15px; color: var(--ink); text-decoration: none; }
.admin-brand img { width: 116px; height: 40px; object-fit: contain; }
.admin-brand div { padding-left: 15px; border-left: 1px solid #e0e1e3; display: flex; flex-direction: column; gap: 3px; }
.admin-brand strong { font-size: 14px; }
.admin-brand span { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user > div { display: flex; flex-direction: column; gap: 2px; }
.admin-user > div strong { font-size: 12px; }
.admin-user > div span { color: #9a9fa6; font-size: 10px; }
.admin-user button { margin-left: 12px; padding: 7px 12px; border-radius: 5px; background: #f5f5f6; color: #737880; font-size: 11px; cursor: pointer; }
.admin-layout { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.admin-side { padding: 33px 18px; background: #fff; border-right: 1px solid var(--line); }
.admin-side-title { padding: 0 12px 26px; display: flex; flex-direction: column; gap: 7px; }
.admin-side-title span { color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.admin-side-title strong { font-size: 20px; }
.admin-side > button, .admin-side > a { width: 100%; min-height: 58px; margin-bottom: 8px; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 11px; background: transparent; color: #656a72; text-align: left; text-decoration: none; cursor: pointer; }
.admin-side > button:hover, .admin-side > a:hover, .admin-side > button.active { background: #fff1f0; color: var(--brand); }
.admin-side > button > span, .admin-side > a > span { flex: 0 0 31px; width: 31px; height: 31px; border-radius: 7px; display: grid; place-items: center; background: #f3f4f5; font-size: 11px; font-weight: 700; }
.admin-side > button.active > span { color: #fff; background: var(--brand); }
.admin-side > button div, .admin-side > a div { display: flex; flex-direction: column; gap: 3px; }
.admin-side > button strong, .admin-side > a strong { font-size: 12px; }
.admin-side > button small, .admin-side > a small { color: #aaaeb4; font-size: 9px; }
.admin-side > a { margin-top: 30px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 22px; }
.admin-side > a.tab-link { margin-top: 0; border-top: 0; border-radius: 8px; padding-top: 10px; }
.admin-side > a.tab-link.active { background: #fff1f0; color: var(--brand); }
.admin-side > a.tab-link.active > span { color: #fff; background: var(--brand); }
.admin-content { min-width: 0; padding: 40px clamp(24px, 4vw, 62px) 60px; }
.admin-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.admin-title-row h1 { margin: 9px 0 7px; font-size: 28px; letter-spacing: -.03em; }
.admin-title-row p { margin: 0; color: #888d94; font-size: 12px; }
.admin-summary { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.admin-summary div { min-width: 96px; padding: 14px 18px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.admin-summary div + div { border-left: 1px solid var(--line); }
.admin-summary strong { font-size: 20px; }
.admin-summary span { color: #9ca1a8; font-size: 9px; }
.admin-notice { margin-top: 22px; padding: 12px 16px; border-radius: 7px; font-size: 12px; }
.admin-notice.success { color: #287b4d; background: #edf8f2; border: 1px solid #d3eddf; }
.admin-notice.error { color: #ad2823; background: #fff1f0; border: 1px solid #f1d1ce; }
.admin-loading { margin-top: 30px; min-height: 240px; border-radius: 10px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: #999ea5; font-size: 13px; }
.admin-section-stack { margin-top: 29px; display: flex; flex-direction: column; gap: 22px; }
.admin-create-card { padding: 20px; display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(180px, 1fr) minmax(220px, 1.5fr) auto; align-items: center; gap: 13px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.admin-create-card > div { display: flex; flex-direction: column; gap: 5px; }
.admin-create-card > div span { color: var(--brand); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.admin-create-card > div strong { font-size: 13px; }
.admin-create-card input, .admin-create-card select { min-width: 0; height: 40px; padding: 0 12px; border: 1px solid #dde0e3; border-radius: 6px; outline: 0; color: var(--ink); background: #fff; font-size: 11px; }
.admin-create-card input:focus, .admin-create-card select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(217,40,32,.07); }
.admin-create-card > button { height: 40px; padding: 0 17px; border-radius: 6px; color: #fff; background: var(--brand); font-size: 11px; font-weight: 700; cursor: pointer; }
.admin-create-card button:disabled { opacity: .6; cursor: wait; }
.user-create { grid-template-columns: minmax(170px, 1.2fr) repeat(4, minmax(130px, 1fr)) auto; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.role-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 22px rgba(35,37,40,.035); }
.role-card.admin-role { border-top: 3px solid var(--brand); }
.role-card-head { min-height: 92px; padding: 21px 22px; border-bottom: 1px solid #eff0f1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.role-card-head > div { display: flex; align-items: center; gap: 12px; }
.role-card-head > div > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: #fff1f0; font-size: 10px; font-weight: 700; }
.admin-role .role-card-head > div > span { color: #fff; background: var(--brand); }
.role-card-head h2 { margin: 0 0 5px; font-size: 15px; }
.role-card-head p { margin: 0; color: #999ea5; font-size: 10px; }
.role-card-head em { padding: 5px 8px; border-radius: 10px; background: #f4f5f6; color: #8d9299; font-size: 9px; font-style: normal; white-space: nowrap; }
.permission-list { padding: 20px 22px; display: flex; flex-direction: column; gap: 9px; }
.permission-label { margin-bottom: 3px; color: #9da2a9; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.permission-list label { min-height: 48px; padding: 8px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid #e4e6e8; border-radius: 7px; cursor: pointer; transition: border .18s, background .18s; }
.permission-list label.selected { border-color: #edc5c2; background: #fff8f7; }
.permission-list input { position: absolute; opacity: 0; pointer-events: none; }
.permission-check { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; border: 1px solid #d5d8dc; color: transparent; background: #fff; font-size: 10px; }
.permission-list label.selected .permission-check { color: #fff; border-color: var(--brand); background: var(--brand); }
.permission-list label > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.permission-list label strong { font-size: 11px; }
.permission-list label small { color: #a0a5ac; font-size: 9px; }
.role-card-footer { min-height: 58px; padding: 12px 22px; border-top: 1px solid #eff0f1; display: flex; align-items: center; justify-content: flex-end; }
.role-card-footer span { color: #a2a7ad; font-size: 10px; }
.role-card-footer button { height: 33px; padding: 0 15px; border-radius: 5px; color: #fff; background: var(--brand); font-size: 10px; font-weight: 700; cursor: pointer; }
.user-table-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.user-table-head { height: 60px; padding: 0 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.user-table-head strong { font-size: 13px; }
.user-table-head span { color: #9da2a9; font-size: 10px; }
.user-table-scroll { overflow-x: auto; }
.user-table-card table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.user-table-card th { padding: 12px 14px; background: #fafafa; color: #8f949b; font-size: 9px; font-weight: 700; text-align: left; }
.user-table-card td { padding: 14px; border-top: 1px solid #f0f1f2; vertical-align: middle; }
.table-user { display: flex; align-items: center; gap: 9px; }
.table-user > span { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(135deg, #e34538, #a71915); font-size: 11px; font-weight: 700; }
.table-user > div { display: flex; flex-direction: column; gap: 2px; }
.table-user input { width: 120px; padding: 3px 5px; border: 1px solid transparent; border-radius: 4px; color: #32363c; background: transparent; font-size: 11px; font-weight: 700; }
.table-user input:focus { outline: 0; border-color: #e1b6b3; background: #fff8f7; }
.table-user small { padding-left: 5px; color: #a0a5ac; font-size: 9px; }
.user-table-card td > select { width: 140px; height: 32px; border: 1px solid #dfe1e4; border-radius: 5px; background: #fff; color: #666b72; font-size: 10px; }
.status-switch { display: inline-flex; align-items: center; gap: 6px; color: #777c83; font-size: 10px; cursor: pointer; }
.status-switch input { position: absolute; opacity: 0; }
.status-switch span { position: relative; width: 30px; height: 17px; border-radius: 9px; background: #c8cbd0; transition: background .18s; }
.status-switch span::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .18s; }
.status-switch input:checked + span { background: #36a167; }
.status-switch input:checked + span::after { transform: translateX(13px); }
.date-cell { color: #8d9299; font-size: 9px; white-space: nowrap; }
.reset-password { display: flex; gap: 5px; }
.reset-password input { width: 105px; height: 31px; padding: 0 8px; border: 1px solid #dfe1e4; border-radius: 5px; font-size: 9px; }
.reset-password button, .save-user { height: 31px; padding: 0 9px; border-radius: 5px; background: #f1f2f3; color: #666b72; font-size: 9px; cursor: pointer; }
.save-user { color: #fff; background: var(--brand); }
.access-denied { min-height: 100vh; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #fff; }
.access-denied img { width: 250px; margin-bottom: 40px; }
.denied-mark { min-width: 68px; height: 54px; padding: 0 12px; border-radius: 27px; display: grid; place-items: center; color: #fff; background: var(--brand); font-size: 20px; font-weight: 800; }
.access-denied h1 { margin: 20px 0 9px; font-size: 25px; }
.access-denied p { margin: 0; color: #8d9299; font-size: 13px; }
.access-denied a { margin-top: 24px; padding: 11px 18px; border-radius: 6px; color: #fff; background: var(--brand); text-decoration: none; font-size: 12px; }

@media (max-width: 1180px) {
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-metrics { margin-right: 0; }
  .banner-metrics div { min-width: 90px; padding-inline: 13px; }
  .admin-create-card, .user-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-create-card > div { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 36px 24px; background: linear-gradient(180deg, #fff 0%, #fff 74%, #fff3f2 100%); }
  .mobile-logo-wrap { display: block; margin: 0 0 48px; }
  .mobile-logo-wrap img { width: 210px; height: auto; }
  .portal-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 24px; }
  .breadcrumb { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; }
  .mobile-brand img { width: 76px; }
  .welcome-banner { align-items: flex-start; flex-direction: column; gap: 28px; }
  .banner-metrics { width: 100%; }
  .banner-metrics div { flex: 1; }
  .admin-layout { display: block; }
  .admin-side { display: flex; gap: 8px; padding: 14px 18px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side-title { display: none; }
  .admin-side > button, .admin-side > a { width: auto; min-width: 160px; margin: 0; }
  .admin-side > a { padding-top: 10px; border-top: 0; }
  .admin-title-row { align-items: flex-start; flex-direction: column; }
  .role-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .topbar { height: 64px; padding: 0 16px; }
  .mobile-brand strong { display: none; }
  .role-pill { display: none; }
  .user-copy { display: none; }
  .portal-content { padding: 18px 16px 20px; }
  .welcome-banner { min-height: 0; padding: 27px 23px; }
  .banner-copy p { font-size: 13px; }
  .banner-metrics div { min-width: 0; padding: 16px 8px; }
  .banner-metrics strong { font-size: 23px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .category-tabs { gap: 21px; overflow-x: auto; }
  .category-tabs button { white-space: nowrap; }
  .system-grid { grid-template-columns: 1fr; }
  .security-strip { grid-template-columns: 1fr; }
  .security-strip div + div { border-left: 0; border-top: 1px solid var(--line); }
  .portal-footer { flex-direction: column; gap: 7px; }
  .admin-header { height: 64px; padding: 0 16px; }
  .admin-brand img { width: 86px; }
  .admin-brand div, .admin-user > div { display: none; }
  .admin-content { padding: 27px 16px 45px; }
  .admin-summary { width: 100%; }
  .admin-summary div { flex: 1; min-width: 0; padding-inline: 9px; }
  .admin-create-card, .user-create { grid-template-columns: 1fr; }
  .admin-create-card > div { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
