:root {
  --md-primary: #1a73e8;
  --md-primary-hover: #1557b0;
  --md-primary-light: #e8f0fe;
  --md-surface: #fff;
  --md-background: #f8f9fa;
  --md-on-surface: #202124;
  --md-on-surface-variant: #5f6368;
  --md-outline: #dadce0;
  --md-error: #d93025;
  --md-error-bg: #fce8e6;
  --md-elevation-1: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --md-elevation-2: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 2px 6px 2px rgba(60, 64, 67, .15);
  --md-radius: 8px;
  --md-radius-sm: 4px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
}

body {
  margin: 0;
  font-family: 'Roboto', 'Noto Sans JP', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--md-on-surface);
  background: var(--md-background);
  overflow-x: hidden;
  max-width: 100vw;
}

body.text-size-small {
  font-size: 12px;
}

body.text-size-small .main,
body.text-size-small .card,
body.text-size-small .card p {
  font-size: 12px;
}

body.text-size-small h1 {
  font-size: 16px;
}

body.text-size-small h2 {
  font-size: 14px;
}

body.text-size-small .breadcrumb,
body.text-size-small .breadcrumb a {
  font-size: 11px;
}

body.text-size-small .nav-link,
body.text-size-small .nav-btn,
body.text-size-small .nav-user {
  font-size: 12px;
}

body.text-size-small .btn {
  font-size: 12px;
}

body.text-size-small table,
body.text-size-small td {
  font-size: 12px;
}

body.text-size-small th {
  font-size: 11px;
}

body.text-size-small input,
body.text-size-small select,
body.text-size-small label {
  font-size: 12px;
}

body.text-size-small .settings-label {
  font-size: 12px;
}

body.text-size-small .settings-opt {
  font-size: 11px;
}

body.text-size-small .error {
  font-size: 11px;
}

body.text-size-small code {
  font-size: 11px;
}

body.text-size-small .detail-table th,
body.text-size-small .detail-table td {
  font-size: 12px;
}

body.text-size-large {
  font-size: 17px;
}

body.text-size-large .main,
body.text-size-large .card,
body.text-size-large .card p {
  font-size: 17px;
}

body.text-size-large h1 {
  font-size: 28px;
}

body.text-size-large h2 {
  font-size: 20px;
}

body.text-size-large .breadcrumb,
body.text-size-large .breadcrumb a {
  font-size: 15px;
}

body.text-size-large .nav-link,
body.text-size-large .nav-btn,
body.text-size-large .nav-user {
  font-size: 16px;
}

body.text-size-large .btn {
  font-size: 16px;
}

body.text-size-large table,
body.text-size-large td {
  font-size: 17px;
}

body.text-size-large th {
  font-size: 14px;
}

body.text-size-large input,
body.text-size-large select,
body.text-size-large label {
  font-size: 17px;
}

body.text-size-large .settings-label {
  font-size: 16px;
}

body.text-size-large .settings-opt {
  font-size: 15px;
}

body.text-size-large .error {
  font-size: 15px;
}

body.text-size-large code {
  font-size: 15px;
}

body.text-size-large .detail-table th,
body.text-size-large .detail-table td {
  font-size: 17px;
}

body.dark {
  --md-surface: #1e1e1e;
  --md-background: #121212;
  --md-on-surface: #e3e3e3;
  --md-on-surface-variant: #b0b0b0;
  --md-primary-light: #1e3a5f;
  --md-outline: #3e3e3e;
  --md-elevation-1: 0 1px 3px 0 rgba(0, 0, 0, .3), 0 1px 2px -1px rgba(0, 0, 0, .2);
  --md-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, .3), 0 1px 2px 0 rgba(0, 0, 0, .2);
}

body.dark .breadcrumb {
  background: rgba(255, 255, 255, .04);
  border-bottom-color: var(--md-outline);
}

body.dark tbody tr:hover {
  background: rgba(255, 255, 255, .04);
}

