:root {
  --vew-bg: #eef3f5;
  --vew-surface: #ffffff;
  --vew-border: #d9e0e4;
  --vew-text: #1f2a30;
  --vew-muted: #66747d;
  --vew-accent: #1f6f8b;
  --vew-accent-strong: #14506d;
  --vew-radius: 8px;
  --vew-sidebar-width: 274px;
  --vew-topbar-height: 68px;
  --vew-focus: 0 0 0 0.22rem rgba(31, 111, 139, 0.22);
  --vew-shadow-soft: 0 18px 45px rgba(31, 50, 59, 0.08);
  --vew-shadow-lift: 0 14px 32px rgba(31, 50, 59, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 15px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--vew-text);
  background:
    linear-gradient(180deg, #f8fbfc 0, var(--vew-bg) 42%, #edf2f4 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--vew-accent);
}

.btn {
  min-height: 38px;
  border-radius: 7px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--vew-accent);
  border-color: var(--vew-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--vew-accent-strong);
  border-color: var(--vew-accent-strong);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  border-color: var(--vew-accent);
  box-shadow: var(--vew-focus);
}

.form-control {
  border-color: #cfd8dd;
  border-radius: 7px;
  background: #fbfdfe;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.form-select {
  border-color: #cfd8dd;
  border-radius: 7px;
  background-color: #fbfdfe;
}

.form-control:hover,
.form-select:hover {
  border-color: #afc0c8;
}

.form-label {
  color: #334149;
  font-size: 0.9rem;
  font-weight: 650;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #b8c4ca;
  border-radius: 8px;
  color: var(--vew-accent-strong);
  background: #f8fafb;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
}

.brand-name {
  color: var(--vew-text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}

.brand-system {
  color: var(--vew-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.auth-page {
  min-height: 100dvh;
  overflow: hidden;
  background: #f3f6f7;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.02fr) minmax(420px, 0.98fr);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #101820;
}

.auth-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(9, 18, 24, 0.08), rgba(9, 18, 24, 0.03) 42%, rgba(9, 18, 24, 0.38)),
    linear-gradient(180deg, rgba(11, 20, 26, 0.04), rgba(11, 20, 26, 0.2));
  pointer-events: none;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  object-fit: cover;
  object-position: 42% center;
  filter: saturate(0.96) contrast(1.04);
}

.auth-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow-y: auto;
  padding: clamp(1.5rem, 3.2vw, 3.75rem);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.08), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #ffffff, #f4f8fa);
}

.auth-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(31, 111, 139, 0.26), transparent);
}

.auth-form-wrap {
  position: relative;
  width: min(100%, 460px);
  padding: clamp(1.65rem, 3vw, 2.15rem);
  border: 1px solid rgba(204, 217, 224, 0.92);
  border-radius: var(--vew-radius);
  background: #ffffff;
  box-shadow: 0 18px 55px rgba(29, 48, 57, 0.11);
  transform: translateY(-2vh);
}

.auth-form-wrap::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--vew-radius) var(--vew-radius) 0 0;
  content: "";
  background: var(--vew-accent);
}

.auth-heading {
  margin: clamp(1.25rem, 2.4vh, 1.85rem) 0 clamp(1rem, 2.2vh, 1.35rem);
}

