:root {
  --factory-ink: #14212c;
  --factory-muted: #637381;
  --factory-blue: #155c8a;
  --factory-blue-dark: #0e3148;
  --factory-steel: #edf3f7;
  --factory-line: #d8e3ea;
  --factory-panel: rgba(255, 255, 255, .94);
  --factory-accent: #f4a62a;
  --factory-green: #2b8a58;
  --factory-red: #c45145;
  --factory-shadow: 0 18px 50px rgba(20, 33, 44, .09);
  --factory-radius: 22px;
}

body {
  min-height: 100vh;
  color: var(--factory-ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(21, 92, 138, .13), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgba(242, 168, 59, .13), transparent 24rem),
    linear-gradient(135deg, #f7fbfd 0%, #eef6fa 44%, #f8fafc 100%);
  background-size: auto;
  font-family: "Noto Sans Thai", "Sarabun", "Segoe UI", sans-serif;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08), transparent 32%),
    linear-gradient(90deg, #0b2538 0%, #123d5a 54%, #155c8a 100%);
  box-shadow: 0 14px 34px rgba(15, 47, 70, .18);
  backdrop-filter: blur(16px);
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .navbar-toggler,
.user-chip {
  color: #fff;
}

.app-navbar .navbar-brand {
  display: flex;
  gap: 0;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #0f2f46;
  background: linear-gradient(135deg, #ffffff, #dff2fb);
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 15px;
  box-shadow: inset 0 -8px 18px rgba(21, 92, 138, .12), 0 10px 24px rgba(0, 0, 0, .16);
  font-size: .82rem;
  font-weight: 900;
}

.app-navbar .navbar-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .72);
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, .32);
}

.app-navbar .navbar-toggler-icon {
  filter: invert(1) grayscale(1);
}

.app-navbar .nav-link {
  margin: 0 2px;
  padding: .58rem .82rem;
  border-radius: 999px;
  opacity: .84;
  transition: background .18s ease, opacity .18s ease, transform .18s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  background: rgba(255, 255, 255, .15);
  opacity: 1;
}

.app-navbar .nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  font-weight: 700;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 22px 56px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  position: fixed;
  inset: 28px;
  border: 1px solid rgba(21, 92, 138, .12);
  border-radius: 32px;
  pointer-events: none;
}

.auth-card,
.panel,
.metric-card {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(216, 227, 234, .86);
  border-radius: var(--factory-radius);
  box-shadow: var(--factory-shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(500px, 100%);
  padding: 38px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--factory-accent), var(--factory-blue));
}

.auth-card-modern {
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(15, 47, 70, .16);
}

.panel {
  padding: 24px;
  overflow: hidden;
}

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.hero-title {
  padding: 26px;
  background:
    radial-gradient(circle at 88% 8%, rgba(21, 92, 138, .12), transparent 17rem),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .72)),
    linear-gradient(90deg, rgba(21, 92, 138, .08), rgba(242, 168, 59, .09));
  border: 1px solid rgba(216, 227, 234, .92);
  border-radius: 30px;
  box-shadow: 0 22px 60px rgba(15, 47, 70, .1);
}

.page-title h1 {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  margin: 0;
  font-weight: 800;
  letter-spacing: -.03em;
}

.metric-card {
  display: block;
  padding: 22px;
  position: relative;
  overflow: hidden;
  min-height: 132px;
  color: var(--factory-ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -28px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--metric-color, var(--factory-blue)) 18%, transparent);
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 4px;
  border-radius: 999px;
  background: var(--metric-color, var(--factory-blue));
  opacity: .9;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(21, 92, 138, .22);
  box-shadow: 0 28px 70px rgba(15, 47, 70, .14);
}

.status-dot {
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--dot-color, #64748b);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--dot-color, #64748b) 14%, transparent);
}

.status-dot-slate {
  --dot-color: #64748b;
}

.status-dot-amber {
  --dot-color: #f2a83b;
}

.status-dot-sky {
  --dot-color: #0ea5b7;
}

.status-dot-blue {
  --dot-color: #155c8a;
}

.status-dot-green {
  --dot-color: #2b8a58;
}

.metric-draft {
  --metric-color: #7a8693;
}

.metric-pending_approval {
  --metric-color: var(--factory-accent);
}

.metric-approved {
  --metric-color: #1687a7;
}

.metric-warehouse_issued {
  --metric-color: var(--factory-blue);
}

.metric-received {
  --metric-color: var(--factory-green);
}

.metric-label {
  color: var(--factory-muted);
  font-size: .9rem;
  font-weight: 700;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 20px 18px;
  color: var(--factory-ink);
  text-decoration: none;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(216, 227, 234, .95);
  border-left: 5px solid var(--action-color, var(--factory-blue));
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(15, 47, 70, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.quick-action:hover {
  color: var(--factory-ink);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(20, 33, 44, .11);
}

.quick-action span {
  font-weight: 800;
}

.quick-action small {
  color: var(--factory-muted);
}

.quick-action-primary {
  --action-color: var(--factory-blue);
}

.quick-action-warning {
  --action-color: var(--factory-accent);
}

.quick-action-info {
  --action-color: #1687a7;
}

.quick-action-success {
  --action-color: var(--factory-green);
}

.table thead th {
  color: #546372;
  background: #f8fbfd;
  border-bottom: 1px solid var(--factory-line);
  font-size: .86rem;
}

.app-table {
  margin-bottom: 0;
  min-width: 780px;
}

.app-table thead th {
  padding-top: 14px;
  padding-bottom: 14px;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: .01em;
}

.app-table tbody td {
  padding-top: 16px;
  padding-bottom: 16px;
  border-color: #e7eef3;
}

.app-table td:first-child,
.app-table .badge {
  white-space: nowrap;
}

.table-responsive {
  border-radius: 16px;
}

.app-table tbody tr {
  transition: background .16s ease;
}

.app-table tbody tr:hover {
  background: #fbfdff;
}

.table-empty {
  padding: 34px 12px;
  color: var(--factory-muted);
  text-align: center;
  background: #f8fbfd;
  border: 1px dashed var(--factory-line);
  border-radius: 16px;
}

.btn-primary {
  background: var(--factory-blue);
  border-color: var(--factory-blue);
}

.btn-primary:hover {
  background: #0f496d;
  border-color: #0f496d;
}

.btn-warning {
  background: var(--factory-accent);
  border-color: var(--factory-accent);
}

.btn,
.form-control,
.form-select {
  box-shadow: none !important;
}

.form-control,
.form-select {
  border-color: #ccd9e2;
  border-radius: 12px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(21, 92, 138, .64);
  box-shadow: 0 0 0 .22rem rgba(21, 92, 138, .12) !important;
}

.form-label {
  color: #415262;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fbfd, #ffffff);
  border: 1px solid var(--factory-line);
  border-radius: 22px;
}

.filter-field {
  min-width: min(340px, 100%);
}

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

.badge {
  padding: .48em .72em;
  border-radius: 999px;
  letter-spacing: .01em;
}

.user-chip {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 13px;
  line-height: 1.15;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
}

.user-chip small {
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
}

.item-row {
  background: #fbfdfe;
  border: 1px solid var(--factory-line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.empty-state {
  max-width: 620px;
  margin: 70px auto;
  text-align: center;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--factory-line);
  border-radius: 24px;
  padding: 44px;
}

.audit-json {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-approve-department {
  min-width: 150px;
}

.document-form {
  max-width: 980px;
  margin: 0 auto;
}

.document-toolbar {
  position: sticky;
  top: 88px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--factory-line);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(23, 33, 43, .08);
  backdrop-filter: blur(14px);
}

.document-sheet {
  min-height: 1320px;
  padding: 28px;
  background: #fff;
  border: 1px solid #c9d3da;
  box-shadow: 0 24px 70px rgba(23, 33, 43, .14);
}

.document-copy {
  position: relative;
  min-height: 610px;
  padding: 20px 20px 18px;
  border: 2px solid #1d252c;
  color: #111820;
  font-family: Tahoma, "Noto Sans Thai", sans-serif;
  font-size: 12px;
  background: #fff;
}

.document-copy + .document-copy {
  margin-top: 28px;
}

.document-copy h2 {
  margin: 0;
  text-align: center;
  font-size: 21px;
  font-weight: 800;
}

.doc-code {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 12px;
  font-weight: 700;
}

.doc-subtitle {
  margin-bottom: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .08em;
}

.doc-meta-table,
.doc-items-table,
.doc-sign-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.doc-meta-table th,
.doc-meta-table td,
.doc-items-table th,
.doc-items-table td,
.doc-sign-table th,
.doc-sign-table td {
  border: 1px solid #1d252c;
}

.doc-meta-table th {
  width: 24%;
  padding: 6px 8px;
  background: #eef3f6;
  font-weight: 700;
}

.doc-meta-table td {
  width: 26%;
  min-height: 34px;
  padding: 2px 6px;
}

.doc-type-row,
.doc-header-remark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 8px;
  border-right: 1px solid #1d252c;
  border-left: 1px solid #1d252c;
}

.doc-label {
  min-width: 86px;
  font-weight: 700;
}

.doc-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  white-space: nowrap;
}

.doc-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--factory-blue);
}

