:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #5d6d7e;
  --line: #d6dde5;
  --brand: #0f766e;
  --brand-2: #115e59;
  --danger: #c62828;
  --warn: #ff8f00;
  --ok: #2e7d32;
  --app-font-family: "Segoe UI", Tahoma, sans-serif;
  --app-card-radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eff4f8 0%, #f7fbff 100%);
  color: var(--ink);
  font-family: var(--app-font-family);
}

/* Font mapping from app settings (via body class) */
body.ui-font-key-system {
  --app-font-family: "Segoe UI", Tahoma, sans-serif;
}
body.ui-font-key-prompt {
  --app-font-family: "Prompt", "Noto Sans Thai", sans-serif;
}
body.ui-font-key-kanit {
  --app-font-family: "Kanit", "Noto Sans Thai", sans-serif;
}
body.ui-font-key-sarabun {
  --app-font-family: "Sarabun", "Noto Sans Thai", sans-serif;
}
body.ui-font-key-noto_sans_thai {
  --app-font-family: "Noto Sans Thai", sans-serif;
}
body.ui-font-key-ibm_plex_thai {
  --app-font-family: "IBM Plex Sans Thai", sans-serif;
}

body.theme-dark {
  --bg: #0b1220;
  --card: #0f172a;
  --ink: #e5e7eb;
  --muted: #94a3b8;
  --line: #334155;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  background: linear-gradient(180deg, #0b1220 0%, #101a2f 100%);
}

@media (prefers-color-scheme: dark) {
  body.theme-auto {
    --bg: #0b1220;
    --card: #0f172a;
    --ink: #e5e7eb;
    --muted: #94a3b8;
    --line: #334155;
    --danger: #ef4444;
    --warn: #f59e0b;
    --ok: #22c55e;
    background: linear-gradient(180deg, #0b1220 0%, #101a2f 100%);
  }
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--brand-2);
  color: #fff;
}
.app-title { font-size: 1.15rem; font-weight: 700; }
.app-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}
.app-title-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.app-title-sub {
  font-size: .8rem;
  opacity: .88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-branch-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(223, 248, 246, .65);
  background: rgba(255, 255, 255, .12);
}
.header-branch-form label {
  margin: 0;
  color: #e8fffb;
  font-size: .78rem;
  font-weight: 600;
}
.header-branch-form select {
  width: auto;
  min-width: 190px;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #cde4e1;
  background: #ffffff;
  color: #11413c;
  font-size: .83rem;
}
.app-user a { color: #dff8f6; }
.app-user-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(223, 248, 246, .38);
  background: rgba(255, 255, 255, .11);
}
.app-user-line {
  white-space: nowrap;
}
.app-user-sep {
  opacity: .55;
}
.header-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d3ece9;
  background: #ffffff;
  color: #0f5f58;
  text-decoration: none;
  font-weight: 700;
  font-size: .86rem;
  white-space: nowrap;
}
.header-refresh:hover {
  background: #f0fffd;
}
.header-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cae0ff;
  background: #e9f2ff;
  color: #1e4f8f;
  font-weight: 700;
  font-size: .86rem;
  white-space: nowrap;
}
.header-install:hover {
  background: #f2f7ff;
}
.header-install.ready {
  border-color: #8ddfbf;
  background: #e9fff4;
  color: #116344;
}
.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 25, 39, .45);
}
.pwa-install-modal.is-open {
  display: flex;
}
.pwa-install-modal-panel {
  width: min(540px, 100%);
  border-radius: 14px;
  border: 1px solid #c5d8e5;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.pwa-install-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2ecf3;
  background: #f5fafc;
}
.pwa-install-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #123447;
}
.pwa-install-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid #c6d5e3;
  background: #fff;
  color: #1b3e58;
  font-size: 1.15rem;
  line-height: 1;
}
.pwa-install-body {
  padding: 12px 14px 15px;
  color: #23485f;
}
.pwa-install-body p {
  margin: 0 0 10px;
}
.pwa-install-body ol {
  margin: 0 0 12px 18px;
  padding: 0;
}
.pwa-install-body li {
  margin: 0 0 8px;
}
.pwa-install-kiosk-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #97b7cd;
  background: #f4fbff;
  color: #0d4d72;
  text-decoration: none;
  font-weight: 700;
}
@media (max-width: 640px) {
  .app-header {
    align-items: flex-start;
  }

  .app-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .header-branch-form {
    width: 100%;
    justify-content: space-between;
  }

  .header-branch-form select {
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-install {
    min-height: 32px;
    padding: 5px 10px;
    font-size: .78rem;
  }
  .pwa-install-modal {
    padding: 10px;
  }
  .pwa-install-head {
    padding: 10px 11px;
  }
  .pwa-install-body {
    padding: 10px 11px 12px;
    font-size: .92rem;
  }
}
.header-maint-form {
  display: inline-flex;
}
.header-maintenance {
  width: auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #f9d8a9;
  background: linear-gradient(180deg, #fff5e4 0%, #ffe4bf 100%);
  color: #7a3f00;
  font-weight: 800;
  font-size: .84rem;
  white-space: nowrap;
}
.header-maintenance:hover {
  background: linear-gradient(180deg, #fff9ef 0%, #ffeccf 100%);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #e1ecef;
  border-bottom: 1px solid #c6d6db;
  position: relative;
  z-index: 20;
  overflow: visible;
}
.tabs-grouped {
  align-items: center;
  position: relative;
  z-index: 90;
  isolation: isolate;
}
.nav-hamburger {
  display: none;
  width: auto;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #9ab2bc;
  background: #fff;
  color: #163b49;
  font-weight: 700;
}
.nav-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.tabs-grouped.is-measuring .nav-groups {
  flex-wrap: nowrap;
}
.nav-group {
  position: relative;
  z-index: 1;
}
.nav-group[open] {
  z-index: 200;
}
.nav-group-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-group-summary::-webkit-details-marker {
  display: none;
}
.nav-group-summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: .78rem;
}
.nav-group[open] > .nav-group-summary::after {
  content: "▴";
}
.nav-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 180;
  min-width: 220px;
  max-width: min(420px, 90vw);
  padding: 8px;
  border: 1px solid #c5d3de;
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  display: none;
}
.nav-group[open] > .nav-submenu,
.nav-group:hover > .nav-submenu {
  display: grid;
  gap: 6px;
}
.nav-subtab {
  display: block;
}
.tabs-grouped.is-collapsed {
  align-items: stretch;
  gap: 10px;
}
.tabs-grouped.is-collapsed .nav-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tabs-grouped.is-collapsed .nav-groups {
  display: none;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 170;
  padding: 12px;
  border: 1px solid rgba(197, 211, 222, 0.92);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 20px 44px rgba(15, 23, 42, .18);
}
.tabs-grouped.is-collapsed .nav-groups.open {
  display: flex;
}
.tabs-grouped.is-collapsed .nav-group {
  width: 100%;
}
.tabs-grouped.is-collapsed .nav-group-summary {
  width: 100%;
}
.tabs-grouped.is-collapsed .nav-submenu {
  position: static;
  min-width: 0;
  max-width: none;
  margin-top: 6px;
  display: none;
}
.tabs-grouped.is-collapsed .nav-group[open] > .nav-submenu,
.tabs-grouped.is-collapsed .nav-group:hover > .nav-submenu {
  display: grid;
}
.tabs-grouped.is-collapsed .nav-subtab {
  width: 100%;
}
.app-main-nav {
  position: relative;
  z-index: 95;
  overflow: visible;
}
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(10, 17, 28, .26);
  opacity: 0;
  transition: opacity .18s ease;
}
.nav-scrim.open {
  opacity: 1;
}
body.nav-panel-open {
  overflow: hidden;
}
.tab {
  background: #fff;
  border: 1px solid #b8c7cd;
  border-radius: 8px;
  text-decoration: none;
  color: #114;
  padding: 8px 10px;
  font-size: .92rem;
}

body.theme-dark .tabs {
  background: #1e293b;
  border-bottom-color: #334155;
}
body.theme-dark .tab {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}
body.theme-dark .tabs-grouped.is-collapsed .nav-groups {
  background: rgba(11, 21, 40, 0.96);
  border-color: #334155;
  box-shadow: 0 18px 44px rgba(2, 6, 23, .46);
}
body.theme-dark .nav-submenu {
  background: #0b1528;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(2, 6, 23, .45);
}
body.theme-dark .tab.active {
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  body.theme-auto .tabs {
    background: #1e293b;
    border-bottom-color: #334155;
  }
  body.theme-auto .tab {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
  }
  body.theme-auto .tabs-grouped.is-collapsed .nav-groups {
    background: rgba(11, 21, 40, 0.96);
    border-color: #334155;
    box-shadow: 0 18px 44px rgba(2, 6, 23, .46);
  }
  body.theme-auto .nav-submenu {
    background: #0b1528;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(2, 6, 23, .45);
  }
  body.theme-auto .tab.active {
    color: #fff;
  }
}
.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.container {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 12px 20px;
}

body.ui-container-normal .container { max-width: 1200px; }
body.ui-container-wide .container { max-width: 1440px; }
body.ui-container-full .container { max-width: none; }

h1 { margin: 0 0 16px; font-size: 1.4rem; }
h2 { margin: 0 0 12px; font-size: 1.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--app-card-radius);
  padding: 14px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

label {
  font-size: .88rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

input, select, textarea, button {
  width: 100%;
  border: 1px solid #b8c7d4;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  font-family: inherit;
  font-size: inherit;
}

body.ui-density-compact input,
body.ui-density-compact select,
body.ui-density-compact textarea,
body.ui-density-compact button {
  padding: 6px 8px;
}

body.ui-density-comfortable input,
body.ui-density-comfortable select,
body.ui-density-comfortable textarea,
body.ui-density-comfortable button {
  padding: 11px 12px;
}

body.ui-density-compact th,
body.ui-density-compact td {
  padding: 6px;
}

body.ui-density-comfortable th,
body.ui-density-comfortable td {
  padding: 10px;
}

button {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: #aebbc8;
}
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.actions button { width: auto; min-width: 140px; }

body.ui-style-ios2027 {
  --ff-bg: #edf3f6;
  --ff-bg-elevated: rgba(255, 255, 255, 0.72);
  --ff-surface: rgba(255, 255, 255, 0.82);
  --ff-surface-strong: rgba(255, 255, 255, 0.92);
  --ff-surface-solid: #ffffff;
  --ff-text: #10212b;
  --ff-text-muted: #607080;
  --ff-line: rgba(97, 122, 143, 0.18);
  --ff-radius-sm: 12px;
  --ff-radius-md: 16px;
  --ff-radius-lg: 22px;
  --ff-radius-xl: 28px;
  --ff-radius-pill: 999px;
  --ff-gap-xs: 6px;
  --ff-gap-sm: 10px;
  --ff-gap-md: 16px;
  --ff-gap-lg: 24px;
  --ff-gap-xl: 32px;
  --ff-shadow-sm: 0 8px 20px rgba(16, 33, 43, 0.06);
  --ff-shadow-md: 0 14px 36px rgba(16, 33, 43, 0.10);
  --ff-shadow-lg: 0 22px 56px rgba(16, 33, 43, 0.16);
  --ff-blur-sm: 8px;
  --ff-blur-md: 14px;
  --ff-blur-lg: 20px;
  --ff-transition-fast: 140ms ease;
  --ff-transition-normal: 220ms ease;
  color: var(--ff-text);
  background-color: var(--ff-bg);
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

body.ui-style-ios2027 > .app-header,
body.ui-style-ios2027 > .tabs,
body.ui-style-ios2027 > .container {
  position: relative;
  z-index: 1;
}

body.ui-style-ios2027.bg-plain {
  background: linear-gradient(180deg, #eef3f6 0%, #f7fafc 100%);
}

body.ui-style-ios2027.bg-none {
  background: var(--ff-bg);
}

body.ui-style-ios2027.bg-gradient {
  background:
    radial-gradient(circle at 12% 8%, rgba(132, 214, 201, 0.32), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(154, 199, 255, 0.28), transparent 22%),
    linear-gradient(180deg, #edf4f6 0%, #f8fbfd 100%);
}

body.ui-style-ios2027.bg-aurora {
  background:
    radial-gradient(circle at 15% 10%, rgba(112, 215, 187, 0.26), transparent 25%),
    radial-gradient(circle at 85% 8%, rgba(145, 171, 255, 0.24), transparent 22%),
    radial-gradient(circle at 55% 90%, rgba(188, 226, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #edf4f6 0%, #f7fbfd 100%);
}

body.ui-style-ios2027.bg-forest_blur {
  background:
    radial-gradient(circle at 8% 12%, rgba(80, 180, 138, 0.20), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(126, 187, 220, 0.18), transparent 18%),
    linear-gradient(180deg, #ecf4f1 0%, #f8fbfb 100%);
}

body.ui-style-ios2027.bg-mode-image::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--ff-bg-image, none);
  background-repeat: var(--ff-bg-repeat, no-repeat);
  background-size: var(--ff-bg-size, cover);
  background-position: var(--ff-bg-position, center center);
  opacity: 0.96;
}

/* Reinforce bubble texture so preset backgrounds remain visible on all layouts */
body.ui-style-ios2027.bg-mode-image::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--ff-bg-image, none);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-position: left top;
  opacity: 0.34;
}

body.ui-style-ios2027.bg-mode-style::before,
body.ui-style-ios2027.bg-mode-style::after,
body.ui-style-ios2027.bg-mode-image.bg-layout-tile::after {
  content: none;
}

.ui-bg-settings-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(198, 214, 223, 0.9);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(16, 33, 43, 0.08);
}

.ui-bg-settings-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ui-bg-settings-head h3 {
  margin: 0 0 4px;
}

.ui-bg-current-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(248, 252, 255, 0.88);
  color: #24465a;
  font-size: .92rem;
  font-weight: 700;
}

.ui-bg-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ui-bg-mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #d7e4ec;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(16, 33, 43, 0.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ui-bg-mode-card.is-active {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.12);
}

.ui-bg-mode-card:hover {
  transform: translateY(-1px);
}

.ui-bg-mode-card input {
  width: auto;
  margin: 0 0 6px;
}

.ui-bg-mode-title {
  font-weight: 800;
  color: #10212b;
}

.ui-bg-mode-copy {
  color: #5c7188;
  font-size: .92rem;
  line-height: 1.45;
}

.ui-bg-source-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ui-bg-library-note {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  background: rgba(248, 252, 255, 0.82);
  color: #4d657a;
  line-height: 1.5;
}

.ui-bg-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ui-bg-library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #d7e4ec;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(16, 33, 43, 0.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ui-bg-library-card.is-active {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.12);
}

.ui-bg-library-card:hover,
.ui-bg-library-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 16px 32px rgba(16, 33, 43, 0.12);
  outline: none;
}

.ui-bg-library-thumb {
  display: block;
  height: 110px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background-color: #eff5f8;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.ui-bg-library-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #24465a;
}

.ui-bg-library-copy strong {
  color: #10212b;
}

.ui-bg-library-copy span {
  font-size: .86rem;
  line-height: 1.45;
}

.ui-bg-library-empty {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  background: rgba(248, 252, 255, 0.82);
  color: #4d657a;
}

