: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: #526b79;
  --line: #d7e6ed;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --shadow: 0 14px 38px rgba(8, 66, 92, .1);
  --sidebar-width: 244px;
  --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: var(--canvas);
  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: 230px; height: 78px; 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: 132px; height: 48px; object-fit: contain; border-radius: 12px; background: #fff; padding: 5px 9px; 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: 220px; height: 74px; 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 { min-height: 90px; flex-shrink:0; display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 70px; flex-shrink:0; height: 42px; object-fit: contain; padding: 3px 5px; border-radius: 11px; background: #fff; }
.brand-copy { display: grid; min-width:0; overflow-wrap:break-word; 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; align-content:start; gap: 6px; padding: 16px 10px; overflow-y: auto; min-height:0; }
.nav-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  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: #087d9a; box-shadow: inset 3px 0 #73e0e5; }
.nav-item > span:nth-child(2) { min-width: 0; white-space: normal; overflow-wrap:break-word; line-height:1.4; }
.nav-icon svg { width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nav-icon { color:#8fd8df; }
.nav-item.active .nav-icon { color:#fff; }
.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; flex-shrink:0; display: grid; gap: 12px; padding: 14px 16px 18px; 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 { color: #fff; white-space: normal; overflow-wrap:anywhere; }
.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 { min-width: 0; 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 { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.app-shell:not(.dashboard-view) .topbar-actions { display: none; }
.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-online-summary { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: #196b58; background: #eefaf5; font-size: 12px; }
.notification-online-summary small { min-width: 0; overflow: hidden; color: #5b7d73; text-overflow: ellipsis; white-space: nowrap; }
.online-pulse { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: #1fba7a; box-shadow: 0 0 0 4px rgba(31,186,122,.14); animation: onlinePulse 1.8s ease-out infinite; }
@keyframes onlinePulse { 0%,100% { box-shadow: 0 0 0 3px rgba(31,186,122,.14); } 50% { box-shadow: 0 0 0 7px rgba(31,186,122,0); } }
.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); }
.button:disabled { transform: none; opacity: .48; cursor: not-allowed; box-shadow: none; }
.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; }
.online-total { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #bee6d7; border-radius: 13px; color: #197158; background: #f1fbf7; }
.online-total strong { color: #0e8060; font-size: 22px; }
.online-member-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.online-member-card { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 22px rgba(17,82,108,.05); }
.online-member-card > div { min-width: 0; }
.online-member-card strong,.online-member-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-member-card strong { color: var(--navy); font-size: 13px; }
.online-member-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.online-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg,var(--blue),#22b7c5); font-weight: 900; }
.online-now { display: inline-flex; align-items: center; gap: 5px; color: #16815e; font-size: 11px; font-weight: 800; }
.online-now i { width: 7px; height: 7px; border-radius: 50%; background: #1fba7a; }
.activity-empty-inline { grid-column: 1/-1; padding: 16px; border: 1px dashed #c7dce5; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.7); text-align: center; }
.activity-filter-bar { display: grid; grid-template-columns: minmax(280px,1.5fr) minmax(180px,.7fr) minmax(180px,.7fr); gap: 12px; margin-bottom: 14px; }
.activity-filter-bar select,.activity-filter-bar .search-field { min-height: 46px; margin: 0; }
.activity-table-panel td:first-child { min-width: 150px; white-space: nowrap; }
.activity-action { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 999px; color: #2e6174; background: #e9f4f8; font-size: 11px; font-weight: 850; white-space: nowrap; }
.activity-action.action-create,.activity-action.action-restore,.activity-action.action-login { color: #147255; background: #e7f7f0; }
.activity-action.action-update,.activity-action.action-permission,.activity-action.action-approve,.activity-action.action-sync { color: #765612; background: #fff4d7; }
.activity-action.action-delete,.activity-action.action-logout { color: #a7323d; background: #ffeaed; }
.status-pill.status-online { color: #147255; background: #def6eb; box-shadow: inset 0 0 0 1px #bce9d7; }
.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); }
.usage-guide { display: grid; gap: 18px; }
.guide-intro { min-height: 178px; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; padding: 30px 34px; border: 1px solid #9bd1df; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, #064d6d 0%, #087fa4 60%, #13a6bc 100%); box-shadow: 0 12px 30px rgba(7,84,119,.17); }
.guide-intro .eyebrow { color: #bceff4; }
.guide-intro h2 { margin: 6px 0 9px; color: #fff; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; }
.guide-intro p { max-width: 720px; margin: 0; color: #dbf3f7; font-size: 15px; line-height: 1.6; }
.guide-intro-badge { width: 126px; height: 126px; flex: 0 0 auto; display: grid; place-content: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.11); text-align: center; }
.guide-intro-badge strong { font-size: 38px; line-height: 1; }
.guide-intro-badge span { margin-top: 6px; color: #d5f2f5; font-size: 11px; font-weight: 750; }
.guide-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide-quick-grid article { min-height: 108px; display: flex; align-items: flex-start; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 17px rgba(18,54,76,.04); }
.guide-quick-grid article > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--cyan)); font-weight: 900; }
.guide-quick-grid strong { display: block; color: var(--navy); font-size: 14px; }
.guide-quick-grid p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.guide-section-list { display: grid; gap: 10px; }
.guide-section-list details { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(18,54,76,.035); }
.guide-section-list summary { display: flex; align-items: center; gap: 14px; padding: 17px 20px; color: var(--navy); cursor: pointer; list-style: none; }
.guide-section-list summary::-webkit-details-marker { display: none; }
.guide-section-list summary:after { content: "+"; margin-left: auto; color: var(--blue); font-size: 23px; font-weight: 500; line-height: 1; }
.guide-section-list details[open] summary:after { content: "−"; }
.guide-section-list summary:hover { background: #f5fbfd; }
.guide-section-list summary > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.guide-section-list summary strong { font-size: 15px; }
.guide-section-list summary small { color: var(--muted); font-size: 11px; font-weight: 600; }
.guide-summary-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-size: 18px; font-weight: 900; }
.guide-detail-body { padding: 3px 22px 22px 74px; border-top: 1px solid #edf2f4; }
.guide-steps { margin: 16px 0 0; padding-left: 20px; color: #405663; }
.guide-steps li { margin: 0 0 10px; padding-left: 5px; line-height: 1.62; }
.guide-steps li::marker { color: var(--blue); font-weight: 900; }
.guide-note { margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid var(--cyan); border-radius: 8px; color: #476777; background: #eef9fb; line-height: 1.55; }
.guide-checklist { margin: 16px 0 0; padding: 0; list-style: none; }
.guide-checklist li { position: relative; margin: 0 0 10px; padding-left: 27px; color: #405663; line-height: 1.58; }
.guide-checklist li:before { content: "✓"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 10px; font-weight: 900; }
.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; gap: 14px; padding: 8px 14px 8px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.table-meta-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.document-result-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.document-view-toggle { display: inline-flex; align-items: center; padding: 3px; border: 1px solid #cbdce4; border-radius: 10px; background: #f4f8fa; }
.document-view-button { min-height: 30px; padding: 5px 11px; border: 0; border-radius: 7px; color: #607684; background: transparent; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; white-space: nowrap; }
.document-view-button:hover { color: var(--blue-dark); }
.document-view-button.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--cyan)); box-shadow: 0 3px 8px rgba(8,102,141,.18); }
.table-export-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.compact-export-button { min-height: 32px; padding: 6px 11px; border: 1px solid #cbdce4; border-radius: 8px; color: var(--blue-dark); background: #fff; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.compact-export-button:hover { border-color: #83c1d6; background: #f0fafc; }
.table-scroll { overflow-x: auto; }
/* Keep the wide records table inside its panel, with reachable scrollbars. */
#document-list-view { min-width: 0; max-width: 100%; }
#document-list-view .table-scroll { width: 100%; max-width: 100%; max-height: 65vh; overflow: auto; scrollbar-gutter: stable; }
#document-list-view .configured-document-table { width: max-content; min-width: 100%; }
#document-list-view .configured-document-table thead th { position: sticky; top: 0; z-index: 1; }
.template-editor-actions select { flex: 1 1 240px; min-width: 0; max-width: 100%; padding: 10px; }
[data-selected-base] { min-width: 0; }
[data-selected-base] { display: flex; flex-wrap: wrap; gap: 8px; }
[data-selected-base] > label { flex: 1 1 180px; min-width: 0; }
.configured-document-table th, .configured-document-table td { min-width: 100px; max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.configured-document-table th { font-size: 12px; text-transform:none; letter-spacing:normal; }
.configured-document-table td { font-size: 12px; }
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; }
.document-approver-cell { min-width: 145px; }
.document-approver-cell strong, .document-approver-cell small { display: block; }
.document-approver-cell small { color: var(--muted); }
.document-approve-now { margin-top: 7px; padding: 6px 10px; white-space: nowrap; }
.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; }
.trash-actions { min-width: 190px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.trash-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.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); }

.document-tree-view { min-height: 280px; background: linear-gradient(180deg, #fbfdfe, #f7fbfc); }
.document-tree-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.document-tree-toolbar > div:first-child { display: grid; gap: 2px; }
.document-tree-toolbar strong { color: var(--navy); font-size: 13px; }
.document-tree-toolbar span { color: var(--muted); font-size: 11px; font-weight: 600; }
.document-tree-toolbar-actions { display: flex; align-items: center; gap: 6px; }
.document-tree-toolbar-actions button { min-height: 31px; padding: 5px 10px; border: 1px solid #cbdce4; border-radius: 8px; color: var(--blue-dark); background: #fff; font: inherit; font-size: 10px; font-weight: 850; cursor: pointer; white-space: nowrap; }
.document-tree-toolbar-actions button:hover { border-color: #83c1d6; background: #f0fafc; }
.document-tree { padding: 16px 18px 22px; }
.document-tree details { position: relative; }
.document-tree summary { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; color: #385361; cursor: pointer; list-style: none; user-select: none; }
.document-tree summary::-webkit-details-marker { display: none; }
.document-tree summary:hover { background: #edf8fb; }
.document-tree summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-tree-arrow { width: 9px; height: 9px; flex: 0 0 auto; border-right: 2px solid #72909f; border-bottom: 2px solid #72909f; transform: rotate(-45deg); transition: transform .16s ease; }
.document-tree details[open] > summary .document-tree-arrow { transform: rotate(45deg); }
.document-tree-icon { width: 25px; height: 25px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 7px; font-size: 12px; font-weight: 900; }
.document-tree-company > summary { min-height: 48px; color: var(--navy); background: #eaf6fa; }
.document-tree-company > summary:hover { background: #dff2f7; }
.document-tree-company-icon { color: #087a8e; background: #d5f0f1; }
.document-tree-department-icon { color: #13769d; background: #e0f1fa; }
.document-tree-category-icon { color: #a06d12; background: #fff3d7; }
.document-tree-count { margin-left: auto; padding: 4px 8px; border-radius: 99px; color: #607684 !important; background: #eef3f5; font-size: 10px !important; font-weight: 850 !important; white-space: nowrap; }
.document-tree-branch { position: relative; margin-left: 21px; padding: 4px 0 6px 20px; border-left: 2px solid #cde8ee; }
.document-tree-branch:before { content: ""; position: absolute; left: -2px; top: 23px; width: 18px; border-top: 2px solid #cde8ee; }
.document-tree-department + .document-tree-department,
.document-tree-category + .document-tree-category { margin-top: 2px; }
.document-tree-leaves { display: grid; gap: 8px; margin: 3px 0 7px 19px; padding: 3px 0 3px 20px; border-left: 2px solid #dbecef; }
.document-tree-document { overflow: hidden; border: 1px solid #dbe7ec; border-radius: 11px; background: #fff; box-shadow: 0 3px 10px rgba(18,54,76,.035); }
.document-tree-document-main { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.document-tree-document-icon { color: #0c789c; background: #e6f4f8; }
.document-tree-document-copy { min-width: 0; display: grid; flex: 1; gap: 2px; }
.document-tree-document-copy strong { overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.document-tree-document-copy span { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.document-tree-file { min-height: 46px; display: flex; align-items: center; gap: 10px; margin-left: 24px; padding: 7px 10px 7px 12px; border-top: 1px solid #edf2f4; background: #fbfdfe; }
.document-tree-file.missing { background: #fffaf1; }
.document-tree-file-icon { width: 23px; height: 23px; color: var(--green); background: var(--green-soft); font-size: 11px; }
.document-tree-file.missing .document-tree-file-icon { color: #ad7212; background: var(--amber-soft); }
.document-tree-file-copy { min-width: 150px; display: grid; flex: 1; gap: 1px; }
.document-tree-file-copy strong { color: #405663; font-size: 11px; }
.document-tree-file-copy span { color: var(--muted); font-size: 9px; font-weight: 600; }
.document-tree-file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.document-tree-file-actions .table-action { padding: 5px 7px; font-size: 10px; }

.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 {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}
.document-toolbar .toolbar-buttons {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
}
.document-toolbar .toolbar-buttons .button { white-space: nowrap; }
.document-primary-actions { align-items: center; }
.toolbar-action-menu { position: relative; }
.toolbar-action-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.toolbar-action-menu > summary::-webkit-details-marker { display: none; }
.toolbar-action-menu[open] > summary { border-color: #83c1d6; background: #f0fafc; }
.toolbar-action-menu-panel { position: absolute; z-index: 35; top: calc(100% + 8px); right: 0; width: min(310px, calc(100vw - 34px)); display: grid; gap: 5px; padding: 8px; border: 1px solid #cbdde5; border-radius: 13px; background: #fff; box-shadow: 0 16px 36px rgba(8,55,77,.16); }
.toolbar-menu-action { width: 100%; min-height: 52px; display: grid; gap: 2px; padding: 9px 11px; border: 0; border-radius: 9px; color: inherit; background: transparent; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.toolbar-menu-action:hover, .toolbar-menu-action:focus-visible { outline: 0; background: #edf8fb; }
.toolbar-menu-action strong { color: var(--navy); font-size: 12px; }
.toolbar-menu-action small { color: var(--muted); font-size: 10px; }
.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); }
.asset-filters,
.document-filters {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 11px;
  margin: 15px 0;
}
.asset-filters .filter-group,
.document-filters .filter-group {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(2, minmax(180px, 1fr));
  align-items: center;
}
.asset-filters .search-field,
.document-filters .search-field { width: 100%; min-width: 0; max-width: none; }
.asset-filters .filter-group select,
.document-filters .filter-group select { width: 100%; min-width: 0; max-width: none; }
.asset-filters .toolbar-buttons,
.document-filters .export-buttons { width: 100%; justify-content: flex-end; }
.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; }
.folder-manager-panel { margin: 0 0 16px; overflow: hidden; border: 1px solid #bcd9e5; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(18,54,76,.06); }
#report-book-panel { padding: 18px; min-height: 0; overflow-wrap: anywhere; }
#report-book-panel p { margin: 10px 0; line-height: 1.6; }
#report-book-panel .button { white-space: normal; }
.field-order-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; min-width:0; }
#modal-body [data-document-template-fields] { display:contents; }
#modal-body [data-document-template-fields] > .document-template-section-title { display:none; }
.template-unified-fields [data-selected-base] { width:100%; min-width:0; }
.document-storage-caption { display:block; margin-top:6px; color:var(--muted); font-weight:400; line-height:1.5; overflow-wrap:anywhere; }
.document-code { color:var(--navy); }
.configured-document-table td { vertical-align:middle; }
.configured-document-table .document-title { min-width:160px; max-width:280px; white-space:normal; overflow-wrap:break-word; }
.documents-folder-mode .document-metric-grid,
.documents-folder-mode .document-filters,
.documents-folder-mode > .table-panel { display: none !important; }
.documents-folder-mode #new-document-button { display: none !important; }
.documents-folder-mode .folder-manager-panel { min-height: min(690px, calc(100vh - 190px)); margin-bottom: 0; }
.folder-manager-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f7fcfe, #eef9fc); }
.folder-manager-head h3 { margin: 3px 0 4px; color: var(--navy); font-size: 20px; }
.folder-manager-head p { margin: 0; color: var(--muted); font-size: 12px; }
.folder-create-form { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(230px,1.2fr) minmax(260px,1.35fr) auto; align-items: end; gap: 10px; padding: 16px 20px 10px; }
.folder-create-form label { display: grid; gap: 6px; min-width: 0; }
.folder-create-form label > span { color: #506574; font-size: 11px; font-weight: 800; }
.folder-create-form select, .folder-create-form input { width: 100%; min-width: 0; }
.folder-manager-message { margin: 0; padding: 2px 20px 13px; color: var(--muted); font-size: 11px; }
.drive-folder-tree { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 0 20px 20px; }
.drive-company-tree { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; }
.drive-company-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: #eef8fb; }
.drive-company-head > div { min-width: 0; display: flex; align-items: center; gap: 7px; }
.drive-company-head strong { overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.drive-company-icon { color: var(--blue); }
.drive-company-content { max-height: 390px; overflow: auto; padding: 8px; }
.drive-department-branch { margin-bottom: 5px; }
.drive-department-row, .drive-folder-row { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 8px; }
.drive-department-row { background: #f1f6f8; }
.drive-department-row > strong, .drive-folder-name { min-width: 0; flex: 1; }
.drive-department-row > strong { overflow: hidden; color: #365565; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drive-department-row > small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.drive-folder-branch { padding-left: calc(var(--folder-depth) * 14px); }
.drive-folder-row { border-left: 2px solid #b6deea; }
.drive-folder-row:hover { background: #f4fafc; }
.drive-folder-icon { color: #d69521; font-size: 12px; }
.drive-folder-name strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drive-folder-name small { display: block; color: var(--muted); font-size: 9px; }
.drive-folder-row .table-action, .drive-department-row .table-action, .drive-company-head .table-action { flex: 0 0 auto; padding: 4px 5px; font-size: 9px; }
.folder-tree-empty { padding: 16px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.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 { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.document-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.original-document { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.original-document.yes { color: var(--green); background: var(--green-soft); }
.original-document.no { color: var(--muted); background: #edf2f4; }
.original-document.unknown { color: #a86608; background: var(--amber-soft); }
.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); }
.scope-permission-list { grid-column: 1 / -1; display: grid; gap: 10px; }
.permission-scope-empty { margin: 0; padding: 16px; border: 1px dashed #abcbd7; border-radius: 11px; color: var(--muted); background: #f8fbfc; }
.scope-permission-row { display: grid; grid-template-columns: 1.15fr 1.35fr 1.35fr 150px auto; gap: 9px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbfc; }
.scope-permission-row select { min-width: 0; }

.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.template-modal { width: min(1040px, calc(100vw - 30px)); }
.modal.permission-modal { width: min(1080px, calc(100vw - 30px)); }
.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; }
.modal-body > .full { grid-column: 1 / -1; }
.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; }
.document-template-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.document-template-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-left: 4px solid var(--blue); border-radius: 8px; color: var(--navy); background: #eef9fc; }
.document-template-section-title small { color: var(--muted); font-weight: 600; }
.template-editor-note { padding: 11px 13px; border: 1px solid #b9dce8; border-radius: 10px; color: #416273; background: #f0fafc; font-size: 12px; }
.template-status { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; color: #456371; background: #f7fafb; }
.template-status strong { color: var(--navy); }
.template-section-heading { display: grid; gap: 3px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.template-section-heading strong { color: var(--navy); font-size: 14px; }
.template-section-heading span { color: var(--muted); font-size: 11px; }
.base-field-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.base-field-option { min-width: 0; display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfc; cursor: pointer; }
.base-field-option:has(> input[type="checkbox"]:checked) { border-color: #9ed3df; background: #effafd; }
.base-field-option.locked { background: #f3f6f7; cursor: default; }
.base-field-option > input[type="checkbox"] { margin: 10px 0 0; accent-color: var(--blue); }
.base-field-option > label { min-width: 0; display: grid; gap: 3px; }
.base-field-option > label input { width: 100%; min-width: 0; min-height: 36px; margin: 0; padding: 7px 9px; border: 1px solid #bfd2dc; border-radius: 8px; color: var(--navy); background: #fff; font-size: 11px; font-weight: 800; }
.base-field-option > label input:focus { border-color: var(--blue); outline: 3px solid rgba(14, 131, 183, .12); }
.base-field-option small { display: block; }
.base-field-option small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.base-field-option[data-selected-base] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; cursor: default; }
.base-field-option[data-selected-base] > input[hidden] { display: none !important; }
.base-field-option[data-selected-base] > label { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; gap: 6px; }
.base-field-option[data-selected-base] > label input { box-sizing: border-box; width: 100%; min-height: 42px; font-size: 14px; }
.base-field-option[data-selected-base] small { font-size: 12px; white-space: normal; overflow-wrap: break-word; }
.base-field-option[data-selected-base] > button { justify-self: end; max-width: 100%; white-space: normal; font-size: 13px; }
.base-input-type { display: grid; gap: 6px; min-width: 0; font-size: 13px; }
.base-input-type select { box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; color: var(--navy); opacity: 1; }
.base-field-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field-access-controls { display:grid; gap:10px; min-width:0; }
.field-access-controls label { display:grid; gap:6px; min-width:0; font-size:14px; }
.field-access-controls select { width:100%; min-width:0; max-width:100%; box-sizing:border-box; font-size:14px; }
.template-field-row > label { min-width:0; }
.template-field-row select, .template-field-row input, .template-field-row textarea { max-width:100%; box-sizing:border-box; }
.base-field-controls > label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.base-field-controls input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 0; padding: 0; }
.base-field-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
.template-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.template-editor-actions .field-note { flex: 1 1 280px; }
.template-field-list { display: grid; gap: 12px; }
.template-access-summary { padding:16px; border:1px solid var(--line); border-radius:12px; background:#f2f9fc; min-width:0; }
.template-access-summary p, .template-access-summary small { color:var(--muted); overflow-wrap:anywhere; }
.template-access-summary ul { padding:0; margin:12px 0; list-style:none; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:8px; }
.template-access-summary li { display:flex; flex-direction:column; gap:4px; padding:10px; background:white; border-radius:8px; overflow-wrap:anywhere; }
.template-access-summary li span { font-size:14px; color:var(--muted); }
.template-unified-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr)); gap:16px; align-items:start; min-width:0; }
.template-unified-fields > .base-field-list, .template-unified-fields > .template-field-list { display:contents; }
.template-unified-fields .template-field-row { grid-template-columns:minmax(0,1fr); margin:0; }
.template-unified-fields .template-empty { grid-column:1/-1; }
.template-library { border:1px solid var(--line); border-radius:10px; padding:12px; min-width:0; }
@media screen {
  .template-access-summary, .template-editor-note, .template-field-row,
  .base-field-option[data-selected-base] { background:#fff; }
  .template-access-summary li { background:#f3f6f8; }
  .template-editor-note { border-color:var(--line); color:var(--muted); }
  .template-empty { background:#f7f9fa; color:var(--muted); }
}
.template-library summary { cursor:pointer; font-size:14px; color:var(--muted); }
.template-library[open] summary { margin-bottom:12px; }
.template-library select { flex:1 1 220px; min-width:0; max-width:100%; }
.template-unified-fields .template-field-row { padding:16px; gap:12px; }
.template-unified-fields .template-field-row input[type="text"], .template-unified-fields .template-field-row select, .template-unified-fields .template-field-row textarea { padding:10px 12px; border:1px solid var(--line); border-radius:8px; font:inherit; min-height:42px; background:white; }
.template-unified-fields .template-field-row .hidden { display:none; }
.template-field-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 14px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfc; }
.template-field-row > label { display: grid; gap: 5px; min-width: 0; color: #506574; font-size: 14px; font-weight: 800; }
.template-field-row input[type="text"], .template-field-row select, .template-field-row textarea { width: 100%; min-width: 0; }
.template-field-row textarea { min-height: 46px; resize: vertical; }
.template-check { grid-template-columns: 18px auto !important; align-items: center; align-self: center; white-space: nowrap; }
.template-check input { margin: 0; accent-color: var(--blue); }
.template-add-button { margin-right: 10px; }
.template-empty { margin: 0; padding: 20px; border: 1px dashed #abcbd7; border-radius: 11px; color: var(--muted); text-align: center; background: #f8fbfc; }
.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-preview-content .report-table { table-layout: auto; }
.print-preview-content .report-table th,
.print-preview-content .report-table td { overflow-wrap: anywhere; white-space: normal; }
.print-preview-content .document-report { table-layout: fixed; font-size: 8.5px; line-height: 1.25; }
.print-preview-content .document-report th:nth-child(1) { width: 6%; }
.print-preview-content .document-report th:nth-child(2) { width: 9%; }
.print-preview-content .document-report th:nth-child(3) { width: 7%; }
.print-preview-content .document-report th:nth-child(4) { width: 9%; }
.print-preview-content .document-report th:nth-child(5) { width: 7%; }
.print-preview-content .document-report th:nth-child(6) { width: 7%; }
.print-preview-content .document-report th:nth-child(7) { width: 6%; }
.print-preview-content .document-report th:nth-child(8) { width: 9%; }
.print-preview-content .document-report th:nth-child(9) { width: 8%; }
.print-preview-content .document-report th:nth-child(10) { width: 7%; }
.print-preview-content .document-report th:nth-child(11) { width: 7%; }
.print-preview-content .document-report th:nth-child(12) { width: 6%; }
.print-preview-content .document-report th:nth-child(13) { width: 6%; }
.print-preview-content .document-report th:nth-child(14) { width: 6%; }
.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: 1320px) {
  .online-member-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-filter-bar .search-field { grid-column: 1 / -1; }
  [data-view-panel="activity"] .section-toolbar { align-items: flex-start; flex-direction: column; }
}

@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; }
  .document-toolbar { grid-template-columns: 1fr; align-items: start; }
  .document-toolbar .toolbar-buttons { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: end; }
  .document-toolbar .toolbar-buttons .button { justify-content: center; }
  .folder-create-form { grid-template-columns: 1fr 1fr; }
  .drive-folder-tree { grid-template-columns: 1fr; }
}

@media (max-width: 1500px) {
  .document-toolbar { grid-template-columns: 1fr; align-items: start; }
  .document-toolbar .toolbar-buttons { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: end; }
  .document-toolbar .toolbar-buttons .button { justify-content: center; }
}

@media (min-width: 981px) {
  .app-shell:not(.dashboard-view) .topbar { display: none; }
}

@media (max-width: 980px) {
  :root { --sidebar-width: min(244px, 86vw); }
  .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; }
  .app-shell:not(.dashboard-view) .topbar { min-height: 58px; padding: 8px 12px; }
  .app-shell:not(.dashboard-view) .topbar h1 { max-width: calc(100vw - 86px); font-size: 18px; }
  .app-shell:not(.dashboard-view) .page-eyebrow { display: none; }
  .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) {
  .online-member-list { grid-template-columns: 1fr; }
  .activity-filter-bar { grid-template-columns: 1fr; }
  .notification-online-summary { grid-template-columns: auto 1fr; }
  .notification-online-summary small { grid-column: 1/-1; }
  .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: 190px; height: 64px; }
  .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; gap: 8px; padding: 11px 12px; }
  .topbar-left { gap: 8px; }
  .topbar-left > div { min-width: 0; }
  .topbar h1 { max-width: 145px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .page-eyebrow { display: none; }
  .topbar-actions { gap: 5px; }
  .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; }
  .guide-intro { min-height: 0; padding: 24px 22px; }
  .guide-intro-badge { display: none; }
  .guide-quick-grid { grid-template-columns: 1fr; }
  .guide-detail-body { padding: 3px 17px 18px; }
  .guide-section-list summary { padding: 14px; }
  .guide-section-list summary small { white-space: normal; }
  .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; }
  .asset-filters .filter-group, .document-filters .filter-group { 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; }
  .document-toolbar .toolbar-buttons { grid-template-columns: 1fr; }
  .toolbar-action-menu, .toolbar-action-menu > summary { width: 100%; }
  .toolbar-action-menu-panel { position: fixed; top: auto; right: 13px; bottom: 13px; left: 13px; width: auto; max-height: min(70vh, 470px); overflow-y: auto; }
  .folder-create-form { grid-template-columns: 1fr; padding: 14px; }
  .folder-manager-head { padding: 15px; }
  .folder-manager-message { padding: 0 14px 12px; }
  .drive-folder-tree { padding: 0 14px 14px; }
  .export-buttons { width: 100%; }
  .export-buttons .button { flex: 1 1 auto; }
  .table-meta { padding: 8px 10px 8px 13px; }
  .document-result-actions { width: 100%; justify-content: space-between; }
  .document-tree-toolbar { align-items: flex-start; flex-direction: column; }
  .document-tree-toolbar-actions { width: 100%; }
  .document-tree-toolbar-actions button { flex: 1; }
  .document-tree { padding: 12px 10px 18px; }
  .document-tree-branch { margin-left: 12px; padding-left: 10px; }
  .document-tree-leaves { margin-left: 9px; padding-left: 10px; }
  .document-tree-document-main { align-items: flex-start; flex-wrap: wrap; }
  .document-tree-document-main .document-status { margin-left: 35px; }
  .document-tree-file { align-items: flex-start; flex-wrap: wrap; margin-left: 12px; }
  .document-tree-file-actions { width: 100%; justify-content: flex-start; padding-left: 33px; }
  .activity-row { grid-template-columns: 40px 1fr auto; }
  .activity-row .activity-from, .activity-row .activity-to { display: none; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-body > .full { grid-column: auto; }
  .field.full { grid-column: auto; }
  .document-template-fields { grid-template-columns: 1fr; }
  .base-field-list { grid-template-columns: 1fr; }
  .template-field-row { grid-template-columns: 1fr; align-items: stretch; }
  .template-check { justify-content: start; }
  .recipient-grid { grid-template-columns: 1fr; }
  .permission-row { grid-template-columns: 1fr; gap: 8px; }
  .scope-permission-row { grid-template-columns: 1fr; }
  .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; }
  .table-meta-copy > span:not(:first-child) { display: none; }
  .table-meta { align-items: stretch; flex-direction: column; }
  .document-result-actions { align-items: stretch; flex-direction: column; }
  .document-view-toggle { width: 100%; }
  .document-view-button { flex: 1; }
  .table-export-actions { width: 100%; }
  .table-export-actions .compact-export-button { flex: 1; }
  .compact-export-button { min-height: 30px; padding: 5px 9px; }
  .filter-group { grid-template-columns: 1fr; }
  .asset-filters .filter-group, .document-filters .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%; }
}

/* V2.97: working space first; screen-only so printed reports stay unchanged. */
@media screen {
  .workspace, .content, .view-panel, .panel, .table-panel { min-width: 0; }
  .content { padding: 24px clamp(16px, 2vw, 32px) 40px; }
  .hero-panel { min-height: 0; padding: 26px 30px; grid-template-columns: minmax(0, 1fr) 180px; }
  .hero-panel > div:first-child { position: relative; z-index: 1; }
  .hero-visual { height: 170px; }
  .hero-actions { margin-top: 18px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card { min-height: 108px; padding: 16px; gap: 12px; }
  .metric-card small, .metric-card strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .document-toolbar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .document-toolbar .toolbar-buttons { display: flex; flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .section-toolbar > div, .field, .filter-group, .panel-header > div { min-width: 0; }
  .table-meta, .panel-header { flex-wrap: wrap; }
  .table-scroll { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .configured-document-table th, .configured-document-table td { min-width: 120px; overflow-wrap: break-word; }
  .configured-document-table .document-title { min-width: 220px; }
  .sync-status { overflow-wrap: anywhere; }
  .modal { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
  .modal form { min-height: 0; max-height: none; overflow: hidden; }
  .modal-header, .modal-footer { flex-shrink: 0; }
  .modal-body { min-height: 0; overscroll-behavior: contain; }
  .modal-footer { flex-wrap: wrap; }
}
@media screen and (min-width: 1800px) {
  .metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .document-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .document-toolbar .toolbar-buttons { width: auto; justify-content: flex-end; }
}
@media screen and (max-width: 1100px) {
  .asset-filters .filter-group, .document-filters .filter-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filters .search-field, .document-filters .search-field { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid .panel { grid-column: 1 / -1; }
}
@media screen and (max-width: 980px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { height: 100dvh; }
}
@media screen and (max-width: 760px) {
  .content { padding: 16px 12px 30px; }
  .hero-panel { padding: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .document-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .document-metric-grid article { padding: 12px; }
  .document-toolbar .toolbar-buttons > .button { flex: 1 1 130px; }
  .document-toolbar .toolbar-action-menu { flex: 1 1 100%; }
  .button, .table-action, .document-view-button, .compact-export-button, .icon-button { min-height: 44px; }
  .field input, .field select, .field textarea { font-size: 16px; max-width: 100%; }
  .modal-header, .modal-body, .modal-footer { padding: 14px; }
  .modal-header h2 { overflow-wrap: break-word; }
  .toolbar-action-menu-panel { bottom: max(13px, env(safe-area-inset-bottom)); }
  .panel { padding: 16px; }
}
@media screen and (max-width: 380px) {
  .asset-filters .filter-group, .document-filters .filter-group { grid-template-columns: minmax(0, 1fr); }
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
}

/* V2.98: department identity, totals and actions have separate space. */
@media screen {
  .location-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: stretch; }
  .location-card { display: flex; flex-direction: column; min-width: 0; }
  .location-card-head { padding: 18px; align-items: flex-start; flex: 1; }
  .location-label, .location-label > div { min-width: 0; }
  .location-label h3 { overflow-wrap: anywhere; line-height: 1.4; }
  .location-label small { display: block; margin-top: 4px; overflow-wrap: anywhere; line-height: 1.5; }
  .location-sync-note { color: var(--green) !important; }
  .location-total { flex: 0 0 auto; display: grid; justify-items: end; }
  .location-number { line-height: 1.2; }
  .location-total small { font-size: 12px; white-space: nowrap; }
  .location-children { padding: 0 18px; }
  .location-child > span:first-child { min-width: 0; overflow-wrap: anywhere; }
  .location-child > span:last-child { flex-shrink: 0; }
  .location-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 18px 14px; }
  .location-card-actions:empty { display: none; }
  .location-card-actions .table-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; text-decoration: none; border: 1px solid var(--line); background: #f5fafc; }
  .location-card-actions .table-action:hover { background: var(--blue-soft); }
}
@media screen and (max-width: 760px) {
  .location-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .location-card-head { padding: 14px; }
  .location-children { padding: 0 14px; }
  .location-card-actions { padding: 10px 14px 14px; }
}

/* V2.99: smaller headings, unchanged body font and print typography. */
@media screen {
  .hero-panel h2 { font-size: clamp(24px, 2.1vw, 30px); line-height: 1.3; letter-spacing: -.02em; margin: 6px 0 10px; }
  .hero-panel h2 br { display: none; }
  .hero-panel { padding: 22px 26px; grid-template-columns: minmax(0, 1fr) 140px; }
  .hero-visual { height: 140px; }
  .hero-badge { width: 130px; height: 130px; }
  .hero-badge span { font-size: 42px; }
  .hero-panel .radar-one { width: 158px; height: 158px; }
  .hero-panel .radar-two { width: 110px; height: 110px; }
  .topbar h1 { font-size: clamp(22px, 1.8vw, 26px); line-height: 1.3; }
  .section-heading { font-size: clamp(21px, 1.8vw, 24px); line-height: 1.35; }
  .dashboard-grid .panel h3 { font-size: 18px; line-height: 1.4; }
  .modal-header h2 { font-size: 21px; line-height: 1.35; }
}
@media screen and (max-width: 980px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 760px) {
  .hero-panel { padding: 18px; }
  .hero-panel h2 { font-size: 24px; }
  .topbar h1, .modal-header h2 { font-size: 20px; }
}

/* V3.00 compact overview; details do not stretch neighbouring panels. */
@media screen {
  .dashboard-shortcuts .hero-actions { margin: 0; gap: 8px; }
  .dashboard-shortcuts .button { color: var(--blue-dark); background: #fff; border: 1px solid var(--line); }
  .dashboard-view .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0; gap: 12px; }
  .dashboard-view .dashboard-secondary-metric { display: none !important; }
  .dashboard-view .metric-card { min-height: 88px; padding: 12px; }
  .dashboard-view .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
  .dashboard-view .dashboard-grid > .panel { grid-column: auto; padding: 16px; }
  .dashboard-view .panel-header { margin-bottom: 12px; gap: 8px; }
  .dashboard-view .panel-header .eyebrow { display: none; }
  .dashboard-view .overview-status { order: 0; }
  .dashboard-view .overview-distribution { order: 1; }
  .dashboard-view .overview-attention { order: 2; }
  .dashboard-view .overview-recent { order: 3; }
  .dashboard-view .asset-overview-panel { order: 4; grid-column: 1 / -1 !important; }
  .overview-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .overview-switch .button { min-height: 40px; padding: 7px 12px; }
  .overview-switch [aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); }
  .overview-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; margin: 10px 0; }
  .overview-bar > span { overflow-wrap: anywhere; font-size: 14px; }
  .overview-bar > strong { color: var(--blue-dark); }
  .overview-bar .bar-track { grid-column: 1 / -1; height: 7px; }
  .overview-more summary { padding: 10px 0; cursor: pointer; color: var(--blue-dark); }
  .overview-more[open] { max-height: 340px; overflow-y: auto; }
  .dashboard-view .attention-item { padding: 10px; }
  .dashboard-view .attention-list { gap: 8px; }
  .dashboard-view .overview-recent .activity-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; }
  .dashboard-view .overview-recent .activity-from, .dashboard-view .overview-recent .activity-to { display: none; }
  .dashboard-view .overview-recent .activity-symbol { width: 28px; height: 28px; }
  .dashboard-view .overview-recent .activity-row > div { min-width: 0; overflow-wrap: anywhere; }
  .dashboard-view .asset-overview-grid article { min-height: 70px; padding: 10px; }
  .dashboard-view .asset-overview-grid small { display: none; }
}
@media screen and (max-width: 760px) {
  .dashboard-view .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-view .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-view .status-chart-wrap { grid-template-columns: 112px minmax(0, 1fr); }
  .dashboard-view .metric-card { flex-direction: row; align-items: center; }
  .dashboard-view .metric-icon { display: none; }
  .dashboard-view .asset-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen {
  .overview-status .status-legend-row { width: 100%; min-height: 40px; padding: 6px; border: 0; border-radius: 8px; background: transparent; font: inherit; text-align: left; cursor: pointer; }
  .overview-status .status-legend-row:hover, .overview-status .status-legend-row:focus-visible { background: var(--blue-soft); outline: 2px solid #82c9dd; }
  .overview-status .status-legend-row small, .overview-bar strong small { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
  .overview-status .status-legend-row strong { white-space: nowrap; }
  .overview-status .status-legend-row > span { overflow-wrap: anywhere; }
  .overview-bar .bar-fill { transform-origin: left; animation: overview-grow .4s ease-out both; }
  .overview-status .status-donut { animation: overview-appear .35s ease-out both; }
  @keyframes overview-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes overview-appear { from { opacity: .5; } to { opacity: 1; } }
}
@media screen and (prefers-reduced-motion: reduce) {
  .overview-bar .bar-fill, .overview-status .status-donut { animation: none; }
}

/* V3.02: compact two-chart overview and one switchable detail panel. */
@media screen {
  .dashboard-view .topbar { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
  .dashboard-view .page-eyebrow { display: none; }
  .dashboard-view .content { min-height: 0; padding: 12px 20px 16px; }
  .dashboard-view .dashboard-shortcuts .button { min-height: 38px; padding: 7px 12px; }
  .dashboard-view .metric-grid { margin: 10px 0; gap: 10px; }
  .dashboard-view .metric-card { min-height: 72px; padding: 10px 14px; border-radius: 12px; box-shadow: none; }
  .dashboard-view .metric-card small { display: none; }
  .dashboard-view .metric-icon { width: 34px; height: 34px; font-size: 18px; }
  .dashboard-view .dashboard-grid { gap: 10px; align-items: stretch; }
  .dashboard-view .dashboard-grid > .panel { padding: 14px; border-radius: 14px; box-shadow: none; }
  .dashboard-view .panel-header { margin-bottom: 8px; }
  .dashboard-view .status-chart-wrap { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; }
  .dashboard-view .status-donut { width: 108px; height: 108px; }
  .dashboard-view .status-donut:before { width: 74px; height: 74px; }
  .dashboard-view .status-legend { gap: 1px; min-width: 0; }
  .dashboard-view .status-legend-row { min-height: 30px; padding: 3px 5px; gap: 7px; font-size: 13px; }
  .dashboard-view .overview-switch { margin-bottom: 8px; }
  .dashboard-view .overview-switch .button { min-height: 34px; padding: 5px 10px; }
  .dashboard-view #department-summary, .dashboard-view #document-category-bars { max-height: 168px; overflow-y: auto; overscroll-behavior: contain; }
  .dashboard-view .overview-bar { margin: 7px 0; gap: 3px 8px; }
  .overview-details { grid-column: 1 / -1; order: 2; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .overview-detail-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .overview-detail-tabs .button { min-height: 36px; padding: 5px 12px; border-color: transparent; background: transparent; }
  .overview-detail-tabs [aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-dark); border-color: #aed9e5; }
  .dashboard-view .overview-details .panel { border: 0; box-shadow: none; margin: 0; padding: 10px 14px; border-radius: 0 0 14px 14px; max-height: 146px; overflow-y: auto; background: transparent; }
  .overview-detail-inactive { display: none !important; }
  .dashboard-view .overview-details .panel-header h3, .dashboard-view .overview-details .panel-header .eyebrow { display: none; }
  .dashboard-view .overview-details .panel-header { margin: 0; justify-content: flex-end; }
  .dashboard-view .overview-details .panel-header > div:empty { display: none; }
  .dashboard-view .attention-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .dashboard-view .attention-item { min-width: 0; padding: 8px; }
  .dashboard-view .attention-item small { display: none; }
  .dashboard-view .attention-icon { width: 30px; height: 30px; }
}
@media screen and (max-width: 760px) {
  .dashboard-view .content { padding: 10px; }
  .dashboard-view .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-view .attention-list { grid-template-columns: minmax(0, 1fr); }
  .dashboard-view .overview-details .panel { max-height: 180px; }
  .dashboard-view .status-legend-row { min-height: 40px; }
  .overview-detail-tabs .button { min-height: 44px; }
}

/* V3.03: explain counts, keep legend values adjacent, fill remaining height. */
@media screen {
  .dashboard-view .metric-card small { display: block; font-size: 12px; line-height: 1.4; margin-top: 4px; }
  .dashboard-view .status-chart-wrap { grid-template-columns: 112px minmax(0, 330px); justify-content: center; gap: 20px; }
  .dashboard-view .status-legend-row { grid-template-columns: 9px minmax(0, 1fr) auto; border-bottom: 1px solid #edf2f4; }
  .dashboard-view .status-legend-row strong { padding-left: 8px; }
  .dashboard-view .overview-details { display: flex; flex-direction: column; min-height: 0; }
  .dashboard-view .overview-detail-tabs { flex-shrink: 0; }
  .dashboard-view .overview-details .panel { max-height: none; min-height: 0; flex: 1; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #85afbf #edf4f7; }
  .dashboard-view .overview-details .panel::-webkit-scrollbar { width: 8px; }
  .dashboard-view .overview-details .panel::-webkit-scrollbar-track { background: #edf4f7; }
  .dashboard-view .overview-details .panel::-webkit-scrollbar-thumb { background: #85afbf; border-radius: 8px; }
}
@media screen and (min-width: 981px) and (min-height: 680px) {
  .dashboard-view .workspace { height: 100dvh; display: flex; flex-direction: column; }
  .dashboard-view .topbar { flex-shrink: 0; }
  .dashboard-view .content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dashboard-view [data-view-panel="dashboard"].active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .dashboard-view .dashboard-shortcuts, .dashboard-view .metric-grid { flex-shrink: 0; }
  .dashboard-view .dashboard-grid { flex: 1; min-height: 0; grid-template-rows: auto minmax(140px, 1fr); }
  .dashboard-view .overview-details { height: 100%; }
}
@media screen and (max-width: 980px), screen and (max-height: 679px) {
  .dashboard-view .overview-details .panel { max-height: 300px; }
}
@media screen and (max-width: 760px) {
  .dashboard-view .status-chart-wrap { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; }
}

/* V3.04: explicit aligned count and percentage columns. */
@media screen {
  .dashboard-view .status-chart-wrap { grid-template-columns: 108px minmax(0, 380px); gap: 16px; }
  .dashboard-view .status-legend-row, .dashboard-view .status-legend-heading { display: grid; grid-template-columns: 9px minmax(0, 1fr) 58px 56px; gap: 7px; align-items: center; }
  .dashboard-view .status-legend-heading { padding: 3px 5px 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .dashboard-view .status-legend-heading > :first-child { grid-column: 1 / 3; }
  .dashboard-view .status-legend-heading > :not(:first-child), .dashboard-view .status-legend-row strong, .dashboard-view .status-legend-row small { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .dashboard-view .status-legend-row strong { padding-left: 0; }
  .dashboard-view .status-legend-row small { font-size: 12px; font-weight: 400; color: var(--muted); }
}
@media screen and (max-width: 1200px) and (min-width: 981px), screen and (max-width: 480px) {
  .dashboard-view .status-chart-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; }
  .dashboard-view .status-legend { width: 100%; max-width: 380px; }
}

.configured-document-table .document-actions-cell { width: 190px; min-width: 190px; }
.document-row-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.document-row-actions > .table-action, .document-more-actions summary { min-height: 36px; padding: 6px 10px; border: 1px solid #d6e5ec; border-radius: 8px; background: #fff; white-space: nowrap; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.document-more-actions summary { list-style: none; text-align: center; min-width: 36px; }
.document-more-actions summary::-webkit-details-marker { display: none; }
.document-more-actions[open] { flex-basis: 100%; }
.document-more-actions[open] summary { width: 36px; }
.document-more-list { display: grid; gap: 2px; margin-top: 6px; padding: 4px; border: 1px solid #d6e5ec; border-radius: 8px; background: #f5fafc; }
.document-more-list .table-action { text-align: left; min-height: 36px; padding: 7px 10px; white-space: nowrap; }
.document-more-list .danger { border-top: 1px solid #e4dce0; }
.document-row-actions button:focus-visible, .document-more-actions summary:focus-visible { outline: 2px solid #0e83b7; outline-offset: 2px; }
@media (pointer: coarse) { .document-row-actions button, .document-more-actions summary { min-height: 44px; } }

.document-row-actions { flex-direction: column; gap: 6px; }
.document-file-buttons, .document-edit-buttons { display: flex; align-items: flex-start; gap: 5px; flex-wrap: wrap; width: 100%; }
.document-file-buttons .table-action, .document-edit-buttons > .table-action { min-height: 36px; padding: 6px 9px; border: 1px solid #d6e5ec; border-radius: 8px; background: #fff; font: inherit; font-weight: 600; white-space: nowrap; }
.document-file-buttons .table-action:disabled { color: #7b8990; background: #f1f4f6; cursor: not-allowed; opacity: .7; }
.document-file-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.document-edit-buttons:empty { display: none; }
@media (pointer: coarse) { .document-file-buttons .table-action, .document-edit-buttons > .table-action { min-height: 44px; } }

/* One-line primary actions; missing-link explanation remains below. */
.configured-document-table .document-actions-cell { min-width: 270px; width: 270px; }
.document-row-actions { display: grid; grid-template-columns: max-content max-content; align-items: start; justify-content: start; gap: 5px; }
.document-file-buttons { grid-column: 1; grid-row: 1; flex-wrap: nowrap; width: auto; }
.document-edit-buttons { grid-column: 2; grid-row: 1; flex-wrap: nowrap; width: auto; }
.document-file-note { grid-column: 1 / -1; grid-row: 2; }
.document-more-actions[open] { flex-basis: auto; }
.document-more-list { min-width: 120px; }
.print-preview-content .report-table th, .print-preview-content .report-table td { vertical-align: middle; padding: 7px 8px; line-height: 1.4; }
.print-preview-content .report-table th { text-align: center; }
.print-preview-content .report-table .report-stt { text-align: center; width: 32px; }

.document-edit-buttons > .table-action.danger { color: #be2940; border-color: #edcbd1; }
.document-edit-buttons > .table-action.danger:hover { background: #fff1f3; }

@media print {
  html, body { margin: 0 !important; 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; box-sizing: border-box; padding: 8mm 10mm; }
  .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: 8px; }
  .print-area th { padding: 3px; color: #000; background: #eaf4f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area td { padding: 3px; color: #000; }
  .print-area .report-table th, .print-area .report-table td { vertical-align: middle; padding: 5px 6px; line-height: 1.4; }
  .print-area .report-table th { text-align: center; }
  .print-area .report-table .report-stt { text-align: center; width: 8mm; }
  .print-area .report-table td { white-space: normal; overflow-wrap: anywhere; }
  .print-area .document-report { table-layout: fixed; font-size: 7.5px; line-height: 1.25; }
  .print-summary { display: flex; gap: 24px; margin: 10px 0 20px; font-size: 11px; }
  @page { size: A4 landscape; margin: 12mm; }
  .print-area { padding: 0; }
  .print-area .formal-document-report .document-report { font-size: 10pt; line-height: 1.4; }
  .formal-document-report thead { display: table-header-group; }
  .formal-document-report tr { break-inside: avoid; }
  .print-area .formal-document-report .report-compact .document-report { font-size: 8pt; }
  .print-area .formal-document-report .report-dense .document-report { font-size: 6.5pt; }
  .print-area .formal-document-report .report-single-width th,
  .print-area .formal-document-report .report-single-width td { padding: 3px 2px; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .print-area .formal-document-report .report-single-width { width: 100%; min-width: 0; }
}

.report-signature { width: 280px; margin: 28px 0 0 auto; text-align: center; break-inside: avoid; font-size: 14px; }
.report-signature strong, .report-signature em { display: block; }
.signature-space { height: 75px; }
.report-column-section h2 { font-size: 16px; margin: 20px 0 6px; }
.report-column-section > p { font-size: 13px; margin: 0 0 12px; }
.formal-document-report .print-summary { display: block; padding: 12px; background: #eef5f8; border-left: 3px solid #0e83b7; font-size: 14px; line-height: 1.7; }
.formal-document-report .report-table { width: 100%; table-layout: fixed; }
.formal-document-report .report-table th, .formal-document-report .report-table td { overflow-wrap: anywhere; }
