:root {
  --page-bg: #f4f7fb;
  --text-color: #1f2937;
  --muted-text: #667085;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-border: rgba(15, 23, 42, 0.08);
  --surface-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --success-bg: #ecfdf3;
  --success-text: #067647;
  --danger-bg: #fef3f2;
  --danger-text: #b42318;
  --warning-bg: #fff7ed;
  --warning-text: #c2410c;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 22%),
    linear-gradient(180deg, #edf4ff 0%, var(--page-bg) 240px, var(--page-bg) 100%);
  color: var(--text-color);
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 240px;
  flex: 0 0 240px;
  padding: 1.1rem 0.9rem;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.98), rgba(30, 41, 59, 0.96));
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: 0.35rem 0.45rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-link {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-caption {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.85rem;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0.38rem;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

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

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
}

.sidebar-section {
  display: grid;
  gap: 0.22rem;
  position: relative;
  padding: 0.2rem 0;
  border-radius: 0.8rem;
}

.sidebar-section.active {
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0 0.75rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-section-title::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 0.32rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.76rem 0.76rem;
  background-color: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-section-overview .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='4' width='7' height='4' rx='1.5'/%3E%3Crect x='14' y='11' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='6' rx='1.5'/%3E%3C/svg%3E");
}

.sidebar-section-sales .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M15 3v4h4'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3Cpath d='M9 9h2'/%3E%3C/svg%3E");
}

.sidebar-section-purchasing .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h15l-1.5 8.5a2 2 0 0 1-2 1.5H9.5a2 2 0 0 1-2-1.5L5 4H2'/%3E%3Ccircle cx='10' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E");
}

.sidebar-section-inventory .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 9-5 9 5-9 5z'/%3E%3Cpath d='m3 8.5 9 5 9-5'/%3E%3Cpath d='M12 13.5v7'/%3E%3C/svg%3E");
}

.sidebar-section-warranty .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5c0 5 3.4 8.8 7 10 3.6-1.2 7-5 7-10V6z'/%3E%3Cpath d='m9.5 12 1.7 1.7 3.3-3.4'/%3E%3C/svg%3E");
}

.sidebar-section-master .sidebar-section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8.5a3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.08V21a2 2 0 1 1-4 0v-.1A1.7 1.7 0 0 0 8.6 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.08-.4H2.8a2 2 0 1 1 0-4h.1A1.7 1.7 0 0 0 4.6 8.6a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 8.6 4.6c.38 0 .74-.14 1-.4A1.7 1.7 0 0 0 10 3.12V3a2 2 0 1 1 4 0v.1c0 .4.14.78.4 1.08.26.26.62.42 1 .42a1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 8.6c0 .38.14.74.4 1 .3.26.68.4 1.08.4h.1a2 2 0 1 1 0 4h-.1c-.4 0-.78.14-1.08.4-.26.26-.4.62-.4 1Z'/%3E%3C/svg%3E");
}

.sidebar-section.active .sidebar-section-title {
  color: rgba(255, 255, 255, 0.76);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  position: relative;
  min-height: 2.25rem;
  padding: 0.54rem 0.8rem 0.54rem 1rem;
  border-radius: 0.7rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  font-weight: 600;
  transition: 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link:focus,
.sidebar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.82), rgba(14, 165, 233, 0.52));
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.16);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 0.18rem;
  border-radius: 999px;
  background: #fff;
}

.sidebar-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  color: rgba(255, 255, 255, 0.72);
  transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  opacity: 0.94;
}

.sidebar-link-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-link:focus .sidebar-link-icon {
  color: rgba(255, 255, 255, 0.92);
  transform: translateY(-0.5px);
}