body.ui-style-ios2027.theme-dark {
  --ff-bg: #0a131d;
  --ff-bg-elevated: rgba(9, 20, 32, 0.72);
  --ff-surface: rgba(14, 26, 40, 0.82);
  --ff-surface-strong: rgba(16, 28, 44, 0.92);
  --ff-surface-solid: #0f172a;
  --ff-text: #e6eef7;
  --ff-text-muted: #a0b2c6;
  --ff-line: rgba(134, 163, 184, 0.18);
  --ff-shadow-sm: 0 10px 26px rgba(2, 6, 23, 0.32);
  --ff-shadow-md: 0 18px 42px rgba(2, 6, 23, 0.42);
  --ff-shadow-lg: 0 28px 68px rgba(2, 6, 23, 0.52);
}

@media (prefers-color-scheme: dark) {
  body.ui-style-ios2027.theme-auto {
    --ff-bg: #0a131d;
    --ff-bg-elevated: rgba(9, 20, 32, 0.72);
    --ff-surface: rgba(14, 26, 40, 0.82);
    --ff-surface-strong: rgba(16, 28, 44, 0.92);
    --ff-surface-solid: #0f172a;
    --ff-text: #e6eef7;
    --ff-text-muted: #a0b2c6;
    --ff-line: rgba(134, 163, 184, 0.18);
    --ff-shadow-sm: 0 10px 26px rgba(2, 6, 23, 0.32);
    --ff-shadow-md: 0 18px 42px rgba(2, 6, 23, 0.42);
    --ff-shadow-lg: 0 28px 68px rgba(2, 6, 23, 0.52);
  }
}

body.ui-style-ios2027.theme-dark,
body.ui-style-ios2027.theme-auto {
  color: var(--ff-text);
}

body.ui-style-ios2027 .container {
  padding: 20px 16px 30px;
}

body.ui-style-ios2027 h1,
body.ui-style-ios2027 h2,
body.ui-style-ios2027 h3 {
  letter-spacing: -.02em;
}

body.ui-style-ios2027 .card,
body.ui-style-ios2027 .panel,
body.ui-style-ios2027 .box,
body.ui-style-ios2027 .ff-card {
  border-radius: max(var(--app-card-radius), var(--ff-radius-lg));
  border: 1px solid var(--ff-line);
  box-shadow: var(--ff-shadow-md);
  padding: clamp(14px, 2vw, 22px);
}

body.ui-style-ios2027.surface-glass .card,
body.ui-style-ios2027.surface-glass .panel,
body.ui-style-ios2027.surface-glass .box,
body.ui-style-ios2027.surface-glass .ff-card {
  background: var(--ff-surface);
  border-color: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(var(--ff-blur-md));
  -webkit-backdrop-filter: blur(var(--ff-blur-md));
}

body.ui-style-ios2027.surface-solid .card,
body.ui-style-ios2027.surface-solid .panel,
body.ui-style-ios2027.surface-solid .box,
body.ui-style-ios2027.surface-solid .ff-card {
  background: var(--ff-surface-solid);
}

body.ui-style-ios2027 .app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(14, 130, 120, 0.94) 0%, rgba(17, 94, 89, 0.92) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(15, 59, 73, 0.12);
  backdrop-filter: blur(var(--ff-blur-sm));
  -webkit-backdrop-filter: blur(var(--ff-blur-sm));
}

body.ui-style-ios2027 .app-title {
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  letter-spacing: -.02em;
}

body.ui-style-ios2027 .app-title-sub {
  font-size: .82rem;
  color: rgba(244, 253, 252, .86);
}

body.ui-style-ios2027 .tabs {
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--ff-radius-xl);
  box-shadow: var(--ff-shadow-sm);
  backdrop-filter: blur(var(--ff-blur-sm));
  -webkit-backdrop-filter: blur(var(--ff-blur-sm));
}

body.ui-style-ios2027 .tab,
body.ui-style-ios2027 .nav-hamburger {
  border: 1px solid rgba(120, 147, 168, 0.28);
  color: var(--ff-text);
  background: rgba(255, 255, 255, 0.66);
  min-height: 42px;
  padding: 9px 14px;
  font-weight: 700;
  transition:
    transform var(--ff-transition-fast),
    box-shadow var(--ff-transition-fast),
    background var(--ff-transition-fast),
    border-color var(--ff-transition-fast);
}

body.ui-style-ios2027.nav-pills .tab,
body.ui-style-ios2027.nav-pills .nav-hamburger {
  border-radius: var(--ff-radius-pill);
}

body.ui-style-ios2027.nav-tabs .tab,
body.ui-style-ios2027.nav-tabs .nav-hamburger {
  border-radius: var(--ff-radius-md);
}

body.ui-style-ios2027.nav-floating .tabs {
  position: sticky;
  top: 72px;
  z-index: 60;
}

body.ui-style-ios2027 .tab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

body.ui-style-ios2027 .nav-submenu {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--ff-shadow-lg);
  backdrop-filter: blur(var(--ff-blur-md));
  -webkit-backdrop-filter: blur(var(--ff-blur-md));
}

body.ui-style-ios2027 .app-user-pill {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.ui-style-ios2027 .header-install {
  min-height: 36px !important;
  padding: 6px 12px !important;
  border: 1px solid #bfe9d9 !important;
  background: #eefcf5 !important;
  color: #0f5f58 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027 .header-install:hover,
body.ui-style-ios2027 .header-install:focus {
  background: #f6fffa !important;
  border-color: #95d2ba !important;
}

body.ui-style-ios2027 .header-install.ready {
  border-color: #7fcea8 !important;
  background: #e5fff0 !important;
  color: #106644 !important;
}

body.ui-style-ios2027 input,
body.ui-style-ios2027 select,
body.ui-style-ios2027 textarea,
body.ui-style-ios2027 button,
body.ui-style-ios2027 .btn {
  min-height: 46px;
  border: 1px solid var(--ff-line);
  transition:
    transform var(--ff-transition-fast),
    box-shadow var(--ff-transition-fast),
    background var(--ff-transition-fast),
    border-color var(--ff-transition-fast);
}

body.ui-style-ios2027.control-rounded input,
body.ui-style-ios2027.control-rounded select,
body.ui-style-ios2027.control-rounded textarea,
body.ui-style-ios2027.control-rounded button,
body.ui-style-ios2027.control-rounded .btn {
  border-radius: var(--ff-radius-md);
}

body.ui-style-ios2027.control-pill input,
body.ui-style-ios2027.control-pill select,
body.ui-style-ios2027.control-pill textarea,
body.ui-style-ios2027.control-pill button,
body.ui-style-ios2027.control-pill .btn {
  border-radius: var(--ff-radius-pill);
}

body.ui-style-ios2027 input,
body.ui-style-ios2027 select,
body.ui-style-ios2027 textarea {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.ui-style-ios2027 button,
body.ui-style-ios2027 .btn {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.16);
}

body.ui-style-ios2027 button.secondary,
body.ui-style-ios2027 .btn.secondary,
body.ui-style-ios2027 .secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ff-text);
  border-color: rgba(120, 147, 168, 0.28);
  box-shadow: none;
}

body.ui-style-ios2027 .muted {
  color: var(--ff-text-muted);
}

body.ui-style-ios2027 .badge,
body.ui-style-ios2027 .chip,
body.ui-style-ios2027 .ff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--ff-radius-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(120, 147, 168, 0.24);
}

body.ui-style-ios2027 .flash,
body.ui-style-ios2027 .ff-alert {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--ff-shadow-sm);
  backdrop-filter: blur(var(--ff-blur-sm));
  -webkit-backdrop-filter: blur(var(--ff-blur-sm));
}

body.ui-style-ios2027 .progress,
body.ui-style-ios2027 .ff-progress {
  min-height: 12px;
  border-radius: var(--ff-radius-pill);
  background: rgba(16, 33, 43, 0.08);
  overflow: hidden;
}

body.ui-style-ios2027.motion-subtle button:hover,
body.ui-style-ios2027.motion-subtle .btn:hover,
body.ui-style-ios2027.motion-subtle .tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--ff-shadow-sm);
}

body.ui-style-ios2027.motion-normal button:hover,
body.ui-style-ios2027.motion-normal .btn:hover,
body.ui-style-ios2027.motion-normal .tab:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--ff-shadow-md);
}

body.ui-style-ios2027.motion-off *,
body.ui-style-ios2027.motion-off *::before,
body.ui-style-ios2027.motion-off *::after {
  transition: none !important;
  animation: none !important;
}

@media (max-width: 640px) {
  body.ui-style-ios2027 .container {
    padding: 14px 10px 24px;
  }

  .app-user-pill {
    width: 100%;
    justify-content: flex-start;
    border-radius: 18px;
  }

  body.ui-style-ios2027 .tabs {
    padding: 10px;
    border-radius: 20px;
  }

  body.ui-style-ios2027 .app-header {
    padding: 12px 14px;
  }
}

.settings-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 78px;
}

.settings-nav h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.settings-nav-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.settings-nav-list a {
  display: block;
  border: 1px solid #d5e0ea;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  text-decoration: none;
  background: #f8fbff;
  font-size: .88rem;
}

.settings-nav-list a.active {
  background: #e6f4ff;
  border-color: #96c6ef;
  font-weight: 700;
}

.settings-main {
  display: grid;
  gap: 14px;
}

.settings-pane {
  border: 1px solid #d9e3ee;
}

.settings-pane.pane-hidden {
  display: none;
}

.settings-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-pane-head h2 {
  margin: 0;
}

.settings-pane-toggle {
  min-width: 38px;
  padding: 6px 8px;
}

.settings-pane-body {
  display: block;
}

.settings-pane.collapsed .settings-pane-body {
  display: none;
}

.logging-overview-grid,
.logging-insights-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.logging-human-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 12px;
}

.log-human-card .metric-note {
  margin-top: 4px;
}

.log-hero-summary {
  margin-top: 12px;
  border: 1px solid #c8d7e5;
  border-radius: 16px;
  padding: 14px 16px;
  background: #f8fbff;
}

.log-hero-summary.status-normal {
  background: #ecfdf3;
  border-color: #9ad8b0;
}

.log-hero-summary.status-degraded {
  background: #fffbeb;
  border-color: #f5cf8f;
}

.log-hero-summary.status-incident {
  background: #fef2f2;
  border-color: #f3a2a2;
}

.log-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.log-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b6c7d9;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 700;
  color: #1f3f58;
  background: #fff;
}

.log-hero-summary.status-normal .log-hero-badge {
  border-color: #7bc89a;
  color: #166534;
}

.log-hero-summary.status-degraded .log-hero-badge {
  border-color: #e9b456;
  color: #92400e;
}

.log-hero-summary.status-incident .log-hero-badge {
  border-color: #e08282;
  color: #991b1b;
}

.log-hero-summary h3 {
  margin: 10px 0 8px;
  font-size: 1.25rem;
}

.log-hero-lines p {
  margin: 4px 0;
}

.logging-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.logging-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logging-filters .actions {
  align-items: flex-end;
  gap: 8px;
}

.logging-filters code {
  word-break: break-all;
}

.log-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #c8d4e2;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: .78rem;
  line-height: 1.1;
  white-space: nowrap;
}

.log-level-badge.level-success {
  border-color: #9ad8b0;
  background: #ecfdf3;
  color: #166534;
}

.log-level-badge.level-warning {
  border-color: #f5cf8f;
  background: #fffbeb;
  color: #92400e;
}

.log-level-badge.level-fail,
.log-level-badge.level-error {
  border-color: #f3a2a2;
  background: #fef2f2;
  color: #991b1b;
}

.log-level-badge.level-critical {
  border-color: #d38ea4;
  background: #fff1f5;
  color: #9d174d;
}

.log-level-badge.level-info {
  border-color: #b6cee9;
  background: #eff6ff;
  color: #1d4ed8;
}

body.theme-dark .log-level-badge {
  border-color: #334155;
  background: #1e293b;
  color: #e2e8f0;
}

body.theme-dark .log-level-badge.level-success {
  border-color: #1f7a4f;
  background: #0b3222;
  color: #b9f8d2;
}

body.theme-dark .log-level-badge.level-warning {
  border-color: #9a6b19;
  background: #3d2d0f;
  color: #fcd38f;
}

body.theme-dark .log-level-badge.level-fail,
body.theme-dark .log-level-badge.level-error {
  border-color: #8b1f2f;
  background: #3d131a;
  color: #fecaca;
}

body.theme-dark .log-level-badge.level-critical {
  border-color: #7c2550;
  background: #3f1231;
  color: #f9a8d4;
}

body.theme-dark .log-level-badge.level-info {
  border-color: #2f5c8f;
  background: #102744;
  color: #bfdbfe;
}

body.theme-dark .log-hero-summary {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .log-hero-summary.status-normal {
  background: #0b3222;
  border-color: #1f7a4f;
}

body.theme-dark .log-hero-summary.status-degraded {
  background: #3d2d0f;
  border-color: #9a6b19;
}

body.theme-dark .log-hero-summary.status-incident {
  background: #3d131a;
  border-color: #8b1f2f;
}

body.theme-dark .log-hero-badge {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.settings-embed-shell {
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fbff;
}

.settings-embed-frame {
  width: 100%;
  min-height: 1200px;
  border: 0;
  background: #f8fbff;
  display: block;
}

body.employees-embed-body {
  margin: 0;
  padding: 14px;
  background: #f3f7fb;
}

.employee-role-select {
  min-width: 170px;
}

.employee-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: .9rem;
}

.employee-inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.employee-create-grid .actions {
  align-items: flex-end;
}

.auto-backup-status {
  border: 1px solid #d7dfe8;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  margin-bottom: 10px;
  font-weight: 700;
}

.auto-backup-status.ok {
  background: #ecfdf3;
  border-color: #b8eac9;
  color: #166534;
}

.menu-label-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.menu-label-item {
  border: 1px solid #d5e0ea;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}

.menu-builder-shell {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 12px;
}

.menu-builder-shell.is-readonly {
  opacity: .92;
}

.menu-builder-palette {
  border: 1px solid #d6e0ea;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.menu-builder-palette-head {
  font-weight: 700;
  color: #1f3f58;
}

.menu-builder-palette-list {
  display: grid;
  gap: 6px;
  max-height: 380px;
  overflow: auto;
  padding-right: 2px;
}

.menu-palette-btn {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.menu-custom-text-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.menu-builder-board-wrap {
  border: 1px solid #d6e0ea;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  min-height: 280px;
}

.menu-builder-board {
  display: grid;
  gap: 8px;
}

.menu-builder-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #d5e0ea;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.menu-builder-row.is-submenu {
  margin-left: 28px;
  border-style: dashed;
  background: #f6fbff;
}

.menu-row-drag {
  color: #6b7f93;
  font-weight: 700;
  user-select: none;
  cursor: grab;
  text-align: center;
}

.menu-row-content {
  min-width: 0;
}

.menu-row-title {
  font-weight: 700;
  color: #18334b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-row-meta {
  margin-top: 2px;
  color: #60758a;
  font-size: .82rem;
}

.menu-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-row-actions .tiny-btn {
  min-width: 44px;
  padding: 6px 8px;
}

.menu-builder-row.dragging {
  opacity: .65;
}

.menu-builder-row.drop-target {
  border-color: #2f7ad9;
  box-shadow: 0 0 0 2px rgba(47, 122, 217, .14);
}

.menu-builder-empty {
  border: 1px dashed #bdd1e3;
  border-radius: 10px;
  background: #f7fbff;
  padding: 20px 12px;
  color: #5e7489;
  text-align: center;
}

.menu-builder-help {
  margin-top: 8px;
}

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

  .settings-nav {
    position: static;
  }

  .settings-nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .settings-nav-list a {
    min-width: max-content;
    white-space: nowrap;
  }

  .menu-label-grid {
    grid-template-columns: 1fr;
  }

  .menu-builder-shell {
    grid-template-columns: 1fr;
  }

  .menu-builder-row {
    grid-template-columns: 22px 1fr;
  }

  .menu-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .menu-builder-row.is-submenu {
    margin-left: 14px;
  }
}

.font-preview-sample {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed #b9c8d6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.font-preview-title {
  font-size: .88rem;
  font-weight: 700;
  color: #33506b;
  margin-bottom: 6px;
}

.font-preview-body {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #15283a;
}

.font-preview-note {
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.confirm-overlay.open {
  display: flex;
}

.confirm-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border: 1px solid #cdd9e5;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, .22);
}

.confirm-dialog h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: #0f172a;
}