body.dark input,
body.dark select {
  background: #2a2a2a;
  border-color: var(--md-outline);
  color: var(--md-on-surface);
}

body.dark .log-message {
  background: rgba(255, 255, 255, .06);
  border-color: var(--md-outline);
}

body.dark .log-level-info {
  background: rgba(33, 150, 243, .25);
  color: #90caf9;
}

body.dark .log-level-warn {
  background: rgba(255, 152, 0, .25);
  color: #ffb74d;
}

body.dark .log-level-error {
  background: rgba(244, 67, 54, .25);
  color: #ef5350;
}

.nav {
  background: var(--md-surface);
  color: var(--md-on-surface);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--md-elevation-1);
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 0;
  max-width: 100%;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--md-on-surface-variant);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--md-primary-light);
  color: var(--md-primary);
}

.nav-link .icon {
  color: inherit;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  color: var(--md-on-surface-variant);
  font-size: 14px;
  padding: 0 4px 0 0;
}

.nav-logout {
  margin: 0;
  padding: 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--md-on-surface-variant);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: var(--md-primary-light);
  color: var(--md-primary);
}

.nav-btn .icon {
  color: inherit;
}

.nav-btn-icon {
  padding: 8px;
}

.nav-btn-icon .icon {
  margin: 0;
}

.nav-settings-wrap {
  position: relative;
}

.settings-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 220px;
  background: var(--md-surface);
  border-radius: var(--md-radius);
  box-shadow: var(--md-elevation-2);
  border: 1px solid var(--md-outline);
  padding: 12px 0;
  z-index: 100;
}

.settings-section {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-on-surface);
}

.settings-label .icon {
  width: 18px;
  height: 18px;
}

.settings-options {
  display: flex;
  gap: 4px;
}

.settings-opt {
  padding: 6px 12px;
  border: 1px solid var(--md-outline);
  background: transparent;
  border-radius: var(--md-radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--md-on-surface-variant);
}

.settings-opt:hover {
  background: var(--md-primary-light);
  color: var(--md-primary);
  border-color: var(--md-primary);
}

.settings-opt.active {
  background: var(--md-primary-light);
  color: var(--md-primary);
  border-color: var(--md-primary);
}

.settings-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--md-outline);
  border: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.settings-toggle.on {
  background: var(--md-primary);
}

.settings-toggle-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--md-elevation-1);
  transition: transform 0.2s;
  margin-left: 0;
}

.settings-toggle.on .settings-toggle-thumb {
  margin-left: 20px;
}

.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px;
  font-size: 13px;
  color: var(--md-on-surface-variant);
  background: rgba(0, 0, 0, .02);
  border-bottom: 1px solid var(--md-outline);
  min-width: 0;
}