.sidebar-link.active .sidebar-link-icon {
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.45rem 0.1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.sidebar-user {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.sidebar-user-role {
  margin-top: 0.1rem;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-logout {
  width: 100%;
  min-height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.7rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  transition: 0.18s ease;
}

.sidebar-logout:hover,
.sidebar-logout:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.welcome-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.welcome-branch {
  color: var(--muted-text);
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.welcome-postit-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  align-items: start;
}

.welcome-postit {
  position: relative;
  min-height: 220px;
  padding: 1.15rem 1rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.45rem 0.45rem 0.85rem 0.85rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  transform: rotate(-1.4deg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.welcome-postit:nth-child(even) {
  transform: rotate(1.35deg);
}

.welcome-postit:nth-child(3n) {
  transform: rotate(-0.35deg);
}

.welcome-postit:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.welcome-postit::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0) 48%, rgba(15, 23, 42, 0.08) 49%, rgba(255, 255, 255, 0.7) 100%);
  border-bottom-right-radius: 0.85rem;
}

.welcome-postit.note-amber {
  background: linear-gradient(180deg, #fff9c8 0%, #fff3a4 100%);
}

.welcome-postit.note-mint {
  background: linear-gradient(180deg, #ddfce8 0%, #c4f1d4 100%);
}

.welcome-postit.note-sky {
  background: linear-gradient(180deg, #dff3ff 0%, #cbe9ff 100%);
}

.welcome-postit.note-peach {
  background: linear-gradient(180deg, #ffe9d9 0%, #ffd8bb 100%);
}

.welcome-postit.note-lilac {
  background: linear-gradient(180deg, #f1e4ff 0%, #e6d2ff 100%);
}

.welcome-postit-pin {
  position: absolute;
  top: 0.7rem;
  left: 50%;
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 999px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 35%, #fff, #dbe4ef 34%, #64748b 100%);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.22);
}

.welcome-postit-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.welcome-postit-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.welcome-postit-date {
  display: inline-block;
  color: #475467;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.welcome-postit-title {
  margin: 0;
  color: #172554;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
}

.welcome-postit-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 1rem;
  color: #0f4aa1;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.welcome-postit-link:hover,
.welcome-postit-link:focus {
  color: #0b3b80;
}

.welcome-announcement-detail-shell {
  max-width: 860px;
}

.welcome-postit-detail {
  min-height: 360px;
  padding: 1.4rem 1.25rem 1.2rem;
  transform: rotate(-0.45deg);
}

.welcome-postit-detail:hover {
  transform: rotate(0deg);
}

.welcome-postit-meta-detail {
  margin-bottom: 1.1rem;
}

.welcome-postit-title-detail {
  margin-bottom: 1.1rem;
  font-size: 1.45rem;
}

.welcome-announcement-detail-message {
  color: #1f2937;
  line-height: 1.75;
  white-space: pre-line;
  font-size: 0.98rem;
}

.welcome-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 3rem;
  margin-bottom: 0.9rem;
  padding: 0 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.welcome-card-icon.finance {
  background: #dbeafe;
  color: #1d4ed8;
}

.welcome-card-icon.inventory {
  background: #dcfce7;
  color: #15803d;
}

.welcome-card-icon.dashboard {
  background: #f3e8ff;
  color: #7e22ce;
}

.app-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88)),
    #0f172a;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-panel {
  width: min(100%, 420px);
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.login-brand {
  margin-bottom: 1.25rem;
}

.login-brand-name {
  color: var(--heading-color);
  font-size: 1.45rem;
  font-weight: 800;
}

.login-brand-caption {
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.login-form {
  display: grid;
  gap: 0.9rem;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.page-shell {
  flex: 1 0 auto;
  padding: 1rem 1.15rem 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.55rem;
}

.page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0.32rem 0 0;
  color: var(--muted-text);
  max-width: 48rem;
  font-size: 0.92rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.confirm-popover-shell {
  position: relative;
  display: inline-flex;
}

.confirm-popover {
  position: fixed;
  z-index: 40;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.confirm-popover::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: -0.42rem;
  width: 0.75rem;
  height: 0.75rem;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  border-left: 1px solid rgba(15, 23, 42, 0.1);
  transform: rotate(45deg);
}

.confirm-popover-title {
  color: #101828;
  font-size: 0.92rem;
  font-weight: 700;
}

.confirm-popover-text {
  margin-top: 0.35rem;
  color: var(--muted-text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.confirm-popover-field {
  margin-top: 0.75rem;
}

.confirm-popover-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #344054;
  font-size: 0.8rem;
  font-weight: 700;
}

.confirm-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.content-card,
.hero-card {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--surface-shadow);
  border-radius: 1rem;
}

.content-card .card-body,
.hero-card .card-body {
  padding: 1.1rem;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.section-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted-text);
  font-size: 0.88rem;
}

.table-card .card-body {
  padding: 0;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--surface-border);
}

.table-meta {
  color: var(--muted-text);
  font-size: 0.82rem;
}

.entity-table {
  margin-bottom: 0;
}

.entity-table thead th {
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.35;
  color: #344054;
  background: rgba(248, 250, 252, 0.95);
  border-bottom-width: 1px;
  border-bottom-color: rgba(15, 23, 42, 0.12);
  padding: 0.84rem 1.1rem;
}

.entity-table tbody td {
  padding: 0.78rem 1.1rem;
  vertical-align: middle;
  border-color: rgba(15, 23, 42, 0.06);
}

.entity-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.52rem;
  border-radius: 0.6rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.2;
}

.status-pill.active {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-pill.inactive {
  background: #f2f4f7;
  color: #475467;
}

.status-pill.draft {
  background: #fffbeb;
  color: #92400e;
}

.status-pill-default {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #344054;
}

.status-pill-draft {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.status-pill-submitted,
.status-pill-issued {
  background: #eff8ff;
  border-color: #b2ddff;
  color: #175cd3;
}

.status-pill-approved,
.status-pill-posted,
.status-pill-paid {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.status-pill-partial,
.status-pill-converted {
  background: #f5f3ff;
  border-color: #d9d6fe;
  color: #6d28d9;
}

.status-pill-complete {
  background: #ecfdf3;
  border-color: #6ce9a6;
  color: #05603a;
}

.status-pill-rejected {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.status-pill-cancelled {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #475467;
}

.table-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-actions-multirow {
  max-width: 18rem;
  row-gap: 0.4rem;
}

.list-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.74);
}

.list-filter-field {
  flex: 0 0 180px;
  min-width: 160px;
}

.list-filter-field.grow {
  flex: 1 1 280px;
}

.list-filter-actions {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: auto;
}

.pagination-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}

.pagination-summary {
  color: var(--muted-text);
  font-size: 0.88rem;
  font-weight: 600;
}

.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-text);
}

.quote-editor-table {
  min-width: 980px;
}

.quotation-lines-table {
  min-width: 100%;
}

.quote-editor-table th,
.quote-editor-table td {
  padding: 0.75rem 0.7rem;
  vertical-align: top;
}

.quote-editor-table th {
  font-size: 0.8rem;
}

.quote-editor-table .form-control,
.quote-editor-table .form-select {
  min-width: 100%;
}

.po-lines-editor-wrap {
  overflow: visible;
}


.po-allocation-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(62px, 0.32fr) auto;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.quote-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.quote-summary-card {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.85);
}

.quote-summary-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted-text);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quote-summary-value {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.mini-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.document-history-section {
  background: #f8fafc;
}

.document-history-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.65rem;
  background: #fff;
}

.document-history-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) minmax(10rem, 0.65fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.42rem 0.7rem;
}