.doc-check-readonly.is-checked {
  font-weight: 700;
}

.doc-items-table th {
  padding: 6px;
  text-align: center;
  background: #eef3f6;
  font-weight: 800;
}

.doc-items-table td {
  height: 34px;
  padding: 0 5px;
  vertical-align: middle;
}

.doc-col-no {
  width: 48px;
}

.doc-col-qty {
  width: 105px;
}

.doc-col-wh {
  width: 150px;
}

.doc-col-remark {
  width: 170px;
}

.doc-col-action {
  width: 58px;
}

.doc-input {
  width: 100%;
  min-height: 30px;
  padding: 3px 4px;
  color: #111820;
  background: #fffdf5;
  border: 0;
  border-radius: 0;
  outline: 0;
  font: inherit;
}

.doc-input:focus {
  background: #fff5d7;
  box-shadow: inset 0 -2px 0 var(--factory-accent);
}

.doc-static,
[data-mirror-output],
[data-mirror-items] td {
  display: block;
  min-height: 28px;
  padding: 5px 4px;
}

.doc-sign-table {
  margin-top: 14px;
}

.doc-sign-table th {
  width: 25%;
  padding: 6px;
  text-align: center;
  background: #eef3f6;
}

.doc-sign-table td {
  height: 50px;
  text-align: center;
  vertical-align: bottom;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 18px 12px 42px;
  }

  .page-title,
  .hero-title {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title .btn {
    width: 100%;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-field,
  .filter-actions,
  .filter-actions .btn,
  .filter-actions .btn-link {
    width: 100%;
  }

  .document-form {
    max-width: 100%;
  }

  .document-sheet {
    overflow-x: auto;
    padding: 14px;
  }

  .document-copy {
    min-width: 860px;
  }
}

/* Modern office shell redesign. Keep document editor styles above intact. */
body.app-body {
  min-height: 100vh;
  color: #17212f;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(34, 112, 150, .16), transparent 26rem),
    radial-gradient(circle at 92% 0%, rgba(242, 168, 59, .12), transparent 24rem),
    linear-gradient(135deg, #f5f8fb 0%, #edf3f7 48%, #f8fafc 100%);
}

.app-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  max-width: 100vw;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 18px;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 26%),
    linear-gradient(180deg, #102f46 0%, #0b2436 100%);
  box-shadow: 18px 0 60px rgba(15, 47, 70, .16);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-brand:hover {
  color: #ffffff;
}

.app-brand strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
}

.app-brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .62);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  flex: 0 0 auto;
  color: #0f2f46;
  background: linear-gradient(135deg, #ffffff, #dff2fb);
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 17px;
  box-shadow: inset 0 -8px 18px rgba(21, 92, 138, .12), 0 10px 24px rgba(0, 0, 0, .16);
  font-size: .82rem;
  font-weight: 900;
}

.brand-mark img,
.auth-showcase-mark img,
.auth-form-logo img {
  display: block;
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.side-nav {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 10px;
  color: rgba(255, 255, 255, .76);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 18px;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.side-nav-link:hover,
.side-nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .11);
  border-color: rgba(255, 255, 255, .12);
  transform: translateX(2px);
}

.side-nav-link.active {
  box-shadow: inset 4px 0 0 #f2a83b;
}

.side-nav-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  color: #dff2fb;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  font-size: .78rem;
  font-weight: 900;
}

.side-nav-copy strong,
.side-nav-copy small {
  display: block;
}

.side-nav-copy strong {
  color: inherit;
  font-size: .93rem;
}

.side-nav-copy small {
  margin-top: 1px;
  color: rgba(255, 255, 255, .48);
  font-size: .73rem;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
}

.profile-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  color: #0f2f46;
  background: #ffffff;
  border-radius: 15px;
  font-weight: 900;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}

.sidebar-profile strong {
  color: #ffffff;
  font-size: .88rem;
  line-height: 1.25;
}

.sidebar-profile small {
  color: rgba(255, 255, 255, .58);
  font-size: .72rem;
}

.app-main-frame {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 18px 34px;
  background: rgba(248, 250, 252, .78);
  border-bottom: 1px solid rgba(216, 227, 234, .78);
  backdrop-filter: blur(18px);
}

