:root {
  color-scheme: light;
  --bg: #f4efe6;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf9;
  --topbar-surface: #f7f1e7;
  --ink: #1f2a1f;
  --muted: #5f6f64;
  --brand: #123524;
  --brand-soft: #d8e8da;
  --accent: #d9702b;
  --danger: #b5382f;
  --border: rgba(18, 53, 36, 0.14);
  --shadow: 0 24px 80px rgba(38, 46, 35, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --topbar-height: 104px;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 112, 43, 0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(18, 53, 36, 0.14), transparent 24%),
    linear-gradient(180deg, #f8f2e8 0%, #ece7db 100%);
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-height) + 36px);
  background: var(--bg);
  z-index: 900;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.app-shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 20px) 0 56px;
}

.panel,
.workspace-card,
.stat-card {
  backdrop-filter: blur(14px);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1380px, calc(100vw - 32px));
  background: var(--topbar-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.panel,
.workspace-card {
  padding: 24px;
}

.brand-block,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-row,
.topbar-menu-panel {
  display: flex;
  align-items: center;
}

.topbar-row {
  flex: 0 0 auto;
}

.topbar-menu-panel {
  flex: 1;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.brand-home-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.topbar {
  gap: 18px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.topbar-menu-panel > .topbar-actions:only-child {
  margin-left: auto;
}

.topbar-install-button {
  display: none;
}

.topbar-nav-button,
.mypage-link {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(18, 53, 36, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  font-weight: 700;
}

.topbar-nav-button.active,
.topbar-nav-button[aria-expanded="true"] {
  background: var(--brand);
  color: #f8f4ed;
}

.mypage-menu {
  position: relative;
}

.mypage-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(248, 244, 237, 0.98);
  border: 1px solid rgba(18, 53, 36, 0.12);
  box-shadow: var(--shadow);
}

.mypage-link {
  justify-content: flex-start;
  text-align: left;
}

.topbar-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(18, 53, 36, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.topbar-menu-toggle span {
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--brand);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-topbar-launcher {
  display: none;
}

.brand-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.1;
}

.topbar-actions p {
  margin: 0;
  color: var(--muted);
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

.inventory-list-label {
  display: inline-block;
  min-width: 14ch;
  white-space: nowrap;
}

#item-logs-page .subheader > div h3,
#item-logs-page .subheader > div .section-label {
  white-space: nowrap;
}

.subheader-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.panel h2,
.workspace-card h3,
.brand-block h1 {
  margin: 0;
  line-height: 1.15;
}

.topbar-actions p,
.demo-box p,
.result-card,
.session-role,
.table-meta,
.message-box {
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 24px;
  margin-top: 16px;
}

.auth-panel {
  width: min(680px, 100%);
  margin: 0 auto;
}

.auth-panel-header {
  margin-bottom: 18px;
}

.auth-form-panel {
  padding-block: 14px;
}

.topbar-session-box {
  padding: 0;
  gap: 14px;
}

.panel-header,
.subheader,
.session-box,
.scan-actions,
.form-actions,
.inline-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack,
.inventory-form,
.user-form {
  display: grid;
  gap: 14px;
}

#password-form {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

#password-form > div:empty {
  display: none;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 53, 36, 0.16);
  background: rgba(255, 255, 255, 0.8);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(217, 112, 43, 0.25);
  border-color: rgba(217, 112, 43, 0.8);
}

.field-error-target {
  border-color: rgba(181, 56, 47, 0.7);
  background: rgba(181, 56, 47, 0.05);
}

.field-error-target:focus {
  outline: 2px solid rgba(181, 56, 47, 0.18);
  border-color: rgba(181, 56, 47, 0.85);
}

.field-error-text {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.upload-scan span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  background: var(--brand);
  color: #f8f4ed;
}

.secondary-button,
.upload-scan span {
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(18, 53, 36, 0.18);
  color: var(--brand);
}

.danger-button {
  background: rgba(181, 56, 47, 0.12);
  color: var(--danger);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.upload-scan:hover span {
  transform: translateY(-1px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.1);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
}

.status-chip.muted {
  background: rgba(95, 111, 100, 0.12);
  color: var(--muted);
}

.demo-box,
.message-box,
.result-card,
.image-preview-card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(18, 53, 36, 0.08);
  padding: 16px;
}

.message-box:empty {
  display: none;
}

.toast-region {
  position: fixed;
  top: 33%;
  left: 50%;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.auth-page .toast-region {
  top: 31.5%;
}

.toast {
  pointer-events: auto;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(18, 53, 36, 0.12);
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 16px 40px rgba(38, 46, 35, 0.18);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  animation: toast-enter 180ms ease-out;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast-error {
  border-color: rgba(181, 56, 47, 0.24);
  background: #fff7f5;
  color: var(--danger);
}

.toast-success {
  border-color: rgba(18, 53, 36, 0.18);
  background: #f3fbf4;
  color: var(--brand);
}

.toast-info {
  border-color: rgba(95, 111, 100, 0.2);
}

.toast-exit {
  opacity: 0;
  transform: translateY(-6px);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[hidden] {
  display: none !important;
}

.demo-box ul {
  padding-left: 18px;
  line-height: 1.8;
}

.auth-page::before {
  display: none;
}

.auth-page .app-shell {
  min-height: 100svh;
  padding-top: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.auth-page .topbar {
  position: static;
  transform: none;
  width: 100%;
}

.auth-page .layout {
  align-content: start;
}

.dashboard {
  display: grid;
  gap: 22px;
}

.dashboard-page {
  display: grid;
  gap: 18px;
}

.dashboard-home {
  gap: 22px;
}

.stats-grid,
.workspace-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  padding: 18px 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.workspace-grid {
  grid-template-columns: 1.1fr 1fr;
}

.workspace-card {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  align-items: stretch;
  gap: 22px;
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(18, 53, 36, 0.96) 0%, rgba(34, 74, 52, 0.92) 54%, rgba(217, 112, 43, 0.78) 100%);
  color: #f7f1e7;
  overflow: hidden;
  position: relative;
}

.dashboard-hero::before,
.dashboard-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.dashboard-hero::before {
  top: -72px;
  right: -42px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero::after {
  bottom: -88px;
  left: -30px;
  width: 210px;
  height: 210px;
  background: rgba(255, 255, 255, 0.06);
}

.dashboard-hero-copy,
.dashboard-hero-aside {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy {
  display: grid;
  align-content: center;
  gap: 16px;
}

.dashboard-hero .section-label {
  margin-bottom: 0;
  color: rgba(255, 242, 225, 0.78);
}

.dashboard-hero h3 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.dashboard-hero-description {
  max-width: 58ch;
  margin: 0;
  color: rgba(247, 241, 231, 0.8);
  font-size: 1rem;
  line-height: 1.65;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.dashboard-quick-link {
  min-width: 120px;
}

.dashboard-hero .dashboard-search-link.primary-button {
  min-width: 148px;
  background: #d9702b;
  color: #fff8ef;
  border: 2px solid rgba(255, 248, 239, 0.78);
  box-shadow: 0 14px 30px rgba(83, 36, 10, 0.32), 0 0 0 4px rgba(217, 112, 43, 0.22);
}

.dashboard-hero .primary-button {
  background: #fff7ec;
  color: var(--brand);
}

.dashboard-hero .secondary-button {
  background: rgba(255, 255, 255, 0.18);
  color: #fff8ef;
}

.dashboard-install-button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dashboard-hero .ghost-button {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff8ef;
}

.dashboard-hero-aside {
  display: grid;
  align-items: stretch;
}

.dashboard-hero-panel {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 24px;
  background: rgba(250, 246, 239, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.dashboard-hero-panel-label {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 245, 234, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-hero-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: rgba(255, 245, 234, 0.88);
  line-height: 1.55;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.94) 0%, rgba(248, 244, 237, 0.92) 100%);
  border: 1px solid rgba(18, 53, 36, 0.08);
  box-shadow: 0 18px 44px rgba(38, 46, 35, 0.08);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(18, 53, 36, 0.75), rgba(217, 112, 43, 0.45));
}

.stat-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.08);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.stat-card-total::before {
  background: linear-gradient(90deg, rgba(18, 53, 36, 0.85), rgba(56, 118, 84, 0.5));
}

.stat-card-active::before {
  background: linear-gradient(90deg, rgba(56, 118, 84, 0.86), rgba(18, 53, 36, 0.38));
}

.stat-card-disposed::before {
  background: linear-gradient(90deg, rgba(181, 56, 47, 0.8), rgba(217, 112, 43, 0.45));
}

.stat-card-scan::before {
  background: linear-gradient(90deg, rgba(217, 112, 43, 0.88), rgba(18, 53, 36, 0.35));
}

.inline-form input {
  flex: 1;
}

.scan-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.upload-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.upload-scan span {
  pointer-events: none;
}

.upload-scan input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#scanner-video {
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: #0d120f;
}

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  background: #050807;
}

.scanner-overlay-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050807;
}

.scanner-overlay-footer {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  padding: 20px 18px max(20px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(5, 8, 7, 0) 0%, rgba(5, 8, 7, 0.88) 56%, rgba(5, 8, 7, 0.96) 100%);
}

.scanner-stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(320px, 100%);
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.96);
  color: var(--brand);
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.result-card.empty {
  border-style: dashed;
}

.search-result-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-result-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 53, 36, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-align: left;
}