.confirm-note {
  margin: 0 0 10px;
  color: #475569;
  font-size: .9rem;
}

.confirm-list {
  border: 1px solid #d8e2ec;
  border-radius: 10px;
  background: #f8fbff;
}

.confirm-row {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid #e1e8f0;
}

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

.confirm-row span {
  color: #64748b;
  font-size: .86rem;
}

.confirm-row strong {
  color: #0f172a;
  font-size: .94rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.confirm-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.search-card {
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.search-card.search-active {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcff 100%);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, .14);
}

.search-feedback {
  margin-top: 10px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .9rem;
}

.filter-tag {
  background: #e0f2fe;
  color: #075985;
  margin-left: 4px;
}

.item-select.filtered {
  border-color: #7dd3fc;
  background: #f8fdff;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, .12);
}

.item-lookup-hint {
  margin-top: 6px;
}

.item-picked-detail {
  margin-top: 8px;
  border: 1px solid #d7dfe8;
  background: #f6f8fb;
  color: #5a6c7f;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .9rem;
}

.item-picked-detail.is-selected {
  border-color: #b8dfc6;
  background: #eef9f2;
  color: #196c46;
}

.search-submit.is-loading {
  opacity: .86;
  cursor: wait;
}

.search-actions {
  align-items: stretch;
}

.search-actions .search-submit,
.search-actions .tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-actions .tab {
  white-space: nowrap;
}

.file-pick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c7cd;
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #114;
  text-decoration: none;
  cursor: pointer;
  min-height: 42px;
}

.file-trigger.camera {
  background: #e8f4ff;
  border-color: #b7d3f0;
}

.sr-only-file {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-picked-note {
  margin-top: 6px;
  font-size: .88rem;
  color: #0f3f74;
}

.file-preview-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.file-preview-item {
  display: grid;
  grid-template-columns: 32px 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fbfdff;
}

.file-preview-item-doc {
  grid-template-columns: 32px 52px minmax(0, 1fr) auto;
}

.file-preview-order {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7f3f1;
  color: #0f766e;
  font-weight: 700;
  font-size: .82rem;
}

.file-preview-thumb,
.file-preview-doc-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #d6dee8;
  background: #fff;
}

.file-preview-thumb {
  object-fit: cover;
}

.file-preview-doc-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #345;
  background: #f3f6fa;
}

.file-preview-meta {
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  color: #123;
  word-break: break-word;
}

.file-preview-size {
  margin-top: 2px;
  font-size: .82rem;
  color: #678;
}

.file-preview-remove {
  border: 1px solid #e1b2b2;
  border-radius: 8px;
  background: #fff5f5;
  color: #a33;
  padding: 7px 10px;
  cursor: pointer;
  min-height: 38px;
}

.note-display {
  white-space: pre-wrap;
  border: 1px solid #d7dfe8;
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfc;
  min-height: 48px;
}