.auth-heading p {
  margin: 0 0 0.55rem;
  color: var(--vew-accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0;
  color: #172329;
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.08;
}

.auth-heading span {
  display: block;
  margin-top: 0.55rem;
  color: var(--vew-muted);
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.password-input {
  position: relative;
}

.password-input .form-control {
  padding-right: 3.2rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #53636c;
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus {
  color: var(--vew-accent-strong);
  background: #edf4f7;
  outline: none;
  box-shadow: var(--vew-focus);
}

.auth-submit {
  min-height: 44px;
  margin-top: 0.15rem;
  font-weight: 700;
}

.auth-form .form-control-lg {
  min-height: 44px;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 1rem;
}

.auth-form .form-control {
  border-color: #d7e1e6;
  background: #fbfdfe;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-form .form-control:focus {
  background: #ffffff;
}

.auth-submit {
  border: 0;
  background: linear-gradient(135deg, var(--vew-accent), var(--vew-accent-strong));
  box-shadow: 0 9px 18px rgba(20, 80, 109, 0.18);
}

.auth-submit:hover,
.auth-submit:focus {
  background: linear-gradient(135deg, #23809f, var(--vew-accent-strong));
}

.auth-footnote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
  color: #70808a;
  font-size: 0.82rem;
  font-weight: 650;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  gap: 0.85rem;
  background:
    radial-gradient(circle at center, rgba(31, 111, 139, 0.12), transparent 28rem),
    #f7fafb;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.app-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loader-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(31, 111, 139, 0.28);
  border-radius: 8px;
  color: var(--vew-accent-strong);
  background: #ffffff;
  box-shadow: var(--vew-shadow-soft);
  font-size: 0.82rem;
  font-weight: 900;
  animation: loaderRise 780ms ease both;
}

.loader-line {
  width: 116px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8e3e8;
}

.loader-line::after {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  content: "";
  background: linear-gradient(90deg, var(--vew-accent), #e3a235);
  animation: loaderSlide 880ms ease-in-out infinite;
}

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

@keyframes loaderSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: var(--vew-sidebar-width);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  flex: 0 0 var(--vew-sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--vew-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 252, 0.98)),
    #ffffff;
  box-shadow: 12px 0 34px rgba(31, 50, 59, 0.04);
}

.sidebar-brand {
  display: flex;
  min-height: var(--vew-topbar-height);
  flex: 0 0 var(--vew-topbar-height);
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--vew-border);
  background: rgba(255, 255, 255, 0.86);
}

.sidebar-nav {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.85rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9c8cf transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b9c8cf;
  background-clip: content-box;
}

.sidebar-group-label {
  margin: 1rem 0.8rem 0.35rem;
  color: var(--vew-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-link {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 0.72rem;
  padding: 0 0.8rem;
  border-radius: 7px;
  color: #314047;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, transform 140ms ease;
}

.sidebar-link::before {
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  content: "";
  background: transparent;
}

.sidebar-link:hover,
.sidebar-link:focus,
.sidebar-link.active {
  color: var(--vew-accent-strong);
  background: #e9f2f5;
  transform: translateX(2px);
}

.sidebar-link.active::before {
  background: linear-gradient(180deg, var(--vew-accent), #e3a235);
}

.sidebar-plan {
  display: flex;
  min-height: 58px;
  flex: 0 0 auto;
  align-items: center;
  margin: 0;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--vew-border);
  background: rgba(255, 255, 255, 0.94);
}

.sidebar-plan span {
  width: 100%;
  color: var(--vew-accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.app-main {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  display: flex;
  min-height: var(--vew-topbar-height);
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--vew-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 28px rgba(31, 50, 59, 0.04);
  backdrop-filter: blur(10px);
}

.topbar-title {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
}

.topbar-title span {
  font-weight: 800;
}

.topbar-title small {
  color: var(--vew-muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.global-search-form {
  position: relative;
  display: flex;
  min-width: min(34vw, 560px);
  max-width: 620px;
  flex: 1 1 340px;
  align-items: center;
  margin-left: auto;
}

.global-search-form i {
  position: absolute;
  left: 0.85rem;
  z-index: 1;
  color: var(--vew-muted);
}

.global-search-form input {
  width: 100%;
  height: 42px;
  padding: 0 4.4rem 0 2.35rem;
  border: 1px solid rgba(191, 204, 211, 0.9);
  border-radius: 7px;
  color: #172329;
  background: linear-gradient(135deg, rgba(31, 111, 139, 0.05), rgba(255, 255, 255, 0) 45%), #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.global-search-form input:focus {
  border-color: rgba(31, 111, 139, 0.65);
  outline: none;
  box-shadow: var(--vew-focus);
}

.global-search-form kbd {
  position: absolute;
  right: 0.65rem;
  border: 1px solid rgba(191, 204, 211, 0.9);
  border-radius: 5px;
  color: #60717a;
  background: #f5f8f9;
  font-size: 0.68rem;
  font-weight: 800;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  gap: 0.45rem;
  color: #334149;
  font-size: 0.9rem;
  font-weight: 700;
}

.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--vew-border);
  border-radius: 7px;
  color: #334149;
  background: #ffffff;
}

.icon-button:focus {
  outline: none;
  box-shadow: var(--vew-focus);
}

.app-content {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(1.15rem, 1.8vw, 1.75rem) clamp(1.15rem, 2.1vw, 2.2rem);
  scroll-behavior: smooth;
}

.page-section {
  max-width: 760px;
}

.page-kicker {
  margin-bottom: 0.55rem;
  color: var(--vew-accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-section h1 {
  margin: 0;
  color: #172329;
  font-size: clamp(1.65rem, 2rem, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
}

.page-section p {
  margin: 0.85rem 0 0;
  color: var(--vew-muted);
  line-height: 1.65;
}

.status-strip {
  display: grid;
  max-width: 820px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-border);
}

.status-strip div {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  padding: 1rem;
  background: var(--vew-surface);
}

.status-label {
  color: var(--vew-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-strip strong {
  color: #1f2a30;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1rem;
  margin-top: 1.35rem;
}

.dashboard-hero-main,
.dashboard-health,
.dashboard-metric,
.dashboard-panel {
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-surface);
  box-shadow: var(--vew-shadow-soft);
}

.dashboard-hero-main {
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 2vw, 1.65rem);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.09), rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.dashboard-hero-main h2 {
  max-width: 820px;
  margin: 0;
  color: #172329;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.dashboard-health {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  padding: 1.2rem;
  color: #ffffff;
  background: linear-gradient(135deg, #14506d, #1f6f8b);
}

.dashboard-health span,
.dashboard-health small {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 750;
}

.dashboard-health strong {
  font-size: 2.55rem;
  line-height: 1;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.dashboard-metric {
  display: grid;
  min-height: 132px;
  gap: 0.5rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
}

.dashboard-metric:hover,
.dashboard-metric:focus {
  border-color: rgba(31, 111, 139, 0.35);
  box-shadow: var(--vew-shadow-lift);
  transform: translateY(-2px);
}

.metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  color: var(--vew-accent-strong);
  background: #e9f2f5;
}

.dashboard-metric strong {
  align-self: end;
  color: #172329;
  font-size: 1.65rem;
  line-height: 1;
}

.dashboard-metric.warning .metric-icon {
  color: #7a5200;
  background: #fff5d9;
}

.dashboard-metric.danger .metric-icon {
  color: #8f2727;
  background: #fde8e8;
}

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

.dashboard-panel {
  padding: 1.1rem;
}

.dashboard-panel h2 {
  margin: 0 0 0.35rem;
  color: #1f2a30;
  font-size: 1.05rem;
  font-weight: 800;
}

.dashboard-panel p {
  margin: 0 0 0.9rem;
  color: var(--vew-muted);
}

.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 1rem;
  margin-bottom: 1rem;
}

.ops-hero-copy,
.ops-hero-status,
.ops-period-strip,
.ops-summary-card,
.ops-master-strip,
.ops-panel,
.search-page-header,
.search-empty-state,
.search-group {
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: var(--vew-radius);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 50, 59, 0.055);
}

.ops-hero-copy {
  min-height: 220px;
  padding: clamp(1.25rem, 2.2vw, 2rem);
  background: linear-gradient(135deg, rgba(31, 111, 139, 0.12), rgba(227, 162, 53, 0.1) 46%, rgba(255, 255, 255, 0) 72%), #ffffff;
}

.ops-hero-copy h1,
.search-page-header h1 {
  max-width: 900px;
  margin: 0;
  color: #172329;
  font-size: clamp(1.9rem, 3.2vw, 3.35rem);
  font-weight: 850;
  line-height: 1.05;
}

.ops-hero-copy p,
.search-page-header p {
  max-width: 920px;
  margin: 1rem 0 0;
  color: var(--vew-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.ops-hero-status {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 1.35rem;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(227, 162, 53, 0.92), rgba(31, 111, 139, 0.95)), var(--vew-accent-strong);
  overflow: hidden;
}

.ops-hero-status strong {
  font-size: 3rem;
  line-height: 1;
}

.ops-hero-status span,
.ops-hero-status small {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
}

.ops-period-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.ops-period-strip > div:first-child {
  display: grid;
  gap: 0.1rem;
}

.period-switcher {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: 7px;
  background: #f7fafb;
}

.period-switcher a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 0.8rem;
  border-radius: 6px;
  color: #40515a;
  font-weight: 800;
  text-decoration: none;
}

.period-switcher a.active,
.period-switcher a:hover,
.period-switcher a:focus {
  color: #ffffff;
  background: var(--vew-accent-strong);
}

.ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.ops-summary-card {
  position: relative;
  display: grid;
  min-height: 136px;
  align-content: space-between;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ops-summary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--vew-accent);
}

.ops-summary-card.accent::before {
  background: linear-gradient(180deg, var(--vew-accent), #e3a235);
}

.ops-summary-card:hover,
.ops-summary-card:focus,
.ops-master-strip a:hover,
.ops-master-strip a:focus,
.quick-action-grid a:hover,
.quick-action-grid a:focus,
.attention-row:hover,
.attention-row:focus,
.activity-item:hover,
.activity-item:focus,
.search-result-item:hover,
.search-result-item:focus {
  border-color: rgba(31, 111, 139, 0.38);
  box-shadow: 0 20px 42px rgba(31, 50, 59, 0.08);
  transform: translateY(-2px);
}

.ops-summary-card span,
.ops-master-strip span {
  color: var(--vew-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ops-summary-card strong {
  color: #172329;
  font-size: 2.15rem;
  line-height: 1;
}

.ops-summary-card small {
  color: var(--vew-muted);
  font-weight: 700;
}

.ops-master-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 0.85rem;
  overflow: hidden;
  background: var(--vew-border);
}

.ops-master-strip a {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  color: inherit;
  background: #ffffff;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ops-master-strip strong {
  color: var(--vew-accent-strong);
  font-size: 1.35rem;
}

.ops-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 1rem;
  margin-top: 1rem;
}

.ops-panel {
  padding: 1rem;
}

.ops-panel-wide {
  grid-row: span 2;
}

.ops-panel h2 {
  margin: 0;
  color: #172329;
  font-size: 1.18rem;
  font-weight: 850;
}

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

.attention-grid h3 {
  margin: 0 0 0.65rem;
  color: #334149;
  font-size: 0.92rem;
  font-weight: 850;
}

.attention-list,
.activity-feed,
.search-result-list {
  display: grid;
  gap: 0.55rem;
}

.attention-row,
.activity-item,
.search-result-item {
  display: grid;
  min-height: 58px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: 7px;
  color: inherit;
  background: #f9fbfc;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.attention-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.attention-row strong,
.activity-item strong,
.search-result-item strong {
  display: block;
  color: #172329;
}

.attention-row small,
.activity-item small,
.search-result-item small {
  display: block;
  color: var(--vew-muted);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: #40515a;
  background: #e9eef1;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.status-active,
.status-completed,
.status-in-stock {
  color: #1f6b49;
  background: #ddf4e9;
}

.status-inactive,
.status-cancelled,
.status-out-of-stock {
  color: #8f2727;
  background: #fde8e8;
}

.status-low-stock {
  color: #7a5200;
  background: #fff5d9;
}

.empty-note {
  margin: 0;
  padding: 1rem;
  border: 1px dashed rgba(191, 204, 211, 0.95);
  border-radius: 7px;
  color: var(--vew-muted);
  background: #f9fbfc;
  font-weight: 700;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.quick-action-grid a {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: 7px;
  color: #26343b;
  background: #f9fbfc;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-action-grid i,
.activity-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 7px;
  color: var(--vew-accent-strong);
  background: #e9f2f5;
}

.activity-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.search-page-header {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 2vw, 1.75rem);
  background: linear-gradient(135deg, rgba(31, 111, 139, 0.11), rgba(227, 162, 53, 0.08) 45%, rgba(255, 255, 255, 0) 70%), #ffffff;
}

.search-page-form {
  position: relative;
  display: flex;
  max-width: 920px;
  gap: 0.65rem;
  align-items: center;
}

.search-page-form i {
  position: absolute;
  left: 0.95rem;
  color: var(--vew-muted);
}

.search-page-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 1rem 0 2.55rem;
  border: 1px solid rgba(191, 204, 211, 0.95);
  border-radius: 7px;
}

.search-empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 2rem;
  color: var(--vew-muted);
  text-align: center;
}

.search-empty-state i {
  color: var(--vew-accent-strong);
  font-size: 2rem;
}

.search-empty-state h2 {
  margin: 0;
  color: #172329;
  font-size: 1.35rem;
  font-weight: 850;
}

.search-empty-state p {
  margin: 0;
}

.search-results-summary {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.search-results-summary span {
  color: var(--vew-muted);
  font-weight: 800;
}

.search-results-summary strong {
  color: var(--vew-accent-strong);
}

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

.search-group {
  padding: 1rem;
}

.search-group-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.search-group-title i {
  color: var(--vew-accent-strong);
}

.search-group-title h2 {
  margin: 0;
  color: #172329;
  font-size: 1rem;
  font-weight: 850;
}

.search-group-title span {
  margin-left: auto;
  color: var(--vew-muted);
  font-weight: 850;
}

.search-result-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.quick-link-list {
  display: grid;
  gap: 0.45rem;
}

.quick-link-list a {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8ec;
  border-radius: 7px;
  color: #334149;
  background: #f8fafb;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.quick-link-list a:hover,
.quick-link-list a:focus {
  color: var(--vew-accent-strong);
  border-color: rgba(31, 111, 139, 0.28);
  background: #eef6f8;
  box-shadow: 0 10px 22px rgba(31, 50, 59, 0.06);
  transform: translateX(2px);
}

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

.report-group {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: var(--vew-radius);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.055), rgba(255, 255, 255, 0) 36%),
    #ffffff;
  box-shadow: var(--vew-shadow-soft);
}

.report-group-heading {
  color: var(--vew-accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.report-link-list {
  display: grid;
  gap: 0.5rem;
}

.report-link-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0.7rem;
  min-height: 72px;
  padding: 0.75rem;
  border: 1px solid #e2e8ec;
  border-radius: 7px;
  color: inherit;
  background: rgba(248, 251, 252, 0.86);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.report-link-card:hover,
.report-link-card:focus {
  border-color: rgba(31, 111, 139, 0.3);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(31, 50, 59, 0.06);
  transform: translateY(-1px);
}

.report-link-card > i:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  color: var(--vew-accent-strong);
  background: #e9f2f5;
  font-size: 1rem;
}

.report-link-card span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.report-link-card strong {
  color: #172329;
}

.report-link-card small {
  color: var(--vew-muted);
  line-height: 1.35;
}

.report-filter-toolbar {
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 252, 0.96));
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-summary-card {
  display: grid;
  gap: 0.24rem;
  min-height: 76px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-left: 4px solid var(--vew-accent);
  border-radius: var(--vew-radius);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 50, 59, 0.045);
}

.report-summary-card span {
  color: var(--vew-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.report-summary-card strong {
  color: #172329;
  font-size: 1.35rem;
  line-height: 1.1;
}

.report-summary-card.good {
  border-left-color: #2f9d68;
}

.report-summary-card.warning {
  border-left-color: #d4931f;
}

.report-summary-card.danger {
  border-left-color: #c44949;
}

.report-summary-card.total {
  border-left-color: var(--vew-accent-strong);
}

.report-table {
  min-width: 1180px;
}

.report-table-shell {
  box-shadow: 0 18px 42px rgba(31, 50, 59, 0.065);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(217, 224, 228, 0.9);
}

.page-header h1 {
  margin: 0;
  color: #172329;
  font-size: clamp(1.55rem, 2rem, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
}

.page-header p {
  max-width: 680px;
  margin: 0.55rem 0 0;
  color: var(--vew-muted);
}

.button-row,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: none;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(217, 224, 228, 0.88);
  border-radius: var(--vew-radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(31, 50, 59, 0.045);
}

.search-box {
  position: relative;
  flex: 1 1 320px;
}

.search-box i {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  color: var(--vew-muted);
  transform: translateY(-50%);
}

.search-box .form-control {
  padding-left: 2.35rem;
}

.status-select {
  max-width: 160px;
}

.wide-list-toolbar {
  max-width: 1120px;
  flex-wrap: wrap;
}

.list-filter-select {
  max-width: 180px;
}

.list-date-filter {
  max-width: 150px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-surface);
  box-shadow: var(--vew-shadow-soft);
}

.compact-table {
  min-width: 760px;
  margin-bottom: 0;
}

.raw-material-table {
  min-width: 1040px;
}

.purchase-table,
.stock-table,
.issue-table,
.scrap-entry-table,
.scrap-register-table {
  min-width: 1280px;
}

.purchase-entry-table,
.issue-entry-table,
.scrap-entry-items-table {
  min-width: 1160px;
}

.purchase-entry-table select {
  min-width: 260px;
}

.purchase-entry-table input {
  min-width: 110px;
}

.purchase-entry-table input[name$=".Remarks"] {
  min-width: 180px;
}

.issue-entry-table select {
  min-width: 280px;
}

.issue-entry-table input {
  min-width: 110px;
}

.issue-detail-table {
  min-width: 980px;
}

.scrap-detail-table {
  min-width: 1120px;
}

.compact-table th {
  color: #42515a;
  background: linear-gradient(180deg, #fbfdfe, #f3f7f9);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.compact-table td,
.compact-table th {
  padding: 0.72rem 0.85rem;
  border-color: #e5eaed;
}

.compact-table tbody tr {
  transition: background-color 140ms ease;
}

.compact-table tbody tr:hover {
  background: #f8fbfc;
}

.empty-row {
  padding: 2rem !important;
  color: var(--vew-muted);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-badge.active {
  color: #176343;
  background: #e7f5ed;
}

.status-badge.inactive {
  color: #7a3b13;
  background: #fff0df;
}

.status-badge.warning {
  color: #7a5200;
  background: #fff5d9;
}

.status-badge.danger {
  color: #8f2727;
  background: #fde8e8;
}

.stock-summary-strip {
  display: grid;
  max-width: 760px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-border);
}

.stock-summary-strip div {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  background: var(--vew-surface);
}

.stock-summary-strip span {
  color: var(--vew-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stock-summary-strip strong {
  color: #172329;
  font-size: 1.15rem;
}

.stock-hero-header {
  margin-bottom: 1rem;
}

.stock-command-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.5fr);
  gap: 1rem;
  margin-bottom: 1rem;
  padding: clamp(1rem, 1.6vw, 1.35rem);
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: var(--vew-radius);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.12), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 252, 0.98));
  box-shadow: 0 18px 42px rgba(31, 50, 59, 0.07);
}

.stock-command-copy {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  min-width: 0;
}

.stock-command-copy span {
  color: var(--vew-accent-strong);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stock-command-copy strong {
  color: #172329;
  font-size: clamp(1.15rem, 1.5vw, 1.55rem);
  line-height: 1.18;
}

.stock-command-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--vew-muted);
  line-height: 1.55;
}

.stock-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stock-summary-card {
  position: relative;
  display: grid;
  min-height: 118px;
  align-content: space-between;
  gap: 0.3rem;
  overflow: hidden;
  padding: 0.9rem;
  border: 1px solid rgba(217, 224, 228, 0.94);
  border-radius: var(--vew-radius);
  color: inherit;
  background: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(31, 50, 59, 0.045);
  transition: transform 150ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stock-summary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--vew-accent);
}

.stock-summary-card:hover,
.stock-summary-card:focus {
  border-color: rgba(31, 111, 139, 0.32);
  box-shadow: var(--vew-shadow-lift);
  transform: translateY(-2px);
}

.stock-summary-card span {
  color: var(--vew-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stock-summary-card strong {
  color: #172329;
  font-size: 2rem;
  line-height: 1;
}

.stock-summary-card small {
  color: var(--vew-muted);
  font-weight: 700;
}

.stock-summary-card.good::before {
  background: #2f9d68;
}

.stock-summary-card.warning::before {
  background: #d4931f;
}

.stock-summary-card.danger::before {
  background: #c44949;
}

.stock-filter-toolbar {
  max-width: none;
}

.elevated-filter-toolbar {
  align-items: stretch;
  margin-bottom: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 252, 0.96));
}

.stock-table-shell {
  box-shadow: 0 20px 48px rgba(31, 50, 59, 0.07);
}

.stock-table-shell .compact-table thead th {
  border-bottom-color: #9cadb6;
}

.rich-empty-row {
  padding: 2.2rem 1rem !important;
}

.rich-empty-row div {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  color: var(--vew-muted);
}

.rich-empty-row i {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--vew-radius);
  color: var(--vew-accent-strong);
  background: #e9f2f5;
  font-size: 1.2rem;
}

.rich-empty-row strong {
  color: #26343b;
  font-size: 1rem;
}

.rich-empty-row span {
  max-width: 540px;
  text-align: center;
}

.stock-detail-grid {
  max-width: 1120px;
}

.movement-section {
  max-width: none;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-title-row p {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.movement-table {
  min-width: 1280px;
}

.department-ledger-table {
  min-width: 1040px;
}

.ledger-filter-toolbar {
  max-width: none;
}

.ledger-detail-grid {
  max-width: 1120px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.department-ledger-document .detail-section {
  max-width: none;
}

.ledger-summary-table {
  min-width: 840px;
}

.ledger-detail-table {
  min-width: 1280px;
}

.unit-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--vew-border);
  border-radius: 7px;
  color: #40515a;
  background: #f8fafb;
  font-size: 0.9rem;
}

.cancelled-ledger-row {
  color: #71808a;
  background: #fbfcfc;
}

.ledger-print-context {
  display: none;
}

.scrap-issue-context {
  max-width: 1120px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: #f8fafb;
}

.scrap-entry-items-table {
  min-width: 1540px;
}

.master-form {
  position: relative;
  display: grid;
  width: 100%;
  max-width: none;
  gap: 1rem;
  padding: clamp(1.05rem, 1.75vw, 1.45rem);
  border: 1px solid rgba(217, 224, 228, 0.94);
  border-radius: var(--vew-radius);
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.06), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 252, 0.98)),
    #ffffff;
  box-shadow: 0 20px 48px rgba(31, 50, 59, 0.075);
}

.master-form::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--vew-radius) var(--vew-radius) 0 0;
  content: "";
  background: linear-gradient(90deg, var(--vew-accent), #e3a235);
}

