* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); letter-spacing: .005em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #16877f45; outline-offset: 2px; }
.app { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 25px; padding: 24px 15px 18px; color: #fff; background: linear-gradient(180deg, #12343c, #102d36); box-shadow: 8px 0 28px #16383c0c; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 19px; border-bottom: 1px solid #ffffff1c; }
.logo { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: #fff; font-size: 18px; font-weight: 900; letter-spacing: -1px; background: linear-gradient(145deg, #27b3a5, #16877f); box-shadow: 0 6px 16px #091d2450; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; margin-top: 2px; color: #aac4c4; font-size: 11px; }
.navlabel { padding: 0 12px 9px; color: #8eaaaa; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; }
.nav { display: grid; gap: 5px; }
.nav button { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 11px; padding: 10px 12px; color: #c4d7d6; background: transparent; text-align: left; font-size: 13px; font-weight: 550; }
.nav button:hover { color: #fff; background: #ffffff12; transform: translateX(2px); }
.nav button.active { color: #fff; background: linear-gradient(90deg, #1a9188, #21766f); box-shadow: 0 6px 16px #0c222c55; font-weight: 750; }
.nav button.active::before { position: absolute; left: -15px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: #8be0cf; content: ""; }
.nav .ico { width: 21px; text-align: center; font-size: 16px; }
.sidefoot { margin-top: auto; border-top: 1px solid #ffffff1c; padding: 15px 8px 2px; color: #aec1c0; font-size: 11px; line-height: 1.7; }
.preview-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dcefe7; border-radius: 8px; padding: 6px 10px; color: #26785f; background: #eff7f4; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5edeb; padding: 0 clamp(18px, 3.2vw, 44px); background: #ffffffed; backdrop-filter: blur(14px); }
.crumb { color: #6e8383; font-size: 14px; font-weight: 750; }
.topright { display: flex; align-items: center; gap: 12px; }
.content { max-width: 1580px; margin: 0 auto; padding: 28px clamp(18px, 3.2vw, 44px) 42px; }
.safety-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; border: 1px solid var(--amber-line); border-radius: 12px; padding: 12px 14px; color: var(--amber-text); background: var(--amber-bg); font-size: 11px; line-height: 1.5; }
.safety-banner strong { color: #624a12; }
.safety-icon { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: #805e16; background: #f7e9bb; font-weight: 900; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; border: 1px solid #e8efed; border-radius: 18px; padding: 21px 23px; background: linear-gradient(115deg, #fff, #f7fbfa); box-shadow: 0 4px 16px #17373c08; }
.heading h1 { margin: 0 0 6px; color: #16343a; font-size: 25px; line-height: 1.2; letter-spacing: -.6px; }
.sub { color: var(--muted); font-size: 13px; }
.actions, .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.btn { border: 1px solid #dce7e5; border-radius: 10px; padding: 9px 13px; color: #355056; background: #fff; box-shadow: 0 1px 2px #12323b08; font-size: 12px; font-weight: 700; }
.btn:hover { border-color: #b7cfca; background: #f8fbfa; box-shadow: 0 4px 12px #12323b12; transform: translateY(-1px); }
.btn.primary { border-color: #123b43; color: #fff; background: #123b43; box-shadow: 0 5px 12px #123b4320; }
.btn.primary:hover { border-color: #1a5e62; background: #1a5e62; }
.btn.teal { border-color: var(--teal); color: #fff; background: var(--teal); }
.btn.small { border-radius: 8px; padding: 6px 10px; font-size: 11px; }
.btn.danger { border-color: #efd0cc; color: var(--red); background: #fff8f7; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.card { min-width: 0; border: 1px solid #e6eeec; border-radius: var(--radius); padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { overflow: hidden; padding: 17px 18px 16px; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px #17373c1a; }
.stathead { display: flex; align-items: center; justify-content: space-between; color: #6d8182; font-size: 11px; font-weight: 700; }
.staticon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #d9eeea; border-radius: 11px; color: var(--teal); background: var(--sage); font-size: 15px; }
.statnum { margin: 11px 0 3px; color: #183b40; font-size: 28px; font-weight: 850; line-height: 1.1; letter-spacing: -.8px; }
.statfoot, .smallmuted { color: #829293; font-size: 10px; }
.cardtitle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; color: #244247; font-size: 14px; font-weight: 800; }
.two { grid-template-columns: 1.3fr 1fr; }
.tablewrap { overflow: auto; border: 1px solid #e8efed; border-radius: 12px; overscroll-behavior-inline: contain; }
table { width: 100%; min-width: 620px; border-collapse: collapse; }
th { color: #6c8181; background: #f7faf9; font-size: 10px; font-weight: 800; letter-spacing: .065em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td, th { border-bottom: 1px solid #edf1f0; padding: 12px 13px; vertical-align: middle; }
td { color: #395156; font-size: 12px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fbfa; }
tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.miniavatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #286f6d; background: #e6f0ef; font-size: 11px; font-weight: 850; }
.person b { display: block; color: #244247; font-size: 12px; }
.person small { display: block; margin-top: 1px; color: #819091; font-size: 10px; }
.status { display: inline-block; border-radius: 999px; padding: 4px 9px; color: #536665; background: #eef2f2; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status.green { color: var(--green); background: var(--green-bg); }
.status.amber { color: #936817; background: #fff4df; }
.status.red { color: var(--red); background: var(--red-bg); }
.fieldgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #4c6467; font-size: 11px; font-weight: 800; }
.field input, .field select, .field textarea, .search { width: 100%; min-width: 0; border: 1px solid #dce7e5; border-radius: 10px; padding: 10px 12px; color: #243e42; background: #fff; }
.field input:hover, .field select:hover, .field textarea:hover, .search:hover { border-color: #bfd3cf; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #16877f18; }
.field textarea { min-height: 84px; resize: vertical; }
.formactions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toolbar { margin-bottom: 14px; gap: 12px; }
.toolbar .search { max-width: 360px; padding: 10px 13px; }
.listitem { margin-bottom: 8px; border: 1px solid #e5eeec; border-radius: 12px; padding: 13px; cursor: pointer; }
.listitem.selected, .listitem:hover { border-color: #b9d9d2; background: #f2faf7; }
.checkrow { display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid #edf1f0; padding: 10px 0; }
.checkrow input { margin-top: 3px; accent-color: var(--teal); }
.checkrow span { display: block; }
.checkrow small { display: block; margin-top: 2px; color: var(--muted); }
.tag { display: inline-flex; margin: 2px; border-radius: 6px; padding: 4px 7px; color: #426863; background: #edf5f3; font-size: 10px; }
.notice, .successnote { margin-bottom: 14px; border: 1px solid; border-radius: 11px; padding: 12px 14px; font-size: 11px; }
.notice { border-color: var(--amber-line); color: var(--amber-text); background: var(--amber-bg); }
.successnote { border-color: #cce9d9; color: #23674b; background: #ebf7f0; }
.empty { padding: 38px 20px; color: #7c8d8d; text-align: center; font-size: 12px; }
.permissiongrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permissionbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.modalback { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow: auto; padding: 18px; background: #10272d99; backdrop-filter: blur(4px); }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; border: 1px solid #e4eeeb; border-radius: 20px; padding: 23px; background: #fff; box-shadow: 0 24px 90px #102b4640; }
.modalhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modalhead h2 { margin: 0; color: #1d3a3e; font-size: 18px; }
.close { border: 0; border-radius: 8px; padding: 7px 10px; color: #50696b; background: #f0f5f4; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); border: 1px solid #ffffff20; border-radius: 12px; padding: 12px 16px; color: #fff; background: #173d43; box-shadow: 0 14px 36px #102b4633; font-size: 13px; }
.bottomnav { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 226px minmax(0, 1fr); }
  .content { padding: 24px 22px 38px; }
  .two { grid-template-columns: 1fr; }
  .stats { gap: 12px; }
}
@media (max-width: 700px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { height: 60px; padding: 0 15px; }
  .topright .preview-pill { display: none; }
  .content { padding: 14px 12px 96px; }
  .heading { display: block; margin-bottom: 14px; border-radius: 15px; padding: 18px 16px; }
  .heading h1 { font-size: 22px; }
  .heading .actions { margin-top: 14px; }
  .heading .actions .btn { flex: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
  .stat-card { padding: 13px; }
  .statnum { margin-top: 9px; font-size: 23px; }
  .staticon { width: 31px; height: 31px; }
  .card { border-radius: 14px; padding: 14px; }
  .cardtitle { font-size: 13px; }
  .tablewrap table { min-width: 560px; }
  .toolbar .search { max-width: none; flex: 1; }
  .toolbar .smallmuted { width: 100%; }
  .fieldgrid, .permissiongrid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .safety-banner { align-items: flex-start; }
  .bottomnav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 7px 2px calc(8px + env(safe-area-inset-bottom)); background: #fffffff2; box-shadow: 0 -8px 24px #16373a0a; backdrop-filter: blur(14px); }
  .bottomnav button { min-width: 48px; display: grid; justify-items: center; gap: 3px; border: 0; padding: 4px 3px; color: #708483; background: transparent; font-size: 9px; }
  .bottomnav button .ico { font-size: 16px; }
  .bottomnav button span:not(.ico) { font-size: 9px; line-height: 1.1; }
  .bottomnav button.active { color: var(--teal); font-weight: 850; }
  .modal { max-height: 88vh; border-radius: 17px; padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-actions .btn { min-height: 42px; }
.section-gap { margin-top: 16px; }
.profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 15px 0; }
.modalbackdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow: auto; padding: 18px; background: #10272d99; backdrop-filter: blur(4px); }
.scrollbox { max-height: 180px; overflow: auto; }
.field-label { color: #4c6467; font-size: 11px; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
@media (max-width: 700px) { .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .quick-actions { gap: 8px; } }