.document-history-row + .document-history-row {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.document-history-reason {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.65rem;
  background: #fff;
}

.document-history-label {
  color: var(--muted-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-history-value {
  min-width: 0;
  color: var(--heading-color);
  font-weight: 700;
}

.document-history-meta {
  color: var(--muted-text);
  font-size: 0.82rem;
  text-align: right;
}

.serial-stack {
  display: grid;
  gap: 0.45rem;
}

.serial-stack .form-control {
  min-height: 2.35rem;
}

.receiving-lines-stack {
  display: grid;
  gap: 1rem;
}

.receiving-line-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: #fff;
}

.receiving-line-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.receiving-line-title {
  color: var(--heading-color);
  font-weight: 700;
}

.receiving-line-status-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.receiving-line-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.receiving-line-status.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.receiving-line-status.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.receiving-line-status.is-muted {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.receiving-line-hint {
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #f8fafc;
  color: #475569;
  font-size: 0.88rem;
}

.receiving-line-hint.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.receiving-line-hint.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.receiving-line-hint.is-muted {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.receiving-line-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.receiving-line-metric {
  min-height: 4.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.65rem;
  background: #f8fafc;
}

.receiving-line-metric span {
  display: block;
  color: var(--muted-text);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receiving-line-metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
}

.receiving-line-entry-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 0.85rem;
  align-items: start;
}

.receiving-entry-block {
  min-width: 0;
}

.receiving-entry-wide {
  display: grid;
  gap: 0.35rem;
}

.search-dropdown {
  position: relative;
}

.search-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.search-dropdown-menu-wide {
  right: auto;
  width: min(42rem, max(100%, calc(100vw - 4rem)));
  min-width: 100%;
}


.search-dropdown-option {
  display: grid;
  width: 100%;
  gap: 0.12rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  text-align: left;
}

.search-dropdown-option:last-child {
  border-bottom: 0;
}

.search-dropdown-option:hover,
.search-dropdown-option:focus {
  background: rgba(37, 99, 235, 0.06);
}

.search-dropdown-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #101828;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-meta,
.search-dropdown-empty {
  font-size: 0.8rem;
  color: var(--muted-text);
}

.search-dropdown-empty {
  padding: 0.75rem 0.85rem;
}

.serial-checkbox-list {
  display: grid;
  gap: 0.45rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.75rem;
  background: #fff;
}

.serial-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: #344054;
}

.serial-checkbox-item .form-check-input {
  margin-top: 0.15rem;
}

.invoice-entry-shell {
  display: grid;
  gap: 0.9rem;
}

.invoice-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 0.75rem;
}

.invoice-entry-item {
  min-width: 0;
}

.invoice-entry-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.invoice-entry-card {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.82);
}