.alert {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert.success { background: #edf9ef; border-color: #b7e0bc; color: #1b5e20; }
.alert.error { background: #ffebee; border-color: #f3b2b7; color: #b71c1c; }
.alert.info { background: #e8f3ff; border-color: #bfdcff; color: #1a4f8b; }

.kpi {
  font-size: 1.8rem;
  font-weight: 700;
}
.kpi-label { color: var(--muted); font-size: .88rem; }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
th, td {
  border: 1px solid #d7dfe8;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

body.ui-font-size-sm { font-size: 14px; }
body.ui-font-size-md { font-size: 16px; }
body.ui-font-size-lg { font-size: 17px; }

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #0b1324;
  color: #e5e7eb;
  border-color: #46556b;
}
body.theme-dark .card {
  box-shadow: none;
}
body.theme-dark .alert.info {
  background: #1d3453;
  border-color: #33557f;
  color: #d4e8ff;
}
body.theme-dark .alert.success {
  background: #133325;
  border-color: #2f6f50;
  color: #c7f5dc;
}
body.theme-dark .alert.error {
  background: #3a1e25;
  border-color: #6e3742;
  color: #ffd9de;
}
@media (prefers-color-scheme: dark) {
  body.theme-auto input,
  body.theme-auto select,
  body.theme-auto textarea {
    background: #0b1324;
    color: #e5e7eb;
    border-color: #46556b;
  }
  body.theme-auto .alert.info {
    background: #1d3453;
    border-color: #33557f;
    color: #d4e8ff;
  }
  body.theme-auto .alert.success {
    background: #133325;
    border-color: #2f6f50;
    color: #c7f5dc;
  }
  body.theme-auto .alert.error {
    background: #3a1e25;
    border-color: #6e3742;
    color: #ffd9de;
  }
}
th {
  background: #f1f5f8;
  white-space: nowrap;
}
tr.low-stock td { background: #fff8e1; }
.stock-below-min td {
  background: #ffe3e3;
  color: #a01f1f;
}
.group-row td {
  background: #e8f1fb;
  font-weight: 700;
  color: #1f3b59;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: #e0f2f1;
  color: #0b4f4a;
}
.tag.in { background: #e8f5e9; color: #1b5e20; }
.tag.out { background: #ffebee; color: #b71c1c; }
.tag.adjust { background: #fff3e0; color: #e65100; }

@media (max-width: 900px) {
  .col-2, .col-3, .col-4, .col-5, .col-6, .col-8 { grid-column: span 12; }
  .actions { flex-direction: column; }
  .actions button { width: 100%; }
  .history-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-split-grid {
    grid-template-columns: 1fr;
  }
  .history-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
  .history-tab,
  .preset-chip {
    width: 100%;
  }
  .tx-note {
    max-width: 180px;
  }
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .app-user {
    font-size: .86rem;
    line-height: 1.35;
  }
  .header-branch-form {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }
  .header-branch-form select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .search-card .search-actions {
    width: 100%;
    align-items: stretch;
  }
  .search-card .search-actions .search-submit,
  .search-card .search-actions .tab {
    width: 100%;
    text-align: center;
  }
  .count-round-progress-row {
    flex-direction: column;
    align-items: stretch;
  }
  .count-round-percent {
    width: 100%;
    text-align: left;
  }
  .search-card input,
  .search-card select {
    font-size: 16px;
  }
  .file-pick-row {
    width: 100%;
    flex-direction: column;
  }
  .file-trigger {
    width: 100%;
  }
  .file-preview-item,
  .file-preview-item-doc {
    grid-template-columns: 28px 48px minmax(0, 1fr);
  }
  .file-preview-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .file-preview-thumb {
    width: 48px;
    height: 48px;
  }
  .file-preview-doc-icon {
    width: 42px;
    height: 42px;
  }
}

.section-head {
  background: linear-gradient(90deg, #f7fbff 0%, #e9f7f5 100%);
}
.section-head-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.head-actions .tab,
.head-actions button.tab {
  width: auto;
}
.muted {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 4px;
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-form input[type="file"] {
  flex: 1;
}
.tiny-btn {
  min-width: 100px;
  padding: 6px 8px;
}
.tiny-btn,
.tiny-btn.button,
button.tiny-btn {
  width: auto;
}
.filters-grid .actions {
  justify-content: flex-end;
}

.item-filter-form {
  border: 1px solid #d6dee8;
  border-radius: 10px;
  padding: 10px;
  background: #fafcff;
}

.item-filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.item-filter-cell {
  min-width: 0;
}

.item-filter-sort { grid-column: span 3; }
.item-filter-view { grid-column: span 2; }
.item-filter-status { grid-column: span 2; }
.item-filter-main { grid-column: span 3; }
.item-filter-sub { grid-column: span 2; }

.item-filter-search {
  margin-top: 10px;
}

.item-filter-search input {
  width: 100%;
}

.item-filter-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.item-filter-btn {
  width: auto;
  min-height: 40px;
  min-width: 132px;
  padding: 8px 12px;
  border-radius: 8px;
}

.item-filter-actions .item-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .head-actions,
  .inline-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .item-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-filter-sort,
  .item-filter-view,
  .item-filter-status,
  .item-filter-main,
  .item-filter-sub {
    grid-column: span 1;
  }

  .item-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .item-filter-btn,
  .item-filter-actions .item-filter-reset {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .item-filter-grid {
    grid-template-columns: 1fr;
  }

  .item-filter-sort,
  .item-filter-view,
  .item-filter-status,
  .item-filter-main,
  .item-filter-sub {
    grid-column: span 1;
  }
}

.status-card { position: relative; overflow: hidden; }
.status-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: #2f855a;
}
.status-card.warn::after { background: #b7791f; }
.status-card.danger::after { background: #c53030; }
.status-card.ok::after { background: #2f855a; }

.dash-charts h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.insights-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.insights-label {
  margin: 0;
  color: var(--muted);
}

.insights-mode-select {
  width: auto;
  min-width: 220px;
}

.count-round-summary {
  border: 1px solid #d7e3f1;
  background: linear-gradient(90deg, #f8fbff 0%, #eef8f3 100%);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.count-round-title {
  font-weight: 700;
  color: #1f3b59;
  margin-bottom: 8px;
}

.count-round-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-round-progressbar {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: #dbe7f3;
  overflow: hidden;
}

.count-round-progressbar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1f9f57 0%, #2f855a 100%);
}

.count-round-percent {
  min-width: 64px;
  text-align: right;
  font-weight: 700;
  color: #1f3b59;
}

.count-round-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: .88rem;
}

.pie-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
}

.pie-chart-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  flex: 0 0 auto;
}

.pie-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d7dfe8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}

.pie-center-title {
  font-size: .66rem;
  color: var(--muted);
  line-height: 1.2;
}

.pie-center-value {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: 2px;
}

.pie-legend {
  display: grid;
  gap: 6px;
  min-width: 220px;
  font-size: .88rem;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 240px;
  padding: 10px;
  border: 1px solid #d7dfe8;
  border-radius: 10px;
  overflow-x: auto;
}

.vbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 52px;
}

.vbar-pair {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
}

.vbar-pair.single {
  gap: 0;
}

.vbar {
  position: relative;
  width: 16px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.vbar.in { background: #2f855a; }
.vbar.out { background: #c53030; }
.vbar.topbar { width: 24px; }

.vbar-value {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #d7dfe8;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: .65rem;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.vbar-label {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  max-width: 72px;
  word-break: break-word;
}

.backup-actions form {
  margin: 0;
}

.backup-btn-form button {
  width: 100%;
}

.backup-upload-form {
  flex-wrap: wrap;
  align-items: center;
}

.backup-upload-form input[type="file"] {
  flex: 1 1 280px;
  min-width: 220px;
}

.backup-upload-form button {
  width: auto;
  min-width: 220px;
}

.backup-simple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.backup-step-card {
  border: 1px solid #d6dee8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.backup-step-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.backup-step-card .muted {
  margin: 0;
}

.backup-step-card.is-primary {
  border-color: #b7d4cc;
  background: #f3fbf9;
}

.backup-primary-form button {
  min-height: 42px;
  font-size: 1rem;
}

.backup-sub-actions {
  display: grid;
  gap: 8px;
}

.backup-upload-simple {
  display: grid;
  gap: 8px;
}

.backup-upload-simple input[type="file"] {
  width: 100%;
  min-width: 0;
}

.backup-upload-simple button {
  width: 100%;
  min-width: 0;
}

.backup-legacy-tools {
  margin-top: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.backup-legacy-tools summary {
  cursor: pointer;
  font-weight: 700;
  color: #475569;
}

.bars-wrap {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  align-items: center;
}

.bar-label {
  font-size: .82rem;
  color: var(--muted);
}

.bar-pair {
  display: grid;
  gap: 4px;
}

.bar {
  color: #fff;
  font-size: .78rem;
  padding: 4px 6px;
  border-radius: 6px;
  min-width: 42px;
}
.bar.in { background: #2f855a; }
.bar.out { background: #c53030; }

.section-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.section-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.widget-control-card {
  background: linear-gradient(90deg, #f8fcff 0%, #eef8f3 100%);
}

.widget-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.widget-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d5e0ea;
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
  color: #1f2937;
}

.widget-check-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.widget-check-item > span {
  flex: 1;
  min-width: 0;
}

.widget-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.widget-sections-grid .dash-section {
  margin-bottom: 0;
}

.widget-sections-grid .dash-section.widget-wide {
  grid-column: 1 / -1;
}

.widget-control-card.collapsed #widget-checklist {
  display: none;
}

.widget-hidden {
  display: none !important;
}

.title-editor summary {
  color: var(--muted);
  cursor: pointer;
  font-size: .86rem;
  margin-bottom: 6px;
}

.item-row-form {
  display: contents;
}

.item-row-form .edit-val {
  width: 100%;
}

@media (max-width: 900px) {
  .bar-row {
    grid-template-columns: 1fr;
  }
  .insights-mode-select {
    width: 100%;
    min-width: 0;
  }
  .pie-chart {
    width: 150px;
    height: 150px;
  }
  .widget-checklist {
    grid-template-columns: 1fr;
  }
  .widget-check-item {
    flex-wrap: wrap;
  }
  .widget-sections-grid {
    grid-template-columns: 1fr;
  }
  .backup-upload-form button {
    width: 100%;
    min-width: 0;
  }

  .backup-simple-grid {
    grid-template-columns: 1fr;
  }

  .confirm-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .confirm-actions {
    justify-content: stretch;
  }

  .confirm-actions button {
    flex: 1 1 48%;
    min-width: 0;
  }
}

.title-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.title-inline h2 {
  margin: 0;
}
.title-editor-inline summary {
  cursor: pointer;
  color: #334155;
  font-size: .86rem;
}
.title-editor-inline[open] {
  width: 100%;
}
.title-editor-inline[open] .inline-form {
  margin-top: 6px;
}

.icon-tool {
  width: auto;
  min-width: 34px;
  padding: 4px 6px;
  font-size: .9rem;
  line-height: 1;
}

.icon-tool.is-wide {
  border-color: #0f766e;
  background: #e9f7f5;
}

.dash-section .section-body {
  margin-top: 6px;
}
.dash-section.collapsed .section-body {
  display: none;
}

.movement-photo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.photo-link {
  display: inline-block;
  text-decoration: none;
  border: 1px solid #b7d3f0;
  background: #eef6ff;
  color: #0f3f74;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .78rem;
  white-space: nowrap;
}

.photo-link:hover {
  background: #dceeff;
}

.photo-more {
  font-size: .78rem;
  color: var(--muted);
}

.history-hero h1 {
  margin: 0 0 6px;
}

.history-tabs-card {
  padding: 10px 12px;
}

.history-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #c8d5e2;
  background: #f8fbff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.history-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.history-filter-card {
  display: grid;
  gap: 12px;
}

.history-preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
}

.preset-chip.active {
  background: #e6f4ff;
  border-color: #87bce9;
  color: #0f4f88;
}

.history-summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 14px;
}

.metric-label {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
}

.metric-value-sm {
  font-size: 1.15rem;
}

.metric-note {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--muted);
}

.history-table .tx-row-adjust td {
  background: #fff7ed;
}

.tx-sku-cell {
  display: grid;
  gap: 2px;
}

.tx-sku-link {
  color: #0f4f88;
  text-decoration: none;
  font-weight: 700;
}

.tx-sku-link:hover {
  text-decoration: underline;
}

.tx-item-name {
  color: var(--muted);
  font-size: .84rem;
}

.tx-flow {
  font-weight: 700;
  color: #1f3b59;
  white-space: nowrap;
}

.tx-note {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
}

.history-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tx-photo-dialog {
  width: min(960px, 100%);
}

.tx-photo-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tx-photo-card {
  border: 1px solid #d7dfe8;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.tx-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d7dfe8;
  background: #fff;
}

.tx-photo-meta {
  font-size: .85rem;
  color: #334155;
  word-break: break-word;
}

.tx-photo-actions {
  display: flex;
  justify-content: flex-end;
}

body.theme-dark .history-tab,
body.theme-dark .preset-chip {
  background: #111c2a;
  border-color: #314055;
}

body.theme-dark .preset-chip.active {
  background: #15314e;
  border-color: #2e5f90;
  color: #dbeafe;
}

body.theme-dark .history-table .tx-row-adjust td {
  background: rgba(249, 115, 22, 0.12);
}

body.theme-dark .tx-photo-card {
  background: #111c2a;
  border-color: #314055;
}

body.theme-dark .tx-photo-card img {
  border-color: #314055;
}

.stock-count-embed {
  width: 100%;
  min-height: 760px;
  border: 1px solid #d7dfe8;
  border-radius: 10px;
  background: #fff;
}

.embed-stockcount-body {
  background: #f8fbfd;
}

.embed-stockcount-container {
  max-width: none;
  margin: 0;
  padding: 10px;
}

.count-table .num {
  text-align: right;
  white-space: nowrap;
}

.count-group-main td {
  background: #dce9f7;
  color: #163a5c;
  font-weight: 700;
}

.count-preview {
  display: inline-block;
  min-width: 54px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #d7dfe8;
  background: #f8fafc;
  color: #334155;
  text-align: center;
  font-size: .82rem;
}

.count-preview.pos {
  color: #0f5132;
  background: #e9f9ef;
  border-color: #b9e8c7;
}

.count-preview.neg {
  color: #991b1b;
  background: #fdecec;
  border-color: #f4c0c0;
}

.count-preview.zero {
  color: #0f5132;
  background: #ecfdf3;
  border-color: #bde8cc;
}

.count-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid #d7dfe8;
  background: #f8fafc;
  color: #334155;
}

.count-status.pending {
  background: #fff8e1;
  border-color: #ffd666;
  color: #8a5a00;
}

.count-status.approved {
  background: #e9f9ef;
  border-color: #b9e8c7;
  color: #1b5e20;
}

.count-status.rejected {
  background: #fdecec;
  border-color: #f5bcbc;
  color: #9f1d1d;
}

.row-saving {
  opacity: .72;
  pointer-events: none;
}

.row-toast {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  opacity: 1;
  transition: opacity .2s ease;
}

.row-toast.hide {
  opacity: 0;
}

.row-toast.info {
  background: #e6f2ff;
  border-color: #b7d4f5;
  color: #0d4678;
}

.row-toast.success {
  background: #ebfbf1;
  border-color: #9fdfb7;
  color: #0f7a32;
}

.row-toast.error {
  background: #fdecec;
  border-color: #f5bcbc;
  color: #9f1d1d;
}

.num-pos {
  color: #0f5132;
  font-weight: 700;
}

.num-neg {
  color: #9f1d1d;
  font-weight: 700;
}

.approval-form label {
  margin-bottom: 2px;
  font-size: .78rem;
}

.approval-form input,
.approval-form select {
  padding: 6px 8px;
  font-size: .84rem;
}

.approval-actions {
  flex-wrap: wrap;
}

.approval-actions button {
  min-width: 100px;
}

@media (max-width: 900px) {
  .stock-count-embed {
    min-height: 980px;
  }
}

.item-manage-hero,
.item-manage-tabs-card,
.item-manage-list-card,
.item-manage-create-card {
  overflow: hidden;
}

.item-manage-hero {
  padding: 16px 18px;
}

.item-manage-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.item-manage-hero-copy h2 {
  margin: 2px 0 4px;
}

.item-manage-hero-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-manage-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-manage-summary-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.item-manage-summary-grid .metric-card {
  padding: 12px 14px;
  min-height: 0;
}

.item-manage-summary-grid .metric-label {
  font-size: .78rem;
  margin-bottom: 4px;
}

.item-manage-summary-grid .metric-value {
  font-size: 1.35rem;
  line-height: 1.05;
}

.item-manage-summary-grid .metric-note {
  margin-top: 4px;
  font-size: .74rem;
  line-height: 1.2;
}

.suppliers-summary-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.suppliers-summary-grid .metric-card {
  padding: 12px 14px;
  min-height: 0;
}

.suppliers-summary-grid .metric-card.ok {
  border-left: 6px solid #2f855a;
}

.suppliers-summary-grid .metric-card.warn {
  border-left: 6px solid #d69e2e;
}

.suppliers-summary-grid .metric-card.danger {
  border-left: 6px solid #dc2626;
}

.suppliers-summary-grid .metric-label {
  font-size: .78rem;
  margin-bottom: 4px;
}

.suppliers-summary-grid .metric-value {
  font-size: 1.35rem;
  line-height: 1.05;
}

.suppliers-summary-grid .metric-note {
  margin-top: 4px;
  font-size: .74rem;
  line-height: 1.2;
}

.supplier-filter-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.suppliers-list-meta {
  margin-bottom: 10px;
}

.supplier-channel-badge,
.supplier-usage-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: #35526f;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.supplier-usage-pill {
  background: #ecfdf3;
  color: #1f7a43;
}

.supplier-qr-thumb {
  display: block;
  margin-top: 8px;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 1px solid #dbe3ef;
  background: #fff;
  padding: 5px;
}

.supplier-qr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: 8px;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.supplier-qr-button-large {
  margin-top: 0;
}

.supplier-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suppliers-online-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.supplier-online-card {
  border: 1px solid #d6dee8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.supplier-online-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.supplier-online-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .88rem;
}

.supplier-online-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.supplier-qr-large {
  width: 132px;
  height: 132px;
  display: block;
  border-radius: 14px;
  border: 1px solid #d6dee8;
  background: #fff;
  padding: 8px;
}

.supplier-drawer-summary {
  margin: 0;
}

.supplier-drawer-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.supplier-drawer-qr-wrap {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.supplier-qr-modal {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  z-index: 80;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.supplier-qr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.supplier-qr-modal-head h3 {
  margin: 0;
}

.supplier-qr-modal-body {
  display: flex;
  justify-content: center;
}

.supplier-qr-modal-image {
  width: min(320px, 72vw);
  height: min(320px, 72vw);
  border-radius: 18px;
  border: 1px solid #d6dee8;
  background: #fff;
  padding: 12px;
}

.entity-help-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.entity-help-trigger {
  width: 30px;
  height: 30px;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
  color: #0f4f88;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
}

body.ui-style-ios2027.page-item_manage .entity-help-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: 1px solid #c6dced !important;
  border-radius: 999px !important;
  background: #f7fbff !important;
  color: #2a6794 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027.page-item_manage .entity-help-trigger:hover,
body.ui-style-ios2027.page-item_manage .entity-help-trigger:focus {
  background: #eef7ff !important;
  border-color: #b4d2e6 !important;
}

.asset-note-trigger {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  font-size: .72rem;
  line-height: 1;
}

.asset-filter-submit-plain {
  border: 0;
  background: transparent;
  padding: 0 4px;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.asset-filter-submit-plain:hover,
.asset-filter-submit-plain:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}

.asset-filter-actions-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.entity-help-modal {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.entity-help-modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.entity-help-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.entity-help-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.entity-help-close {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
}

.entity-help-copy {
  padding: 18px 20px 20px;
  display: grid;
  gap: 12px;
}

.entity-help-copy h3 {
  margin: 0;
  font-size: 1rem;
}

.entity-help-copy p {
  margin: 0;
  line-height: 1.6;
}

.entity-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.assets-center-hero,
.assets-center-tabs-card,
.asset-form-card,
.assets-list-card {
  overflow: hidden;
}

.assets-center-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.assets-center-summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.assets-center-summary-grid .metric-card {
  padding: 12px 14px;
}

.assets-center-summary-grid .metric-card.ok {
  border-left: 6px solid #2f855a;
}

.assets-center-summary-grid .metric-card.warn {
  border-left: 6px solid #d69e2e;
}

.assets-center-summary-grid .metric-card.danger {
  border-left: 6px solid #dc2626;
}

.assets-center-summary-grid .metric-label {
  font-size: .78rem;
  margin-bottom: 4px;
}

.assets-center-summary-grid .metric-value {
  font-size: 1.35rem;
  line-height: 1.05;
}

.assets-center-summary-grid .metric-note {
  margin-top: 4px;
  font-size: .74rem;
  line-height: 1.2;
}

.assets-center-filter-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.asset-inline-note {
  color: var(--muted);
  font-size: .9rem;
}

.asset-form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.asset-form-card .grid {
  gap: 14px;
}

.asset-form-card .grid > div {
  min-width: 0;
}

.asset-form-card .grid input,
.asset-form-card .grid select,
.asset-form-card .grid textarea {
  width: 100%;
}

.asset-upload-box {
  display: grid;
  align-content: start;
  gap: 6px;
}

.asset-file-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.asset-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fafcff;
}

.asset-file-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.asset-file-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d6dee8;
  background: #fff;
}

.asset-file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.asset-record-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.asset-record-card {
  border: 1px solid #d6dee8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.asset-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.asset-record-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.asset-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  background: #eef4fb;
  color: #35526f;
}

.asset-status-chip.ok {
  background: #ecfdf3;
  color: #1f7a43;
}

.asset-status-chip.warn {
  background: #fff7ed;
  color: #b45309;
}

.asset-status-chip.danger {
  background: #fff1f2;
  color: #b42318;
}

.asset-status-chip.muted {
  background: #f1f5f9;
  color: #64748b;
}

.asset-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.asset-meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.asset-meta-row span {
  color: var(--muted);
  font-size: .78rem;
}

.asset-meta-row strong {
  color: var(--text);
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.asset-preview-strip {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-preview-image {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d6dee8;
  background: #fff;
}

.asset-file-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: #35526f;
  font-size: .82rem;
  font-weight: 700;
}

.asset-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.asset-table-actions form {
  margin: 0;
}

body.page-assets_register .container {
  max-width: 1480px;
}

body.theme-dark .asset-record-card,
body.theme-dark .asset-file-row {
  border-color: #334155;
  background: #0f172a;
}

body.theme-dark .asset-status-chip.muted {
  background: #1e293b;
  color: #94a3b8;
}

.item-manage-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.item-manage-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.item-manage-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand);
  font-size: .82rem;
}

.item-manage-tab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
}

.item-manage-tab.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.item-manage-note-strip {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #edf7ff 0%, #eefaf5 100%);
  border: 1px solid #d8e8f8;
  color: #23415f;
}

.item-manage-note-strip.warning {
  background: linear-gradient(90deg, #fff8ef 0%, #fff3f3 100%);
  border-color: #f1d0d0;
  color: #6d2f2f;
}

.item-manage-category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.item-manage-category-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.item-manage-category-tab.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.item-manage-filter-card {
  padding: 14px;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  background: #fbfdff;
  margin-bottom: 12px;
}

.item-manage-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.item-manage-filter-cell {
  grid-column: span 1;
  min-width: 0;
}

.item-manage-filter-cell.search-wide {
  grid-column: span 2;
}

.item-manage-advanced {
  margin-top: 10px;
  border-top: 1px dashed #d6dee8;
  padding-top: 10px;
}

.item-manage-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.item-manage-advanced .advanced-grid {
  margin-top: 12px;
}

.item-manage-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.item-manage-table td,
.item-manage-table th {
  vertical-align: top;
}

.item-manage-table td[data-label]::before {
  content: none;
}

.item-manage-row.stock-below-min td {
  background: #fff2f2;
}

.item-name-cell {
  min-width: 180px;
}

.item-name-main {
  font-weight: 700;
  color: var(--text);
}

.item-name-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: .88rem;
}

.need-buy-cell {
  font-weight: 700;
}

.need-buy-cell.ok {
  color: #1f7a43;
}

.need-buy-cell.danger {
  color: #c53030;
}

.item-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}

.item-status-badge.active {
  background: #e8f7ef;
  color: #1f7a43;
}

.item-status-badge.warn {
  background: #fff4db;
  color: #a16207;
}

.item-status-badge.inactive {
  background: #eef2f7;
  color: #516173;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  z-index: 70;
}

.item-manage-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 96vw);
  height: 100vh;
  background: #fff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.18);
  z-index: 71;
  display: flex;
  flex-direction: column;
}

.item-manage-drawer[hidden],
.drawer-overlay[hidden] {
  display: none;
}

.item-manage-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.drawer-eyebrow {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.item-manage-drawer-head h3 {
  margin: 4px 0 0;
  font-size: 1.12rem;
}

.item-manage-drawer-body {
  padding: 18px 20px 24px;
  overflow: auto;
}

.drawer-stock-lock {
  margin-bottom: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7f4 100%);
}

.drawer-stock-lock-title {
  font-weight: 700;
  color: #1f3b59;
}

.drawer-stock-lock-value {
  margin: 6px 0 8px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
}

.drawer-form textarea {
  min-height: 88px;
  resize: vertical;
}

.drawer-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.drawer-actions {
  margin-top: 6px;
}

.drawer-delete-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #d6dee8;
}

.drawer-delete-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .9rem;
}

.item-manage-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.item-manage-pagination-meta {
  color: var(--muted);
  font-weight: 600;
}

.tab.disabled {
  pointer-events: none;
  opacity: .5;
}

body.drawer-open {
  overflow: hidden;
}

body.theme-dark .item-manage-tab {
  background: #132132;
  border-color: #334155;
}

body.theme-dark .item-manage-note-strip {
  background: linear-gradient(90deg, rgba(30, 64, 175, 0.18) 0%, rgba(15, 118, 110, 0.18) 100%);
  border-color: rgba(148, 163, 184, 0.22);
  color: #d7e3ef;
}

body.theme-dark .item-manage-note-strip.warning {
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.22) 0%, rgba(127, 29, 29, 0.22) 100%);
  border-color: rgba(248, 113, 113, 0.2);
  color: #f8d7d7;
}

body.theme-dark .item-manage-category-tab {
  background: #132132;
  border-color: #334155;
  color: #e2e8f0;
}

body.theme-dark .item-manage-category-tab.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

body.theme-dark .item-manage-filter-card,
body.theme-dark .item-manage-drawer {
  background: #0f172a;
}