.topbar-eyebrow {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.topbar-title {
  margin-top: 2px;
  color: #111827;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-shell {
  width: min(100%, 1180px);
  max-width: 100%;
  margin: 0 auto;
  padding: 34px 30px 64px;
}

.app-shell-document {
  max-width: 1200px;
}

.app-layout-document .app-topbar {
  background: rgba(255, 255, 255, .86);
}

.app-layout-document .document-toolbar {
  top: 96px;
}

.app-shell-document .page-title {
  align-items: center;
  margin-bottom: 22px;
  padding: 0;
}

.app-shell-document .page-title h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.app-shell-document .page-title p {
  margin-top: 2px;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.page-title h1 {
  margin: 10px 0 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 950;
  line-height: .95;
  letter-spacing: -.06em;
}

.page-title p {
  margin-top: 10px;
  color: #64748b !important;
  font-size: .98rem;
}

.hero-title {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell-document .page-title h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.panel,
.metric-card,
.quick-action,
.auth-card {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(222, 232, 239, .92);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(15, 47, 70, .1);
  backdrop-filter: blur(16px);
}

.panel {
  padding: 24px;
}

.metric-card {
  min-height: 172px;
  padding: 24px;
  border-radius: 28px;
}

.metric-card::before {
  left: 24px;
  right: 24px;
  bottom: 18px;
  height: 5px;
}

.metric-card::after {
  width: 116px;
  height: 116px;
  right: -38px;
  top: -38px;
}

.metric-label {
  color: #475569;
  font-size: .95rem;
  font-weight: 900;
}

.metric-value {
  color: #111827;
  font-size: 2.6rem;
  line-height: 1;
}

.quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.quick-action {
  min-height: 104px;
  padding: 22px;
  border-left-width: 0;
  border-top: 5px solid var(--action-color, #155c8a);
}

.quick-action span {
  color: #111827;
  font-size: 1rem;
}

.quick-action small {
  color: #64748b;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 340px) auto;
  align-items: end;
  padding: 18px;
  background: #f8fbfd;
  border: 1px solid #e2ebf1;
  border-radius: 22px;
}

.table-responsive {
  border: 1px solid #e5edf3;
  border-radius: 22px;
}

.app-table {
  min-width: 820px;
}

.table thead th {
  color: #64748b;
  background: #f8fafc;
  border-color: #e5edf3;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-table tbody td {
  padding-top: 18px;
  padding-bottom: 18px;
  color: #182434;
  border-color: #eef3f7;
}

.app-table tbody tr:hover {
  background: #f8fbfd;
}

.btn {
  border-radius: 14px;
  font-weight: 800;
}

.btn-primary {
  background: #155c8a;
  border-color: #155c8a;
}

.btn-primary:hover {
  background: #0f496d;
  border-color: #0f496d;
}

.btn-outline-secondary {
  color: #334155;
  border-color: #d5e0e8;
  background: rgba(255, 255, 255, .76);
}

.form-control,
.form-select {
  min-height: 42px;
  border-color: #d5e0e8;
  border-radius: 14px;
}

.badge {
  padding: .55em .78em;
  border-radius: 999px;
  font-weight: 900;
}

.auth-body {
  background:
    radial-gradient(circle at 15% 12%, rgba(21, 92, 138, .18), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(242, 168, 59, .14), transparent 24rem),
    linear-gradient(135deg, #f7fbfd 0%, #edf4f8 100%);
}

.auth-card {
  width: min(520px, 100%);
  padding: 42px;
}

@media (max-width: 1080px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 12px;
    border-radius: 0 0 28px 28px;
  }

  .app-brand {
    padding: 8px;
    border-bottom: 0;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .side-nav-link {
    flex: 0 0 auto;
    min-width: 174px;
  }

  .sidebar-profile {
    display: none;
  }

  .app-topbar {
    position: relative;
    padding: 16px;
  }

  .app-shell {
    padding: 22px 14px 48px;
  }
}

@media (max-width: 760px) {
  .app-topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title h1 {
    font-size: 2.15rem;
  }

  .topbar-actions,
  .topbar-actions .btn,
  .page-title .btn {
    width: 100%;
  }

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

/* Pastel office polish */
:root {
  --pastel-ink: #263241;
  --pastel-muted: #728196;
  --pastel-blue: #8fc7df;
  --pastel-blue-strong: #5f9fc0;
  --pastel-mint: #b7dfd1;
  --pastel-cream: #fff1d6;
  --pastel-peach: #ffd7c2;
  --pastel-lilac: #d9d5f3;
  --pastel-paper: rgba(255, 255, 255, .92);
  --pastel-line: #e2edf2;
  --pastel-shadow: 0 18px 46px rgba(78, 111, 134, .13);
}

body.app-body {
  color: var(--pastel-ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(143, 199, 223, .34), transparent 24rem),
    radial-gradient(circle at 92% 0%, rgba(255, 215, 194, .42), transparent 22rem),
    radial-gradient(circle at 82% 92%, rgba(183, 223, 209, .28), transparent 24rem),
    linear-gradient(135deg, #f8fbfd 0%, #eef6f8 50%, #fffaf2 100%);
}

.app-sidebar {
  color: var(--pastel-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(247, 252, 253, .86)),
    linear-gradient(135deg, rgba(143, 199, 223, .28), rgba(255, 215, 194, .2));
  border-right: 1px solid rgba(195, 216, 226, .72);
  box-shadow: 18px 0 44px rgba(86, 116, 138, .1);
}

.app-brand {
  color: var(--pastel-ink);
  border-bottom-color: rgba(160, 190, 204, .35);
}

.app-brand:hover {
  color: #182434;
}

.app-brand strong {
  font-size: 1rem;
}

.app-brand small,
.side-nav-copy small,
.sidebar-profile small {
  color: var(--pastel-muted);
}

.brand-mark {
  color: #2b5e76;
  background: linear-gradient(135deg, #ffffff, #dff4f7 58%, #fff1d6);
  border-color: rgba(143, 199, 223, .46);
  box-shadow: inset 0 -8px 18px rgba(143, 199, 223, .18), 0 10px 22px rgba(91, 126, 146, .16);
}

.side-nav-link {
  min-height: 54px;
  color: #46586b;
  border-color: transparent;
}

.side-nav-link:hover,
.side-nav-link.active {
  color: #213142;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(179, 207, 219, .72);
  box-shadow: 0 10px 24px rgba(78, 111, 134, .08);
}

.side-nav-link.active {
  box-shadow: inset 4px 0 0 var(--pastel-blue-strong), 0 10px 24px rgba(78, 111, 134, .08);
}

.side-nav-mark {
  color: #3f728c;
  background: #eef8fa;
  border-color: #d5eaf1;
  font-size: .74rem;
}

.side-nav-copy strong {
  font-size: .88rem;
}

.side-nav-copy small {
  font-size: .7rem;
}

.sidebar-profile {
  background: rgba(255, 255, 255, .66);
  border-color: rgba(179, 207, 219, .7);
}

.profile-avatar {
  color: #2b5e76;
  background: linear-gradient(135deg, #f9fdff, #dff4f7);
}

.sidebar-profile strong {
  color: #263241;
}

.app-topbar {
  min-height: 70px;
  background: rgba(255, 255, 255, .76);
  border-bottom-color: rgba(210, 226, 234, .8);
}

.topbar-eyebrow {
  color: #7d8da0;
  font-size: .68rem;
  letter-spacing: .16em;
}

.topbar-title {
  color: #263241;
  font-size: 1rem;
}

.app-shell {
  padding-top: 28px;
}

.page-title {
  margin-bottom: 18px;
}

.page-title h1 {
  color: #223041;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.page-title p {
  color: var(--pastel-muted) !important;
  font-size: .94rem;
}

.tw-tracking-\[\.24em\] {
  letter-spacing: .18em !important;
}

.tw-text-office-blue {
  color: #5f9fc0 !important;
}

.panel,
.metric-card,
.quick-action,
.auth-card {
  background: var(--pastel-paper);
  border-color: rgba(216, 232, 239, .88);
  border-radius: 24px;
  box-shadow: var(--pastel-shadow);
}

.metric-card {
  min-height: 145px;
  padding: 20px;
}

.metric-card::after {
  width: 98px;
  height: 98px;
  background: color-mix(in srgb, var(--metric-color, var(--pastel-blue)) 14%, transparent);
}

.metric-card::before {
  height: 4px;
  opacity: .65;
}

.metric-draft {
  --metric-color: #a9b5c4;
}

.metric-pending_approval {
  --metric-color: #f3c66d;
}

.metric-approved {
  --metric-color: #8fc7df;
}

.metric-warehouse_issued {
  --metric-color: #8aaedf;
}

.metric-received {
  --metric-color: #8fcfb6;
}

.metric-label {
  color: #506174;
  font-size: .88rem;
}

.metric-value {
  color: #223041;
  font-size: 2.1rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--dot-color, #8fc7df) 16%, transparent);
}

.quick-action {
  min-height: 92px;
  padding: 18px;
  border-radius: 22px;
}

.quick-action-primary {
  --action-color: #8fc7df;
}

.quick-action-warning {
  --action-color: #f3c66d;
}

.quick-action-info {
  --action-color: #9ebce5;
}

.quick-action-success {
  --action-color: #8fcfb6;
}

.quick-action span {
  color: #263241;
  font-size: .95rem;
}

.quick-action small {
  color: var(--pastel-muted);
  font-size: .8rem;
}

.filter-bar {
  background: rgba(248, 252, 253, .9);
  border-color: var(--pastel-line);
}

.table-responsive {
  border-color: var(--pastel-line);
}

.table thead th {
  color: #657589;
  background: #f7fbfc;
  font-size: .74rem;
  letter-spacing: .07em;
}

.app-table tbody td {
  color: #263241;
  padding-top: 15px;
  padding-bottom: 15px;
  font-size: .93rem;
}

.badge {
  font-size: .76rem;
}

.btn {
  font-size: .9rem;
}

.btn-primary {
  color: #183348;
  background: #b9deee;
  border-color: #b9deee;
}

.btn-primary:hover {
  color: #102636;
  background: #a6d3e7;
  border-color: #a6d3e7;
}

.btn-warning {
  color: #4c3713;
  background: #ffe0a3;
  border-color: #ffe0a3;
}

.btn-success {
  color: #153b2c;
  background: #aee2c9;
  border-color: #aee2c9;
}

.btn-outline-primary {
  color: #4e8ead;
  border-color: #abd7e8;
}

.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success {
  background: rgba(255, 255, 255, .72);
}

.form-label {
  color: #506174;
  font-size: .88rem;
}

.form-control,
.form-select {
  border-color: #dce9ef;
  font-size: .92rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #9fd0e3;
  box-shadow: 0 0 0 .2rem rgba(143, 199, 223, .2) !important;
}

.auth-body {
  background:
    radial-gradient(circle at 12% 12%, rgba(143, 199, 223, .34), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(255, 215, 194, .4), transparent 22rem),
    linear-gradient(135deg, #f9fcfd 0%, #eef6f8 100%);
}

@media (max-width: 1080px) {
  .app-sidebar {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(239, 249, 251, .94)),
      linear-gradient(90deg, rgba(143, 199, 223, .24), rgba(255, 215, 194, .18));
  }
}

@media (max-width: 760px) {
  .page-title h1 {
    font-size: 1.8rem;
  }

  .metric-card {
    min-height: 132px;
  }
}

/* Fastwork-inspired marketplace UI */
:root {
  --fw-green: #12c48b;
  --fw-green-dark: #0e9f73;
  --fw-mint: #e7fbf4;
  --fw-mint-2: #f2fdf9;
  --fw-sky: #eef8ff;
  --fw-yellow: #fff6df;
  --fw-ink: #1f2937;
  --fw-muted: #6b7280;
  --fw-line: #e6edf1;
  --fw-page: #f7faf9;
  --fw-shadow: 0 14px 40px rgba(31, 41, 55, .08);
}

body.app-body {
  color: var(--fw-ink);
  background:
    radial-gradient(circle at 12% 3%, rgba(18, 196, 139, .12), transparent 24rem),
    radial-gradient(circle at 94% 2%, rgba(255, 222, 138, .22), transparent 22rem),
    linear-gradient(180deg, #ffffff 0%, var(--fw-page) 42%, #ffffff 100%);
}

.app-layout {
  grid-template-columns: 270px minmax(0, 1fr);
}

.app-sidebar {
  color: var(--fw-ink);
  background: rgba(255, 255, 255, .94);
  border-right: 1px solid var(--fw-line);
  box-shadow: 8px 0 34px rgba(31, 41, 55, .05);
}

.app-brand {
  color: var(--fw-ink);
  border-bottom-color: var(--fw-line);
}

.app-brand:hover {
  color: var(--fw-ink);
}

.brand-mark {
  color: var(--fw-green-dark);
  background: linear-gradient(135deg, #ffffff, var(--fw-mint));
  border-color: #c9f5e5;
  box-shadow: inset 0 -8px 18px rgba(18, 196, 139, .12), 0 10px 22px rgba(18, 196, 139, .12);
}

.app-brand strong {
  color: var(--fw-ink);
  font-size: .98rem;
}

.app-brand small {
  color: var(--fw-green-dark);
  font-size: .68rem;
}

.side-nav {
  gap: 10px;
}

.side-nav-link {
  min-height: 56px;
  color: #4b5563;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 18px;
}

.side-nav-link:hover,
.side-nav-link.active {
  color: var(--fw-ink);
  background: var(--fw-mint-2);
  border-color: #c9f5e5;
  box-shadow: 0 10px 26px rgba(18, 196, 139, .08);
  transform: translateX(0);
}

.side-nav-link.active {
  box-shadow: inset 5px 0 0 var(--fw-green), 0 10px 26px rgba(18, 196, 139, .08);
}

.side-nav-mark {
  color: var(--fw-green-dark);
  background: var(--fw-mint);
  border-color: #c9f5e5;
}

.side-nav-copy strong {
  font-size: .88rem;
}

.side-nav-copy small {
  color: var(--fw-muted);
  font-size: .69rem;
}

.sidebar-profile {
  background: #ffffff;
  border-color: var(--fw-line);
  box-shadow: var(--fw-shadow);
}

.profile-avatar {
  color: #ffffff;
  background: linear-gradient(135deg, var(--fw-green), var(--fw-green-dark));
}

.sidebar-profile strong {
  color: var(--fw-ink);
}

.sidebar-profile small {
  color: var(--fw-muted);
}

.app-topbar {
  min-height: 72px;
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--fw-line);
  box-shadow: 0 10px 28px rgba(31, 41, 55, .04);
}

.topbar-eyebrow {
  color: var(--fw-green-dark);
  font-size: .66rem;
  letter-spacing: .15em;
}

.topbar-title {
  color: var(--fw-ink);
  font-size: 1.02rem;
  font-weight: 900;
}

.app-shell {
  padding-top: 30px;
}

.page-title h1 {
  color: var(--fw-ink);
  font-size: clamp(1.72rem, 2.6vw, 2.35rem);
  letter-spacing: -.04em;
}

.page-title p {
  color: var(--fw-muted) !important;
  font-size: .92rem;
}

.tw-text-office-blue {
  color: var(--fw-green-dark) !important;
}

.panel,
.metric-card,
.quick-action,
.auth-card {
  background: #ffffff;
  border-color: var(--fw-line);
  border-radius: 22px;
  box-shadow: var(--fw-shadow);
}

.metric-card {
  min-height: 138px;
  padding: 18px;
}

.metric-card::after {
  width: 90px;
  height: 90px;
  background: color-mix(in srgb, var(--metric-color, var(--fw-green)) 13%, transparent);
}

.metric-card::before {
  height: 4px;
  background: var(--metric-color, var(--fw-green));
  opacity: .75;
}

.metric-card:hover,
.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(18, 196, 139, .12);
}

.metric-draft {
  --metric-color: #94a3b8;
}

.metric-pending_approval {
  --metric-color: #f5c84c;
}

.metric-approved {
  --metric-color: #62c8e4;
}

.metric-warehouse_issued {
  --metric-color: #12c48b;
}

.metric-received {
  --metric-color: #36d399;
}

.metric-label {
  color: #374151;
  font-size: .86rem;
}

.metric-value {
  color: var(--fw-ink);
  font-size: 2rem;
}

.status-dot-green {
  --dot-color: var(--fw-green);
}

.quick-action {
  min-height: 88px;
  padding: 17px;
  border-top-width: 4px;
}

.quick-action-primary,
.quick-action-info,
.quick-action-success {
  --action-color: var(--fw-green);
}

.quick-action-warning {
  --action-color: #f5c84c;
}

.quick-action span {
  color: var(--fw-ink);
  font-size: .93rem;
}

.quick-action small {
  color: var(--fw-muted);
  font-size: .78rem;
}

.filter-bar {
  background: var(--fw-mint-2);
  border-color: #d6f5e9;
}

.table-responsive {
  border-color: var(--fw-line);
  box-shadow: none;
}

.table thead th {
  color: #6b7280;
  background: #fbfcfc;
  font-size: .72rem;
}

.app-table tbody td {
  color: var(--fw-ink);
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: .91rem;
}

.app-table tbody tr:hover {
  background: var(--fw-mint-2);
}

.table-empty {
  background: var(--fw-mint-2);
  border-color: #d6f5e9;
}

.btn {
  border-radius: 999px;
  font-size: .88rem;
}

.btn-primary {
  color: #ffffff;
  background: var(--fw-green);
  border-color: var(--fw-green);
}

.btn-primary:hover {
  color: #ffffff;
  background: var(--fw-green-dark);
  border-color: var(--fw-green-dark);
}

.btn-warning {
  color: #6b4b00;
  background: #ffe59a;
  border-color: #ffe59a;
}

.btn-success {
  color: #07543c;
  background: #bff4df;
  border-color: #bff4df;
}

.btn-outline-primary {
  color: var(--fw-green-dark);
  border-color: #a7efd6;
}

.btn-outline-primary:hover {
  color: #ffffff;
  background: var(--fw-green);
  border-color: var(--fw-green);
}

.btn-outline-secondary {
  color: #4b5563;
  border-color: var(--fw-line);
}

.badge {
  font-size: .74rem;
}

.text-bg-warning {
  color: #704f00 !important;
  background: #ffe49a !important;
}

.text-bg-success {
  color: #064e3b !important;
  background: #bff4df !important;
}

.text-bg-primary,
.text-bg-info {
  color: #07543c !important;
  background: #c7f6e5 !important;
}

.form-control,
.form-select {
  border-color: var(--fw-line);
  border-radius: 14px;
  font-size: .9rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--fw-green);
  box-shadow: 0 0 0 .2rem rgba(18, 196, 139, .14) !important;
}

.auth-body {
  background:
    radial-gradient(circle at 18% 10%, rgba(18, 196, 139, .14), transparent 26rem),
    radial-gradient(circle at 88% 0%, rgba(255, 222, 138, .24), transparent 22rem),
    linear-gradient(180deg, #ffffff 0%, var(--fw-page) 100%);
}

@media (max-width: 1080px) {
  .app-sidebar {
    background: rgba(255, 255, 255, .94);
  }

  .side-nav-link {
    background: #ffffff;
    border-color: var(--fw-line);
  }
}

@media (max-width: 760px) {
  .page-title h1 {
    font-size: 1.72rem;
  }

  .metric-card {
    min-height: 126px;
  }
}

/* Fastwork responsive polish: marketplace feel without touching the document form. */
.app-shell:not(.app-shell-document) .page-title {
  position: relative;
  align-items: center;
  padding: 24px 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 224, 138, .46), transparent 9rem),
    linear-gradient(135deg, #ffffff 0%, #f0fdf8 58%, #fff9e8 100%);
  border: 1px solid #d9f6ea;
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(18, 196, 139, .09);
}

.app-shell:not(.app-shell-document) .page-title::after {
  position: absolute;
  right: -54px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  content: "";
  background: rgba(18, 196, 139, .1);
  border-radius: 999px;
}

.app-shell:not(.app-shell-document) .page-title > * {
  position: relative;
  z-index: 1;
}

.app-shell:not(.app-shell-document) .page-title h1 {
  margin-top: 8px;
}

.app-shell:not(.app-shell-document) .page-title .tw-uppercase {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(18, 196, 139, .18);
  border-radius: 999px;
}

.topbar-actions .btn-primary {
  padding-right: 1.35rem;
  padding-left: 1.35rem;
  box-shadow: 0 10px 22px rgba(18, 196, 139, .2);
}

.topbar-actions .btn-outline-secondary {
  background: #ffffff;
}

@media (max-width: 1080px) {
  .app-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    gap: 10px;
    padding: 12px 14px 10px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--fw-line);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 12px 30px rgba(31, 41, 55, .07);
  }

  .app-brand {
    padding: 4px 6px 8px;
    border-bottom: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav-link {
    flex: 0 0 auto;
    min-width: 156px;
    min-height: 52px;
    background: #ffffff;
    border-color: var(--fw-line);
  }

  .side-nav-link.active {
    box-shadow: inset 4px 0 0 var(--fw-green), 0 8px 20px rgba(18, 196, 139, .08);
  }

  .sidebar-profile {
    display: none;
  }

  .app-topbar {
    position: relative;
    min-height: 64px;
    padding: 14px 16px;
  }

  .app-shell {
    width: 100%;
    padding: 24px 16px 50px;
  }
}

@media (max-width: 760px) {
  .app-topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .topbar-eyebrow {
    font-size: .56rem;
  }

  .topbar-title {
    font-size: .9rem;
  }

  .topbar-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
  }

  .topbar-actions .btn,
  .page-title .btn {
    width: auto;
  }

  .topbar-actions .btn {
    padding: .42rem .78rem;
    font-size: .78rem;
  }

  .app-shell:not(.app-shell-document) .page-title {
    align-items: flex-start;
    padding: 20px;
    border-radius: 24px;
  }

  .app-shell:not(.app-shell-document) .page-title h1 {
    font-size: 1.62rem;
    line-height: 1.1;
  }

  .app-shell:not(.app-shell-document) .page-title p {
    font-size: .86rem;
  }

  .metric-card {
    min-height: 118px;
    padding: 16px;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .quick-action {
    min-height: 78px;
    padding: 15px 16px;
  }
}

/* Document form UX upgrade */
.app-shell-document {
  width: min(100%, 1180px);
}

.app-shell-document .page-title {
  position: relative;
  align-items: center;
  margin-bottom: 14px;
  padding: 28px 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 224, 138, .5), transparent 11rem),
    linear-gradient(135deg, #ffffff 0%, #f2fdf9 62%, #fff9eb 100%);
  border: 1px solid #d9f6ea;
  border-radius: 30px;
  box-shadow: 0 18px 46px rgba(18, 196, 139, .08);
}

.app-shell-document .page-title::after {
  position: absolute;
  right: -68px;
  bottom: -88px;
  width: 210px;
  height: 210px;
  content: "";
  background: rgba(18, 196, 139, .1);
  border-radius: 999px;
}

.app-shell-document .page-title > * {
  position: relative;
  z-index: 1;
}

.app-shell-document .page-title h1 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.document-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 980px;
  margin: 0 auto 14px;
}

.document-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--fw-line);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(31, 41, 55, .05);
}

.document-step span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  grid-row: span 2;
  color: var(--fw-green-dark);
  background: var(--fw-mint);
  border: 1px solid #c9f5e5;
  border-radius: 13px;
  font-weight: 900;
}

.document-step strong {
  color: var(--fw-ink);
  font-size: .92rem;
  line-height: 1.15;
}

.document-step small {
  color: var(--fw-muted);
  font-size: .76rem;
  line-height: 1.25;
}

.document-step.is-active {
  background: linear-gradient(135deg, #ffffff, #f0fdf8);
  border-color: #b9f0dc;
  box-shadow: 0 14px 34px rgba(18, 196, 139, .1);
}

.document-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(242, 253, 249, .92)),
    radial-gradient(circle at 0 0, rgba(18, 196, 139, .08), transparent 12rem);
  border-color: #d4f4e8;
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(31, 41, 55, .08);
}

.document-toolbar-copy {
  display: grid;
  min-width: 220px;
  line-height: 1.2;
}

.document-toolbar-copy strong {
  color: var(--fw-ink);
  font-size: .9rem;
  letter-spacing: -.01em;
}

.document-toolbar-copy span {
  margin-top: 3px;
  color: var(--fw-muted);
  font-size: .78rem;
}

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

.document-toolbar .btn {
  min-height: 38px;
  padding-right: 1rem;
  padding-left: 1rem;
}

.document-toolbar .btn-primary {
  box-shadow: 0 12px 24px rgba(18, 196, 139, .22);
}

.document-sheet {
  position: relative;
  padding: 34px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(18, 196, 139, .38), rgba(255, 224, 138, .5)) border-box;
  border: 1px solid transparent;
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(31, 41, 55, .13);
}