.search-result-item span {
  font-weight: 800;
}

.search-result-item small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.inventory-form,
.user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#user-form {
  grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.25fr) minmax(130px, 0.8fr) auto auto;
  align-items: end;
}

#user-form > button {
  min-height: 44px;
  white-space: nowrap;
}

#password-form {
  grid-template-columns: minmax(0, 1fr);
}

.wide-field {
  grid-column: 1 / -1;
}

.image-preview-card {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(18, 53, 36, 0.24);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.image-preview-card.drag-active {
  border-color: rgba(18, 53, 36, 0.72);
  background: rgba(216, 232, 218, 0.44);
  box-shadow: inset 0 0 0 2px rgba(18, 53, 36, 0.08);
}

.image-preview-card img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.table-wrapper {
  overflow-x: auto;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(18, 53, 36, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  font-weight: 700;
}

.pagination-button.active {
  background: var(--brand);
  color: #f8f4ed;
}

.inventory-list-tools {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  align-items: start;
  gap: 12px;
  justify-content: flex-end;
  flex: 1 1 min(100%, 720px);
  min-width: 0;
}

.inventory-excel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 8px;
}

.inventory-excel-tools select {
  width: 180px;
  flex: 0 0 auto;
}

.inventory-excel-tools button {
  min-height: 38px;
  padding-inline: 14px;
  white-space: nowrap;
}

.inventory-status-tabs {
  display: inline-flex;
  gap: 8px;
  align-self: start;
  justify-self: end;
  white-space: nowrap;
}

.inventory-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.inventory-filter-grid input,
.inventory-filter-grid select {
  min-height: 38px;
  min-width: 0;
}

.inventory-filter-grid button {
  min-height: 38px;
  white-space: nowrap;
}

.status-tab-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(18, 53, 36, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  font-weight: 700;
}

.status-tab-button.active {
  background: var(--brand);
  color: #f8f4ed;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(18, 53, 36, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:hover td {
  background: rgba(216, 232, 218, 0.24);
}

.table-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.08);
  color: var(--brand);
  font-weight: 700;
}