body.theme-dark .supplier-online-card,
body.theme-dark .supplier-drawer-summary {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .supplier-qr-modal {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .supplier-channel-badge {
  background: #1e293b;
  color: #cbd5e1;
}

body.theme-dark .supplier-usage-pill {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

body.theme-dark .drawer-stock-lock {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.92) 100%);
}

@media (max-width: 900px) {
  .item-manage-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .item-manage-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .suppliers-summary-grid,
  .supplier-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .suppliers-online-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-manage-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-manage-filter-cell,
  .item-manage-filter-cell.search-wide {
    grid-column: span 1;
  }

  .item-manage-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .item-manage-filter-actions .tab,
  .item-manage-filter-actions button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .item-manage-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .suppliers-summary-grid,
  .supplier-filter-grid,
  .suppliers-online-grid,
  .supplier-drawer-summary-grid {
    grid-template-columns: 1fr;
  }

  .item-manage-tabs {
    flex-direction: column;
  }

  .item-manage-category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .item-manage-tab {
    width: 100%;
    justify-content: space-between;
  }

  .item-manage-filter-grid {
    grid-template-columns: 1fr;
  }

  .supplier-row-actions {
    justify-content: flex-start;
  }

  .item-manage-filter-cell,
  .item-manage-filter-cell.search-wide {
    grid-column: span 1;
  }

  .item-manage-drawer {
    width: 100vw;
  }

  .drawer-stock-lock-value {
    font-size: 1.6rem;
  }

  .item-manage-table {
    width: 100%;
  }

  .item-manage-table thead {
    display: none;
  }

  .item-manage-table,
  .item-manage-table tbody,
  .item-manage-table tr,
  .item-manage-table td {
    display: block;
    width: 100%;
  }

  .item-manage-table .group-row td {
    border-bottom: 0;
  }

  .item-manage-row {
    display: block;
    margin: 0 0 12px;
    border: 1px solid #d6dee8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .item-manage-row td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px dashed #d6dee8;
    text-align: right;
  }

  .item-manage-row td:last-child {
    border-bottom: 0;
  }

  .item-manage-table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    color: var(--muted);
    font-weight: 700;
  }

  .item-name-cell {
    min-width: 0;
    width: 100%;
  }

  .item-manage-pagination {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.sku-master-hero,
.sku-master-tabs-card,
.sku-master-pane {
  border: 1px solid #d6dee8;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.sku-master-eyebrow {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.sku-master-hero-copy h2 {
  margin: 0 0 8px;
}

.sku-master-summary-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sku-master-summary-grid .metric-card {
  padding: 12px 14px;
  min-height: 0;
}

.sku-master-summary-grid .metric-label {
  font-size: .78rem;
  margin-bottom: 4px;
}

.sku-master-summary-grid .metric-value {
  font-size: 1.35rem;
  line-height: 1.05;
}

.sku-master-summary-grid .metric-note {
  margin-top: 4px;
  font-size: .74rem;
  line-height: 1.2;
}

.sku-master-tabs {
  justify-content: flex-start;
}

.sku-master-tabs .item-manage-tab {
  cursor: grab;
  user-select: none;
}

.sku-master-tabs .item-manage-tab.dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.sku-master-pane-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.sku-master-pane {
  margin-bottom: 18px;
}

.sku-master-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sku-master-tool-card {
  margin: 0;
  border: 1px solid #d6dee8;
  background: #fbfdff;
}

.sku-master-tool-card h3 {
  margin: 0 0 8px;
}

.compact-grid {
  gap: 10px;
}

.sku-master-preview-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d6dee8;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7f4 100%);
}

.sku-master-preview-box.ok {
  border-color: #b9dcc9;
  background: linear-gradient(135deg, #eefaf3 0%, #f5fbff 100%);
}

.sku-master-preview-box.danger {
  border-color: #efc0c0;
  background: linear-gradient(135deg, #fff4f4 0%, #fff9f3 100%);
}

.preview-label {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 6px;
}

.preview-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

.sku-master-filter-bar {
  padding: 14px;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  background: #fbfdff;
  margin-bottom: 12px;
}

.sku-master-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sku-master-filter-cell {
  min-width: 0;
}

.sku-master-filter-cell.search-wide {
  grid-column: span 2;
}

.sku-master-table td,
.sku-master-table th {
  vertical-align: top;
}

.sku-master-row-form {
  display: inline-block;
}

.sku-master-usage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #516173;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}

.sku-master-usage-badge.ok {
  background: #e8f7ef;
  color: #1f7a43;
}

.sku-master-usage-badge.danger {
  background: #fdecec;
  color: #b42318;
}

.sku-master-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sku-master-checkbox input[type="checkbox"] {
  width: auto;
}

body.theme-dark .sku-master-tool-card,
body.theme-dark .sku-master-filter-bar {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .sku-master-preview-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-color: #334155;
}

body.theme-dark .sku-master-preview-box.ok {
  border-color: rgba(34, 197, 94, 0.25);
}

body.theme-dark .sku-master-preview-box.danger {
  border-color: rgba(248, 113, 113, 0.25);
}

body.theme-dark .sku-master-usage-badge {
  background: #1e293b;
  color: #cbd5e1;
}

body.theme-dark .sku-master-usage-badge.ok {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

body.theme-dark .sku-master-usage-badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

@media (max-width: 1100px) {
  .sku-master-pane-grid {
    grid-template-columns: 1fr;
  }

  .sku-master-tools-grid,
  .sku-master-summary-grid,
  .sku-master-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sku-master-filter-cell.search-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .sku-master-summary-grid,
  .sku-master-tools-grid,
  .sku-master-filter-grid {
    grid-template-columns: 1fr;
  }

  .sku-master-filter-cell.search-wide {
    grid-column: span 1;
  }

  .sku-master-table {
    width: 100%;
  }

  .sku-master-table thead {
    display: none;
  }

  .sku-master-table,
  .sku-master-table tbody,
  .sku-master-table tr,
  .sku-master-table td {
    display: block;
    width: 100%;
  }

  .sku-master-table tr {
    margin: 0 0 12px;
    border: 1px solid #d6dee8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .sku-master-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px dashed #d6dee8;
    text-align: right;
  }

  .sku-master-table td:last-child {
    border-bottom: 0;
  }

  .sku-master-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    color: var(--muted);
    font-weight: 700;
  }
}

.location-center-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.location-center-summary-grid .metric-card {
  padding: 12px 14px;
  min-height: 0;
}

.location-center-summary-grid .metric-card.inactive {
  border-left: 6px solid #64748b;
}

.location-center-summary-grid .metric-card.ok {
  border-left: 6px solid #2f855a;
}

.location-center-summary-grid .metric-card.warn {
  border-left: 6px solid #d69e2e;
}

.location-center-summary-grid .metric-card.danger {
  border-left: 6px solid #dc2626;
}

.location-center-card {
  padding: 16px 18px;
}

.location-center-hero-card {
  overflow: visible;
}

.location-center-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.location-center-hero-actions .secondary {
  background: #fff;
}

.location-center-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.location-center-story-card {
  padding: 16px 18px;
}

.location-center-story-card h3 {
  margin: 0 0 8px;
}

.location-center-story-text {
  margin: 0 0 10px;
  color: #516173;
  line-height: 1.65;
}

.location-center-story-list {
  display: grid;
  gap: 10px;
}

.location-center-story-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  background: #fbfdff;
}

.location-center-form-card {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #d6dee8;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.85) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.location-center-form-card h3 {
  margin: 0 0 10px;
}

.location-center-filter-bar {
  margin: 14px 0 10px;
  padding: 14px 16px;
  border: 1px solid #d6dee8;
  border-radius: 16px;
  background: #f8fbff;
}

.location-center-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.location-center-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-center-filter-actions .secondary {
  white-space: nowrap;
}

.location-center-table td input,
.location-center-table td select,
.location-center-table td textarea {
  width: 100%;
}

.location-center-inline-note {
  margin-top: 6px;
  font-size: .8rem;
  line-height: 1.45;
  color: #6b7b8f;
}

.location-admin-panel {
  margin-top: 14px;
  border: 1px solid #d6dee8;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.location-admin-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: #123;
  list-style: none;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
}

body.ui-style-ios2027.page-locations .location-admin-panel summary {
  background: linear-gradient(135deg, #0f766e 0%, #2f938b 100%) !important;
  color: #ffffff !important;
}

body.ui-style-ios2027.page-locations .location-admin-panel summary:hover,
body.ui-style-ios2027.page-locations .location-admin-panel summary:focus {
  background: linear-gradient(135deg, #0d6a63 0%, #27857e 100%) !important;
}

.location-admin-panel summary::-webkit-details-marker {
  display: none;
}

.location-admin-panel[open] summary {
  border-bottom: 1px solid #d6dee8;
}

.location-admin-panel .location-center-form-card {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.ui-style-ios2027.page-locations .location-admin-panel .actions button,
body.ui-style-ios2027.page-locations .location-room-quick-name-row .tiny-btn {
  min-height: 38px !important;
  box-shadow: none !important;
}

.location-visual-grid,
.location-point-grid,
.location-room-grid,
.location-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.location-rule-groups {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.location-visual-card,
.location-point-card,
.location-room-card,
.location-check-card,
.location-rule-card {
  border: 1px solid #d6dee8;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.location-visual-card.active,
.location-point-card.active,
.location-room-card.active,
.location-check-card.ready,
.location-rule-item.ready {
  border-left: 6px solid #2f855a;
}

.location-visual-card.warn,
.location-point-card.warn,
.location-room-card.warn,
.location-check-card.issue,
.location-rule-item.need-fill {
  border-left: 6px solid #d69e2e;
}

.location-visual-card.danger,
.location-point-card.danger,
.location-room-card.danger {
  border-left: 6px solid #dc2626;
}

.location-visual-card.inactive,
.location-point-card.inactive,
.location-room-card.inactive,
.location-check-card.pending {
  border-left: 6px solid #64748b;
}

.location-visual-head,
.location-point-head,
.location-room-head,
.location-check-head,
.location-rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.location-visual-head h3,
.location-point-head h3,
.location-room-head h3,
.location-check-head h3,
.location-rule-head h3 {
  margin: 4px 0 2px;
}

.location-visual-type,
.location-point-type {
  color: #64748b;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.location-visual-sub,
.location-point-code {
  margin: 0;
  color: #6b7b8f;
  font-size: .85rem;
}

.location-visual-stats,
.location-point-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.location-room-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.location-visual-stats span,
.location-point-meta span,
.location-check-helper,
.location-check-last {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f7fb;
  color: #516173;
  font-size: .82rem;
}

.location-visual-shortage-list,
.location-rule-list,
.location-check-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.location-visual-shortage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff8e8;
  color: #7a4a00;
  font-size: .84rem;
}

.location-visual-ready-note,
.location-point-note,
.location-rule-story {
  margin: 12px 0 0;
  color: #607086;
  line-height: 1.6;
}

.location-room-story {
  margin: 12px 0 0;
  color: #475569;
  line-height: 1.6;
  font-weight: 600;
}

.location-visual-actions,
.location-point-actions,
.location-check-form-head,
.location-rule-head-side,
.location-rule-actions,
.location-inline-editor-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.location-visual-actions,
.location-point-actions,
.location-check-form-head {
  margin-top: 14px;
}

.location-inline-editor {
  margin-top: 14px;
  border-top: 1px dashed #d6dee8;
  padding-top: 12px;
}

.location-room-rules {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.location-room-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
  align-items: start;
}

.location-room-browser {
  padding: 16px;
  position: sticky;
  top: 96px;
}

body.ui-style-ios2027.page-locations .location-room-browser {
  border: 1px solid #dbe5ef;
  background: #ffffff;
}

.location-room-browser-list {
  display: grid;
  gap: 10px;
}

.location-room-browser-tab {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  background: #fbfdff;
  color: #0f172a;
  font-weight: 700;
  cursor: grab;
}

body.ui-style-ios2027.page-locations .location-room-browser-tab {
  min-height: 0 !important;
  padding: 11px 14px !important;
  border: 1px solid #cfd9e5 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  color: #11253b !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027.page-locations .location-room-browser-tab:hover,
body.ui-style-ios2027.page-locations .location-room-browser-tab:focus {
  background: #f6fbff !important;
  border-color: #a7c5df !important;
}

.location-room-browser-tab.active {
  background: #eff8ff;
  border-color: #8fb7de;
  color: #0f172a;
}

body.ui-style-ios2027.page-locations .location-room-browser-tab.active {
  background: #eef8ff !important;
  border-color: #8fb7de !important;
  color: #0f172a !important;
}

.location-room-browser-tab.dragging {
  opacity: .65;
  cursor: grabbing;
}

.location-room-browser-tab.drag-over {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.location-room-panels {
  min-width: 0;
}

.location-room-browser-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #d6dee8;
  border-left: 6px solid #cbd5e1;
  border-radius: 16px;
  background: #fbfdff;
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.location-room-browser-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.location-room-browser-item.active {
  background: linear-gradient(180deg, rgba(239, 248, 255, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  border-color: #8fb7de;
}

.location-room-browser-item.active.active,
.location-room-browser-item.active.ready {
  border-left-color: #2f855a;
}

.location-room-browser-item.warn {
  border-left-color: #d69e2e;
}

.location-room-browser-item.danger {
  border-left-color: #dc2626;
}

.location-room-browser-item.inactive {
  border-left-color: #64748b;
}

.location-room-browser-main {
  display: grid;
  gap: 4px;
}

.location-room-browser-main strong {
  font-size: .98rem;
}

.location-room-browser-main span,
.location-room-browser-meta {
  color: #64748b;
  font-size: .82rem;
}

.location-room-browser-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.location-room-focus {
  border: 1px solid #d6dee8;
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
}

.location-check-plain-page {
  margin-bottom: 18px;
}

body.page-location_checks .container {
  max-width: 1560px;
}

.housekeeping-checklist-preview {
  max-width: 420px;
  white-space: pre-line;
  color: var(--muted);
}

.housekeeping-table-wrap table td {
  vertical-align: top;
}

.page-housekeeping_tasks .container {
  max-width: 1440px;
}

.page-housekeeping_tasks .housekeeping-room-layout .location-room-browser-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.page-housekeeping_cleaner .container,
.page-housekeeping_reviewer .container {
  max-width: 1440px;
}

.housekeeping-work-meta {
  overflow: hidden;
}

.housekeeping-work-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.housekeeping-work-head h2 {
  margin: 0 0 6px;
}

.housekeeping-work-date label {
  display: grid;
  gap: 4px;
  font-size: .82rem;
  color: #64748b;
  min-width: 180px;
}

.housekeeping-work-bars {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.housekeeping-progress-card {
  border: 1px solid #d6dee8;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.housekeeping-progress-card .label {
  font-size: .8rem;
  color: #64748b;
}

.housekeeping-progress-card .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.housekeeping-progress-card .meta {
  font-size: .82rem;
  color: #64748b;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e6edf5;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width .18s ease;
}

.progress-fill.ok {
  background: linear-gradient(90deg, #0f766e 0%, #16a34a 100%);
}

.progress-fill.danger {
  background: linear-gradient(90deg, #dc2626 0%, #ea580c 100%);
}

.housekeeping-work-shell {
  overflow: hidden;
}

.housekeeping-admin-hero,
.housekeeping-admin-shell {
  overflow: hidden;
}

.housekeeping-summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.housekeeping-slot-card {
  margin-top: 12px;
  padding: 14px;
}

.housekeeping-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.housekeeping-slot-head h4 {
  margin: 0;
}

.housekeeping-slot-count {
  font-size: .82rem;
  color: #64748b;
}

.housekeeping-work-list,
.housekeeping-config-list {
  display: grid;
  gap: 8px;
}

.housekeeping-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.housekeeping-check-row.done {
  border-color: #86d9a8;
  background: #f2fcf6;
}

.housekeeping-check-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.housekeeping-check-toggle input[type="checkbox"] {
  margin-top: 3px;
}

.housekeeping-check-state {
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #d6dee8;
  background: #f8fafc;
  color: #64748b;
  white-space: nowrap;
}

.housekeeping-check-state.pass {
  border-color: #86d9a8;
  background: #eafaf1;
  color: #166534;
}

.housekeeping-check-state.fail {
  border-color: #fdba74;
  background: #fff7ed;
  color: #b45309;
}

.housekeeping-config-row {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.housekeeping-drag-handle,
.housekeeping-drag-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 30px;
}

.housekeeping-drag-handle {
  font-size: .88rem;
  color: #64748b;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.housekeeping-task-row.dragging {
  opacity: .65;
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.housekeeping-config-check input[type="checkbox"] {
  margin: 0;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  accent-color: #0f766e;
}

.housekeeping-config-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "task note"
    "photo photo"
    "schedule schedule";
  gap: 8px;
}

.housekeeping-config-fields > input[name="task_text"] {
  grid-area: task;
}

.housekeeping-config-fields > input[name="guidance_note"] {
  grid-area: note;
}

.housekeeping-config-photo {
  grid-area: photo;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #f8fbff;
}

.housekeeping-photo-required {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: .82rem;
  color: #0f172a;
  white-space: nowrap;
}

.housekeeping-photo-required input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  accent-color: #0f766e;
}

.housekeeping-photo-min {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: .8rem;
  color: #334155;
  min-width: 0;
  white-space: nowrap;
}

.housekeeping-photo-min input[type="number"] {
  width: 72px;
  min-width: 72px;
  height: 34px;
  padding: 6px 8px;
  margin: 0;
}

.housekeeping-config-schedule {
  grid-area: schedule;
  display: grid;
  grid-template-columns: 180px 140px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.housekeeping-config-schedule label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  color: #64748b;
}

.housekeeping-weekday-picks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
}

.housekeeping-weekday-picks label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .76rem;
  color: #334155;
  border: 1px solid #d6dee8;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
}

.housekeeping-weekday-picks input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
}

.housekeeping-config-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 170px;
}

.housekeeping-config-actions button {
  width: auto;
  min-height: 30px;
  min-width: 64px;
  padding: 0 10px;
  font-size: .74rem;
  border-radius: 8px;
}

.housekeeping-config-add .housekeeping-config-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.housekeeping-add-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: .74rem;
  color: #64748b;
  white-space: nowrap;
}

.housekeeping-add-status.is-saving {
  color: #0369a1;
}

.housekeeping-add-status.is-success {
  color: #166534;
}

.housekeeping-add-status.is-error {
  color: #b91c1c;
}

.housekeeping-empty-slot {
  padding: 8px 2px;
}

.housekeeping-copy-panel {
  margin: 0 0 12px;
  border: 1px solid #d6dee8;
  background: #fbfdff;
}

.housekeeping-copy-panel > summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  list-style: none;
}

.housekeeping-copy-panel > summary::-webkit-details-marker {
  display: none;
}

.housekeeping-copy-panel-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.housekeeping-copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.housekeeping-copy-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d6dee8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.housekeeping-copy-option input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  accent-color: #0f766e;
}

.housekeeping-copy-option span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.housekeeping-copy-option strong,
.housekeeping-copy-option small {
  display: block;
  line-height: 1.25;
}

.housekeeping-copy-option strong {
  font-size: .84rem;
  color: #0f172a;
}

.housekeeping-copy-option small {
  font-size: .72rem;
  color: #64748b;
}

.housekeeping-copy-actions {
  display: flex;
  justify-content: flex-end;
}

.housekeeping-config-list[data-order-status]::before {
  content: attr(data-order-status);
  display: block;
  font-size: .75rem;
  margin: 2px 0 8px;
  color: #475569;
}

.housekeeping-config-list.is-order-saving::before {
  color: #0369a1;
}

.housekeeping-config-list.is-order-success::before {
  color: #166534;
}

.housekeeping-config-list.is-order-error::before {
  color: #b91c1c;
}

.housekeeping-advanced-wrap {
  display: grid;
  gap: 12px;
}

.housekeeping-preview-actions {
  margin-top: 8px;
}

#housekeeping-advanced .housekeeping-advanced-wrap {
  gap: 14px;
}

#housekeeping-advanced .section-head-row {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #f8fbff;
  align-items: center;
}

#housekeeping-advanced .section-head-row h2 {
  margin: 0 0 4px;
}

#housekeeping-advanced .section-head-row p {
  margin: 0;
}

#housekeeping-advanced .section-head-row .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

#housekeeping-advanced .section-head-row .actions form {
  margin: 0;
}

