:root {
  --navy: #0b3954;
  --navy-2: #125b78;
  --blue: #0e83b7;
  --blue-dark: #075f8a;
  --blue-soft: #e5f4fa;
  --cyan: #24b6c8;
  --green: #2f7d62;
  --green-soft: #e9f3ee;
  --amber: #e1a23a;
  --amber-soft: #fff5df;
  --red: #d94b55;
  --red-soft: #fff0f1;
  --purple: #7557d6;
  --ink: #173444;
  --muted: #66808e;
  --line: #d7e6ed;
  --surface: #ffffff;
  --canvas: #edf6f8;
  --shadow: 0 14px 38px rgba(8, 66, 92, .1);
  --sidebar-width: 264px;
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden], .access-hidden { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 4%, rgba(36, 182, 200, .11), transparent 28%),
    linear-gradient(150deg, #f5fbfd 0%, #e8f3f7 100%);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.hidden { display: none !important; }
.mobile-only { display: none; }

.boot-screen,
.setup-screen,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(14,131,183,.18), transparent 31%),
    radial-gradient(circle at 90% 90%, rgba(26,154,139,.16), transparent 28%),
    linear-gradient(145deg, #eef8fb 0%, #e6f1f2 100%);
}

.auth-card {
  width: min(500px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  overflow-y: auto;
  border: 1px solid rgba(9,82,105,.15);
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 30px 90px rgba(11,57,84,.18);
}
.auth-brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 38px 12px;
  color: var(--ink);
  text-align: center;
}
.auth-logo { width: 145px; height: 105px; object-fit: contain; }
.auth-brand-panel h1 { margin: 12px 0 0; color: #173444; font-size: clamp(28px, 5vw, 34px); line-height: 1.08; letter-spacing: -.04em; }
.auth-form-panel { padding: 18px 38px 30px; }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { margin: 6px 0 5px; color: var(--navy); font-size: clamp(27px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.auth-form > div > p { margin: 0; color: var(--muted); }
.auth-field { display: grid; gap: 7px; }
.auth-field span { color: #506574; font-size: 14px; font-weight: 800; }
.auth-field em { color: var(--red); font-style: normal; }
.auth-field input { width: 100%; min-height: 54px; padding: 12px 15px; border: 1px solid #c9dce3; border-radius: 13px; outline: none; background: #fbfdfe; color: var(--ink); font-size: 17px; }
.auth-field input:focus { border-color: #0a9b93; box-shadow: 0 0 0 5px rgba(10,155,147,.1); background: #fff; }
.auth-submit { width: 100%; min-height: 50px; margin-top: 8px; border-radius: 12px; background: linear-gradient(135deg, #079c92, #087e73) !important; font-size: 16px; }
.auth-contact { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); color: #66808e; font-size: 13px; text-align: center; }
.auth-contact a { color: #087e73; font-weight: 850; text-decoration: none; }
.auth-contact a:hover { text-decoration: underline; }
.auth-note { color: #8295a1; text-align: center; }
.auth-error { margin: -5px 0 0; padding: 10px 12px; border-radius: 9px; color: #b72d38 !important; background: var(--red-soft); font-size: 12px; }

.boot-screen { grid-template-columns: auto auto auto; justify-content: center; gap: 18px; }
.boot-logo { width: 74px; height: 58px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; box-shadow: var(--shadow); }
.boot-copy { display: grid; gap: 2px; }
.boot-copy strong { font-size: 22px; color: var(--navy); }
.boot-copy span { color: var(--muted); }
.boot-loader { width: 24px; height: 24px; border: 3px solid #d9eaf2; border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.setup-card {
  width: min(620px, 100%);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 70px rgba(11,39,64,.14);
  text-align: center;
}
.setup-logo { width: 130px; height: 100px; object-fit: contain; margin-bottom: 18px; }
.setup-card h1 { margin: 6px 0 10px; font-size: clamp(25px, 4vw, 34px); line-height: 1.2; color: var(--navy); }
.setup-card p { color: var(--muted); }
.setup-actions { display: flex; justify-content: center; gap: 10px; margin: 26px 0; flex-wrap: wrap; }
.setup-note { border-top: 1px solid var(--line); padding-top: 20px; margin: 0; font-size: 13px; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #d8e7ef;
  background:
    radial-gradient(circle at 18% 0, rgba(36,182,200,.18), transparent 30%),
    linear-gradient(180deg, #0a4d6b 0%, #073b57 54%, #052c43 100%);
  box-shadow: 8px 0 30px rgba(8, 32, 49, .1);
}

.brand { height: 90px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 58px; height: 47px; object-fit: contain; padding: 4px; border-radius: 11px; background: #fff; }
.brand-copy { display: grid; line-height: 1.3; }
.brand-copy strong { color: #fff; font-size: 17px; letter-spacing: -.01em; }
.brand-copy span { font-size: 12px; color: #a9ccd9; }

.main-nav { display: grid; gap: 6px; padding: 24px 14px; overflow-y: auto; }
.nav-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  color: #c3dbe4;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: #fff; background: linear-gradient(100deg, #0b7cad, #21abc2); box-shadow: 0 9px 24px rgba(3,83,119,.32); }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; font-size: 20px; }
.nav-count { min-width: 25px; height: 23px; display: grid; place-items: center; padding: 0 7px; border-radius: 99px; color: #dff6ff; background: rgba(255,255,255,.13); font-size: 11px; font-weight: 800; }
.nav-item.active .nav-count { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; padding: 18px 22px 25px; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; }
.sidebar-user { margin: -5px -9px 3px; }
.sidebar-user .profile-button { width: 100%; padding: 8px 9px; color: #fff; }
.sidebar-user .profile-button:hover { background: rgba(255,255,255,.08); }
.sidebar-user .avatar { background: linear-gradient(135deg, #0d90bd, #35c2d1); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.sidebar-user .profile-copy { flex: 1; min-width: 0; }
.sidebar-user .profile-copy strong { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .profile-copy small { color: #acd0dc; }
.sidebar-user .profile-menu { top: auto; right: 0; bottom: calc(100% + 8px); left: 0; min-width: 0; }
.security-badge { display: flex; align-items: center; gap: 9px; color: #cce7ef; }
.status-dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #32d583; box-shadow: 0 0 0 4px rgba(50,213,131,.13); }
.help-link { color: #9cc7d5; text-decoration: none; }
.help-link:hover { color: #fff; }

.workspace { margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 15px clamp(20px, 3vw, 46px);
  border-bottom: 1px solid rgba(206,220,228,.9);
  background: rgba(255,255,255,.91);
  backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; color: var(--navy); font-size: clamp(22px, 2.1vw, 29px); line-height: 1.1; letter-spacing: -.03em; }
.page-eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.menu-button { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.notification-bell { position: relative; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--navy); background: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 5px 16px rgba(18,54,76,.06); }
.notification-bell:hover { border-color: #8ec8dc; background: #f3fbfe; }
.notification-bell-icon { position: relative; width: 16px; height: 17px; display: inline-block; border: 2px solid var(--blue); border-bottom: 0; border-radius: 9px 9px 3px 3px; }
.notification-bell-icon::before { content: ""; position: absolute; right: -4px; bottom: -3px; left: -4px; height: 2px; border-radius: 2px; background: var(--blue); }
.notification-bell-icon::after { content: ""; position: absolute; bottom: -7px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%); border-radius: 50%; background: var(--blue); }
.notification-badge { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; color: #fff; background: var(--red); font-size: 11px; box-shadow: 0 0 0 3px #fff; }

.notification-scrim { position: fixed; inset: 0; z-index: 64; background: rgba(5,45,65,.2); backdrop-filter: blur(1px); }
.notification-panel { position: fixed; z-index: 70; top: 82px; right: 22px; width: min(420px, calc(100vw - 28px)); max-height: calc(100vh - 102px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(194,216,226,.95); border-radius: 18px; background: #fff; box-shadow: 0 28px 70px rgba(6,31,48,.24); }
.notification-panel-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.notification-panel-header h2 { margin: 2px 0 0; color: var(--navy); font-size: 22px; }
.notification-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #f7fbfd; }
.notification-toolbar .button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.notification-toolbar .text-button { font-size: 12px; }
.notification-list { overflow-y: auto; padding: 8px; }
.notification-item { width: 100%; display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; padding: 14px 12px; border: 0; border-bottom: 1px solid #e7eef2; border-radius: 10px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.notification-item:hover { background: #f3fafc; }
.notification-item.unread { background: #eff9fc; }
.notification-item-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #b8c7ce; }
.notification-item.unread .notification-item-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(14,131,183,.12); }
.notification-copy { min-width: 0; display: grid; gap: 3px; }
.notification-copy strong { color: var(--navy); font-size: 13px; }
.notification-copy span { color: #506574; font-size: 12px; line-height: 1.45; }
.notification-copy small { color: var(--muted); font-size: 10px; }
.notification-arrow { align-self: center; color: var(--blue); font-weight: 900; }
.notification-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.notification-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 900; }
.notification-empty strong { color: var(--navy); }
.notification-empty small { max-width: 270px; line-height: 1.45; }

.search-field {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
  color: #7a8c99;
}
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--blue), #19a9c4); box-shadow: 0 8px 18px rgba(14,131,183,.23); }
.button.primary:hover { box-shadow: 0 10px 22px rgba(14,131,183,.31); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--navy); }
.button.secondary:hover { border-color: #9dcddd; background: #f5fbfd; }
.button.light { color: var(--blue-dark); background: #fff; box-shadow: 0 8px 24px rgba(5,73,113,.2); }
.button.ghost-light { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.06); }
.button.danger { color: #fff; background: var(--red); }
.text-button { border: 0; padding: 5px; color: var(--blue-dark); background: transparent; font-weight: 750; cursor: pointer; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; font-size: 23px; cursor: pointer; }
.icon-button:hover { background: #edf4f7; }

.profile-menu-wrap { position: relative; }
.profile-button { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 4px 8px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; }
.profile-button:hover { background: #f0f5f7; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--navy), var(--blue)); font-weight: 850; }
.profile-copy { display: grid; min-width: 106px; text-align: left; line-height: 1.25; }
.profile-copy strong { color: var(--navy); font-size: 13px; }
.profile-copy small { color: var(--muted); }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 230px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.profile-menu p { margin: 0 0 9px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-menu a { display: block; color: var(--red); text-decoration: none; font-weight: 750; }
.profile-menu button { width: 100%; padding: 0; border: 0; color: var(--red); background: transparent; text-align: left; font-weight: 750; cursor: pointer; }

.content { width: 100%; min-height: calc(100vh - 90px); padding: clamp(20px, 3vw, 42px) clamp(20px, 3vw, 46px) 60px; background: linear-gradient(145deg, rgba(249,253,254,.55), rgba(222,240,246,.23)); }
.view { display: none; }
.view.active { display: block; animation: fade-in .22s ease; }
.no-access-panel { max-width: 760px; margin: 8vh auto 0; padding: clamp(32px, 6vw, 64px); text-align: center; }
.no-access-panel h2 { margin: 10px 0 12px; font-size: clamp(28px, 4vw, 44px); }
.no-access-panel p { margin: 0 auto; max-width: 620px; color: var(--muted); line-height: 1.7; }
.permission-section-title { font-size: 15px; color: var(--navy); }
@keyframes fade-in { from { opacity: .2; transform: translateY(3px); } }

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 274px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  align-items: center;
  padding: clamp(28px, 4.5vw, 58px);
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(5,62,91,.98), rgba(8,143,181,.94)),
    #087fae;
  box-shadow: 0 20px 45px rgba(7,101,142,.2);
}
.hero-panel:after { content: ""; position: absolute; width: 460px; height: 460px; right: -180px; top: -185px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.04), 0 0 0 110px rgba(255,255,255,.025); }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.hero-panel .eyebrow { color: #8eeaf1; }
.hero-panel h2 { max-width: 700px; margin: 8px 0 12px; font-size: clamp(29px, 3vw, 43px); line-height: 1.13; letter-spacing: -.035em; }
.hero-panel p { max-width: 680px; margin: 0; color: #d8edf4; font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.hero-visual { position: relative; height: 210px; display: grid; place-items: center; z-index: 1; }
.hero-badge { z-index: 2; width: 164px; height: 164px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: inset 0 0 40px rgba(255,255,255,.08), 0 16px 40px rgba(3,74,108,.3); backdrop-filter: blur(8px); }
.hero-badge span { font-size: 58px; font-weight: 950; line-height: 1; letter-spacing: -.05em; }
.hero-badge small { margin-top: 8px; font-size: 8px; letter-spacing: .2em; }
.radar { position: absolute; border: 1px solid rgba(111,224,239,.2); border-radius: 50%; }
.radar-one { width: 208px; height: 208px; }
.radar-two { width: 130px; height: 130px; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.metric-card { min-height: 126px; display: flex; align-items: center; gap: 16px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.metric-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; font-size: 23px; font-weight: 900; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.cyan { color: #0b8ca7; background: #e5f7fa; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.red { color: var(--red); background: #fff0f1; }
.metric-icon.purple { color: var(--purple); background: #f1edff; }
.metric-card div:last-child { min-width: 0; display: grid; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { margin: 3px 0 1px; color: var(--navy); font-size: clamp(22px, 2.1vw, 30px); line-height: 1.1; letter-spacing: -.04em; overflow: hidden; text-overflow: ellipsis; }
.metric-card small { color: #8da0ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr 1.2fr .9fr; gap: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.panel.span-two { grid-column: span 2; }
.panel.span-three { grid-column: 1 / -1; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel h3 { margin: 3px 0 0; color: var(--navy); font-size: 19px; }

.location-bars { display: grid; gap: 16px; }
.bar-row { width: 100%; display: grid; grid-template-columns: minmax(120px, 180px) 1fr 82px; align-items: center; gap: 14px; padding: 3px 0; border: 0; border-radius: 8px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.bar-row:hover, .bar-row:focus-visible { background: #f5fafc; outline: none; }
.bar-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.bar-label { min-width: 0; display: grid; gap: 2px; }
.bar-label small { color: var(--muted); font-size: 10px; }
.bar-track { height: 10px; overflow: hidden; border-radius: 99px; background: #edf2f4; }
.bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bar-row span:last-child { text-align: right; color: var(--muted); font-weight: 750; }
.empty-state-inline { min-height: 110px; display: grid; place-items: center; color: var(--muted); }

.attention-list { display: grid; gap: 11px; }
.attention-item { width: 100%; display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 11px; padding: 11px; border: 0; border-radius: 11px; color: inherit; background: #f7fafb; text-align: left; cursor: pointer; }
.attention-item:hover, .attention-item:focus-visible { background: #eef7fa; outline: none; }
.attention-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: var(--amber); background: var(--amber-soft); font-weight: 900; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { font-size: 13px; }
.attention-item small { color: var(--muted); }
.attention-count { color: var(--amber); font-size: 19px; font-weight: 900; }

.status-chart-wrap { min-height: 178px; display: grid; grid-template-columns: 136px 1fr; align-items: center; gap: 22px; }
.status-donut { width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) 0 25%, var(--blue) 25% 50%, var(--amber) 50% 75%, #a6b2b9 75% 100%); }
.status-donut:before { content: ""; grid-area: 1 / 1; width: 88px; height: 88px; border-radius: 50%; background: #fff; }
.status-donut > div { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.status-donut strong { color: var(--navy); font-size: 25px; line-height: 1; }
.status-donut small { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.status-legend { display: grid; gap: 9px; }
.status-legend-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-legend-row i { width: 9px; height: 9px; border-radius: 3px; background: var(--legend-color); }
.status-legend-row strong { color: var(--navy); }
.department-summary { min-height: 178px; overflow-x: auto; }
.department-summary table th, .department-summary table td { padding-left: 9px; padding-right: 9px; }
.department-summary td:first-child { min-width: 190px; color: var(--navy); }
.department-link { padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.department-link:hover strong { color: var(--blue-dark); }
.department-code { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; }
.data-warning { color: var(--amber); font-weight: 900; }
.data-ok { color: var(--green); font-weight: 900; }

.asset-overview-panel { background: linear-gradient(135deg, #fff 0%, #f1fafd 100%); }
.asset-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.35fr; gap: 12px; }
.asset-overview-grid article { min-height: 104px; display: grid; align-content: center; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); }
.asset-overview-grid span { color: var(--muted); font-size: 11px; font-weight: 750; }
.asset-overview-grid strong { margin: 4px 0; color: var(--navy); font-size: 26px; line-height: 1; letter-spacing: -.04em; }
.asset-overview-grid small { color: #8da0ab; font-size: 10px; }
.asset-overview-grid .asset-value-card { background: linear-gradient(135deg, #075477, #0e98be); }
.asset-overview-grid .asset-value-card span, .asset-overview-grid .asset-value-card small { color: #d8eef5; }
.asset-overview-grid .asset-value-card strong { color: #fff; font-size: 20px; }

.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 42px 1.2fr 1fr 1fr 130px; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid #edf2f4; }
.activity-row:first-child { border-top: 0; }
.activity-symbol { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.activity-row strong { display: block; font-size: 13px; }
.activity-row small, .activity-row span { color: var(--muted); font-size: 12px; }

.section-toolbar { min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 19px; }
.section-heading { margin: 0; color: var(--navy); font-size: 25px; letter-spacing: -.025em; }
.section-description { margin: 3px 0 0; color: var(--muted); }
.filter-group { min-width: 0; display: flex; flex: 1; align-items: center; gap: 9px; }
.search-field { min-width: 220px; flex: 1; max-width: 410px; }
select, .field input, .field textarea {
  min-height: 42px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cddae2;
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  background: #fff;
}
select { width: auto; max-width: 210px; }
select:focus, .field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14,131,183,.12); }
.toolbar-buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.export-buttons { display: flex; flex-wrap: wrap; gap: 9px; }

.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.table-meta { min-height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 15px; color: #647987; background: #f7fafb; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid #edf2f4; color: #405663; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fbfdfe; }
.asset-code { color: var(--blue-dark); font-weight: 850; white-space: nowrap; }
.cell-title { max-width: 260px; }
.cell-title strong, .cell-title small { display: block; }
.cell-title strong { color: var(--navy); }
.cell-title small { color: var(--muted); }
.status-pill, .role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--green); background: var(--green-soft); }
.status-storage { color: var(--blue-dark); background: var(--blue-soft); }
.status-maintenance { color: #bc7a13; background: var(--amber-soft); }
.status-retired { color: #7b8992; background: #eef2f4; }
.condition-good { color: var(--green); }
.condition-warning { color: var(--amber); }
.table-action { border: 0; border-radius: 8px; padding: 7px 9px; background: transparent; color: var(--blue-dark); font-weight: 800; cursor: pointer; }
.table-action:hover { background: var(--blue-soft); }
.table-action.approve { color: #087e73; background: #e8f6f3; }
.table-action.approve:hover { background: #d7efe9; }
.table-action.danger { color: #b72d38; }
.table-action.danger:hover { background: var(--red-soft); }
.table-action.restore { color: #087e73; background: #e8f6f3; }
.table-action.restore:hover { background: #d7efe9; }
.file-actions { min-width: 146px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.empty-state { padding: 55px 20px; text-align: center; }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; color: var(--blue); background: var(--blue-soft); font-size: 26px; }
.empty-state h3 { margin: 0; color: var(--navy); }
.empty-state p { margin: 5px 0 0; color: var(--muted); }

.location-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.location-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.location-card-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px; background: linear-gradient(145deg, #f1f9fc, #fff); }
.location-label { display: flex; gap: 12px; }
.location-pin { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 20px; }
.location-card h3 { margin: 0; color: var(--navy); font-size: 16px; }
.location-card small { color: var(--muted); }
.location-number { color: var(--blue-dark); font-size: 25px; font-weight: 900; }
.location-card-actions { display: grid; justify-items: end; align-content: start; gap: 5px; }
.location-children { display: grid; padding: 0 20px 18px; }
.location-child { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid #edf2f4; }
.location-child span:last-child { color: var(--muted); font-weight: 750; }
.empty-action { margin-top: 17px; }

.document-toolbar { margin-bottom: 14px; }
.sync-status { margin: 6px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.sync-status.ready { color: var(--green); }
.sync-status.warning { color: var(--amber); }
.document-filters { margin: 15px 0; }
.document-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.document-metric-grid article { min-height: 82px; display: grid; align-content: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(18,54,76,.035); }
.document-metric-grid span { color: var(--muted); font-size: 11px; font-weight: 750; }
.document-metric-grid strong { margin-top: 3px; color: var(--navy); font-size: 25px; line-height: 1; }
.document-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: var(--blue-dark); background: transparent; font-weight: 800; text-decoration: none; cursor: pointer; }
.document-link.missing { color: #96a5ad; font-weight: 700; }
.document-title { max-width: 310px; }
.document-title strong, .document-title small { display: block; }
.document-title strong { color: var(--navy); }
.document-title small { color: var(--muted); }
.document-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.doc-active { color: var(--green); background: var(--green-soft); }
.doc-expiring { color: #a86608; background: var(--amber-soft); }
.doc-pending { color: var(--blue-dark); background: var(--blue-soft); }
.doc-expired { color: var(--red); background: #fff0f1; }
.doc-archive { color: #677983; background: #edf2f4; }
.confidentiality { display: inline-flex; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.confidentiality.restricted { color: #a86608; }
.confidentiality.secret { color: var(--red); }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.report-card { display: flex; flex-direction: column; min-height: 270px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.report-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 23px; }
.report-card h3 { margin: 19px 0 6px; color: var(--navy); font-size: 19px; }
.report-card p { margin: 0 0 24px; color: var(--muted); }
.report-card > div:last-child { display: flex; gap: 8px; margin-top: auto; }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.role-grid article { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.role-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-weight: 900; }
.role-icon.admin { color: var(--purple); background: #f1edff; }
.role-icon.manager { color: var(--blue); background: var(--blue-soft); }
.role-icon.viewer { color: var(--green); background: var(--green-soft); }
.role-grid strong { color: var(--navy); }
.role-grid p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.role-pill.admin { color: var(--purple); background: #f1edff; }
.role-pill.manager { color: var(--blue-dark); background: var(--blue-soft); }
.role-pill.viewer { color: var(--green); background: var(--green-soft); }
.access-rule-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #b9dce8; border-radius: 12px; color: #476777; background: #eff9fc; }
.access-rule-note strong { flex: 0 0 auto; color: var(--navy); }
.group-access-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; max-width: 360px; }
.group-access-summary small { color: var(--muted); }
.access-level-pill { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.access-level-pill.view { color: #176948; background: #e8f5ee; }
.access-level-pill.edit { color: #075f8a; background: #e5f4fa; }
.table-action.assign { color: #5d4bb5; background: #f1edff; }
.permission-matrix { grid-column: 1 / -1; display: grid; gap: 8px; }
.permission-row { display: grid; grid-template-columns: minmax(190px, 1fr) 190px; align-items: center; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfc; }
.permission-row strong { color: var(--navy); }
.permission-row small { display: block; margin-top: 2px; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5,45,65,.58); backdrop-filter: blur(3px); }
.modal { position: fixed; z-index: 100; top: 50%; left: 50%; width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 30px); transform: translate(-50%, -50%); overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: 0 35px 90px rgba(6,31,48,.32); }
.modal-header { min-height: 80px; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; color: var(--navy); font-size: 23px; }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 112px); }
.modal-body { overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 24px; }
.field { display: grid; align-content: start; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #506574; font-size: 12px; font-weight: 800; }
.field label em { color: var(--red); font-style: normal; }
.field textarea { min-height: 82px; resize: vertical; }
.field input[type="file"] { width: 100%; min-height: 48px; padding: 9px; border: 1px dashed #a9c5d5; border-radius: 10px; background: #f5fbfe; color: var(--ink); }
.field input[type="file"]::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; }
.current-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #f7fafb; }
.current-file span { color: var(--muted); font-size: 12px; }
.current-file button { border: 0; color: var(--blue-dark); background: transparent; font-weight: 850; cursor: pointer; }
.field-note { color: var(--muted); font-size: 11px; }
.recipient-grid { max-height: 180px; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfc; }
.recipient-option { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: #fff; cursor: pointer; }
.recipient-option:has(input:checked) { border-color: #8dcedf; background: #ecf9fc; }
.recipient-option input { margin: 2px 0 0; accent-color: var(--blue); }
.recipient-option strong { display: block; color: var(--navy); font-size: 12px; }
.recipient-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.modal-footer { min-height: 70px; display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 13px 24px; border-top: 1px solid var(--line); background: #f9fbfc; }
.modal > form > .auth-error { margin: 0 24px 14px; font-size: 13px; }

.viewer-backdrop { position: fixed; inset: 0; z-index: 110; background: rgba(5,45,65,.7); backdrop-filter: blur(4px); }
.document-viewer,
.print-preview { position: fixed; z-index: 120; inset: 24px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.5); border-radius: 18px; background: #fff; box-shadow: 0 35px 90px rgba(6,31,48,.36); }
.viewer-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.viewer-header h2 { margin: 2px 0 0; color: var(--navy); font-size: 22px; }
.document-viewer iframe { width: 100%; flex: 1; border: 0; background: #edf7fa; }
.print-preview { inset: 24px max(24px, calc((100vw - 1180px) / 2)); }
.print-preview-content { flex: 1; overflow: auto; padding: 34px; background: #edf5f8; }
.print-preview-content > .print-document { width: min(1120px, 100%); min-height: 720px; margin: 0 auto; padding: 36px; background: #fff; box-shadow: 0 10px 34px rgba(11,39,64,.13); }
.print-preview-content table { width: 100%; border-collapse: collapse; font-size: 11px; }
.print-preview-content th,
.print-preview-content td { padding: 8px; border: 1px solid #d7e1e7; text-align: left; vertical-align: top; }
.print-preview-content th { color: var(--navy); background: #eaf4f8; }
.print-head { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid #0e83b7; }
.print-head img { width: 85px; max-height: 60px; object-fit: contain; }
.print-head h1 { margin: 0; color: var(--navy); font-size: 20px; }
.print-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.print-summary { display: flex; justify-content: space-between; gap: 24px; margin: 10px 0 20px; font-size: 11px; }
.preview-footer { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; padding: 13px 22px; border-top: 1px solid var(--line); background: #f7fbfd; }

.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 290px; max-width: 420px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 11px; color: var(--ink); background: #fff; box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.print-area { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 1220px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .location-grid { grid-template-columns: repeat(2, 1fr); }
  .document-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-row { grid-template-columns: 42px 1.2fr 1fr 120px; }
  .activity-row .activity-from { display: none; }
  .profile-copy { display: none; }
  .asset-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asset-overview-grid .asset-value-card { grid-column: span 2; }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 246px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(8,27,40,.4); }
  .sidebar.open + .sidebar-scrim { display: block; }
  .workspace { margin-left: 0; }
  .menu-button, .mobile-only { display: grid !important; }
  .brand .mobile-only { margin-left: auto; color: #fff; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .panel.span-two { grid-column: span 1; }
  .panel.span-three { grid-column: 1 / -1; }
  .report-grid { grid-template-columns: 1fr; }
  .asset-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-overview-grid .asset-value-card { grid-column: span 2; }
}

@media (max-width: 760px) {
  .auth-screen { padding: 12px; }
  .auth-card { max-height: calc(100vh - 24px); border-radius: 20px; }
  .auth-brand-panel { padding: 24px 22px 10px; }
  .auth-brand-panel h1 { font-size: 27px; }
  .auth-logo { width: 120px; height: 86px; }
  .auth-form-panel { padding: 16px 22px 24px; }
  .auth-field input { min-height: 50px; font-size: 16px; }
  .auth-submit { min-height: 48px; }
  .topbar { min-height: 76px; padding: 11px 15px; }
  .notification-panel { top: 68px; right: 8px; max-height: calc(100vh - 80px); }
  .content { padding: 16px 13px 45px; }
  .hero-panel { padding: 27px 22px; border-radius: 17px; }
  .hero-panel h2 br { display: none; }
  .metric-grid, .dashboard-grid, .location-grid, .role-grid { grid-template-columns: 1fr; }
  .document-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-overview-grid { grid-template-columns: 1fr 1fr; }
  .status-chart-wrap { grid-template-columns: 118px 1fr; }
  .status-donut { width: 112px; height: 112px; }
  .status-donut:before { width: 74px; height: 74px; }
  .panel.span-three { grid-column: auto; }
  .metric-card { min-height: 104px; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; max-width: none; }
  .filter-group select { width: 100%; max-width: none; }
  .toolbar-buttons { width: 100%; }
  .toolbar-buttons .button { flex: 1 1 auto; }
  .export-buttons { width: 100%; }
  .export-buttons .button { flex: 1 1 auto; }
  .activity-row { grid-template-columns: 40px 1fr auto; }
  .activity-row .activity-from, .activity-row .activity-to { display: none; }
  .modal-body { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .recipient-grid { grid-template-columns: 1fr; }
  .permission-row { grid-template-columns: 1fr; gap: 8px; }
  .bar-row { grid-template-columns: minmax(105px, 145px) 1fr 74px; gap: 8px; }
  .setup-card { padding: 28px 20px; }
  .document-viewer, .print-preview { inset: 8px; border-radius: 13px; }
  .viewer-header { min-height: 66px; padding: 12px 15px; }
  .print-preview-content { padding: 12px; }
  .print-preview-content > .print-document { min-width: 900px; min-height: 620px; padding: 24px; }
}

@media (max-width: 460px) {
  .metric-grid { gap: 10px; }
  .document-metric-grid { grid-template-columns: 1fr; }
  .metric-card { padding: 16px; }
  .hero-actions .button { width: 100%; }
  .profile-button > span:last-child { display: none; }
  .notification-bell { width: 44px; padding: 8px; justify-content: center; }
  .notification-bell > span:nth-child(2) { display: none; }
  .notification-badge { position: absolute; top: -6px; right: -6px; }
  .notification-toolbar { align-items: stretch; flex-direction: column; }
  .filter-group { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .toolbar-buttons { flex-direction: column; }
  .export-buttons { flex-direction: column; }
  .export-buttons .button { width: 100%; }
  .asset-overview-grid { grid-template-columns: 1fr; }
  .asset-overview-grid .asset-value-card { grid-column: auto; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
}

@media print {
  body { background: #fff; color: #000; font-family: Arial, sans-serif; }
  .app-shell, .modal, .modal-backdrop, .viewer-backdrop, .document-viewer, .print-preview, .notification-panel, .notification-scrim, .toast-region, .setup-screen, .auth-screen, .boot-screen { display: none !important; }
  .print-area { display: block !important; padding: 0; }
  .print-head { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid #0e83b7; }
  .print-head img { width: 85px; max-height: 60px; object-fit: contain; }
  .print-head h1 { margin: 0; font-size: 20px; }
  .print-head p { margin: 3px 0 0; font-size: 11px; }
  .print-area table { font-size: 10px; }
  .print-area th { padding: 7px; color: #000; background: #eaf4f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area td { padding: 7px; color: #000; }
  .print-summary { display: flex; gap: 24px; margin: 10px 0 20px; font-size: 11px; }
  @page { size: A4 landscape; margin: 12mm; }
}