.document-sheet::before {
  position: absolute;
  inset: 14px;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(rgba(18, 196, 139, .12) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 22px;
  opacity: .34;
}

.document-copy {
  z-index: 1;
  border-color: #17212f;
  border-radius: 2px;
  box-shadow: 0 16px 34px rgba(31, 41, 55, .08);
}

.document-copy-edit {
  background:
    linear-gradient(90deg, rgba(18, 196, 139, .045), transparent 34%),
    #ffffff;
}

.document-copy-mirror {
  background:
    linear-gradient(90deg, rgba(255, 224, 138, .07), transparent 34%),
    #ffffff;
}

.doc-copy-tag {
  position: absolute;
  top: -15px;
  left: 18px;
  padding: 5px 11px;
  color: var(--fw-green-dark);
  background: #ffffff;
  border: 1px solid #c9f5e5;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(31, 41, 55, .08);
  font-family: "Noto Sans Thai", "Sarabun", sans-serif;
  font-size: 11px;
  font-weight: 900;
}

.doc-meta-table th,
.doc-items-table th,
.doc-sign-table th {
  color: #17212f;
  background: #f3f8fb;
}

.doc-input {
  transition: background .16s ease, box-shadow .16s ease;
}

.doc-input:hover {
  background: #fff9e8;
}

.doc-input:focus {
  background: #fff6dc;
  box-shadow: inset 0 -2px 0 var(--fw-green);
}

.doc-check {
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background .16s ease, border-color .16s ease;
}

.doc-check:has(input:checked) {
  background: #e9fbf5;
  border-color: #b9f0dc;
  font-weight: 800;
}

.doc-check input {
  accent-color: var(--fw-green);
}

.doc-items-table tbody tr {
  transition: background .16s ease;
}

.doc-items-table tbody tr:focus-within {
  background: #f2fdf9;
}

.doc-items-table .btn-outline-danger {
  padding: .25rem .56rem;
  color: #b42318;
  background: #fff8f6;
  border-color: #ffd4cc;
  border-radius: 999px;
}

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

  .document-toolbar {
    align-items: stretch;
  }

  .document-toolbar-copy {
    min-width: 0;
  }

  .document-toolbar-actions {
    justify-content: stretch;
  }

  .document-toolbar-actions .btn {
    flex: 1 1 140px;
  }

  .document-sheet {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .app-shell-document .page-title {
    padding: 22px;
  }

  .app-shell-document .page-title h1 {
    font-size: 1.82rem;
  }

  .document-toolbar {
    top: 74px;
  }
}

main.app-shell-document .document-steps {
  display: grid !important;
  width: min(980px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto 14px;
}

main.app-shell-document .document-steps > .document-step {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 14px 16px !important;
  background: rgba(255, 255, 255, .92) !important;
  border: 1px solid var(--fw-line) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 26px rgba(31, 41, 55, .06) !important;
}

main.app-shell-document .document-steps > .document-step > span {
  display: grid !important;
  width: 34px;
  height: 34px;
  place-items: center;
  grid-row: span 2;
  color: var(--fw-green-dark);
  background: var(--fw-mint);
  border: 1px solid #c9f5e5;
  border-radius: 13px;
  font-weight: 900;
}

main.app-shell-document .document-steps > .document-step.is-active {
  background: linear-gradient(135deg, #ffffff, #f0fdf8) !important;
  border-color: #b9f0dc !important;
}

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

/* Factory inventory reference theme */
:root {
  --ref-navy-950: #05233f;
  --ref-navy-900: #08345e;
  --ref-navy-800: #0b4c87;
  --ref-blue-700: #075dbe;
  --ref-blue-600: #0b6fe8;
  --ref-cyan: #13c8c3;
  --ref-mint: #e9fbf7;
  --ref-sky: #eaf5ff;
  --ref-amber: #fff3dd;
  --ref-orange: #fff0e7;
  --ref-green: #eafaf1;
  --ref-ink: #0f2742;
  --ref-muted: #6b7d92;
  --ref-line: #dce7f1;
  --ref-page: #f4f8fc;
  --ref-shadow: 0 16px 42px rgba(15, 39, 66, .1);
}

body.app-body {
  color: var(--ref-ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(11, 111, 232, .08), transparent 30rem),
    radial-gradient(circle at 94% 8%, rgba(19, 200, 195, .12), transparent 26rem),
    linear-gradient(180deg, #f8fbff 0%, var(--ref-page) 48%, #ffffff 100%);
}

.app-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
  color: #ffffff;
  background:
    radial-gradient(circle at 24% 6%, rgba(19, 200, 195, .22), transparent 9rem),
    linear-gradient(180deg, #073e6f 0%, #062f56 42%, #041f39 100%);
  border-right: 0;
  box-shadow: 18px 0 44px rgba(5, 35, 63, .2);
}

.app-brand {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, .13);
}

.app-brand:hover {
  color: #ffffff;
}

.brand-mark {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(19, 200, 195, .95), rgba(11, 111, 232, .9));
  border-color: rgba(255, 255, 255, .3);
  box-shadow: inset 0 -10px 18px rgba(5, 35, 63, .18), 0 12px 26px rgba(19, 200, 195, .18);
}

.app-brand strong {
  color: #ffffff;
}

.app-brand small {
  color: rgba(210, 241, 255, .78);
}

.side-nav-link {
  color: rgba(235, 247, 255, .8);
  background: transparent;
  border-color: transparent;
  border-radius: 12px;
}

.side-nav-link:hover,
.side-nav-link.active {
  color: #ffffff;
  background: rgba(11, 111, 232, .9);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 12px 24px rgba(2, 19, 37, .18);
  transform: translateX(0);
}

.side-nav-link.active {
  box-shadow: inset 4px 0 0 var(--ref-cyan), 0 12px 24px rgba(2, 19, 37, .18);
}

.side-nav-mark {
  color: #bceeff;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .14);
  border-radius: 10px;
}

.side-nav-link.active .side-nav-mark {
  color: #ffffff;
  background: rgba(255, 255, 255, .18);
}

.side-nav-copy small {
  color: rgba(220, 239, 255, .58);
}

.sidebar-profile {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .13);
  box-shadow: none;
}

.profile-avatar,
.topbar-user-avatar {
  color: #ffffff;
  background: linear-gradient(135deg, var(--ref-blue-600), var(--ref-cyan));
}

.sidebar-profile strong {
  color: #ffffff;
}

.sidebar-profile small {
  color: rgba(220, 239, 255, .62);
}

.app-topbar {
  min-height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--ref-line);
  box-shadow: 0 8px 24px rgba(15, 39, 66, .05);
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar-menu {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ref-navy-800);
  background: #f5f9fd;
  border: 1px solid var(--ref-line);
  border-radius: 11px;
  font-weight: 900;
}