#housekeeping-advanced .section-head-row .actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
}

#housekeeping-advanced .housekeeping-inline-tools {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed #b9cadc;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#housekeeping-advanced .housekeeping-inline-tools input[type="file"] {
  flex: 1 1 380px;
  min-width: 220px;
}

#housekeeping-advanced .housekeeping-inline-tools button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

#housekeeping-advanced .table-scroll {
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #fff;
}

#housekeeping-advanced .housekeeping-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#housekeeping-advanced .housekeeping-preview-actions form {
  margin: 0;
}

#housekeeping-advanced .housekeeping-preview-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .housekeeping-checklist-preview {
    max-width: none;
  }

  .housekeeping-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .housekeeping-work-bars {
    grid-template-columns: 1fr;
  }

  .housekeeping-work-head {
    display: grid;
  }

  .housekeeping-config-row {
    grid-template-columns: 1fr;
  }

  .housekeeping-drag-handle,
  .housekeeping-drag-placeholder {
    display: none;
  }

  .housekeeping-config-fields {
    grid-template-columns: 1fr;
    grid-template-areas:
      "task"
      "note"
      "photo"
      "schedule";
  }

  .housekeeping-config-schedule {
    grid-template-columns: 1fr;
  }

  .housekeeping-config-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .housekeeping-copy-grid {
    grid-template-columns: 1fr 1fr;
  }

  .housekeeping-copy-actions {
    justify-content: stretch;
  }

  .housekeeping-copy-actions button {
    width: 100%;
  }

  .housekeeping-copy-option {
    padding: 8px 9px;
  }

  .housekeeping-copy-option strong {
    font-size: .8rem;
  }

  .housekeeping-check-row {
    grid-template-columns: 1fr;
  }

  .housekeeping-photo-uploader {
    margin-left: 0;
  }

  .housekeeping-photo-trigger {
    width: 100%;
    justify-content: center;
  }

  .housekeeping-photo-thumb {
    width: 52px;
    height: 52px;
  }

  #housekeeping-advanced .section-head-row {
    padding: 10px 12px;
  }

  #housekeeping-advanced .section-head-row .actions {
    width: 100%;
  }

  #housekeeping-advanced .section-head-row .actions form,
  #housekeeping-advanced .section-head-row .actions button {
    width: 100%;
  }

  #housekeeping-advanced .housekeeping-inline-tools {
    padding: 10px 12px;
  }

  #housekeeping-advanced .housekeeping-inline-tools input[type="file"],
  #housekeeping-advanced .housekeeping-inline-tools button {
    width: 100%;
    flex: 1 1 100%;
  }

  #housekeeping-advanced .housekeeping-preview-actions form,
  #housekeeping-advanced .housekeeping-preview-actions button {
    width: 100%;
  }
}

.location-check-simple-filters {
  margin: 14px 0 18px;
}

.location-check-simple-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.location-check-simple-filter-field {
  min-width: 180px;
  flex: 1 1 180px;
}

.location-check-simple-list {
  display: block;
  margin-top: 14px;
}

.location-check-simple-room {
  padding: 0;
  border-bottom: 0;
  margin: 0 0 22px;
}

.location-check-simple-room:last-child {
  margin-bottom: 0;
}

.location-check-simple-room-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.location-check-simple-item {
  margin: 0 0 6px;
}

.location-check-simple-item label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}

.location-check-simple-item input[type="checkbox"] {
  margin-top: 4px;
  flex: 0 0 auto;
}

.location-check-mobile-page {
  max-width: 980px;
}

.location-check-mobile-meta {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #d8e2ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fb 100%);
}

.location-check-mobile-meta p {
  margin: 0 0 4px;
}

/* ซ่อนปุ่มลัดชุดเก่าบนหน้าเช็ครวม หาก markup รุ่นก่อนยังค้างบน server */
.page-housekeeping_combined .location-check-mobile-meta .tab,
.page-housekeeping_combined .location-check-mobile-meta .tabs,
.page-housekeeping_combined .location-check-mobile-meta .tiny-btn,
.page-housekeeping_combined .location-check-mobile-meta .secondary,
.page-housekeeping_combined .location-check-mobile-meta a[href*="housekeeping_cleaner.php"],
.page-housekeeping_combined .location-check-mobile-meta a[href*="housekeeping_location_check.php"],
.page-housekeeping_combined .location-check-mobile-meta a[href*="housekeeping_green_cards.php"],
.page-housekeeping_combined .location-check-mobile-meta a[href*="housekeeping_combined.php"] {
  display: none !important;
}

.housekeeping-reviewer-pair-form {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.housekeeping-reviewer-pair-form label {
  display: grid;
  gap: 4px;
  min-width: 180px;
  font-size: .82rem;
  color: #475569;
}

.housekeeping-reviewer-pair-form select {
  min-width: 0;
}

.location-check-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #d8e2ec;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.location-check-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.page-housekeeping_reviewer .location-check-summary-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.page-housekeeping_reviewer .location-check-summary-box {
  padding: 8px 9px;
}

.page-housekeeping_reviewer .location-check-summary-label {
  font-size: .72rem;
}

.page-housekeeping_reviewer .location-check-summary-value {
  font-size: 1.02rem;
}

.location-check-summary-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f9fd;
  border: 1px solid #d8e2ec;
}

.location-check-summary-box.is-ok {
  background: #ecfdf3;
  border-color: #86efac;
}

.location-check-summary-box.is-warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.location-check-summary-box.is-danger {
  background: #fef2f2;
  border-color: #fca5a5;
}

.location-check-summary-box.is-compact {
  justify-self: start;
  width: 170px;
  max-width: 100%;
}

.location-check-summary-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.location-check-summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.location-check-card-state-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.location-check-card-state {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #c9d3df;
  padding: 14px 14px 12px;
  background: linear-gradient(160deg, #f8fafc 0%, #ecf2f8 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.location-check-card-state-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.location-check-card-state-link:visited {
  color: inherit;
}

.location-check-card-state::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}

.location-check-card-state::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(1px);
  pointer-events: none;
}

.location-check-card-state-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #334155;
  border: 1px solid rgba(51, 65, 85, 0.25);
  background: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
}

.location-check-card-state-title {
  position: relative;
  z-index: 1;
  font-size: .88rem;
  font-weight: 700;
  color: #0f172a;
}

.location-check-card-state.is-green {
  border-color: #16985b;
  background: linear-gradient(155deg, #effcf4 0%, #d6f3e3 100%);
  box-shadow: 0 10px 24px rgba(22, 152, 91, 0.25);
}

.location-check-card-state.is-red {
  border-color: #cf4d4d;
  background: linear-gradient(155deg, #fff4f4 0%, #ffdede 100%);
  box-shadow: 0 10px 24px rgba(207, 77, 77, 0.2);
}

.location-check-card-state.card-1.is-green {
  transform: translateY(-1px);
}

.location-check-card-state.card-2.is-green {
  transform: translateY(-1px);
}

.location-check-progress {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cde4db;
  background: linear-gradient(180deg, #f0fff8 0%, #e7faf2 100%);
}

.location-check-progress-copy {
  font-size: 1rem;
  font-weight: 700;
  color: #14532d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.location-check-progress-copy strong {
  font-size: 1.35rem;
  font-weight: 900;
  color: #065f46;
  line-height: 1;
}

.location-check-progress-meta {
  color: #0f766e;
  font-size: .9rem;
  font-weight: 700;
}

.location-check-progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #d8e7dc;
  border: 1px solid #bfd3c5;
  overflow: hidden;
}

.location-check-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0%, #0f766e 100%);
  box-shadow: 0 0 10px rgba(15, 118, 110, 0.35);
  transition: width 0.2s ease;
}

.location-check-mobile-room {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #d8e2ec;
  border-left: 4px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
}

.location-check-mobile-room.ready {
  border-left-color: #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf8 100%);
}

.location-check-mobile-room.partial {
  border-left-color: #d97706;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf1 100%);
}

.location-check-mobile-room.pending {
  border-left-color: #c2410c;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f5 100%);
}

.location-check-mobile-room-title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
}

.location-check-mobile-room-status {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.combined-room-block {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
}

.combined-room-block:last-child {
  margin-bottom: 0;
}

.combined-room-block-title {
  margin: 0 0 8px;
  font-size: .86rem;
  font-weight: 700;
  color: #0f172a;
}

.location-check-mobile-item {
  margin: 0 0 8px;
}

.location-check-mobile-item.is-saving {
  opacity: .92;
}

.housekeeping-save-badge {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-size: .7rem;
  line-height: 1.1;
  white-space: nowrap;
  vertical-align: middle;
}

.housekeeping-review-item .housekeeping-save-badge {
  margin-left: 6px;
}

.housekeeping-save-badge.is-idle {
  display: none;
}

.housekeeping-save-badge.is-saving {
  display: inline-flex;
  color: #0f766e;
}

.housekeeping-save-badge.is-success {
  display: inline-flex;
  color: #166534;
}

.housekeeping-save-badge.is-error {
  display: inline-flex;
  color: #b91c1c;
}

.housekeeping-upload-progress {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.housekeeping-upload-progress.is-idle {
  display: none;
}

.housekeeping-upload-progress.is-active {
  display: inline-flex;
}

.housekeeping-upload-progress-track {
  width: 74px;
  height: 6px;
  border-radius: 999px;
  background: #dbe7e5;
  overflow: hidden;
}

.housekeeping-upload-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e 0%, #22c55e 100%);
  transition: width .18s linear;
}

.housekeeping-upload-progress-text {
  font-size: .68rem;
  color: #0f766e;
  white-space: nowrap;
}

.housekeeping-save-spinner {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1.6px solid rgba(15, 118, 110, 0.3);
  border-top-color: #0f766e;
  animation: housekeepingSpin .8s linear infinite;
}

@keyframes housekeepingSpin {
  to {
    transform: rotate(360deg);
  }
}

.housekeeping-photo-uploader {
  margin: 6px 0 0 28px;
  display: grid;
  gap: 6px;
}

.housekeeping-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.housekeeping-photo-trigger {
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: .76rem;
}

.housekeeping-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.housekeeping-photo-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d6dee8;
  background: #f8fafc;
}

.housekeeping-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.housekeeping-photo-thumb.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.housekeeping-photo-thumb-fallback {
  font-size: .6rem;
  line-height: 1.2;
  color: #475569;
  text-align: center;
  word-break: break-word;
}

.housekeeping-photo-remove {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-height: 18px;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #b91c1c;
  font-size: .62rem;
  line-height: 1;
}

.housekeeping-photo-meta {
  font-size: .78rem;
}

.location-check-mobile-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  line-height: 1.55;
}

.location-check-mobile-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.location-check-mobile-text {
  display: block;
  flex: 1 1 auto;
  word-break: break-word;
}

.location-check-mobile-text-main {
  display: inline;
}

.housekeeping-review-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  line-height: 1;
  font-size: 1rem;
}

.housekeeping-review-mark.is-pass {
  border-color: #86efac;
  background: #ecfdf3;
}

.housekeeping-review-mark.is-fail {
  border-color: #fca5a5;
  background: #fef2f2;
  cursor: pointer;
}