.breadcrumb a {
  color: var(--md-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-width: 0;
}

.main:has(.login-page) {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main:has(.login-page) .login-page {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
}

.main:has(.login-page) .login-page-inner {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
}

.card {
  background: var(--md-surface);
  border-radius: var(--md-radius);
  box-shadow: var(--md-elevation-1);
  padding: 24px;
  margin-bottom: 24px;
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 48px);
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

.login-page-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 40rem;
  min-width: 0;
  margin: 0 auto;
}

.login-page .login-card {
  max-width: 40rem;
  min-width: 24rem;
  width: 100%;
  padding: 36px 48px;
  margin-bottom: 0;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

.login-page .login-card .login-logo {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto 24px;
}

.login-page .login-card .login-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
  width: 100%;
}

.login-page .login-card .login-title .icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.login-page .login-card .form-group {
  margin-bottom: 20px;
  min-width: 0;
}

.login-page .login-card form {
  width: 100%;
  min-width: 0;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.label-with-icon .icon {
  width: 18px;
  height: 18px;
  color: var(--md-on-surface-variant);
}

.login-page .login-card input {
  font-size: 1rem;
  padding: 12px 14px;
}

.input-otp {
  text-align: center;
  font-size: 1.5rem !important;
  letter-spacing: 0.2rem;
  padding: 4px 10px !important;
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 40%;
  max-width: 200px;
}

.form-group:has(.input-otp) label {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-bottom: 8px;
  width: 100%;
}

.login-page .login-card .btn-wrap {
  text-align: center;
  margin-top: 24px;
}

.login-page .login-card .login-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.login-page .login-card .login-actions .login-link {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  text-decoration: none;
  padding: 0;
  background: none;
  border: none;
}

.login-page .login-card .login-actions .login-link:hover {
  text-decoration: underline;
  color: var(--link-color, #2563eb);
}

.login-page .login-card .btn {
  padding: 12px 28px;
  font-size: 1rem;
}

.login-page .login-card .invite-result {
  margin-top: 16px;
  text-align: center;
}

.login-page .login-card .invite-code {
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
  padding: 12px 16px;
  background: var(--md-surface-variant, #eee);
  border-radius: 8px;
  margin: 12px 0;
  word-break: break-all;
}

.login-page .login-card .invite-expires {
  font-size: 0.9rem;
  color: var(--text-muted, #666);
}

.login-page .login-card .invite-desc {
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.form-page {
  max-width: 560px;
  margin: 0 auto;
}

.form-page h1 {
  text-align: center;
}

.form-card {
  width: 100%;
}

.form-page .actions {
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.form-page input,
.form-page select {
  max-width: 100%;
}

.form-page input:disabled,
.form-page input.input-disabled,
.form-page select:disabled,
.form-page select.input-disabled {
  background-color: var(--md-surface-container-highest, #e0e0e0);
  color: var(--md-on-surface-variant, #666);
  cursor: not-allowed;
}

body.dark .form-page input:disabled,
body.dark .form-page input.input-disabled,
body.dark .form-page select:disabled,
body.dark .form-page select.input-disabled {
  background-color: var(--md-surface-container-highest, #2d2d2d);
  color: var(--md-on-surface-variant, #999);
}

.detail-table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.detail-table th {
  width: 36%;
  min-width: 140px;
  padding: 14px 20px 14px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--md-on-surface-variant);
  font-size: 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--md-outline);
  background: var(--md-background);
  border-right: 1px solid var(--md-outline);
}

.detail-table td {
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--md-outline);
  color: var(--md-on-surface);
  vertical-align: middle;
  font-weight: 500;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-table tbody tr:hover td {
  background: rgba(0, 0, 0, .02);
}

.detail-table tbody tr:hover th {
  background: rgba(0, 0, 0, .03);
}

.en {
  font-size: 0.8em;
  font-weight: 400;
  color: var(--md-on-surface-variant);
  opacity: 0.9;
}

body.hide-en .en {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 36px;
  border-radius: var(--md-radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, box-shadow .2s;
}

.btn-primary {
  background: var(--md-primary);
  color: #fff;
  box-shadow: var(--md-elevation-1);
}

.btn-primary:hover {
  background: var(--md-primary-hover);
  box-shadow: var(--md-elevation-2);
}

.btn-danger {
  background: var(--md-error);
  color: #fff;
}

.btn-danger:hover {
  background: #b3261e;
  box-shadow: var(--md-elevation-1);
}

.btn-danger:disabled,
.btn-danger[disabled] {
  background: var(--md-outline);
  color: var(--md-on-surface-variant);
  cursor: not-allowed;
  box-shadow: none;
}

body.dark .btn-danger:disabled,
body.dark .btn-danger[disabled] {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--md-primary);
  border: 1px solid var(--md-outline);
}

.btn-secondary:hover {
  background: var(--md-primary-light);
}

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

.actions--top {
  margin-bottom: 16px;
}

td.actions {
  white-space: nowrap;
  min-width: 0;
}

.list-table-devices .td-actions,
.list-table .td-actions {
  text-align: right;
  white-space: nowrap;
  min-width: 240px;
  width: 1%;
}

.list-table th:last-child {
  text-align: right;
}

.list-table-devices .td-actions .actions--row,
.list-table .td-actions .actions--row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.list-table-devices .td-actions {
  white-space: normal;
  min-width: 0;
  width: 1%;
}

.list-table-devices .td-actions .actions--row {
  flex-wrap: wrap;
  row-gap: 6px;
  max-width: 100%;
}

.actions--compact .btn {
  padding: 0 14px;
  height: 30px;
  font-size: 13px;
  gap: 6px;
}

.actions--compact .btn .icon {
  width: 14px;
  height: 14px;
}

.list-table-devices td:not(.td-actions),
.list-table-devices th:not(.td-actions),
.list-table-users td:not(.td-actions),
.list-table-users th:not(.td-actions),
.list-table-properties td:not(.td-actions),
.list-table-properties th:not(.td-actions) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-table-devices,
.list-table-users,
.list-table-properties {
  table-layout: fixed;
}

.card--table-scroll {
  overflow-x: auto;
  margin-bottom: 0;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--md-outline);
}

.list-toolbar--page-only {
  justify-content: flex-end;
}

.list-toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  margin-left: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.page-header h1 {
  margin: 0;
}

.page-header .actions {
  margin: 0;
}

.list-search-form {
  margin: 0;
  width: 112px;
  min-width: 80px;
  flex-shrink: 0;
}

.md-text-field {
  position: relative;
  display: block;
}

.md-text-field--underline {
  border: none;
  border-bottom: 1px solid var(--md-outline);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.md-text-field--underline:hover {
  border-bottom-color: var(--md-on-surface);
}

.md-text-field--underline:focus-within {
  border-bottom-width: 2px;
  border-bottom-color: var(--md-primary);
  outline: none;
}

.md-text-field--underline:focus-within .md-text-field__label {
  color: var(--md-primary);
}

.md-text-field__input {
  width: 100%;
  padding: 6px 0 6px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--md-on-surface);
  font-family: inherit;
  box-sizing: border-box;
  display: block;
}

.md-text-field__input.list-search-input-bar {
  height: 26px;
  padding: 10px 0 3px;
  font-size: 10px;
}

.list-search-form .md-text-field__label {
  font-size: 10px;
}

.list-search-form .md-text-field__input:focus~.md-text-field__label,
.list-search-form .md-text-field__input:not(:placeholder-shown)~.md-text-field__label {
  font-size: 8px;
}

.md-text-field__input::placeholder {
  color: transparent;
}

.md-text-field__input:focus {
  outline: none;
}

.md-text-field__label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--md-on-surface-variant);
  pointer-events: none;
  transition: transform 0.2s, font-size 0.2s, color 0.2s;
}

.md-text-field__input:focus~.md-text-field__label,
.md-text-field__input:not(:placeholder-shown)~.md-text-field__label {
  transform: translateY(-180%) scale(0.75);
  transform-origin: left top;
  top: 8px;
  font-size: 11px;
}

.md-text-field__input.list-search-input-bar:focus~.md-text-field__label,
.md-text-field__input.list-search-input-bar:not(:placeholder-shown)~.md-text-field__label {
  top: 8px;
}

.md-text-field__input:focus~.md-text-field__label {
  color: var(--md-primary);
}

body.dark .md-text-field__input {
  color: var(--md-on-surface);
}

.list-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.list-pagination-info {
  margin: 0;
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

.list-pagination-nav {
  margin: 0;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-pagination li {
  margin: 0;
}

.list-pagination-link,
.list-pagination-current,
.list-pagination-ellipsis {
  display: inline-block;
  min-width: 26px;
  padding: 4px 6px;
  text-align: center;
  font-size: 12px;
  border-radius: var(--md-radius-sm);
}

.list-pagination-link {
  color: var(--md-primary);
  text-decoration: none;
}

.list-pagination-link:hover {
  background: var(--md-primary-light);
}

button.list-pagination-btn {
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  border-radius: var(--md-radius-sm);
}

button.list-pagination-btn:hover {
  background: var(--md-primary-light);
}

.list-pagination-current {
  background: var(--md-primary-light);
  color: var(--md-primary);
  font-weight: 500;
}

.list-pagination-ellipsis {
  color: var(--md-on-surface-variant);
  cursor: default;
}

.list-table-devices th:nth-child(1),
.list-table-devices td:nth-child(1) {
  width: 14%;
}

.list-table-devices th:nth-child(2),
.list-table-devices td:nth-child(2) {
  width: 15%;
}

.list-table-devices th:nth-child(3),
.list-table-devices td:nth-child(3) {
  width: 20%;
}

.list-table-devices th:nth-child(4),
.list-table-devices td:nth-child(4) {
  width: 13%;
}

.list-table-devices th:nth-child(5),
.list-table-devices td:nth-child(5) {
  width: 13%;
}

.list-table-devices th:nth-child(6) {
  text-align: right;
}

.list-table-users th:nth-child(1),
.list-table-users td:nth-child(1) {
  width: 10%;
}

.list-table-users th:nth-child(2),
.list-table-users td:nth-child(2) {
  width: 30%;
}

.list-table-users th:nth-child(3),
.list-table-users td:nth-child(3) {
  width: 5%;
}

.list-table-users th:nth-child(4),
.list-table-users td:nth-child(4) {
  width: 25%;
}

.list-table-properties th:nth-child(1),
.list-table-properties td:nth-child(1) {
  width: 16%;
}

.list-table-properties th:nth-child(2),
.list-table-properties td:nth-child(2) {
  width: 35%;
}

.list-table-properties th:nth-child(3),
.list-table-properties td:nth-child(3) {
  width: 20%;
}

.list-table .col-date,
.list-table-devices .col-date {
  white-space: nowrap;
  min-width: 10em;
}

.list-table .col-mfa,
.list-table-devices .col-mfa {
  width: 4em;
  min-width: 4em;
  text-align: center;
}

.list-table-users .col-mfa {
  width: 2.5em;
  min-width: 2.5em;
  padding-left: 6px;
  padding-right: 4px;
}

.list-table-users .col-date {
  min-width: 7em;
  padding-left: 6px;
  padding-right: 8px;
}

.form-inline-actions {
  display: inline-block;
  width: max-content;
  margin-left: auto;
}

.btn-inline {
  display: inline-flex;
  align-items: center;
}

.btn-inline .btn {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--md-outline);
}

th {
  background: var(--md-background);
  font-weight: 500;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

tbody tr:hover {
  background: rgba(0, 0, 0, .02);
}

.logs-table {
  table-layout: fixed;
  width: 100%;
}

.logs-table .col-datetime {
  width: 13em;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.logs-table .col-genpaid {
  width: 14em;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.logs-table .col-device {
  width: 13em;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.logs-table .col-devicemodel {
  width: 8em;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.logs-table .col-devicename {
  width: 10em;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.logs-table th,
.logs-table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  text-overflow: ellipsis;
}

.logs-table .col-level {
  width: 5em;
  text-align: left;
  vertical-align: top;
}

.logs-table .col-message {
  width: 12em;
  text-align: left;
  vertical-align: top;
  padding-right: 2px;
}

.logs-table .col-logdata {
  width: auto;
  text-align: left;
  vertical-align: top;
}

.log-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
}

.log-message {
  margin: 0;
  padding: 8px 10px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--md-surface-container-lowest, #f8f9fa);
  border-radius: 6px;
  border: 1px solid var(--md-outline-variant, #e0e0e0);
  max-height: 200px;
  min-height: 2.5em;
  overflow: auto;
  box-sizing: border-box;
}

.log-level {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
}

.log-level-info,
.log-level-INFO {
  background: #e3f2fd;
  color: #1565c0;
}

.log-level-warn,
.log-level-WARN {
  background: #fff3e0;
  color: #e65100;
}

.log-level-error,
.log-level-ERROR {
  background: #ffebee;
  color: #c62828;
}

.log-search-highlight,
mark.log-search-highlight {
  background: #fff59d;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

body.dark .log-search-highlight,
body.dark mark.log-search-highlight {
  background: rgba(255, 193, 7, .45);
  color: inherit;
}

.logs-table .col-summary {
  width: 18em;
  max-width: 24em;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.logs-table .col-logdata {
  width: auto;
  min-width: 8em;
  text-align: left;
  vertical-align: top;
}

.logs-table .col-expand {
  width: 3em;
  text-align: center;
  vertical-align: middle;
}

.log-data-inline {
  font-size: 12px;
  background: var(--md-surface-container-lowest, #f5f5f5);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.log-event-table-wrap [x-cloak] {
  display: none !important;
}

.log-event-row {
  cursor: pointer;
}

.log-event-row:hover {
  background: rgba(0, 0, 0, .04);
}

.log-event-row--expanded {
  background: var(--md-primary-light, #e3f2fd);
}

.log-event-expand-icon {
  display: inline-block;
  font-size: 10px;
  transition: transform .15s ease;
  color: var(--md-on-surface-variant);
}

.log-event-row--expanded .log-event-expand-icon {
  transform: rotate(90deg);
}

.log-event-detail .log-event-detail-cell {
  background: var(--md-surface-container-lowest, #f5f5f5);
  border-bottom: 1px solid var(--md-outline);
  padding: 12px;
  vertical-align: top;
}

.log-event-detail .log-message--block {
  max-height: 70vh;
  margin: 0;
}

.log-filters--global {
  margin-bottom: 8px;
}

.logs-table th.sortable .th-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logs-table th.sortable .th-label {
  font-weight: inherit;
}

.logs-table .sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  background: var(--md-surface-variant, #f0f0f0);
  color: var(--md-on-surface);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background .15s, border-color .15s;
}

.logs-table .sort-btn:hover {
  background: var(--md-primary-container, #e3f2fd);
  border-color: var(--md-primary, #1976d2);
  color: var(--md-on-primary-container, #1976d2);
}

.logs-table .sort-btn .icon {
  width: 18px;
  height: 18px;
  display: block;
}

.logs-table .sort-btn .sort-icon-neutral {
  font-size: 14px;
  opacity: .7;
  line-height: 1;
}

.list-table th.sortable .th-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.list-table th.sortable .th-label {
  font-weight: inherit;
}

.list-table .sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  background: var(--md-surface-variant, #f0f0f0);
  color: var(--md-on-surface);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background .15s, border-color .15s;
}

.list-table .sort-btn:hover {
  background: var(--md-primary-container, #e3f2fd);
  border-color: var(--md-primary, #1976d2);
  color: var(--md-primary, #1976d2);
}

.list-table .sort-btn .icon {
  width: 18px;
  height: 18px;
  display: block;
}

.log-filters .filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.log-filters .filter-row .form-group {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  max-width: 200px;
}

#property-select-wrap {
  flex: 1.2 1 0;
  max-width: 180px;
}

#device-select-wrap {
  flex: 1 1 0;
  max-width: 200px;
}

.log-filters .filter-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--md-on-surface-variant);
}

.log-filters .filter-row select,
.log-filters .filter-row input[type="text"],
.log-filters .filter-row input[type="date"],
.log-filters .filter-row input[type="datetime-local"] {
  min-width: 110px;
  max-width: 200px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.25;
}

.log-filters #log-table {
  overflow-x: auto;
  width: 100%;
}

.log-filters #log-table-wrap {
  min-width: min(100%, 720px);
}

.log-filters .logs-table {
  min-width: 100%;
}

.log-view-tabs {
  margin-top: 12px;
}

.log-tabs {
  display: flex;
  gap: 0;
  margin-bottom: -1.5rem;
  padding: 0;
  list-style: none;
}

#log-table-wrap .card {
  margin-bottom: 0;
}

#log-table-wrap .list-toolbar {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 8px 0;
}

.log-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-on-surface-variant);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: inherit;
}

.log-tab .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.log-tab:hover {
  color: var(--md-on-surface);
}

.log-tab--active {
  color: var(--md-primary);
  border-bottom-color: var(--md-primary);
}

.log-tab-panel {
  padding-top: 12px;
}

.log-tab-panel[style*="display: none"] {
  display: none !important;
}

.log-tab-loading {
  color: var(--md-on-surface-variant);
  font-size: 14px;
}

.log-api-placeholder {
  font-weight: 500;
  color: var(--md-on-surface-variant);
  margin-bottom: 8px;
}

.log-api-hint {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin: 0;
}

.log-tab-device {
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--md-on-surface-variant);
}

.log-json-view .log-message {
  max-height: 70vh;
}

input,
select {
  padding: 10px 12px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-radius-sm);
  width: 100%;
  max-width: 320px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px var(--md-primary-light);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--md-on-surface);
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label-required {
  font-size: 12px;
  font-weight: 400;
  color: var(--md-error);
}

body.dark .form-label-required {
  color: var(--md-error);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--md-on-surface-variant);
  word-wrap: break-word;
  max-width: 100%;
}

.checkbox-inline {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-inline input[type="checkbox"] {
  margin: 0;
}

.form-show-password {
  margin: 0 0 20px 0;
  padding: 0;
}

.checkbox-inline--small {
  font-size: 12px;
  margin-top: 0;
  color: var(--md-on-surface-variant);
}

.checkbox-inline--small input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.error {
  color: var(--md-error);
  font-size: 12px;
  margin-top: 4px;
}

h1 {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 400;
  color: var(--md-on-surface);
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
}

code {
  background: var(--md-background);
  padding: 2px 6px;
  border-radius: var(--md-radius-sm);
  font-size: 13px;
}

.page-alerts {
  margin-bottom: 16px;
}

.page-alert {
  padding: 12px 16px;
  border-radius: var(--md-radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
}

.page-alert:last-child {
  margin-bottom: 0;
}

.page-alert--success {
  background: var(--md-tertiary-container, #e8f5e9);
  color: var(--md-on-tertiary-container, #1b5e20);
}

.page-alert--error {
  background: var(--md-error-container, #ffebee);
  color: var(--md-on-error-container, #b71c1c);
}

.page-alert--info {
  background: var(--md-primary-container, #e3f2fd);
  color: var(--md-on-primary-container, #0d47a1);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--md-surface);
  padding: 24px;
  border-radius: var(--md-radius-md);
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal h3 {
  margin: 0 0 16px;
}

.modal--otp-setup {
  max-width: 380px;
}

.modal--otp-setup .otp-setup-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--md-on-surface-variant);
  line-height: 1.5;
}

.modal--otp-setup .otp-qr-wrap {
  text-align: center;
  margin: 16px 0;
}

.modal--otp-setup .otp-qr-wrap img {
  display: inline-block;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-radius-sm);
}

.modal--otp-setup .otp-confirm-form .form-group {
  margin-bottom: 16px;
}

.modal--otp-setup .otp-confirm-form .actions {
  margin-top: 16px;
}

.form-page .otp-setup-desc {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--md-on-surface-variant);
  line-height: 1.5;
  text-align: center;
}

.form-page .otp-qr-wrap {
  text-align: center;
  margin: 16px 0;
}

.form-page .otp-qr-wrap img {
  display: inline-block;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-radius-sm);
}

.form-page .otp-confirm-form .form-group {
  margin-bottom: 16px;
}

.form-page .otp-confirm-form .actions {
  margin-top: 16px;
}

[x-cloak] {
  display: none !important;
}

.clickable-code {
  cursor: pointer;
  color: var(--md-primary);
  background: var(--md-primary-light);
  padding: 2px 6px;
  border-radius: var(--md-radius-sm);
  transition: background 0.2s, color 0.2s;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

.clickable-code:hover {
  background: var(--md-primary);
  color: #fff;
}

.copy-feedback {
  font-size: 12px;
  color: #2e7d32;
  margin: 0 8px;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}