.invoice-entry-card-title {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #344054;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invoice-entry-meta {
  margin-bottom: 0.75rem;
  color: var(--muted-text);
  font-size: 0.84rem;
}

.invoice-entry-conditional + .invoice-entry-conditional {
  margin-top: 0.75rem;
}

.invoice-entry-actions {
  display: flex;
  align-items: flex-end;
}

.invoice-warranty-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.invoice-line-detail-shell {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.invoice-line-detail-block {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.85);
}

.quote-notes {
  white-space: pre-wrap;
}

.quotation-form-tight {
  row-gap: 0.7rem;
}

.quotation-header-section {
  padding-bottom: 0.85rem;
}

.quotation-header-grid {
  row-gap: 0.65rem;
}

.quotation-header-stack {
  display: grid;
  gap: 0.85rem;
}

.quotation-header-card {
  padding: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.72);
}

.quotation-header-card-title {
  margin-bottom: 0.75rem;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quotation-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.quotation-summary-chip {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.92);
}

.quotation-summary-chip span {
  display: block;
  color: var(--muted-text);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quotation-summary-chip strong {
  display: block;
  margin-top: 0.22rem;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #101828;
}

.quotation-summary-chip.is-total {
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(219, 234, 254, 0.55);
}

.readonly-detail {
  display: flex;
  align-items: center;
  min-height: 2.55rem;
  color: #101828;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

.readonly-detail-multiline {
  align-items: flex-start;
  min-height: 4.5rem;
  white-space: pre-wrap;
}

.readonly-detail-status {
  min-height: 2.55rem;
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
}

.quotation-expiry-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.quotation-expiry-group .form-control {
  flex: 1;
}

.quotation-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  margin: 0 0 0 0.3rem;
  white-space: nowrap;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 600;
}

.quotation-inline-check .form-check-input {
  margin: 0;
}

.master-status-group .form-control {
  min-width: 0;
}

.item-control-group {
  display: flex;
  align-items: center;
  min-height: 2.55rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.item-control-group .quotation-inline-check {
  margin-left: 0;
}

@media (max-width: 575.98px) {
  .list-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .list-filter-field,
  .list-filter-field.grow {
    min-width: 0;
    width: 100%;
  }

  .list-filter-actions {
    width: 100%;
    margin-left: 0;
  }

  .list-filter-actions .btn {
    flex: 1 1 0;
  }

  .pagination-shell {
    align-items: stretch;
  }

  .pagination-actions,
  .pagination-actions .btn {
    width: 100%;
  }

  .pagination-actions .btn {
    flex: 1 1 0;
  }

  .master-status-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .master-status-group .quotation-inline-check {
    margin-left: 0;
  }
}

.quotation-info-card {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.82);
}

.quotation-info-card-title {
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #344054;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quotation-party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.quotation-party-column {
  min-width: 0;
}

.quotation-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.85rem;
  margin-bottom: 0.5rem;
}

.quotation-info-grid:last-child {
  margin-bottom: 0;
}

.quotation-info-field {
  min-width: 0;
}

.quotation-info-label {
  display: block;
  margin-bottom: 0.14rem;
  color: var(--muted-text);
  font-size: 0.8rem;
  font-weight: 600;
}

.quotation-info-value {
  display: block;
  color: #101828;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.quotation-lines-section {
  min-width: 0;
}

.quotation-summary-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.quotation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 360px));
  gap: 1rem;
  justify-content: end;
  width: 100%;
}

.quotation-summary-stack {
  display: grid;
  gap: 0.12rem;
  width: min(100%, 360px);
  padding: 0.95rem 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.9rem;
  background: rgba(248, 250, 252, 0.92);
}