.topbar-eyebrow {
  color: var(--ref-blue-700);
  letter-spacing: .12em;
}

.topbar-title {
  color: var(--ref-ink);
}

.topbar-actions {
  align-items: center;
}

.notification-menu {
  position: relative;
  flex: 0 0 auto;
}

.notification-menu summary {
  list-style: none;
}

.notification-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-bell {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ref-navy-800);
  cursor: pointer;
  background: #f6f9fc;
  border: 1px solid var(--ref-line);
  border-radius: 999px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.topbar-bell:hover,
.notification-menu[open] .topbar-bell {
  background: #eaf5ff;
  border-color: #b8d7fb;
  transform: translateY(-1px);
}

.topbar-bell::before {
  color: var(--ref-navy-800);
  content: "🔔";
  font-size: .95rem;
  font-weight: 900;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  color: #ffffff;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 900;
  line-height: 1;
}

.notification-count.is-zero {
  color: #64748b;
  background: #e2e8f0;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(380px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 110px));
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(5, 35, 63, .18);
}

.notification-panel::before {
  position: absolute;
  top: -7px;
  right: 19px;
  width: 14px;
  height: 14px;
  content: "";
  background: #ffffff;
  border-top: 1px solid var(--ref-line);
  border-left: 1px solid var(--ref-line);
  transform: rotate(45deg);
}