.housekeeping-review-mark.is-empty {
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.housekeeping-review-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.housekeeping-review-row-head .location-check-mobile-text-main {
  flex: 1 1 auto;
  min-width: 0;
}

.housekeeping-review-text-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.housekeeping-review-text-inline .location-check-mobile-text-main {
  flex: 0 1 auto;
  min-width: 0;
}

.housekeeping-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.housekeeping-review-actions.is-inline {
  gap: 6px;
  flex: 0 0 auto;
}

.housekeeping-review-actions.is-end {
  margin-left: auto;
}

.housekeeping-review-action-divider {
  color: #94a3b8;
  font-size: .76rem;
  line-height: 1;
  user-select: none;
}

.housekeeping-review-action-divider.is-hidden {
  display: none;
}

.housekeeping-review-action-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  line-height: 1;
  font-size: .92rem;
  cursor: pointer;
}

.housekeeping-review-action-btn.is-selected {
  border-color: #86efac;
  background: #ecfdf3;
}

.housekeeping-review-action-btn.housekeeping-review-fail.is-selected {
  border-color: #fca5a5;
  background: #fef2f2;
}

.housekeeping-review-action-btn.is-hidden {
  display: none;
}

.housekeeping-review-action-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.housekeeping-review-photo-view {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  line-height: 1;
  font-size: .82rem;
  cursor: pointer;
}

.housekeeping-review-photo-view.is-hidden {
  display: none;
}

.housekeeping-review-photo-view.is-empty {
  opacity: .45;
  border-color: #e2e8f0;
}

.housekeeping-review-photo-view:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.housekeeping-cleaner-photo-btn {
  margin-left: 2px;
}

/* Keep housekeeping checklist controls compact even when ios2027 theme styles all inputs/buttons. */
body.ui-style-ios2027 .location-check-mobile-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  line-height: 1.5;
}

body.ui-style-ios2027 .location-check-mobile-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

body.ui-style-ios2027 .location-check-mobile-text-main {
  display: inline;
  line-height: 1.45;
}

body.ui-style-ios2027 .location-check-mobile-checkbox,
body.ui-style-ios2027 .housekeeping-cleaner-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  margin: 2px 0 0;
  border-radius: 4px;
  border: 1px solid #7f8ea3;
  background: #fff;
  box-shadow: none;
  vertical-align: top;
}

body.ui-style-ios2027 .housekeeping-review-mark,
body.ui-style-ios2027 .housekeeping-review-photo-view,
body.ui-style-ios2027 .housekeeping-review-action-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  margin-left: 2px;
  border-radius: 999px;
  box-shadow: none;
  line-height: 1;
  font-size: .9rem;
}

body.ui-style-ios2027 .housekeeping-review-mark.is-pass,
body.ui-style-ios2027 .housekeeping-review-action-btn.housekeeping-review-pass.is-selected {
  background: #ecfdf3;
  border-color: #86efac;
}

body.ui-style-ios2027 .housekeeping-review-mark.is-fail,
body.ui-style-ios2027 .housekeeping-review-action-btn.housekeeping-review-fail {
  background: #fef2f2;
  border-color: #fca5a5;
}

body.ui-style-ios2027 .housekeeping-review-photo-view {
  background: #fff;
  border-color: #cbd5e1;
}

/* Lock cleaner checklist visual back to compact legacy layout under iOS2027. */
body.ui-style-ios2027.page-housekeeping_cleaner .location-check-mobile-item {
  margin: 0 0 8px !important;
}

body.ui-style-ios2027.page-housekeeping_cleaner .location-check-mobile-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  line-height: 1.45 !important;
}

body.ui-style-ios2027.page-housekeeping_cleaner .location-check-mobile-text {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
}

body.ui-style-ios2027.page-housekeeping_cleaner .location-check-mobile-text-main {
  display: inline !important;
  line-height: 1.45 !important;
}

body.ui-style-ios2027.page-housekeeping_cleaner .location-check-mobile-checkbox,
body.ui-style-ios2027.page-housekeeping_cleaner .housekeeping-cleaner-checkbox {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

body.ui-style-ios2027.page-housekeeping_cleaner .housekeeping-review-mark,
body.ui-style-ios2027.page-housekeeping_cleaner .housekeeping-review-photo-view,
body.ui-style-ios2027.page-housekeeping_cleaner .housekeeping-review-action-btn,
body.ui-style-ios2027.page-housekeeping_cleaner .housekeeping-cleaner-photo-btn {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 !important;
  margin-left: 2px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  line-height: 1 !important;
  transform: none !important;
}

.housekeeping-review-hint {
  margin: 0;
  font-size: .78rem;
}

.housekeeping-fail-popup-card {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #fff7e6 100%);
}

.housekeeping-review-photo-popup-card {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
}

.housekeeping-fail-popup-card textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
}

.housekeeping-fail-popup-hint {
  color: #92400e;
  font-size: .82rem;
}

.housekeeping-fail-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.housekeeping-fail-popup-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.housekeeping-fail-note {
  color: #9a3412 !important;
}

.housekeeping-fail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.housekeeping-fail-section {
  display: grid;
  gap: 6px;
}

.housekeeping-fail-section-title {
  margin: 0;
  font-weight: 700;
  color: #9f1239;
  text-align: center;
}

.housekeeping-fail-images img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  object-fit: cover;
  background: #fff;
}

.housekeeping-fail-image-thumb {
  cursor: zoom-in;
}

.housekeeping-image-view-popup-card {
  width: min(94vw, 760px);
}

.housekeeping-image-view-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.housekeeping-image-view-wrap img {
  max-width: 100%;
  max-height: min(72vh, 640px);
  border-radius: 12px;
  border: 1px solid #dbe4ee;
  object-fit: contain;
  background: #fff;
}

.location-check-mobile-empty {
  margin: 0;
  color: var(--muted);
}

.housekeeping-complete-popup {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.housekeeping-complete-popup.open {
  opacity: 1;
  pointer-events: auto;
}

.housekeeping-complete-popup-card {
  width: min(92vw, 420px);
  border-radius: 16px;
  border: 1px solid #8ad4a8;
  background: linear-gradient(180deg, #f3fff7 0%, #e8fbef 100%);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
  padding: 18px 16px 14px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.housekeeping-complete-popup-card h3 {
  margin: 0;
  color: #166534;
  font-size: 1.14rem;
  line-height: 1.35;
}

.housekeeping-complete-popup-card p {
  margin: 0;
  color: #14532d;
  font-size: .98rem;
  line-height: 1.45;
}

.housekeeping-complete-popup-card button {
  justify-self: center;
  min-width: 90px;
}

@media (max-width: 700px) {
  body.page-location_checks .container {
    max-width: none;
  }

  .location-check-simple-filter-row {
    display: block;
  }

  .location-check-simple-filter-field {
    margin-bottom: 10px;
  }

  .location-check-simple-item label {
    white-space: normal;
  }

  .location-check-mobile-page {
    max-width: none;
  }

  .location-check-summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-housekeeping_reviewer .location-check-summary-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .page-housekeeping_reviewer .location-check-summary-label {
    font-size: .62rem;
  }

  .page-housekeeping_reviewer .location-check-summary-value {
    font-size: .84rem;
  }

  .location-check-summary-box.is-compact {
    width: 100%;
    justify-self: stretch;
  }

  .location-check-card-state-row {
    grid-template-columns: 1fr;
  }

  .location-check-mobile-room {
    margin-bottom: 18px;
    padding: 12px 14px;
  }

  .combined-room-block {
    padding: 9px 10px;
  }

  .location-check-mobile-room-title {
    margin-bottom: 8px;
    font-size: 0.98rem;
  }

  .location-check-mobile-label {
    gap: 12px;
    line-height: 1.6;
  }

  .housekeeping-reviewer-pair-form {
    flex-direction: column;
    align-items: stretch;
  }

  .housekeeping-reviewer-pair-form label {
    min-width: 0;
  }

  .housekeeping-review-actions {
    gap: 6px;
  }

  .housekeeping-review-actions.is-inline {
    width: auto;
  }

  .housekeeping-review-action-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
  }

  .location-check-mobile-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 1px;
  }

  .housekeeping-complete-popup {
    padding: 14px;
  }

  .housekeeping-complete-popup-card {
    width: 100%;
    padding: 16px 14px 12px;
  }
}

.location-inline-editor summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f766e;
}

.location-inline-editor summary::-webkit-details-marker {
  display: none;
}

.location-rule-card {
  padding: 18px;
}

.location-rule-item {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #d6dee8;
  border-radius: 16px;
  background: #fbfdff;
}

.location-rule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.location-rule-fields label,
.location-check-item-fields label {
  display: grid;
  gap: 4px;
  font-size: .82rem;
  color: #607086;
}

.location-check-card {
  padding: 18px;
}

.location-check-item {
  border: 1px solid #d6dee8;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fbfdff;
}

.location-check-item.issue {
  background: #fff7ed;
}

.location-check-item.ready {
  background: #f0fdf4;
}

.location-check-item-fields {
  display: grid;
  grid-template-columns: 160px 150px minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}

.location-check-ready-toggle {
  align-self: center;
}

.location-check-item-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