.quotation-summary-title {
  margin-bottom: 0.3rem;
  color: #1e3a8a;
  font-size: 0.98rem;
  font-weight: 700;
}

.quotation-summary-stack-reference {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.92));
}

.quotation-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.48rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.quotation-summary-row:last-child {
  border-bottom: 0;
}

.quotation-summary-row.total {
  padding-top: 0.62rem;
  font-weight: 700;
}

.quotation-summary-name {
  color: #475467;
  font-size: 0.95rem;
  font-weight: 600;
}

.quotation-summary-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
}

.quotation-summary-row.total .quotation-summary-name,
.quotation-summary-row.total .quotation-summary-amount {
  font-size: 1.08rem;
}

.form-shell {
  display: grid;
  gap: 0.85rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-section {
  padding: 0.95rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.65);
}

.form-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.form-control,
.form-select,
.form-check-input {
  border-color: rgba(15, 23, 42, 0.12);
}

.form-control,
.form-select {
  min-height: 2.55rem;
  border-radius: 0.75rem;
  padding: 0.62rem 0.8rem;
  font-size: 0.92rem;
}

textarea.form-control {
  min-height: auto;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.55rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  background: var(--surface-solid);
}

.form-check-input {
  margin-top: 0;
}

.form-check-label {
  margin-bottom: 0;
  font-weight: 600;
}

.user-form-grid,
.user-access-grid {
  display: grid;
  gap: 1rem;
}

.user-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-access-grid {
  grid-template-columns: minmax(280px, 520px);
  margin-top: 1rem;
  max-width: 560px;
}

.user-form-field {
  min-width: 0;
}

.profile-page-grid {
  display: grid;
  gap: 1rem;
}

.profile-page-grid-compact {
  gap: 0.85rem;
}

.profile-top-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(360px, 1.35fr);
  gap: 0.85rem;
  align-items: start;
}

.profile-panel {
  padding: 0.85rem 0.95rem;
}

.profile-section-title {
  margin-bottom: 0.65rem;
  font-size: 0.84rem;
}

.profile-form-shell {
  gap: 0.7rem;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-form-grid-compact {
  gap: 0.8rem;
}

.profile-password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.profile-form-actions {
  padding-top: 0;
  gap: 0.6rem;
}

.profile-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.profile-detail-item {
  padding: 0.65rem 0.75rem;
}

@media (max-width: 575.98px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .profile-top-grid {
    grid-template-columns: 1fr;
  }

  .profile-password-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .user-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .user-access-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
  }
}

@media (max-width: 575.98px) {
  .user-form-grid,
  .user-access-grid {
    grid-template-columns: 1fr;
  }
}

.form-text {
  margin-top: 0.35rem;
  color: var(--muted-text);
  font-size: 0.8rem;
}