.notification-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #ffffff, #f4f9ff);
  border-bottom: 1px solid var(--ref-line);
}

.notification-head strong {
  color: var(--ref-ink);
  font-size: 1rem;
}

.notification-head span {
  color: var(--ref-blue-700);
  font-size: .78rem;
  font-weight: 900;
}

.notification-group {
  padding: 10px;
  border-bottom: 1px solid #edf2f7;
}

.notification-group:last-child {
  border-bottom: 0;
}

.notification-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ref-ink);
  text-decoration: none;
  border-radius: 10px;
}

.notification-group-title:hover {
  color: var(--ref-blue-700);
  background: #f6fbff;
}

.notification-group-title span {
  font-size: .86rem;
  font-weight: 900;
}

.notification-group-title strong {
  display: grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  color: #ffffff;
  background: var(--ref-blue-700);
  border-radius: 999px;
  font-size: .72rem;
}

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: var(--ref-ink);
  text-decoration: none;
  border-radius: 10px;
}

.notification-item:hover {
  color: var(--ref-ink);
  background: #f6fbff;
}

.notification-dot {
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .1);
}

.notification-menu.is-read .notification-dot {
  background: #cbd5e1;
  box-shadow: 0 0 0 5px rgba(203, 213, 225, .22);
}

.notification-item strong,
.notification-item small {
  display: block;
}