.table-button-edit {
  background: rgba(217, 112, 43, 0.14);
  color: #8a4518;
  border: 1px solid rgba(217, 112, 43, 0.22);
}

.table-button-ledger {
  background: rgba(18, 53, 36, 0.1);
  color: var(--brand);
  border: 1px solid rgba(18, 53, 36, 0.12);
}

.table-button-ledger:hover,
.table-button-edit:hover {
  transform: translateY(-1px);
}

.table-action-cell {
  text-align: center;
}

.table-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.danger-outline-button {
  background: rgba(181, 56, 47, 0.08);
  color: var(--danger);
}

.table-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.12);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

.table-status-chip.is-disposed {
  background: rgba(143, 53, 53, 0.14);
  color: #8f3535;
}

.table-department-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(18, 53, 36, 0.16);
  border-radius: 999px;
  background: rgba(232, 241, 234, 0.95);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.table-sort-button span {
  color: var(--muted);
  font-size: 0.74rem;
}

.table-sort-button.active span {
  color: var(--brand);
}

.log-change-row {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.log-change-row + .log-change-row {
  margin-top: 8px;
}

.log-change-row strong {
  color: var(--brand);
  font-size: 0.78rem;
}

.log-change-row span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log-change-row b {
  min-width: 0;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(18, 53, 36, 0.05);
  color: var(--text);
  font-weight: 700;
}

.log-change-row i {
  flex: 0 0 auto;
  color: rgba(18, 53, 36, 0.42);
  font-style: normal;
  font-weight: 800;
}

.audit-log-table {
  min-width: 1240px;
  table-layout: fixed;
}

.audit-log-table th,
.audit-log-table td {
  vertical-align: top;
}

.audit-log-table th {
  text-align: center;
}

.audit-log-table td:first-child,
.audit-log-table th:first-child,
.audit-log-table td:last-child,
.audit-log-table th:last-child {
  width: auto;
}

.audit-log-date-column {
  width: 150px;
}

.audit-log-department-column {
  width: 120px;
}

.audit-log-action-column {
  width: 104px;
}

.audit-log-item-column {
  width: 170px;
}

.audit-log-code-column {
  width: 126px;
}

.audit-log-user-column {
  width: 112px;
}

.audit-log-changes-column {
  width: auto;
}

.audit-log-date-cell {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.audit-log-action-cell,
.audit-log-department-cell,
.audit-log-item-cell,
.audit-log-code-cell,
.audit-log-user-cell {
  text-align: center;
}

.audit-log-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.08);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.audit-log-item-cell strong {
  display: block;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.audit-log-code-cell,
.audit-log-user-cell {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.audit-log-changes-cell {
  min-width: 0;
}

.audit-log-empty-change {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 0.84rem;
}

.session-user {
  margin: 0;
  font-weight: 700;
}

.session-role {
  margin: 4px 0 0;
}

.inventory-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(18, 53, 36, 0.08);
  display: block;
  margin: 0 auto;
}

.inventory-thumbnail-button {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  margin: 0 auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
}

.inventory-thumbnail-button:focus-visible {
  outline: 3px solid rgba(18, 53, 36, 0.28);
  outline-offset: 3px;
}

.inventory-list-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.inventory-list-table .inventory-image-column {
  width: 76px;
  text-align: center;
}

.inventory-list-table .inventory-department-column {
  width: 120px;
  text-align: center;
}

.inventory-list-table .inventory-qr-column {
  width: 96px;
  text-align: center;
}

.inventory-list-table .inventory-info-column {
  width: 200px;
  text-align: center;
}

.inventory-list-table .inventory-code-column {
  width: 170px;
  text-align: center;
}

.inventory-list-table .inventory-location-column {
  width: 160px;
  text-align: center;
}

.inventory-list-table .inventory-manager-column {
  width: 180px;
  text-align: center;
}

.inventory-list-table .inventory-notes-column {
  width: 220px;
  text-align: center;
}

.inventory-list-table .inventory-notes-column td {
  text-align: left;
}

.inventory-list-table .inventory-action-column {
  text-align: center;
}

.inventory-list-table th,
.inventory-list-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.inventory-list-table thead th {
  padding-top: 6px;
  padding-bottom: 8px;
  background: transparent;
  color: rgba(18, 53, 36, 0.66);
  font-size: 0.76rem;
}

.inventory-list-table tbody tr {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(38, 46, 35, 0.06);
}

.inventory-list-table tbody td {
  border-top: 1px solid rgba(18, 53, 36, 0.08);
  border-bottom: 1px solid rgba(18, 53, 36, 0.08);
  background: transparent;
}

.inventory-list-table tbody td:first-child {
  border-left: 1px solid rgba(18, 53, 36, 0.08);
  border-radius: 12px 0 0 12px;
}

.inventory-list-table tbody td:last-child {
  border-right: 1px solid rgba(18, 53, 36, 0.08);
  border-radius: 0 12px 12px 0;
}

.inventory-info-cell,
.inventory-code-cell,
.inventory-manager-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inventory-info-cell {
  justify-items: center;
  text-align: center;
}

.inventory-code-cell {
  justify-items: center;
  text-align: center;
}

.inventory-item-main-info,
.search-result-item-header,
.qr-result-item-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.inventory-item-title,
.inventory-code-cell strong {
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-subtext {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inventory-qr-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 112, 43, 0.12);
  color: #8a4518;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-code-cell span,
.inventory-code-cell small,
.inventory-manager-cell span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-code-cell b,
.inventory-manager-cell b {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 2px 5px;
  border-radius: 7px;
  background: rgba(18, 53, 36, 0.06);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.inventory-manager-cell {
  justify-items: start;
}

.inventory-notes-preview-button {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(18, 53, 36, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  text-align: left;
  transition: background-color 160ms ease;
}

.inventory-notes-preview-button:hover {
  background: rgba(216, 232, 218, 0.3);
}

.inventory-notes-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-all;
}

.notes-modal-panel {
  width: min(640px, 100%);
}

.notes-modal-content {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(18, 53, 36, 0.04);
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 60vh;
  overflow-y: auto;
}

.inventory-manager-cell span {
  justify-content: flex-start;
}

.inventory-code-cell strong {
  font-size: 0.88rem;
}

.inventory-location-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(18, 53, 36, 0.05);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-list-table .inventory-info-column .table-sort-button,
.inventory-list-table .inventory-department-column .table-sort-button,
.inventory-list-table .inventory-qr-column .table-sort-button,
.inventory-list-table .inventory-code-column .table-sort-button,
.inventory-list-table .inventory-location-column .table-sort-button,
.inventory-list-table .inventory-manager-column .table-sort-button {
  justify-content: center;
  text-align: center;
}

.inventory-list-table .table-action-buttons {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
  justify-items: center;
}

.inventory-list-table .table-button {
  width: 74px;
  min-height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 0.68rem;
  white-space: nowrap;
}

.inventory-mobile-list {
  display: none;
  width: 100%;
  justify-items: stretch;
}

.inventory-mobile-card {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(18, 53, 36, 0.11);
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(38, 46, 35, 0.08);
}

.inventory-mobile-dept-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: -4px;
}

.inventory-mobile-card-header {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 88px;
}

.inventory-mobile-badge,
.inventory-mobile-code {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-mobile-badge {
  border: 1px solid rgba(18, 53, 36, 0.16);
  background: rgba(232, 241, 234, 0.95);
  color: var(--brand);
}

.inventory-mobile-code {
  background: rgba(217, 112, 43, 0.12);
  color: #8a4518;
}

.inventory-mobile-title-block {
  display: grid;
  gap: 7px;
  align-content: center;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.inventory-mobile-code-text {
  color: #8a4518;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.inventory-mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.inventory-mobile-card-title {
  min-width: 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.inventory-mobile-card-location {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.inventory-mobile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.inventory-mobile-detail {
  display: grid;
  gap: 5px;
  justify-items: center;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(18, 53, 36, 0.08);
  border-radius: 10px;
  background: rgba(248, 244, 237, 0.58);
  text-align: center;
}

.inventory-mobile-detail-wide {
  grid-column: span 1;
}

.inventory-mobile-label {
  color: rgba(18, 53, 36, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.inventory-mobile-detail strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.32;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.inventory-mobile-thumbnail,
.inventory-mobile-thumbnail-button {
  width: 88px;
  min-height: 88px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
}

.inventory-mobile-thumbnail {
  display: block;
  border: 1px solid rgba(18, 53, 36, 0.08);
  background: rgba(18, 53, 36, 0.05);
  height: auto;
  object-fit: cover;
}

.inventory-mobile-thumbnail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
}

.inventory-mobile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inventory-mobile-actions .table-button {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.inventory-mobile-actions .table-button:only-child {
  grid-column: 1 / -1;
}

.table-wrapper td:first-child,
.table-wrapper th:first-child {
  width: 88px;
  text-align: center;
}

.table-wrapper table:not(.inventory-list-table) td:last-child,
.table-wrapper table:not(.inventory-list-table) th:last-child {
  width: 180px;
}

.user-table-wrapper {
  margin-top: 10px;
}

.user-admin-table {
  min-width: 840px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(18, 53, 36, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.user-admin-table thead th {
  background: rgba(18, 53, 36, 0.06);
  color: var(--brand);
  font-size: 0.79rem;
  padding: 16px 14px;
}

.user-admin-table tbody td {
  padding: 18px 14px;
}

.user-admin-table tbody tr:nth-child(even) td {
  background: rgba(248, 244, 237, 0.7);
}

.user-admin-table tbody tr:hover td {
  background: rgba(216, 232, 218, 0.32);
}

.user-table-wrapper .user-name-column,
.user-table-wrapper .user-name-cell {
  width: 240px;
  text-align: left;
}

.user-table-wrapper .user-display-name-column,
.user-table-wrapper .user-display-name-cell {
  width: 180px;
  text-align: center;
}

.user-table-wrapper .user-name-cell {
  white-space: nowrap;
}

.user-table-wrapper .user-display-name-cell {
  white-space: nowrap;
}

.user-table-wrapper .user-suid-column,
.user-table-wrapper .user-suid-cell {
  width: 180px;
  text-align: center;
}

.user-table-wrapper .user-role-column {
  width: 390px;
}

.user-role-column-cell {
  padding-right: 18px;
}

.user-table-wrapper .user-action-column,
.user-admin-action-cell {
  width: 170px;
  text-align: center;
}

.user-action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.user-role-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-role-summary,
.user-role-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-role-name {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(18, 53, 36, 0.1);
  color: var(--brand);
}

.user-role-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-role-detail-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 53, 36, 0.04);
  border: 1px solid rgba(18, 53, 36, 0.08);
}

.user-role-detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.9rem;
}

.user-role-detail-list li + li {
  margin-top: 4px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 31, 0.48);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid rgba(18, 53, 36, 0.14);
  box-shadow: var(--shadow);
}

.ledger-modal-panel,
.ledger-modal-body,
.ledger-summary-grid,
.ledger-form,
.ledger-history-form {
  display: grid;
  gap: 18px;
}

.ledger-summary-grid {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.ledger-image-card {
  min-height: 320px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(18, 53, 36, 0.08);
  display: grid;
  place-items: center;
}

.ledger-image-card img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.image-modal-shell {
  z-index: 2100;
}

.image-modal-panel {
  width: min(980px, 100%);
  display: grid;
  gap: 18px;
}

.image-modal-preview {
  display: block;
  width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: rgba(18, 53, 36, 0.06);
}

.ledger-form,
.ledger-history-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ledger-history-header {
  margin-top: 8px;
}

.ledger-history-table {
  min-width: 820px;
  table-layout: fixed;
}

.ledger-history-date-column {
  width: 112px;
}

.ledger-history-details-column {
  width: 22%;
}

.ledger-history-number-column {
  width: 72px;
}

.ledger-history-remarks-column {
  width: 24%;
}

.ledger-history-table th,
.ledger-history-table td {
  padding: 12px 10px;
}

.ledger-history-table th:first-child,
.ledger-history-table td:first-child,
.ledger-history-table th:last-child,
.ledger-history-table td:last-child {
  width: auto;
}

.ledger-history-date-cell,
.ledger-history-number-cell {
  text-align: center;
  white-space: nowrap;
}

.ledger-history-details-cell,
.ledger-history-remarks-cell {
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ledger-history-details-cell {
  font-weight: 700;
  color: var(--brand);
}

.ledger-history-remarks-cell:empty::after {
  content: "-";
  color: var(--muted);
}

@media (max-width: 1080px) {
  .workspace-grid,
  .stats-grid,
  .dashboard-stat-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-row,
  .topbar-menu-panel,
  .brand-block,
  .topbar-nav,
  .topbar-actions {
    width: 100%;
  }

  .topbar-row,
  .topbar-menu-panel {
    justify-content: space-between;
  }

  .topbar-menu-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .ledger-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h3 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    padding-top: calc(var(--topbar-height) + 12px);
    padding-bottom: 28px;
  }

  .panel,
  .workspace-card,
  .topbar {
    padding: 18px;
  }

  .layout,
  .dashboard,
  .dashboard-page,
  .workspace-card {
    gap: 16px;
  }

  .auth-panel {
    width: 100%;
  }

  .topbar {
    top: 10px;
    width: min(100vw - 20px, 100%);
    gap: 14px;
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
    transition: box-shadow 0.24s ease;
  }

  body::before {
    height: calc(var(--topbar-height) + 20px);
  }

  .panel-header,
  .subheader,
  .session-box,
  .pagination-bar,
  .form-actions,
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-header > div,
  .subheader > div {
    min-width: 0;
  }

  .panel-header h2,
  .subheader h3,
  #item-logs-page .subheader > div h3,
  #item-logs-page .subheader > div .section-label {
    white-space: normal;
    word-break: keep-all;
  }

  .topbar-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-row {
    align-items: center;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-block h1 {
    font-size: clamp(1.15rem, 5vw, 1.4rem);
  }

  .topbar-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .topbar-menu-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-top: 2px;
  }

  .topbar.mobile-nav-open .topbar-menu-panel {
    display: flex;
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .topbar-actions,
  .topbar-session-box {
    width: 100%;
  }

  .topbar-actions {
    gap: 10px;
  }

  .topbar-install-button {
    display: inline-flex;
  }

  .topbar-actions > .secondary-button,
  .topbar-session-box > .ghost-button,
  .topbar-nav-button,
  .mypage-link {
    width: 100%;
    justify-content: center;
  }

  .topbar-session-box {
    gap: 10px;
  }

  .mypage-menu-panel {
    position: static;
    min-width: 100%;
  }

  .dashboard-hero {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .dashboard-hero::before {
    top: -92px;
    right: -82px;
    width: 180px;
    height: 180px;
  }

  .dashboard-hero::after {
    bottom: -100px;
    left: -52px;
    width: 170px;
    height: 170px;
  }

  .dashboard-hero-copy,
  .dashboard-hero-aside,
  .dashboard-hero-panel {
    gap: 14px;
  }

  .dashboard-hero h3 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
    line-height: 1.08;
  }

  .dashboard-hero-description,
  .dashboard-hero-list {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .dashboard-hero-actions {
    flex-direction: column;
  }

  .dashboard-quick-link,
  .dashboard-hero-actions .primary-button,
  .dashboard-hero-actions .secondary-button,
  .dashboard-hero-actions .ghost-button {
    width: 100%;
  }

  .dashboard-stat-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stat-card {
    padding: 18px;
    gap: 8px;
  }

  .stat-card strong {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .inline-form,
  .scan-actions,
  .inventory-list-tools,
  .inventory-status-tabs {
    width: 100%;
  }

  .inline-form input,
  .inline-form button,
  .scan-actions button,
  .inventory-list-tools input,
  .inventory-list-tools select,
  .inventory-list-tools button,
  .inventory-status-tabs button,
  .user-form > button,
  #password-form > button,
  .form-actions > button {
    width: 100%;
  }

  .scan-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-list-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inventory-excel-tools {
    display: none;
  }

  .inventory-filter-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inventory-status-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #password-form > div:empty {
    display: none;
  }

  .inventory-list-label {
    min-width: 0;
  }

  .result-card,
  .image-preview-card,
  .demo-box,
  .message-box {
    padding: 14px;
  }

  .toast-region {
    top: calc(var(--topbar-height) + 18px);
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }

  .auth-page .toast-region {
    top: calc(env(safe-area-inset-top) + 12px);
  }

  .image-preview-card {
    min-height: 160px;
  }

  #scanner-video {
    min-height: 220px;
  }

  .mobile-topbar-launcher {
    display: none;
  }

  .mobile-topbar-launcher[hidden] {
    display: none;
  }

  .table-wrapper {
    overflow: visible;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper table {
    background: transparent;
    border-radius: 0;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrapper tr {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(18, 53, 36, 0.1);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(38, 46, 35, 0.06);
  }

  .table-wrapper td,
  .user-admin-table tbody td,
  .inventory-list-table th,
  .inventory-list-table td {
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .table-wrapper td + td {
    margin-top: 10px;
  }

  .table-wrapper td {
    display: grid;
    grid-template-columns: minmax(86px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    text-align: left !important;
  }

  .table-wrapper td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .table-wrapper td:first-child,
  .table-wrapper th:first-child,
  .table-wrapper td:last-child,
  .table-wrapper th:last-child {
    width: auto;
  }

  .inventory-list-table,
  .user-admin-table,
  .ledger-history-table,
  .audit-log-table {
    min-width: 0;
  }

  .table-wrapper .inventory-list-table {
    display: none;
  }

  .inventory-list-table td,
  .inventory-list-table th {
    width: 100%;
    max-width: 100%;
  }

  .inventory-list-table .inventory-image-column,
  .inventory-list-table .inventory-department-column,
  .inventory-list-table .inventory-qr-column,
  .inventory-list-table .inventory-info-column,
  .inventory-list-table .inventory-code-column,
  .inventory-list-table .inventory-location-column,
  .inventory-list-table .inventory-manager-column,
  .inventory-list-table .inventory-notes-column,
  .inventory-list-table .inventory-action-column {
    width: 100%;
    max-width: 100%;
  }

  .inventory-list-table tbody td:first-child {
    border-left: 0;
  }

  .inventory-list-table td[class*="inventory-"] {
    padding: 10px 12px;
    justify-items: center;
    text-align: center !important;
  }

  .inventory-list-table td[class*="inventory-"]::before {
    justify-self: center;
    text-align: center;
  }

  .inventory-list-table td[class*="inventory-"] > * {
    justify-self: center;
  }

  .inventory-list-table .inventory-action-column .table-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .inventory-list-table .inventory-action-column .table-button {
    width: 100%;
    min-height: 38px;
  }

  .inventory-list-table .inventory-info-column {
    padding: 10px 12px;
    border-left: 0;
    justify-items: center;
    text-align: center !important;
  }

  .inventory-list-table .inventory-info-column::before {
    justify-self: center;
    text-align: center;
  }

  .inventory-list-table .inventory-info-column .inventory-info-cell {
    width: 100%;
    justify-items: center;
    text-align: center;
  }

  .inventory-list-table .inventory-image-column {
    min-height: 96px;
    overflow: visible;
  }

  .inventory-list-table .inventory-image-column .inventory-thumbnail,
  .inventory-list-table .inventory-image-column .inventory-thumbnail-button {
    width: 88px;
    height: auto;
    min-height: 88px;
    aspect-ratio: 1 / 1;
  }

  .inventory-list-table .inventory-image-column .inventory-thumbnail {
    object-fit: cover;
  }

  .inventory-mobile-list {
    display: grid;
    gap: 16px;
  }

  .ledger-history-table colgroup {
    display: none;
  }

  .ledger-history-table td {
    min-width: 0;
  }

  .audit-log-table tr {
    display: grid;
    gap: 10px;
  }

  .audit-log-table td {
    display: grid;
    grid-template-columns: minmax(74px, 92px) minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
  }

  .audit-log-table td[data-label="변경 내용"] {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(18, 53, 36, 0.08);
  }

  .audit-log-table td[data-label="변경 내용"]::before {
    margin-bottom: 0;
  }

  .audit-log-table .log-change-row {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(18, 53, 36, 0.05);
  }

  .audit-log-table .log-change-row strong,
  .audit-log-table .log-change-row span {
    min-width: 0;
  }

  .user-admin-action-cell {
    width: auto;
  }

  .inventory-thumbnail {
    width: 72px;
    height: 72px;
    margin: 0;
  }

  .table-action-buttons {
    justify-content: flex-start;
  }

  .table-action-buttons .table-button,
  .user-admin-action-cell .table-button {
    width: 100%;
  }

  .user-table-wrapper .user-name-column,
  .user-table-wrapper .user-name-cell,
  .user-table-wrapper .user-display-name-column,
  .user-table-wrapper .user-display-name-cell,
  .user-table-wrapper .user-suid-column,
  .user-table-wrapper .user-suid-cell,
  .user-table-wrapper .user-role-column,
  .user-table-wrapper .user-action-column,
  .user-admin-action-cell {
    width: auto;
  }

  .user-table-wrapper .user-name-cell,
  .user-table-wrapper .user-display-name-cell {
    white-space: normal;
  }

  .user-role-detail-panel {
    padding: 10px;
  }

  .pagination-bar {
    margin-top: 12px;
  }

  .pagination-buttons {
    justify-content: flex-start;
  }

  .pagination-button {
    flex: 0 0 auto;
  }

  .inventory-form,
  .user-form,
  .ledger-form,
  .ledger-history-form {
    grid-template-columns: 1fr;
  }

  #user-form {
    grid-template-columns: 1fr;
  }

  .ledger-summary-grid {
    gap: 14px;
  }

  .ledger-image-card {
    min-height: 240px;
    padding: 14px;
  }

  .ledger-history-header {
    margin-top: 0;
  }

  .modal-shell {
    place-items: center;
    padding: 24px;
  }

  .modal-panel {
    width: 100%;
    max-height: min(92vh, 100vh);
    padding: 24px;
    border-radius: var(--radius-xl);
    border-bottom: 1px solid rgba(18, 53, 36, 0.14);
  }

  .image-modal-panel .form-actions,
  .notes-modal-panel .form-actions {
    margin-top: 24px;
  }
}

@media (hover: none) and (pointer: coarse) and (min-width: 761px) {
  .inventory-list-table {
    display: none;
  }

  .inventory-mobile-list {
    display: grid;
    gap: 16px;
  }

  .topbar {
    top: 10px;
    width: min(100vw - 20px, 100%);
    gap: 14px;
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
    transition: box-shadow 0.24s ease;
  }

  body::before {
    height: calc(var(--topbar-height) + 20px);
  }

  .topbar-row {
    width: 100%;
    align-items: center;
    justify-content: space-between;
  }

  .brand-block {
    min-width: 0;
  }

  .topbar-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .topbar-menu-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-top: 2px;
  }

  .topbar.mobile-nav-open .topbar-menu-panel {
    display: flex;
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .topbar.mobile-nav-open .topbar-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .topbar-actions,
  .topbar-session-box {
    width: 100%;
  }

  .topbar-actions {
    gap: 10px;
  }

  .topbar-install-button {
    display: inline-flex;
  }

  .topbar-actions > .secondary-button,
  .topbar-session-box > .ghost-button,
  .topbar-nav-button,
  .mypage-link {
    width: 100%;
    justify-content: center;
  }

  .topbar-session-box {
    gap: 10px;
  }

  .mypage-menu-panel {
    position: static;
    min-width: 100%;
  }

  .mobile-topbar-launcher {
    display: none;
  }

  .mobile-topbar-launcher[hidden] {
    display: none;
  }
}

@media (max-width: 520px) {
  .panel,
  .workspace-card,
  .topbar,
  .modal-panel {
    padding: 16px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-block h1 {
    font-size: 1.05rem;
  }

  .dashboard-hero {
    padding: 20px 16px;
  }

  .dashboard-hero-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .table-wrapper tr {
    padding: 12px;
  }

  .table-wrapper td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .audit-log-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .table-wrapper td::before {
    font-size: 0.72rem;
  }

  .inventory-mobile-card {
    padding: 12px;
    border-radius: 14px;
  }

  .inventory-mobile-card-header {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    min-height: 76px;
  }

  .inventory-mobile-thumbnail,
  .inventory-mobile-thumbnail-button {
    width: 76px;
    height: auto;
    min-height: 76px;
  }

  .inventory-mobile-detail-grid {
    grid-template-columns: 1fr;
  }

  .status-chip,
  .table-status-chip,
  .user-role-name {
    width: fit-content;
    max-width: 100%;
  }

  .mobile-topbar-launcher {
    min-width: 64px;
    min-height: 42px;
    padding: 0 14px;
  }

  #scanner-video {
    min-height: 190px;
  }
}
