:root {
  --g-text: #202124;
  --g-text-2: #3c4043;
  --g-muted: #5f6368;
  --g-border: #dadce0;
  --g-divider: #e8eaed;
  --g-bg: #f6f8fc;
  --g-surface: #ffffff;
  --g-hover: #f1f3f4;
  --g-green: #137333;
  --g-blue: #1967d2;
  --g-red: #d93025;
  --g-yellow: #a56300;
  --font: "Google Sans", "Roboto", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-width: 320px;
}

body {
  font-family: var(--font-body);
  background: var(--g-bg);
  color: var(--g-text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--g-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #050505;
}

.auth-panel {
  display: grid;
  width: min(430px, 100%);
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #171717;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.auth-brand {
  display: grid;
  gap: 14px;
  color: #fff;
}

.mosaic-wordmark {
  width: fit-content;
  color: #fff;
  font-size: 44px;
  font-weight: 950;
  line-height: 0.9;
}

.auth-panel h1 {
  color: #fff;
  font-size: 24px;
}

.auth-panel .eyebrow {
  color: rgba(255, 255, 255, .7);
}

.auth-panel .field-block > span {
  color: rgba(255, 255, 255, .72);
}

.auth-panel .field-block input {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: #111111;
}

.auth-error {
  color: #ffb7af;
  font-size: 13px;
  font-weight: 700;
}

.google-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  background: #fff;
  color: #202124;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
}

.google-auth-button:hover {
  background: #f7f8f9;
}

.google-auth-button .material-symbols-outlined {
  color: #1a73e8;
  font-size: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .18);
}

.field-block {
  display: grid;
  gap: 7px;
}

.field-block > span {
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 700;
}

.field-block input,
.field-block select {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  color: var(--g-text);
  background: var(--g-surface);
  outline: none;
}

.field-block input:focus,
.field-block select:focus {
  border-color: var(--g-text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .1);
}

.primary-button,
.ghost-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
}

.primary-button,
.btn-primary {
  background: #202124;
  color: #fff;
}

.primary-button:hover,
.btn-primary:hover {
  background: #3c4043;
}

.ghost-button,
.btn-text {
  color: var(--g-text-2);
  background: transparent;
}

.ghost-button:hover,
.btn-text:hover {
  background: var(--g-hover);
}

.btn-danger {
  color: var(--g-red);
  background: transparent;
  border: 1px solid var(--g-border);
}

.btn-danger:hover {
  background: #fce8e6;
}

body:not(.is-authenticated) .gheader,
body:not(.is-authenticated) main {
  display: none;
}

.gheader {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: grid;
  grid-template-columns: 256px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--g-bg);
}

.gh-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 4px;
}

.gh-menu {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--g-text-2);
  background: transparent;
}

.gh-menu:hover {
  background: var(--g-hover);
}

.gh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-brand .product {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  color: var(--g-text);
}

.gh-search {
  justify-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  height: 48px;
  padding: 0 8px 0 16px;
  border-radius: 8px;
  background: var(--g-hover);
}

.gh-search:focus-within {
  background: #fff;
  box-shadow: 0 1px 1px 0 rgba(65, 69, 73, .3), 0 1px 3px 1px rgba(65, 69, 73, .15);
}

.gh-search .material-symbols-outlined {
  color: var(--g-text-2);
  font-size: 22px;
}

.gh-search input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: var(--g-text);
}

.gh-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-copy {
  color: var(--g-muted);
  font-size: 13px;
  font-weight: 500;
}

.gh-account {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #188038;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
}

.shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: calc(100vh - 64px);
}

body.nav-collapsed .shell {
  grid-template-columns: 1fr;
}

body.nav-collapsed .gnav {
  display: none;
}

body.nav-collapsed .content {
  margin-left: 16px;
}

.gnav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 18px;
  border-right: 1px solid var(--g-divider);
  background: var(--g-surface);
}

.side-nav-item.is-material {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--g-text-2);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.side-nav-item.is-material:hover {
  background: var(--g-hover);
}

.side-nav-item.is-material .material-symbols-outlined {
  font-size: 20px;
}

.side-nav-item.is-material.is-active {
  color: #fff;
  background: #202124;
  border-color: #202124;
  font-weight: 700;
}

.side-nav-item.is-material.is-active .material-symbols-outlined {
  color: #fff;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.logout-link {
  margin-top: 12px;
}

.side-nav-item .count {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--g-hover);
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.side-nav-item.is-active .count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.content {
  display: flex;
  flex-direction: column;
  margin: 0 16px 16px 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--g-surface);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 12px;
}