.notification-item strong {
  overflow: hidden;
  font-size: .86rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ref-muted);
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-empty {
  padding: 18px;
  color: var(--ref-muted);
  font-size: .86rem;
  text-align: center;
}

.notification-empty-small {
  padding: 10px;
  font-size: .78rem;
  text-align: left;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 10px 6px 6px;
  background: #ffffff;
  border: 1px solid var(--ref-line);
  border-radius: 999px;
}

.topbar-user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
}

.topbar-user strong,
.topbar-user small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user strong {
  font-size: .78rem;
}

.topbar-user small {
  margin-top: 2px;
  color: var(--ref-muted);
  font-size: .66rem;
}

.app-shell {
  width: min(100%, 1240px);
  padding: 28px 28px 56px;
}

.app-shell:not(.app-shell-document) .page-title {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app-shell:not(.app-shell-document) .page-title::after {
  display: none;
}

.app-shell:not(.app-shell-document) .page-title .tw-uppercase {
  padding: 0;
  color: var(--ref-blue-700) !important;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.app-shell:not(.app-shell-document) .page-title h1 {
  margin-top: 6px;
  color: var(--ref-ink);
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  line-height: 1.05;
}

.metric-card {
  min-height: 128px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid var(--ref-line);
  border-radius: 12px;
  box-shadow: var(--ref-shadow);
}

.metric-card::after {
  display: none;
}

.metric-card::before {
  right: auto;
  bottom: auto;
  left: 0;
  width: 4px;
  height: 100%;
  opacity: 1;
}

.metric-draft {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.metric-pending_approval {
  background: linear-gradient(135deg, #fffdf8, var(--ref-amber));
}

.metric-approved {
  background: linear-gradient(135deg, #f9fdff, var(--ref-sky));
}

.metric-warehouse_issued {
  background: linear-gradient(135deg, #fffaf7, var(--ref-orange));
}

.metric-received {
  background: linear-gradient(135deg, #f8fffb, var(--ref-green));
}

.metric-label {
  color: var(--ref-ink);
  font-size: .86rem;
}

.metric-value {
  color: #071d35;
  font-size: 2.15rem;
}

.status-dot {
  width: 10px;
  height: 10px;
}

.quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-action,
.panel {
  background: #ffffff;
  border: 1px solid var(--ref-line);
  border-radius: 14px;
  box-shadow: var(--ref-shadow);
}

.quick-action {
  min-height: 88px;
  border-top: 0;
  border-left: 4px solid var(--action-color, var(--ref-blue-600));
}

.quick-action-primary,
.quick-action-info {
  --action-color: var(--ref-blue-600);
}

.quick-action-warning {
  --action-color: #f59e0b;
}

.quick-action-success {
  --action-color: #10b981;
}

.table-responsive {
  border-color: var(--ref-line);
  border-radius: 14px;
}

.table thead th {
  color: #63758a;
  background: #f7fafd;
}

.app-table tbody td {
  border-color: #edf2f7;
}

.app-table tbody tr:hover {
  background: #f6fbff;
}

.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.dashboard-chart-panel {
  padding: 0;
}

.dashboard-bars {
  display: grid;
  min-height: 260px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px 20px 22px;
  background:
    linear-gradient(to top, rgba(220, 231, 241, .75) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff, #f8fbff);
  background-size: 100% 52px, auto;
  border-radius: 0 0 14px 14px;
}

.dashboard-bar-item {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
}

.dashboard-bar-track {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 44px;
  height: 158px;
  align-items: end;
  overflow: hidden;
  background: #eef5fb;
  border-radius: 12px;
}

.dashboard-bar {
  display: block;
  width: 100%;
  min-height: 12px;
  background: linear-gradient(180deg, var(--ref-blue-600), var(--ref-navy-800));
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 18px rgba(11, 111, 232, .16);
}

.dashboard-bar-item strong {
  color: var(--ref-blue-700);
  font-size: .82rem;
  line-height: 1;
}

.dashboard-bar-item small {
  color: var(--ref-muted);
  font-size: .72rem;
}

.recent-list {
  display: grid;
  padding: 8px;
}

.recent-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: var(--ref-ink);
  text-decoration: none;
  border-radius: 12px;
}

.recent-item:hover {
  color: var(--ref-ink);
  background: #f6fbff;
}

.recent-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ref-blue-700);
  background: #eaf5ff;
  border: 1px solid #cfe6ff;
  border-radius: 10px;
  font-weight: 900;
}

.recent-item strong,
.recent-item small {
  display: block;
}

.recent-item strong {
  font-size: .86rem;
}

.recent-item small {
  margin-top: 2px;
  color: var(--ref-muted);
  font-size: .74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  border-radius: 8px;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #0b6fe8, #075dbe);
  border-color: #0b6fe8;
  box-shadow: 0 10px 22px rgba(11, 111, 232, .22);
}

.btn-primary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #075dbe, #064d9d);
  border-color: #075dbe;
}

.btn-outline-primary {
  color: var(--ref-blue-700);
  border-color: #b8d7fb;
}

.btn-outline-primary:hover {
  color: #ffffff;
  background: var(--ref-blue-700);
  border-color: var(--ref-blue-700);
}

.badge {
  border-radius: 7px;
}

.text-bg-warning {
  color: #9a5b00 !important;
  background: #ffe8bf !important;
}

.text-bg-success {
  color: #057047 !important;
  background: #c8f2de !important;
}

.text-bg-primary,
.text-bg-info {
  color: #075dbe !important;
  background: #dbeeff !important;
}

.form-control,
.form-select {
  border-color: #d7e3ee;
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: #0b6fe8;
  box-shadow: 0 0 0 .2rem rgba(11, 111, 232, .12) !important;
}

body.auth-body {
  background:
    radial-gradient(circle at 10% 8%, rgba(19, 200, 195, .16), transparent 22rem),
    linear-gradient(135deg, #f3f8ff 0%, #ffffff 48%, #f7fbff 100%);
}

.auth-shell {
  align-items: center;
  justify-items: center;
  padding: 28px;
}

.auth-shell::before {
  display: none;
}

.auth-experience {
  display: grid;
  width: min(1180px, 100%);
  min-height: 620px;
  grid-template-columns: minmax(310px, .95fr) minmax(360px, 1.05fr);
  gap: 28px;
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(rgba(5, 35, 63, .66), rgba(5, 35, 63, .93)),
    radial-gradient(circle at 78% 14%, rgba(19, 200, 195, .28), transparent 13rem),
    linear-gradient(135deg, #073e6f, #031b31);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(5, 35, 63, .22);
}

.auth-showcase::after {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  content: "";
  background: rgba(19, 200, 195, .14);
  border-radius: 999px;
}

.auth-showcase-mark,
.auth-form-logo {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ref-cyan), var(--ref-blue-600));
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(19, 200, 195, .24);
  font-weight: 950;
}

.auth-showcase h1 {
  max-width: 460px;
  margin: 32px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -.05em;
}

.auth-showcase p {
  max-width: 430px;
  color: rgba(235, 247, 255, .78);
}

.auth-feature-list {
  display: grid;
  gap: 16px;
  margin-top: 38px;
}

.auth-feature-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
}

.auth-feature-list span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  grid-row: span 2;
  color: #c9fbff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 900;
}

.auth-feature-list strong,
.auth-feature-list small {
  display: block;
}

.auth-feature-list small {
  color: rgba(235, 247, 255, .68);
}

.auth-card {
  width: 100%;
  align-self: center;
  padding: 48px;
  background: #ffffff;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 39, 66, .12);
}

.auth-card::before {
  display: none;
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-form-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.auth-kicker {
  color: var(--ref-blue-700);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 3px 0 0;
  color: var(--ref-ink);
  font-size: 1.72rem;
  font-weight: 950;
}

.auth-card-register {
  width: min(620px, 100%);
}

.app-shell-document .page-title {
  background:
    radial-gradient(circle at 86% 8%, rgba(219, 238, 255, .85), transparent 12rem),
    linear-gradient(135deg, #ffffff 0%, #f4f9ff 60%, #eff8ff 100%);
  border-color: #dcecff;
  box-shadow: 0 18px 46px rgba(11, 111, 232, .07);
}

.document-step span,
main.app-shell-document .document-steps > .document-step > span {
  color: #ffffff;
  background: linear-gradient(135deg, var(--ref-blue-600), var(--ref-navy-800));
  border-color: #b8d7fb;
}

.document-step.is-active,
main.app-shell-document .document-steps > .document-step.is-active {
  background: linear-gradient(135deg, #ffffff, #f0f7ff) !important;
  border-color: #b8d7fb !important;
}

.document-toolbar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 249, 255, .92)),
    radial-gradient(circle at 0 0, rgba(11, 111, 232, .08), transparent 12rem);
  border-color: #dcecff;
}

.doc-copy-tag {
  color: var(--ref-blue-700);
  border-color: #b8d7fb;
}

.doc-check:has(input:checked) {
  background: #eaf5ff;
  border-color: #b8d7fb;
}

.doc-check input {
  accent-color: var(--ref-blue-600);
}

.doc-input:focus {
  box-shadow: inset 0 -2px 0 var(--ref-blue-600);
}

@media (min-width: 1081px) {
  .app-layout {
    display: block;
    min-height: 100vh;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .app-sidebar::-webkit-scrollbar {
    width: 7px;
  }

  .app-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .06);
  }

  .app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
  }

  .app-main-frame {
    margin-left: 260px;
  }

  .app-topbar {
    position: sticky;
    top: 0;
    z-index: 35;
  }
}

