:root {
  color-scheme: light;
  --navy: #082f4d;
  --navy-deep: #06253d;
  --blue: #2465aa;
  --ink: #172336;
  --muted: #64768a;
  --line: #d7e1eb;
  --bg: #edf3f7;
  --surface: #ffffff;
  --bunker: #9b671f;
  --inventory: #257c74;
  --inspection: #2f6599;
  --learning: #76528d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }

.loginView {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 18%, rgba(70, 135, 192, .3), transparent 28%),
    linear-gradient(122deg, var(--navy-deep) 0 48%, #f0f5f8 48% 100%);
}

.loginPanel { width: min(480px, 100%); border: 1px solid rgba(255,255,255,.65); border-radius: 14px; background: rgba(255,255,255,.98); padding: 36px; box-shadow: 0 28px 80px rgba(4, 30, 49, .26); }
.backLink { color: var(--muted); font-size: 13px; text-decoration: none; }
.backLink:hover { color: var(--blue); }
.loginBrand { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 34px; }
.loginBrand strong { color: var(--navy); font-size: 30px; letter-spacing: .08em; }
.loginBrand span { border-left: 1px solid #b9c8d5; padding-left: 12px; color: #587d98; font-size: 14px; font-weight: 700; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; }
.loginLead { margin: 11px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.75; }
form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #506174; font-size: 13px; }
input, select { min-height: 45px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,101,170,.12); }
form button { min-height: 46px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; cursor: pointer; font-weight: 750; }
.previewNote { margin: 2px 0 0; border-left: 3px solid #d39435; background: #fff8ec; padding: 10px 12px; color: #7b602f; font-size: 12px; line-height: 1.65; text-align: left; }

.adminView { min-height: 100vh; }
.adminTopbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding: 12px 30px; background: var(--navy); color: #fff; box-shadow: 0 5px 18px rgba(5,39,64,.16); }
.adminBrand { display: flex; align-items: baseline; gap: 11px; text-decoration: none; white-space: nowrap; }
.adminBrand strong { font-size: 23px; letter-spacing: .08em; }
.adminBrand span { border-left: 1px solid rgba(255,255,255,.32); padding-left: 11px; color: #c5d9e7; font-size: 13px; font-weight: 700; }
.adminBrand small { border-radius: 999px; background: rgba(255,255,255,.12); padding: 4px 8px; color: #fff; font-size: 11px; }
.adminTopbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; align-items: center; }
.adminTopbar nav a, .adminTopbar nav button { border: 1px solid rgba(255,255,255,.25); border-radius: 6px; background: transparent; color: #fff; padding: 7px 10px; cursor: pointer; text-decoration: none; font-size: 12px; }
.adminTopbar nav a:hover, .adminTopbar nav button:hover { background: rgba(255,255,255,.1); }

.adminContent { width: min(1380px, calc(100% - 40px)); margin: 24px auto 42px; }
.previewBanner { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; border: 1px solid #e4c88f; border-radius: 8px; background: #fff9ed; padding: 11px 14px; color: #74582a; font-size: 12px; line-height: 1.6; }
.previewBanner strong { flex: 0 0 auto; border-radius: 999px; background: #d59535; padding: 4px 9px; color: #fff; font-size: 11px; }
.adminWelcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.adminWelcome h1 { font-size: 28px; }
.adminWelcome p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.safetyMotto { color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.sectionHeading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 14px; }
.sectionHeading h2 { margin-bottom: 0; font-size: 20px; }
.sectionHeading > p { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }

.businessGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.businessCard { --area-color: var(--blue); overflow: hidden; border: 1px solid var(--line); border-top: 4px solid var(--area-color); border-radius: 10px; background: var(--surface); padding: 22px; box-shadow: 0 5px 16px rgba(20,45,65,.04); }
.businessCard.bunkerArea { --area-color: var(--bunker); }
.businessCard.inventoryArea { --area-color: var(--inventory); }
.businessCard.inspectionArea { --area-color: var(--inspection); }
.businessCard.learningArea { --area-color: var(--learning); }
.businessCard > header { display: flex; align-items: center; gap: 14px; }
.businessCard > header > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--area-color) 12%, white); color: var(--area-color); font-size: 12px; font-weight: 850; }
.businessCard header small { color: var(--area-color); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.businessCard h3 { margin: 3px 0 0; font-size: 20px; }
.businessCard > p { min-height: 46px; margin: 15px 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.areaActions { display: grid; gap: 8px; }
.areaActions > * { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 49px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfd; padding: 9px 12px; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.areaActions > *:hover { border-color: color-mix(in srgb, var(--area-color) 48%, var(--line)); background: color-mix(in srgb, var(--area-color) 5%, white); }
.areaActions b { font-size: 13px; }
.areaActions span { color: var(--muted); font-size: 11px; }

.sharedSection { margin-top: 28px; }
.moduleGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.moduleGrid > * { position: relative; display: grid; min-height: 150px; align-content: start; gap: 9px; border: 0; border-right: 1px solid var(--line); background: #fff; padding: 21px; color: var(--ink); cursor: pointer; text-align: left; }
.moduleGrid > *:last-child { border-right: 0; }
.moduleGrid > *:hover { background: #f4f8fc; }
.moduleGrid span { color: #91a6b7; font-size: 11px; font-weight: 850; }
.moduleGrid strong { color: var(--navy); font-size: 17px; }
.moduleGrid small { color: var(--muted); font-size: 12px; line-height: 1.65; }
.moduleNotice { min-height: 22px; margin: 16px 0 0; border-radius: 7px; background: #e9f2fb; padding: 11px 13px; color: var(--blue); font-size: 13px; }
.userManagement { margin-top: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 22px; }
.userManagement .sectionHeading button { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px 13px; color: var(--navy); cursor: pointer; }
.userManagementGrid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.4fr); gap: 24px; }
.userManagement h3 { margin: 0 0 14px; color: var(--navy); }
.checkboxLabel { display: flex; align-items: center; }
.checkboxLabel input { min-height: auto; }
.userList { display: grid; gap: 8px; }
.userRow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.userRow p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.userActions { display: flex; gap: 6px; }
.userActions button { border: 1px solid var(--line); border-radius: 5px; background: #f7fafc; padding: 6px 9px; color: var(--navy); cursor: pointer; }
.userActions button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1120px) {
  .adminTopbar { align-items: flex-start; flex-direction: column; }
  .adminTopbar nav { justify-content: flex-start; }
  .moduleGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moduleGrid > * { border-bottom: 1px solid var(--line); }
  .moduleGrid > *:nth-child(2n) { border-right: 0; }
  .moduleGrid > *:nth-child(n+3) { border-bottom: 0; }
}

@media (max-width: 760px) {
  .loginView { padding: 18px; background: var(--bg); }
  .loginPanel { padding: 26px; }
  .loginBrand { align-items: flex-start; flex-direction: column; }
  .loginBrand span { border-left: 0; padding-left: 0; }
  .adminContent { width: min(100% - 24px, 1380px); }
  .adminWelcome, .sectionHeading, .previewBanner { align-items: flex-start; flex-direction: column; }
  .sectionHeading > p { text-align: left; }
  .businessGrid, .moduleGrid { grid-template-columns: 1fr; }
  .userManagementGrid { grid-template-columns: 1fr; }
  .moduleGrid > * { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .moduleGrid > *:last-child { border-bottom: 0 !important; }
  .areaActions > * { align-items: flex-start; flex-direction: column; }
  .safetyMotto { white-space: normal; }
}