body.theme-dark .location-center-form-card,
body.theme-dark .location-center-filter-bar,
body.theme-dark .location-center-story-item,
body.theme-dark .location-admin-panel,
body.theme-dark .location-visual-card,
body.theme-dark .location-point-card,
body.theme-dark .location-room-card,
body.theme-dark .location-room-browser,
body.theme-dark .location-room-browser-item,
body.theme-dark .location-room-focus,
body.theme-dark .location-check-card,
body.theme-dark .location-rule-card,
body.theme-dark .location-rule-item,
body.theme-dark .location-check-item {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .location-center-story-text,
body.theme-dark .location-center-inline-note,
body.theme-dark .location-visual-sub,
body.theme-dark .location-point-code,
body.theme-dark .location-point-note,
body.theme-dark .location-room-story,
body.theme-dark .location-rule-story {
  color: #cbd5e1;
}

body.theme-dark .location-admin-panel summary,
body.theme-dark .location-inline-editor summary {
  background: #0f172a;
  color: #e2e8f0;
}

body.theme-dark .location-visual-stats span,
body.theme-dark .location-point-meta span,
body.theme-dark .location-check-helper,
body.theme-dark .location-check-last {
  background: #122033;
  color: #d4e0ef;
}

body.theme-dark .location-visual-shortage-item {
  background: #3b2c12;
  color: #fde68a;
}

body.theme-dark .location-room-browser-item.active {
  background: linear-gradient(180deg, rgba(19, 33, 50, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: #47627f;
}

body.theme-dark .location-room-browser-tab {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.theme-dark .location-room-browser-tab.active {
  background: #132132;
  border-color: #47627f;
}

body.theme-dark .location-room-browser-main span,
body.theme-dark .location-room-browser-meta {
  color: #cbd5e1;
}

body.theme-dark .location-check-simple-room {
  border-bottom-color: #334155;
}

@media (max-width: 1100px) {
  .location-center-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .location-center-overview-grid,
  .location-center-filter-grid,
  .location-visual-grid,
  .location-point-grid,
  .location-room-grid,
  .location-check-grid {
    grid-template-columns: 1fr;
  }

  .location-room-layout {
    grid-template-columns: 1fr;
  }

  .location-room-browser {
    position: static;
  }

  .location-room-browser-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .location-rule-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .entity-help-modal {
    width: calc(100vw - 18px);
  }

  .entity-help-modal-head,
  .entity-help-copy {
    padding-left: 14px;
    padding-right: 14px;
  }

  .location-center-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .location-check-item-fields,
  .location-rule-fields {
    grid-template-columns: 1fr;
  }

  .location-center-table {
    width: 100%;
  }

  .location-center-table thead {
    display: none;
  }

  .location-center-table,
  .location-center-table tbody,
  .location-center-table tr,
  .location-center-table td {
    display: block;
    width: 100%;
  }

  .location-center-table tr {
    margin: 0 0 12px;
    border: 1px solid #d6dee8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .location-center-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px dashed #d6dee8;
    text-align: right;
  }

  .location-center-table td:last-child {
    border-bottom: 0;
  }

  .location-center-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    color: var(--muted);
    font-weight: 700;
  }

  .location-center-table td input,
  .location-center-table td select,
  .location-center-table td textarea {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .assets-center-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .asset-record-grid {
    grid-template-columns: 1fr;
  }

  .assets-center-filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .asset-meta-list {
    grid-template-columns: 1fr;
  }

  .asset-file-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .asset-file-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .assets-center-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assets-center-filter-grid {
    grid-template-columns: 1fr;
  }

  .asset-form-card .grid {
    gap: 12px;
  }

  .asset-record-head {
    flex-direction: column;
  }

  .asset-preview-image,
  .asset-file-thumb {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 520px) {
  .assets-center-summary-grid {
    grid-template-columns: 1fr;
  }
}

.confirm-row-pin strong {
  display: block;
}

.confirm-row-pin input {
  width: 100%;
  min-height: 40px;
}

.confirm-error {
  margin-top: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .9rem;
  min-height: 18px;
}

.pin-verify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.pin-status {
  font-size: .9rem;
  min-height: 20px;
}

.pin-status.info {
  color: #1f4f82;
}

.pin-status.success {
  color: #166534;
}

.pin-status.error {
  color: #b91c1c;
}

.pm-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.issue-line-items {
  display: grid;
  gap: 10px;
}

.issue-line-item {
  position: relative;
  z-index: 1;
  border: 1px solid #d8e2ec;
  border-radius: 12px;
  padding: 10px;
  background: #fbfdff;
}

.issue-line-item.issue-line-item-active {
  z-index: 40;
}

.issue-line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px;
  align-items: start;
}

.issue-line-field {
  min-width: 0;
}

.issue-line-field-item {
  position: relative;
}

.issue-line-field .issue_item_lookup,
.issue-line-field .issue_quantity {
  width: 100%;
}

.issue-item-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 220;
  margin-top: 0;
  border: 1px solid #c9d8e6;
  border-radius: 10px;
  background: #ffffff;
  max-height: min(260px, 42vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.issue-item-suggestion {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  cursor: pointer;
  touch-action: pan-y;
}

.issue-item-suggestion:last-child {
  border-bottom: 0;
}

.issue-item-suggestion-title {
  color: #0f172a;
  font-weight: 600;
}

.issue-item-suggestion-detail {
  color: #64748b;
  font-size: .84rem;
}

.issue-item-suggestion-empty {
  padding: 10px;
  color: #64748b;
  font-size: .9rem;
}

/* Restore legacy usable controls for issue page under ios2027 theme. */
body.page-issue .issue-line-field .issue_item_lookup,
body.page-issue .issue-line-field .issue_quantity {
  min-height: 40px;
}

body.ui-style-ios2027.page-issue .issue-item-suggestions {
  background: #fff !important;
  border: 1px solid #c9d8e6 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12) !important;
  overflow: auto !important;
}

body.ui-style-ios2027.page-issue .issue-item-suggestion {
  min-height: 0 !important;
  width: 100% !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf2f7 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  transform: none !important;
}

body.ui-style-ios2027.page-issue .issue-item-suggestion:hover,
body.ui-style-ios2027.page-issue .issue-item-suggestion:focus {
  background: #f1f7ff;
}

body.ui-style-ios2027.page-issue .issue-item-suggestion:last-child {
  border-bottom: 0 !important;
}

body.ui-style-ios2027.page-issue .issue-item-suggestion-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.ui-style-ios2027.page-issue .issue-item-suggestion-detail {
  color: #64748b !important;
}

.issue-line-field-qty .issue-remove-line {
  margin-top: 8px;
}

.issue-add-line {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f766e;
  font-weight: 700;
  cursor: pointer;
}

.issue-add-line:hover,
.issue-add-line:focus {
  color: #0b5f59;
  text-decoration: underline;
}

body.ui-style-ios2027.page-issue .issue-add-line {
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f766e !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
  transform: none !important;
}

body.ui-style-ios2027.page-receive .issue-add-line {
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f766e !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
  transform: none !important;
}

body.ui-style-ios2027.page-receive .issue-add-line:hover,
body.ui-style-ios2027.page-receive .issue-add-line:focus {
  color: #0b5f59 !important;
  text-decoration: underline;
}

.receive-inline-field {
  display: grid;
  gap: 4px;
}

.receive-inline-field-price {
  margin-top: 4px;
}

.receive-inline-label {
  font-size: .78rem;
  font-weight: 700;
  color: #526579;
}

body.ui-style-ios2027.page-receive .receive_unit_price {
  min-height: 40px !important;
}

body.ui-style-ios2027.page-issue .issue-add-line:hover,
body.ui-style-ios2027.page-issue .issue-add-line:focus {
  color: #0b5f59;
  text-decoration: underline;
}

body.ui-style-ios2027.page-issue .issue-line-field-qty .issue-remove-line {
  width: auto !important;
  min-height: 32px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transform: none !important;
}

.issue-shortcuts {
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.issue-shortcuts-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.issue-shortcuts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.issue-shortcut-chip {
  min-height: 0;
  width: auto;
  max-width: 100%;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.issue-shortcut-title {
  display: block;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issue-shortcut-meta {
  display: inline-flex;
  font-size: .78rem;
  color: #64748b;
  white-space: nowrap;
  flex: 0 0 auto;
}

body.ui-style-ios2027.page-issue .issue-shortcut-chip {
  min-height: 0 !important;
  width: auto !important;
  max-width: min(100%, 360px) !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a !important;
  border: 1px solid #d6dee8 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027.page-issue .issue-shortcut-chip:hover,
body.ui-style-ios2027.page-issue .issue-shortcut-chip:focus {
  background: #f1f7ff !important;
  border-color: #8fb7de !important;
}

.issue-history-wrap {
  margin-top: 12px;
}

.issue-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.issue-history-item {
  border: 1px solid #d8e2ec;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.issue-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.issue-history-head strong {
  color: #0f172a;
  font-size: .98rem;
}

.issue-history-meta {
  color: #334155;
  font-size: .88rem;
}

@media (max-width: 640px) {
  .issue-history-grid {
    grid-template-columns: 1fr;
  }

  .issue-shortcuts-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .issue-shortcut-chip {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  .issue-shortcut-title {
    font-size: .95rem;
  }

  .issue-shortcut-meta {
    font-size: .75rem;
  }

  .issue-line-grid {
    grid-template-columns: 1fr;
  }

  .issue-item-suggestions {
    max-height: min(240px, 38vh);
  }

  .pin-verify-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Housekeeping month summary */
.hk-month-header-card {
  border: 1px solid #c8e6b6;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .42), transparent 36%),
    linear-gradient(180deg, #f3ffe2 0%, #e4f7c9 52%, #d2efae 100%);
  box-shadow: 0 10px 26px rgba(52, 97, 33, .16);
}

.hk-month-header-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hk-month-header-card .inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hk-month-summary-grid .status-card .kpi-label strong {
  color: #0f172a;
}

.hk-month-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hk-month-summary-strip .status-card {
  margin-bottom: 0;
  flex: 0 0 auto;
  width: fit-content;
  min-width: 320px;
  border: 1px solid #ead78f;
  background:
    linear-gradient(180deg, #fff6d6 0%, #fef1c8 50%, #fde8a1 100%);
  box-shadow: 0 6px 16px rgba(141, 106, 14, .14);
}

.hk-month-day-list {
  display: grid;
  gap: 10px;
}

.hk-month-day-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.hk-month-day-index {
  border: 1px solid #bfe0a5;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0ffe4 0%, #e0f4cb 100%);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 8px 6px;
}

.hk-month-day-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.hk-month-day-weekday {
  margin-top: 6px;
  font-size: .84rem;
  color: #64748b;
  font-weight: 700;
}

.hk-month-day-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hk-month-status-card {
  border: 1px solid #d9d6be;
  border-radius: 12px;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 248, 214, .8), transparent 42%),
    linear-gradient(180deg, #fffdf5 0%, #f8f3df 100%);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
  width: fit-content;
  min-width: 280px;
  max-width: 100%;
}

.hk-month-status-title {
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
}

.hk-month-status-money {
  font-size: 1.04rem;
  font-weight: 800;
  color: #0f172a;
}

.hk-month-status-meta {
  font-size: .84rem;
  color: #475569;
}

.hk-month-status-card.is-green {
  border-color: #7cc88a;
  background: linear-gradient(180deg, #ebffed 0%, #dff8df 100%);
}

.hk-month-status-card.is-green .hk-month-status-title,
.hk-month-status-card.is-green .hk-month-status-money {
  color: #166534;
}

.hk-month-status-card.is-yellow {
  border-color: #f8d88f;
  background: linear-gradient(180deg, #fff9e8 0%, #ffefc8 100%);
}

.hk-month-status-card.is-yellow .hk-month-status-title,
.hk-month-status-card.is-yellow .hk-month-status-money {
  color: #92400e;
}

.hk-month-status-card.is-red {
  border-color: #f4b4b4;
  background: linear-gradient(180deg, #fff0f0 0%, #ffe1e1 100%);
}

.hk-month-status-card.is-red .hk-month-status-title,
.hk-month-status-card.is-red .hk-month-status-money {
  color: #9f1239;
}

.hk-month-status-card.is-neutral {
  border-color: #d8e2ec;
  background: #f8fafc;
}

@media (max-width: 960px) {
  .hk-month-day-row {
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: stretch;
  }

  .hk-month-day-index {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    justify-content: center;
    justify-items: center;
    gap: 2px;
    min-height: 100%;
    padding: 8px 4px;
  }

  .hk-month-day-cards {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hk-month-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hk-month-summary-strip .status-card {
    min-width: 0;
    width: 100%;
  }

  .hk-month-status-card {
    min-width: 0;
    width: 100%;
    padding: 9px 10px;
  }

  .hk-month-status-title {
    font-size: .84rem;
  }

  .hk-month-status-money {
    font-size: .95rem;
  }

  .hk-month-status-meta {
    font-size: .77rem;
  }
}

@media (max-width: 420px) {
  .hk-month-day-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px;
  }

  .hk-month-day-cards,
  .hk-month-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .hk-month-status-card {
    padding: 8px;
  }

  .hk-month-day-number {
    font-size: 1.2rem;
  }

  .hk-month-day-weekday {
    font-size: .74rem;
  }
}

/* ปฏิทินงานแม่บ้าน */
.hk-cal-header {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.hk-cal-title-wrap h1 {
  margin: 0;
  font-size: 1.5rem;
}

.hk-cal-title-wrap p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hk-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hk-cal-month-label {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d0dce8;
  background: #f8fbff;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  color: #1f3347;
}

.hk-cal-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hk-cal-filters label {
  display: grid;
  gap: 4px;
  font-size: .88rem;
  color: #475569;
}

.hk-cal-filters select {
  min-width: 190px;
}

.hk-cal-search {
  min-width: 280px;
}

.hk-cal-search input {
  min-width: 240px;
}

.hk-cal-search-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.hk-cal-search-actions .tab {
  min-width: 116px;
  justify-content: center;
  white-space: nowrap;
}

.hk-cal-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.hk-legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid #d3dce6;
  padding: 4px 10px;
  font-size: .83rem;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  cursor: pointer;
  transition: all .16s ease;
}

.hk-legend-item:hover {
  transform: translateY(-1px);
}

.hk-legend-item.is-active {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .14);
}

.hk-legend-item.all {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.hk-legend-item.daily {
  border-color: #bfd9ff;
  background: #eaf4ff;
  color: #1d4d8b;
}

.hk-legend-item.every_days {
  border-color: #bbe8d0;
  background: #ecfbf2;
  color: #1d6a44;
}

.hk-legend-item.weekly {
  border-color: #e5c1f9;
  background: #f9efff;
  color: #7b2cb3;
}

.hk-legend-item.monthly {
  border-color: #ffd4a9;
  background: #fff5e9;
  color: #9a4a00;
}

.hk-cal-board {
  overflow-x: auto;
}

.hk-cal-weekdays,
.hk-cal-grid {
  min-width: 1050px;
}

.hk-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.hk-cal-weekdays > div {
  background: #f2f6fa;
  border: 1px solid #d6e0ea;
  border-radius: 10px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: #3d556f;
}

.hk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.hk-cal-day {
  border: 1px solid #d7e1ea;
  border-radius: 12px;
  background: #fff;
  min-height: 170px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.hk-cal-day.is-out-month {
  background: #f8fafc;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-month-label {
  background: #ffffff !important;
  border-color: #ced9e4 !important;
  color: #1f3347 !important;
  box-shadow: none !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-weekdays > div {
  background: #f5f8fc !important;
  border-color: #d6e0ea !important;
  color: #3d556f !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-day {
  background: #ffffff !important;
  border-color: #d7e1ea !important;
  box-shadow: none !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-day.is-out-month {
  background: #f8fafc !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-day-add {
  min-width: 32px !important;
  min-height: 32px !important;
  background: #ffffff !important;
  color: #0f5f58 !important;
  border: 1px solid #cfe0dd !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event {
  box-shadow: none !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event.mode-daily {
  background: #eff6ff !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event.mode-every_days {
  background: #ecfdf5 !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event.mode-weekly {
  background: #f8f0ff !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event.mode-monthly {
  background: #fffbeb !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event-open {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #1f3347 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-event-meta {
  color: #617891 !important;
}

body.ui-style-ios2027.page-housekeeping_calendar .hk-cal-empty {
  color: #94a3b8 !important;
}

.hk-cal-day.is-drop-target {
  border-color: #3aa27b;
  box-shadow: 0 0 0 2px rgba(58, 162, 123, .2);
}

.hk-cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hk-cal-day-head strong {
  font-size: 1.05rem;
  color: #1f3347;
}

.hk-cal-day-add {
  border: 1px solid #c7d4e2;
  background: #fff;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
  color: #1f3347;
  font-weight: 700;
  line-height: 1;
}

.hk-cal-day-events {
  display: grid;
  gap: 6px;
  align-content: start;
}

.hk-cal-empty {
  color: #94a3b8;
  font-size: .82rem;
}

.hk-cal-event {
  border: 1px solid #d5e2ef;
  border-left-width: 4px;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px 7px;
  display: block;
  cursor: grab;
}

.hk-cal-event.is-dragging {
  opacity: .55;
}

.hk-cal-event.mode-daily {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.hk-cal-event.mode-every_days {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.hk-cal-event.mode-weekly {
  border-left-color: #a855f7;
  background: #f8f0ff;
}

.hk-cal-event.mode-monthly {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.hk-cal-event-title {
  font-size: .86rem;
  font-weight: 700;
  color: #1f3347;
  line-height: 1.2;
}

.hk-cal-event-meta {
  margin-top: 4px;
  font-size: .74rem;
  color: #617891;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-cal-event-open {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: .86rem;
  font-weight: 700;
  color: #1f3347;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-cal-event-open:hover {
  text-decoration: underline;
}

.hk-cal-board.is-drag-locked .hk-cal-event {
  cursor: default;
}

.hk-cal-board.is-drag-locked .hk-cal-event-open {
  cursor: pointer;
}

.hk-cal-dialog {
  width: min(680px, calc(100vw - 24px));
  border: 1px solid #cad8e6;
  border-radius: 14px;
  padding: 0;
}

.hk-cal-dialog::backdrop {
  background: rgba(15, 23, 42, .45);
}

.hk-cal-dialog-form {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.hk-cal-dialog-form h3 {
  margin: 0;
  font-size: 1.14rem;
}

.hk-cal-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hk-cal-dialog-grid label,
.hk-cal-dialog-grid fieldset {
  display: grid;
  gap: 4px;
}

.hk-cal-dialog-grid label {
  font-size: .88rem;
  color: #4b5f74;
}

.hk-cal-dialog-grid .full {
  grid-column: 1 / -1;
}

.hk-cal-dialog-grid fieldset {
  border: 1px solid #d2deea;
  border-radius: 10px;
  padding: 8px;
}

.hk-cal-dialog-grid fieldset legend {
  padding: 0 4px;
  font-size: .82rem;
  color: #4b5f74;
}

.hk-cal-weekday-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hk-cal-weekday-pills label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.hk-cal-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.hk-cal-dialog-actions .danger {
  border-color: #f3b9b9;
  background: #fff3f3;
  color: #b42318;
}

.hk-cal-task-preview {
  border: 1px solid #d7e3ee;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px 12px;
}

.hk-cal-task-title {
  font-size: 1rem;
  font-weight: 800;
  color: #1f3347;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-cal-task-meta {
  margin-top: 4px;
  font-size: .86rem;
  color: #5f748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-cal-inline-status {
  min-height: 20px;
  margin: 0;
  font-size: .86rem;
}

.hk-cal-inline-status.is-saving {
  color: #0f766e;
}

.hk-cal-inline-status.is-success {
  color: #166534;
}

.hk-cal-inline-status.is-error {
  color: #b91c1c;
}

.hk-cal-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  background: rgba(15, 23, 42, .94);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .88rem;
  font-weight: 700;
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.hk-cal-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.ui-style-ios2027.theme-dark input,
body.ui-style-ios2027.theme-dark select,
body.ui-style-ios2027.theme-dark textarea {
  background: rgba(14, 26, 40, 0.82);
  color: var(--ff-text);
  border-color: var(--ff-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.ui-style-ios2027.theme-dark .card {
  box-shadow: var(--ff-shadow-md);
}

body.ui-style-ios2027.theme-dark .tabs {
  background: rgba(11, 20, 31, 0.62);
  border-color: rgba(134, 163, 184, 0.16);
}

body.ui-style-ios2027.theme-dark .tab,
body.ui-style-ios2027.theme-dark .nav-hamburger,
body.ui-style-ios2027.theme-dark .nav-hamburger {
  background: rgba(14, 26, 40, 0.8);
  color: var(--ff-text);
  border-color: rgba(134, 163, 184, 0.18);
}

body.ui-style-ios2027.theme-dark .nav-submenu {
  background: rgba(11, 20, 31, 0.88);
  border-color: rgba(134, 163, 184, 0.16);
}

@media (prefers-color-scheme: dark) {
  body.ui-style-ios2027.theme-auto input,
  body.ui-style-ios2027.theme-auto select,
  body.ui-style-ios2027.theme-auto textarea {
    background: rgba(14, 26, 40, 0.82);
    color: var(--ff-text);
    border-color: var(--ff-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  body.ui-style-ios2027.theme-auto .card {
    box-shadow: var(--ff-shadow-md);
  }

  body.ui-style-ios2027.theme-auto .tabs {
    background: rgba(11, 20, 31, 0.62);
    border-color: rgba(134, 163, 184, 0.16);
  }

  body.ui-style-ios2027.theme-auto .tab,
  body.ui-style-ios2027.theme-auto .nav-hamburger {
    background: rgba(14, 26, 40, 0.8);
    color: var(--ff-text);
    border-color: rgba(134, 163, 184, 0.18);
  }

  body.ui-style-ios2027.theme-auto .nav-submenu {
    background: rgba(11, 20, 31, 0.88);
    border-color: rgba(134, 163, 184, 0.16);
  }
}

@media (max-width: 980px) {
  .hk-cal-weekdays,
  .hk-cal-grid {
    min-width: 820px;
  }

  .hk-cal-day {
    min-height: 150px;
  }

  .hk-cal-dialog-grid {
    grid-template-columns: 1fr;
  }
}