@media (max-width: 1080px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    gap: 10px;
    padding: 12px 14px 10px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 14px 34px rgba(5, 35, 63, .18);
    background:
      radial-gradient(circle at 18% 0%, rgba(19, 200, 195, .18), transparent 9rem),
      linear-gradient(135deg, #073e6f, #05233f);
  }

  .app-brand {
    padding: 4px 6px 8px;
    border-bottom: 0;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav-link {
    flex: 0 0 auto;
    min-width: 156px;
    min-height: 52px;
    color: var(--ref-ink);
    background: #ffffff;
    border-color: var(--ref-line);
  }

  .side-nav-link:hover,
  .side-nav-link.active {
    color: #ffffff;
  }

  .side-nav-copy small {
    color: var(--ref-muted);
  }

  .side-nav-link.active .side-nav-copy small,
  .side-nav-link:hover .side-nav-copy small {
    color: rgba(255, 255, 255, .78);
  }

  .topbar-user {
    display: none;
  }

  .notification-panel {
    right: -72px;
  }

  .dashboard-insights {
    grid-template-columns: 1fr;
  }
}

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

  .auth-showcase {
    min-height: 360px;
    padding: 32px;
  }
}

@media (max-width: 760px) {
  .app-topbar {
    padding: 12px 16px;
  }

  .topbar-menu {
    display: none;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card,
  .auth-showcase {
    padding: 26px;
  }
}

/* Smooth interaction layer */
html {
  scroll-behavior: smooth;
}

.app-main-frame,
.app-shell,
.auth-experience,
.auth-card {
  animation: uiFadeIn .34s ease both;
}

.app-shell > .page-title,
.app-shell > .document-steps,
.app-shell > .document-form,
.app-shell > .tw-grid,
.app-shell > .quick-actions,
.app-shell > .dashboard-insights,
.app-shell > .panel {
  animation: uiRise .38s ease both;
}

.app-shell > .tw-grid,
.app-shell > .quick-actions {
  animation-delay: .04s;
}

.app-shell > .dashboard-insights,
.app-shell > .panel {
  animation-delay: .08s;
}

.side-nav-link,
.topbar-bell,
.topbar-user,
.btn,
.metric-card,
.quick-action,
.panel,
.recent-item,
.notification-item,
.notification-group-title,
.document-step,
.document-toolbar,
.document-copy {
  transition:
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease,
    opacity .18s ease,
    transform .18s ease;
}

.btn:active,
.side-nav-link:active,
.metric-card:active,
.quick-action:active,
.recent-item:active,
.notification-item:active {
  transform: translateY(1px) scale(.995);
}

.metric-card:hover,
.panel:hover,
.document-toolbar:hover {
  box-shadow: 0 20px 50px rgba(15, 39, 66, .12);
}

.notification-panel {
  transform-origin: top right;
  animation: notificationDrop .18s ease both;
}

.notification-menu[open] .topbar-bell {
  box-shadow: 0 0 0 4px rgba(11, 111, 232, .1);
}

.notification-count {
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.notification-count:not(.is-zero) {
  animation: bellPulse 1.8s ease-in-out infinite;
}

.doc-input,
.form-control,
.form-select {
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

@keyframes uiFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes uiRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notificationDrop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bellPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