.field-validation-error {
  display: block;
  margin-top: 0.32rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.validation-summary-errors,
.form-alert {
  margin-bottom: 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(180, 35, 24, 0.12);
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  font-size: 0.86rem;
}

.validation-summary-valid.form-alert {
  display: none;
}

.validation-summary-errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.workflow-info {
  margin-bottom: 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: #f8fafc;
  color: #475569;
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  font-size: 0.86rem;
}

.workflow-info-success {
  border-color: rgba(6, 118, 71, 0.18);
  background: var(--success-bg);
  color: var(--success-text);
}

.workflow-info-danger {
  border-color: rgba(180, 35, 24, 0.16);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.workflow-info-warning {
  border-color: rgba(194, 65, 12, 0.18);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.workflow-info-info {
  border-color: rgba(100, 116, 139, 0.22);
  background: #f8fafc;
  color: #475569;
}

.workflow-info div + div {
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.detail-item {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.65);
}

.detail-label {
  display: block;
  margin-bottom: 0.24rem;
  color: var(--muted-text);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
  font-size: 0.92rem;
}

.inquiry-card-list {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
}

.inquiry-card {
  border: 1px solid var(--surface-border);
  border-radius: 0.95rem;
  background: rgba(248, 250, 252, 0.9);
  padding: 1rem 1.05rem;
}

.inquiry-card-compact {
  padding: 0.82rem 0.95rem;
}

.inquiry-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.inquiry-card-compact .inquiry-card-top {
  margin-bottom: 0.65rem;
}

.inquiry-card-title-group {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.inquiry-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.inquiry-card-subtitle {
  margin: 0.18rem 0 0;
  color: var(--muted-text);
  font-size: 0.84rem;
}

.inquiry-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.9rem;
}

.inquiry-card-field {
  min-width: 0;
}

.inquiry-card-label {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--muted-text);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inquiry-card-value {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.danger-card {
  border: 1px solid rgba(180, 35, 24, 0.14);
}

.danger-banner {
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  background: var(--danger-bg);
  color: var(--danger-text);
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}

.table thead th {
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 700;
  color: #344054;
}

.footer {
  flex: 0 0 auto;
  background-color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.footer-inner {
  padding: 0.8rem 1.15rem 1rem;
  font-size: 0.82rem;
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95), rgba(37, 99, 235, 0.92));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .page-header,
  .form-header,
  .table-card-header,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .quote-summary-grid {
    grid-template-columns: 1fr;
  }

  .mini-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inquiry-card-grid {
    grid-template-columns: 1fr;
  }

  .quotation-party-grid {
    grid-template-columns: 1fr;
  }

  .welcome-postit-board {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .quotation-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-entry-grid,
  .invoice-entry-detail-grid,
  .invoice-line-detail-shell {
    grid-template-columns: 1fr;
  }

  .invoice-entry-actions {
    align-items: stretch;
  }

  .quotation-info-grid {
    grid-template-columns: 1fr;
  }

  .receiving-line-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receiving-line-entry-grid {
    grid-template-columns: 1fr;
  }

  .document-history-row,
  .document-history-reason {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .document-history-row .document-history-meta {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 575.98px) {
  .entity-table thead th,
  .entity-table tbody td {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .page-shell {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .mini-summary-grid {
    grid-template-columns: 1fr;
  }

  .document-history-row,
  .document-history-reason {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .document-history-row .document-history-meta {
    grid-column: auto;
  }

  .quotation-expiry-group {
    flex-direction: column;
    align-items: stretch;
  }

  .quotation-inline-check {
    width: auto;
    margin-left: 0;
  }

  .quotation-summary-wrap {
    justify-content: stretch;
  }

  .quotation-summary-grid {
    grid-template-columns: 1fr;
  }

  .welcome-postit-board {
    grid-template-columns: 1fr;
  }

  .welcome-postit,
  .welcome-postit:nth-child(even),
  .welcome-postit:nth-child(3n),
  .welcome-postit-detail {
    transform: none;
  }

  .quotation-summary-stack {
    width: 100%;
  }

  .quotation-summary-strip {
    grid-template-columns: 1fr;
  }
}

.permission-option {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  display: flex;
  gap: 0.65rem;
  min-height: 82px;
  padding: 0.85rem;
  width: 100%;
}

.permission-option input {
  margin-top: 0.25rem;
}

.permission-option strong,
.permission-option small {
  display: block;
}

.permission-option strong {
  color: #16345f;
  font-size: 0.95rem;
}

.permission-option small {
  color: #64748b;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.permission-page-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.permission-summary-card {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.9));
}

.permission-summary-label {
  display: block;
  color: #475467;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permission-summary-value {
  display: block;
  margin-top: 0.22rem;
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 800;
}

.permission-module-card {
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.72);
}

.permission-module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.permission-module-title {
  color: #16345f;
  font-size: 1rem;
  font-weight: 800;
}

.permission-module-text,
.permission-module-meta,
.permission-group-meta,
.permission-code {
  color: #64748b;
  font-size: 0.82rem;
}

.permission-module-meta {
  white-space: nowrap;
  font-weight: 700;
}

.permission-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.permission-group-card {
  padding: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.88);
}

.permission-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.permission-group-title {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
}

.permission-group-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.permission-item-stack {
  display: grid;
  gap: 0.55rem;
}

.permission-option-compact {
  min-height: 0;
  padding: 0.75rem 0.8rem;
}

.permission-option-content {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.permission-option-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.permission-kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.62);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pricing-path-card {
  background: linear-gradient(135deg, #f7fbff 0%, #eef6ff 100%);
  border: 1px solid #d6e7fb;
  border-radius: 12px;
  padding: 0.95rem 1rem;
}

.pricing-path-title {
  color: #16345f;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pricing-path-text {
  color: #51657f;
  line-height: 1.5;
}

@media (max-width: 991.98px) {
  .permission-page-summary,
  .permission-group-grid {
    grid-template-columns: 1fr;
  }

  .permission-module-header,
  .permission-group-header {
    flex-direction: column;
    align-items: stretch;
  }
}