.compact-master-form {
  max-width: none;
}

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

.span-2 {
  grid-column: span 2;
}

.form-section-label {
  padding-top: 0.75rem;
  border-top: 1px solid var(--vew-border);
  color: var(--vew-accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.form-section-label:first-child {
  padding-top: 0;
  border-top: 0;
}

.stacked-cell {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.stacked-cell span,
.stacked-cell small {
  overflow-wrap: anywhere;
}

.stacked-cell small {
  color: var(--vew-muted);
}

.purchase-form,
.wide-master-form,
.sale-entry-form {
  max-width: none;
}

.purchase-form .form-grid,
.sale-entry-form .form-grid,
.wide-master-form .form-grid {
  max-width: none;
}

.sale-entry-table {
  min-width: 1480px;
}

.sale-entry-table select {
  min-width: 300px;
}

.sale-entry-table input {
  min-width: 96px;
}

.sale-entry-table input[name$=".Remarks"] {
  min-width: 180px;
}

.sale-table,
.sale-detail-table,
.invoice-table {
  min-width: 1180px;
}

.sale-totals-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-border);
}

.sale-totals-panel div {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
}

.sale-totals-panel span {
  color: var(--vew-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sale-totals-panel strong {
  color: #172329;
  font-size: 1.18rem;
  text-align: right;
}

.detail-totals {
  margin-top: 1rem;
}

.inline-cancel-form {
  display: grid;
  max-width: 780px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.invoice-document {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.2rem, 2vw, 1.8rem);
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: #ffffff;
  box-shadow: var(--vew-shadow-soft);
}

.invoice-header,
.invoice-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.invoice-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--vew-border);
}

.invoice-header h2 {
  margin: 0;
  color: #172329;
  font-size: 1.55rem;
  font-weight: 800;
}

.invoice-header p,
.invoice-meta p {
  margin: 0.2rem 0 0;
  color: var(--vew-muted);
}

.invoice-meta {
  padding: 1.2rem 0;
}

.invoice-meta h3,
.invoice-notes h3 {
  margin: 0 0 0.5rem;
  color: var(--vew-accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-meta dl,
.invoice-total-block dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.35rem 1.2rem;
  margin: 0;
}

.invoice-meta dt,
.invoice-total-block dt {
  color: var(--vew-muted);
  font-weight: 700;
}

.invoice-meta dd,
.invoice-total-block dd {
  margin: 0;
  font-weight: 750;
  text-align: right;
}

.invoice-total-block {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.invoice-total-block dl {
  min-width: 320px;
}

.invoice-total-block dt:last-of-type,
.invoice-total-block dd:last-of-type {
  padding-top: 0.5rem;
  border-top: 1px solid var(--vew-border);
  color: #172329;
  font-size: 1.05rem;
}

.invoice-notes {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--vew-border);
}

.purchase-items-section {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.35rem;
}

.purchase-entry-workspace {
  gap: 1.25rem;
}

.purchase-card-section,
.purchase-notes-card,
.purchase-totals-card {
  border: 1px solid rgba(217, 224, 228, 0.92);
  border-radius: var(--vew-radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(31, 50, 59, 0.045);
}

.purchase-card-section {
  padding: clamp(0.9rem, 1.4vw, 1.15rem);
}

.purchase-card-section .section-title-row {
  align-items: center;
  margin-bottom: 0.2rem;
}

.purchase-card-section .section-title-row p {
  margin: 0.35rem 0 0;
  color: var(--vew-muted);
  font-size: 0.9rem;
}

.purchase-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 1rem;
  align-items: start;
}

.purchase-notes-card,
.purchase-totals-card {
  display: grid;
  gap: 0.9rem;
  padding: clamp(0.95rem, 1.4vw, 1.2rem);
}

.purchase-totals-card {
  background:
    linear-gradient(135deg, rgba(31, 111, 139, 0.08), rgba(255, 255, 255, 0) 38%),
    #ffffff;
}

.purchase-totals-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--vew-border);
}