.head h1 {
  font-size: 22px;
}

.head-meta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.meta {
  color: var(--g-muted);
  font-size: 13px;
}

.inline-compose {
  margin: 0;
  padding: 0 20px 0 16px;
  border-radius: 20px;
}

.compose {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 24px 0 16px;
  border-radius: 16px;
  background: #202124;
  color: #fff;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .15), 0 1px 3px 1px rgba(60, 64, 67, .08);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
}

.compose:hover {
  background: #3c4043;
}

.sync-message {
  margin: 0 24px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.sync-error {
  color: #8c1d18;
  background: #fce8e6;
}

.sync-success {
  color: #0f5a2b;
  background: #e6f4ea;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px 16px;
  border-bottom: 1px solid var(--g-divider);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  padding: 0 24px 16px;
}

.metric {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  background: var(--g-surface);
  text-align: left;
}

.metric-button {
  width: 100%;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.metric-button:hover {
  background: #fafbfd;
  border-color: #c7cbd1;
}

.metric-button.is-active {
  border-color: #202124;
  background: #f8fafd;
  box-shadow: inset 0 0 0 1px #202124;
}

.metric .subtle,
.metric-label {
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  color: var(--g-text);
  font-family: var(--font);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.filter-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.filter-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.filter-select select {
  min-width: 170px;
  height: 32px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--g-border);
  border-radius: 16px;
  background: transparent;
  color: var(--g-text-2);
  appearance: none;
  -webkit-appearance: none;
}

.filter-search input {
  min-width: 220px;
  height: 32px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--g-border);
  border-radius: 16px;
  background: transparent;
  color: var(--g-text-2);
  outline: none;
}

.filter-search input:focus,
.filter-select select:focus {
  border-color: var(--g-text);
  box-shadow: 0 0 0 3px rgba(32, 33, 36, .1);
}

.filter-select .material-symbols-outlined,
.filter-search .material-symbols-outlined {
  position: absolute;
  color: var(--g-muted);
  font-size: 18px;
  pointer-events: none;
}

.filter-select .material-symbols-outlined {
  right: 10px;
}

.filter-search .material-symbols-outlined {
  left: 10px;
}

.list {
  flex: 1;
  overflow-x: auto;
}

.material-list-head,
.row {
  min-width: 880px;
}

.row {
  display: grid;
  grid-template-columns: 40px minmax(240px, 2fr) minmax(110px, 1fr) minmax(110px, .95fr) minmax(90px, .9fr) minmax(100px, .9fr) minmax(160px, 1.3fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--g-divider);
  color: var(--g-text-2);
}

.head-row {
  height: 40px;
  background: #fafbfd;
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.head-row .sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.head-row .sort .material-symbols-outlined {
  font-size: 16px;
  opacity: .6;
}

.employee-material-row:hover,
.row:not(.head-row):hover {
  position: relative;
  z-index: 1;
  background: #fff;
  box-shadow: inset 1px 0 0 var(--g-border), inset -1px 0 0 var(--g-border), 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .08);
}

.r-avatar,
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.r-avatar.c1,
.av.c1 { background: #1a73e8; }
.r-avatar.c2,
.av.c2 { background: #188038; }
.r-avatar.c3,
.av.c3 { background: #d93025; }
.r-avatar.c4,
.av.c4 { background: #b06000; }
.r-avatar.c5,
.av.c5 { background: #8430ce; }
.r-avatar.c6,
.av.c6 { background: #0d7377; }

.r-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pmeta {
  min-width: 0;
}

.pmeta strong {
  display: block;
  color: var(--g-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmeta span,
.cell-sub {
  display: block;
  color: var(--g-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip-ok { color: var(--g-green); background: #e6f4ea; border-color: #c6e3cf; }
.chip-wait { color: var(--g-yellow); background: #fef7e0; border-color: #f6dfa8; }
.chip-muted { color: var(--g-muted); background: var(--g-hover); border-color: var(--g-border); }

.r-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--g-muted);
  background: transparent;
}

.r-action:hover {
  background: var(--g-hover);
  color: var(--g-text);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--g-divider);
  border-bottom: 1px solid var(--g-divider);
}

.metric-material {
  padding: 14px 20px;
  border-right: 1px solid var(--g-divider);
}

.metric-material:last-child {
  border-right: 0;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-label .material-symbols-outlined {
  font-size: 18px;
}

.metric-material strong {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 500;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--g-border);
  border-radius: 16px;
  background: var(--g-surface);
  color: var(--g-text-2);
  font-size: 13px;
  font-weight: 500;
}

.filter-chip.is-active {
  color: #fff;
  background: #202124;
  border-color: #202124;
}

.filter-chip .count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--g-hover);
  color: var(--g-muted);
  font-size: 12px;
}

.filter-chip.is-active .count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.device-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  background: var(--g-surface);
  box-shadow: 0 1px 2px rgba(60, 64, 67, .06);
}

.device-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.device-table th,
.device-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--g-divider);
  text-align: left;
  vertical-align: middle;
}

.device-table tbody tr:last-child td {
  border-bottom: 0;
}

.device-table thead th {
  border-bottom: 1px solid var(--g-border);
  background: #fafbfd;
  color: var(--g-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.device-table tbody tr:hover {
  background: #fafbfd;
}

.device-summary-row {
  cursor: pointer;
}

.device-summary-row.is-open {
  background: #fafbfd;
}

.summary-person-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--g-text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.summary-person-button:hover {
  color: #1a73e8;
}

.summary-person-button .material-symbols-outlined {
  color: var(--g-muted);
  font-size: 18px;
}

.device-detail-row td {
  padding: 12px 16px 16px;
  background: #fafbfd;
}

.device-mini-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.device-mini-card {
  display: grid;
  grid-template-columns: 20px auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  background: var(--g-surface);
  color: var(--g-text-2);
  text-align: left;
}

.device-mini-card:hover {
  border-color: #c7cbd1;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .16);
}

.device-mini-card .material-symbols-outlined {
  grid-row: span 3;
  color: var(--g-muted);
  font-size: 20px;
}

.device-mini-card strong,
.device-mini-card span,
.device-mini-card em {
  font-size: 12px;
  line-height: 1.25;
}

.device-mini-card strong {
  color: var(--g-text);
  font-weight: 600;
}

.device-mini-card em {
  color: var(--g-muted);
  font-style: normal;
}

.department-section {
  padding: 0 24px 24px;
}

.department-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--g-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fafbfd;
}

.department-row span {
  color: var(--g-text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
}

.department-row strong {
  min-width: 34px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--g-hover);
  color: var(--g-muted);
  font-size: 13px;
  text-align: center;
}

.employee-table-wrap {
  border-radius: 0 0 8px 8px;
}

.employee-table {
  min-width: 1240px;
}

.employee-table th:last-child,
.employee-table td:last-child {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.employee-table tr.is-muted {
  opacity: .62;
}

.table-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 240px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
}

.avatar.c1 { background: #1a73e8; }
.avatar.c2 { background: #188038; }
.avatar.c3 { background: #d93025; }
.avatar.c4 { background: #b06000; }
.avatar.c5 { background: #8430ce; }
.avatar.c6 { background: #0d7377; }

.table-person strong,
.table-person span,
.table-muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-person strong {
  color: var(--g-text);
  font-size: 13px;
  font-weight: 500;
}

.table-person span,
.table-muted {
  max-width: 230px;
  color: var(--g-muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-ok { color: var(--g-green); background: #e6f4ea; }
.status-wait { color: var(--g-yellow); background: #fef7e0; }
.status-neutral { color: var(--g-muted); background: var(--g-hover); }
.status-stop { color: var(--g-red); background: #fce8e6; }

.legal-entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--g-border);
  border-radius: 999px;
  background: #fafbfd;
  color: var(--g-text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.legal-entity-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--g-muted);
}

.table-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--g-border);
  border-radius: 18px;
  white-space: nowrap;
}

.table-action-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid var(--g-border);
}

.danger-action {
  color: var(--g-red);
}

.danger-action:hover {
  background: #fce8e6;
}

.device-assign-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-assign-control select {
  width: 100%;
  min-width: 260px;
  max-width: 360px;
  height: 34px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--g-border);
  border-radius: 18px;
  background: var(--g-surface);
  color: var(--g-text-2);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%235f6368'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  outline: none;
}

.device-assign-control select:focus {
  border-color: var(--g-text);
  box-shadow: 0 0 0 3px rgba(32, 33, 36, .1);
}

.department-cards {
  width: 100%;
}

.dept-grid-live {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 20px 24px 24px;
  width: 100%;
}

.dept-card-live {
  display: block;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--g-border);
  border-radius: 12px;
  background: var(--g-surface);
  text-align: left;
}

.dept-card-live:hover {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 2px 6px 2px rgba(60, 64, 67, .08);
}

.dc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.dc-icon.c1 { background: #1a73e8; }
.dc-icon.c2 { background: #188038; }
.dc-icon.c3 { background: #d93025; }
.dc-icon.c4 { background: #b06000; }
.dc-icon.c5 { background: #8430ce; }
.dc-icon.c6 { background: #0d7377; }

.dc-name {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
}

.dc-stats {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dc-stats .num {
  font-family: var(--font);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.dc-stats .lab,
.dc-foot {
  color: var(--g-muted);
  font-size: 12px;
}

.dc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.department-edit {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--g-divider);
  background: #fafbfd;
}

.department-edit .detail-head {
  margin-bottom: 12px;
}

.department-edit .detail-head h3 {
  margin: 0;
  color: var(--g-text);
  font-size: 18px;
  font-weight: 500;
}

.department-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.department-create {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 8px;
  border: 1px solid var(--g-border);
  border-radius: 12px;
  background: #fafbfd;
}

.department-create input {
  min-width: 220px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  background: #fff;
}

.detail-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.detail-form .field {
  width: 100%;
  min-width: 260px;
}

.department-edit .field label {
  background: #fafbfd;
}

.logs-timeline {
  padding: 0 24px 20px;
}

.log-filters {
  border-top: 1px solid var(--g-divider);
}

.panel-head {
  padding: 20px 24px 12px;
}

.log-day-live {
  padding-top: 8px;
}

.log-day-head-live {
  position: sticky;
  top: 64px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 8px;
  background: var(--g-surface);
  border-bottom: 1px solid var(--g-divider);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--g-text-2);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--g-hover);
  color: var(--g-muted);
  font-size: 11px;
}

.log-row-live {
  display: grid;
  grid-template-columns: 80px 32px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--g-divider);
}

.log-time-live {
  padding-top: 4px;
  color: var(--g-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.log-icon-live {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.log-icon-live.create { background: #e6f4ea; color: var(--g-green); }
.log-icon-live.edit { background: #e8f0fe; color: var(--g-blue); }
.log-icon-live.delete { background: #fce8e6; color: var(--g-red); }
.log-icon-live.assign { background: #fef7e0; color: var(--g-yellow); }

.log-title-live {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-title-live .who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.log-title-live .av {
  width: 20px;
  height: 20px;
  font-size: 10px;
  background: #188038;
}

.log-title-live .verb {
  color: var(--g-text-2);
}

.log-title-live .obj {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--g-hover);
  font-size: 13px;
  font-weight: 500;
}

.log-detail-live {
  margin-top: 6px;
  color: var(--g-text-2);
  font-size: 13px;
}

.notice,
.not-found-panel,
.empty-state {
  margin: 24px;
  padding: 20px 24px;
  border: 1px solid var(--g-border);
  border-radius: 16px;
  background: var(--g-surface);
}

.not-found-panel {
  display: grid;
  gap: 12px;
}

.empty-state {
  color: var(--g-muted);
}

.tasks-panel {
  margin: 0 24px 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #fafbfd;
  border: 1px solid var(--g-divider);
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.task-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--g-divider);
  border-radius: 10px;
  background: #fff;
}

.task-item em {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fef7e0;
  color: var(--g-yellow);
  font-style: normal;
  font-size: 12px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: rgba(32, 33, 36, .5);
  backdrop-filter: blur(2px);
}

.dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--g-surface);
  box-shadow: 0 24px 48px rgba(60, 64, 67, .30), 0 12px 24px rgba(60, 64, 67, .15);
}

.device-dialog {
  max-width: 620px;
}

.d-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 8px;
}

.d-head h2 {
  font-size: 20px;
}

.d-head p {
  margin-top: 4px;
  color: var(--g-muted);
  font-size: 13px;
}

.d-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--g-text-2);
  background: transparent;
}

.d-close:hover {
  background: var(--g-hover);
}

.d-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 8px;
}

.modal-message {
  margin: 0 24px 4px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  color: var(--g-text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--g-divider);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.grid .full {
  grid-column: 1 / -1;
}

.field {
  position: relative;
  height: 48px;
}

.field input,
.field select {
  width: 100%;
  height: 100%;
  padding: 14px 12px 0;
  border: 1px solid var(--g-border);
  border-radius: 4px;
  background: transparent;
  color: var(--g-text);
  outline: none;
}

.field select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%235f6368'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.field label {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  background: var(--g-surface);
  color: var(--g-muted);
  font-size: 14px;
  pointer-events: none;
  transition: top .12s, font-size .12s, color .12s;
}

.field:focus-within label,
.field input:not(:placeholder-shown) + label,
.field select + label {
  top: 0;
  font-size: 12px;
  color: var(--g-text-2);
}

.field:focus-within input,
.field:focus-within select {
  border-color: var(--g-text);
  box-shadow: inset 0 0 0 1px var(--g-text);
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--g-hover);
  color: var(--g-text-2);
  font-size: 13px;
}

.types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.type {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--g-border);
  border-radius: 12px;
  background: var(--g-surface);
  color: var(--g-text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
}

.type:hover {
  background: var(--g-hover);
}

.type.selected {
  color: #1967d2;
  background: #e8f0fe;
  border-color: #d2e3fc;
}

.type.selected .material-symbols-outlined {
  color: #1967d2;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.assignee-list {
  overflow: hidden;
  border: 1px solid var(--g-border);
  border-radius: 8px;
}

.assignee-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-bottom: 1px solid var(--g-divider);
  color: inherit;
  text-align: left;
  background: #fff;
}

.assignee-row:last-child {
  border-bottom: 0;
}

.assignee-row:hover {
  background: var(--g-hover);
}

.assignee-row.selected {
  background: #e8f0fe;
}

.assignee-meta {
  flex: 1;
  min-width: 0;
}

.assignee-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.assignee-meta span {
  display: block;
  color: var(--g-muted);
  font-size: 12px;
}

.check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--g-border);
  border-radius: 50%;
}

.assignee-row.selected .check {
  border-color: #1967d2;
  background: #1967d2;
}

.assignee-row.selected .check::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: #fff;
}

.d-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--g-divider);
  background: var(--g-surface);
}

.portal-grid[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 84px 1fr;
  }

  .side-nav-item.is-material {
    justify-content: center;
    padding: 0;
  }

  .side-nav-item.is-material span:not(.material-symbols-outlined) {
    display: none;
  }

  .gheader {
    grid-template-columns: auto 1fr auto;
  }
}

@media (max-width: 760px) {
  .gheader {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 14px 16px 16px;
  }

  .gh-left {
    padding-left: 0;
  }

  .gh-menu {
    width: 36px;
    height: 36px;
  }

  .gh-search {
    max-width: none;
    height: 48px;
  }

  .gh-right {
    justify-content: flex-start;
    min-width: 0;
  }

  .session-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body.nav-collapsed .content {
    margin-left: 0;
  }

  .gnav {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--g-divider);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .gnav::-webkit-scrollbar {
    display: none;
  }

  .side-nav-item.is-material {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 40px;
    padding: 0 12px;
    gap: 8px;
    justify-content: flex-start;
    border-radius: 999px;
  }

  .side-nav-item.is-material.logout-link {
    display: flex;
  }

  .side-nav-item.is-material span:not(.material-symbols-outlined) {
    display: inline;
  }

  .side-nav-item .count {
    margin-left: 2px;
    min-width: 22px;
    padding: 2px 7px;
  }

  .content {
    margin: 0;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
  }

  .head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 24px 28px 12px;
  }

  .head-meta-actions {
    justify-content: flex-start;
    gap: 14px;
  }

  .inline-compose {
    width: fit-content;
    max-width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 28px 18px;
  }

  .metric {
    min-height: 112px;
    justify-items: center;
    align-content: center;
    text-align: center;
  }

  .metric-label {
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 20px 18px;
  }

  .filter-select,
  .filter-select select,
  .filter-search,
  .filter-search input {
    width: 100%;
    min-width: 0;
  }

  .list {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .department-section {
    padding: 0 20px 20px;
  }

  .department-row {
    padding: 14px 16px;
  }

  .employee-table-wrap,
  .device-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .employee-table {
    min-width: 940px;
  }

  .device-table {
    min-width: 820px;
    font-size: 12px;
  }

  .device-table th,
  .device-table td {
    padding: 12px 14px;
  }

  .table-person {
    min-width: 210px;
  }

  .table-person span,
  .table-muted {
    max-width: 190px;
  }

  .department-admin-head {
    flex-direction: column;
    align-items: stretch;
    padding: 24px 28px 0;
  }

  .department-create {
    width: 100%;
    justify-content: stretch;
  }

  .department-create input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .department-create .compose {
    width: 100%;
    justify-content: center;
  }

  .department-edit {
    padding: 20px 28px 28px;
  }

  .detail-form {
    grid-template-columns: 1fr;
  }

  .detail-form .field,
  .detail-form .btn {
    width: 100%;
    min-width: 0;
  }

  .dept-grid-live {
    grid-template-columns: 1fr;
    padding: 20px 28px 28px;
  }

  .stats-strip,
  .types,
  .grid {
    grid-template-columns: 1fr;
  }

  .row {
    min-width: 960px;
  }

  .d-foot {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