.purchase-totals-heading span {
  color: var(--vew-accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.purchase-totals-heading strong {
  color: var(--vew-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.small-icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex-basis: 32px;
}

.material-context {
  display: inline-block;
  min-width: 190px;
  color: var(--vew-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.unit-pill {
  display: inline-flex;
  min-width: 48px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border-radius: 999px;
  color: var(--vew-accent-strong);
  background: #e9f2f5;
  font-size: 0.78rem;
  font-weight: 800;
}

.totals-preview,
.purchase-total-block {
  display: grid;
  width: 100%;
  max-width: 520px;
  gap: 0.65rem;
  margin-left: auto;
}

.purchase-totals-card .totals-preview {
  max-width: none;
  margin-left: 0;
}

.totals-preview div,
.purchase-total-block div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 180px);
  align-items: center;
  gap: 0.75rem 1rem;
}

.totals-preview span,
.purchase-total-block span {
  color: var(--vew-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.totals-preview strong,
.purchase-total-block strong {
  text-align: right;
}

.grand-total-preview {
  padding-top: 0.65rem;
  border-top: 1px solid var(--vew-border);
}

.grand-total-preview strong {
  color: var(--vew-accent-strong);
  font-size: 1.15rem;
}

.print-document-header {
  display: none;
}

.readonly-code {
  display: inline-grid;
  max-width: 320px;
  gap: 0.15rem;
  padding: 0.75rem 0;
}

.readonly-code span {
  color: var(--vew-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.readonly-code strong {
  color: var(--vew-accent-strong);
  font-size: 1.05rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.4rem;
}

.detail-grid {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--vew-border);
  border-radius: var(--vew-radius);
  background: var(--vew-border);
  box-shadow: var(--vew-shadow-soft);
}

.detail-grid div {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  padding: 0.95rem;
  background: var(--vew-surface);
}

.detail-grid span {
  color: var(--vew-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-grid strong {
  overflow-wrap: anywhere;
}

.detail-section {
  width: 100%;
  max-width: none;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--vew-border);
}

.detail-section h2 {
  margin: 0 0 0.45rem;
  color: #1f2a30;
  font-size: 1rem;
  font-weight: 800;
}

.detail-section p {
  margin: 0;
  color: var(--vew-muted);
  line-height: 1.6;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: none;
  margin-top: 1rem;
  color: var(--vew-muted);
  font-size: 0.9rem;
}

.app-alert {
  display: flex;
  align-items: center;
  max-width: 760px;
  gap: 0.5rem;
  border: 1px solid #cfe8db;
  color: #176343;
  background: #edf8f2;
}

.app-alert-danger {
  border-color: #f2c7c7;
  color: #8f2727;
  background: #fdeeee;
}

.signature-row {
  display: grid;
  max-width: 960px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.signature-row div {
  min-height: 58px;
  border-top: 1px solid #9ca9af;
}

.signature-row span {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--vew-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.modal-backdrop.show {
  opacity: 0.32;
  backdrop-filter: blur(3px);
}

.logout-modal {
  border: 0;
  border-radius: var(--vew-radius);
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  background: rgba(15, 23, 28, 0.36);
}

@media (max-width: 1023.98px) {
  .auth-shell {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .purchase-footer-grid {
    grid-template-columns: 1fr;
  }

  .stock-command-panel {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero,
  .reports-grid,
  .dashboard-grid,
  .ops-hero,
  .ops-workbench,
  .attention-grid,
  .search-group-grid {
    grid-template-columns: 1fr;
  }

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

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

  .app-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    bottom: 0;
    left: 0;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
}

@media (min-width: 1280px) {
  .master-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .master-form .span-2 {
    grid-column: span 4;
  }

  .master-form .form-field.span-2 {
    grid-column: span 4;
  }

  .master-form .form-field:not(.span-2) {
    grid-column: span 2;
  }

  .master-form .form-field:has(textarea) {
    grid-column: span 4;
  }
}

@media (min-width: 768px) and (max-height: 760px) {
  .auth-panel {
    align-items: start;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .auth-form-wrap {
    transform: none;
  }

  .auth-heading {
    margin: 1rem 0 0.85rem;
  }

  .auth-heading h1 {
    font-size: 1.8rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .auth-form {
    gap: 0.7rem;
  }
}

@media (max-width: 767.98px) {
  html {
    font-size: 14px;
  }

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

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: 1.35rem;
  }

  .auth-form-wrap {
    transform: none;
  }

  .auth-heading {
    margin: 1.6rem 0 1.2rem;
  }

  .app-topbar {
    min-height: auto;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .global-search-form {
    order: 3;
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
    margin-left: 0;
  }

  .user-chip {
    max-width: min(58vw, 250px);
  }

  .app-content {
    padding: 1.25rem 1rem;
  }

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

  .stock-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .stock-summary-card {
    min-height: 92px;
  }

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

  .ops-summary-grid,
  .ops-master-strip,
  .quick-action-grid,
  .attention-row,
  .activity-item,
  .search-result-item {
    grid-template-columns: 1fr;
  }

  .ops-period-strip,
  .search-page-form {
    align-items: stretch;
    flex-direction: column;
  }

  .search-page-form i {
    top: 0.9rem;
  }

  .sale-totals-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric {
    min-height: 104px;
  }

  .page-header,
  .list-toolbar,
  .purchase-card-section .section-title-row,
  .pagination-row {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header > .btn,
  .page-header .button-row,
  .list-toolbar .btn,
  .status-select,
  .list-filter-select,
  .list-date-filter {
    width: 100%;
    max-width: none;
  }

  .button-row,
  .row-actions,
  .form-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .form-grid,
  .detail-grid,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .totals-preview,
  .purchase-total-block {
    max-width: none;
    margin-left: 0;
  }

  .totals-preview div,
  .purchase-total-block div {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .totals-preview strong,
  .purchase-total-block strong {
    text-align: left;
  }

  .inline-cancel-form,
  .invoice-header,
  .invoice-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .invoice-total-block {
    justify-content: stretch;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-sidebar,
  .app-topbar,
  .no-print,
  .mobile-sidebar-backdrop,
  .modal {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .app-content {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .print-document {
    color: #111820;
  }

  .print-document-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
  }

  .print-document-header h1 {
    margin: 0;
    font-size: 1.6rem;
  }

  .print-document-header p {
    margin: 0.25rem 0 0;
  }

  .table-shell,
  .detail-grid {
    overflow: visible;
    border-color: #cdd6db;
  }

  .compact-table {
    min-width: 0;
    font-size: 0.82rem;
  }

  .purchase-total-block {
    page-break-inside: avoid;
  }

  .stock-summary-strip {
    max-width: none;
  }

  .ledger-print-context {
    display: block;
  }

  .invoice-actions {
    display: none !important;
  }

  .invoice-document {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .invoice-table {
    min-width: 0;
  }

  .invoice-table-shell {
    overflow: visible;
  }

  .reports-grid,
  .report-filter-toolbar,
  .report-summary-grid {
    display: block;
  }

  .report-group,
  .report-summary-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .report-link-card {
    display: none;
  }

  .report-table {
    min-width: 0;
    font-size: 0.72rem;
  }

  .report-print-document .report-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
