/* K Pack ERP Department Portal — mobile app color palette */
:root {
  /* Mobile app (headers, dates, accents) */
  --app-header-blue: #56B4E9;
  --app-header-blue-dark: #4BA8DE;
  --app-purple: #302B63;
  --app-purple-hover: #3A3575;
  --app-purple-deep: #3A2D65;
  --app-page-bg: #EEEEEE;
  --app-date-accent: #56B4E9;

  --erp-primary: var(--app-purple);
  --erp-primary-hover: var(--app-purple-hover);
  --erp-accent-blue: var(--app-header-blue);
  --erp-dark: #0F172A;
  --erp-dark-2: #1E293B;
  --erp-bg: var(--app-page-bg);
  --erp-surface: #FFFFFF;
  --erp-text: #1A1A1A;
  --erp-muted: #5C5C5C;
  --erp-border: #E0E0E0;
  --erp-radius: 12px;
  --erp-header-h: 72px;
  --erp-font: "Inter", system-ui, sans-serif;
  --erp-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --erp-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --erp-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --erp-bg: #0B1220;
  --erp-surface: #1E293B;
  --erp-text: #F1F5F9;
  --erp-muted: #94A3B8;
  --erp-border: #334155;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.erp-body {
  margin: 0;
  font-family: var(--erp-font);
  font-size: 15px;
  color: var(--erp-text);
  background: var(--erp-bg);
  -webkit-font-smoothing: antialiased;
}

.erp-app, .erp-shell, .erp-shell-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.erp-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--erp-header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--erp-border);
  transition: box-shadow var(--erp-transition);
}

[data-theme="dark"] .erp-header { background: rgba(30, 41, 59, 0.92); }

.erp-header.is-scrolled { box-shadow: var(--erp-shadow-md); }

.erp-header-inner {
  height: 100%;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.erp-header-inner.container-fluid {
  --bs-gutter-x: 0;
  max-width: 1320px;
}

.erp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--erp-text);
}

.erp-brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }

.erp-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--erp-primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.erp-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.erp-brand-text strong { font-size: 0.95rem; }
.erp-brand-text small { font-size: 0.68rem; color: var(--erp-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.erp-module-switcher { flex: 1; max-width: 280px; margin: 0 auto; }
.erp-module-switcher .form-select { border-radius: 10px; border-color: var(--erp-border); font-weight: 600; font-size: 0.85rem; }

.erp-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.erp-icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  background: var(--erp-surface);
  color: var(--erp-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.erp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--erp-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.erp-avatar--photo {
  object-fit: cover;
  border: 2px solid rgba(37, 99, 235, 0.25);
  background: var(--erp-surface);
}

.erp-user-name { font-size: 0.875rem; font-weight: 600; }

/* SITE NAV */
.erp-header--site {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 var(--erp-border);
}

[data-theme="dark"] .erp-header--site {
  background: rgba(15, 23, 42, 0.96);
}

.erp-nav-center {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

@media (min-width: 992px) {
  .erp-nav-center { display: flex; }
}

.erp-nav-center a {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--erp-muted);
  text-decoration: none;
  border-radius: 10px;
  transition: color var(--erp-transition), background var(--erp-transition);
}

.erp-nav-center a:hover {
  color: var(--erp-primary);
  background: rgba(37, 99, 235, 0.08);
}

.erp-nav-center a.is-active {
  color: var(--erp-primary);
  background: rgba(37, 99, 235, 0.12);
}

.erp-nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  margin-right: 8px;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  background: var(--erp-surface);
  cursor: pointer;
}

@media (min-width: 992px) {
  .erp-nav-toggle { display: none; }
}

.erp-nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--erp-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.erp-header.nav-open .erp-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.erp-header.nav-open .erp-nav-toggle span:nth-child(2) { opacity: 0; }
.erp-header.nav-open .erp-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 991.98px) {
  .erp-header.nav-open .erp-nav-center {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--erp-header-h);
    left: 0;
    right: 0;
    padding: 16px 24px 20px;
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    box-shadow: var(--erp-shadow-md);
    align-items: stretch;
  }

  .erp-header.nav-open .erp-nav-center a {
    padding: 14px 16px;
  }

  .erp-header--site .erp-header-inner {
    flex-wrap: wrap;
    position: relative;
  }
}

body.erp-page-landing,
body.erp-page-site {
  background:
    radial-gradient(ellipse 70% 40% at 80% 0%, rgba(37, 99, 235, 0.07), transparent),
    var(--erp-bg);
}

/* BUTTONS */
.btn-erp-primary {
  background: var(--erp-primary) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 12px !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.btn-erp-primary:hover {
  background: var(--erp-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(48, 43, 99, 0.35);
  color: #fff !important;
}

.btn-erp-ghost {
  background: transparent !important;
  border: 1px solid var(--erp-border) !important;
  color: var(--erp-text) !important;
  border-radius: 10px !important;
  font-weight: 600;
}

/* LANDING */
.landing-hero {
  padding: clamp(40px, 6vw, 72px) 0;
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
  flex: 1;
}

.landing-hero-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 992px) {
  .landing-hero-grid { grid-template-columns: 1fr 1.05fr; gap: 56px; }
}

.landing-eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--erp-primary);
}

.landing-hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--erp-dark);
}

[data-theme="dark"] .landing-hero-copy h1 { color: var(--erp-text); }

.landing-lead {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--erp-muted);
  max-width: 520px;
}

.landing-cta { padding: 14px 32px !important; font-size: 1rem !important; }

.landing-hero-media img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow-md);
}

.landing-trust {
  padding: 20px 0 32px;
  background: var(--erp-bg);
}

.landing-trust-list {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: center;
}

.landing-trust-list li {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--erp-muted);
}

.landing-trust-list li::before {
  content: "✓ ";
  color: var(--erp-primary);
}

/* LOGIN PAGE */
body.erp-page-login {
  background: var(--erp-bg);
}

.erp-shell-login {
  min-height: 100vh;
}

.login-page {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 992px) {
  .login-page { grid-template-columns: 1.05fr 1fr; }
}

.login-page-media {
  min-height: 240px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.login-page-media-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(32px, 5vw, 56px);
  background: linear-gradient(160deg, rgba(48, 43, 99, 0.88) 0%, rgba(86, 180, 233, 0.85) 100%);
  color: #fff;
}

.login-page-tag {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.login-page-media-inner h2 {
  margin: 0 0 24px;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 420px;
}

.login-page-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.login-page-points li {
  font-size: 0.9rem;
  padding-left: 22px;
  position: relative;
  opacity: 0.92;
}

.login-page-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-header-blue);
}

.login-page-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 48px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.06), transparent),
    var(--erp-bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 32px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 40px rgba(15, 23, 42, 0.08);
}

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--erp-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.login-back:hover { color: var(--erp-primary); }

.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

.login-card-logo--mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--erp-primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
}

.login-card-brand {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--erp-text);
  line-height: 1.2;
}

.login-card-badge {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--erp-muted);
}

.login-card-intro {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--erp-border);
}

.login-card-intro h1 {
  margin: 0 0 8px;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--erp-text);
}

.login-card-intro p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--erp-muted);
  line-height: 1.55;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 20px;
}

.login-alert svg { flex-shrink: 0; margin-top: 1px; }

.login-alert--error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

[data-theme="dark"] .login-alert--error {
  background: rgba(127, 29, 29, 0.25);
  border-color: #991B1B;
  color: #FCA5A5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--erp-text);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  background: #F8FAFC;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[data-theme="dark"] .login-input-wrap {
  background: var(--erp-bg);
  border-color: var(--erp-border);
}

.login-input-wrap:hover {
  border-color: #CBD5E1;
  background: var(--erp-surface);
}

.login-input-wrap:focus-within {
  border-color: var(--app-header-blue);
  background: var(--erp-surface);
  box-shadow: 0 0 0 3px rgba(86, 180, 233, 0.25);
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  pointer-events: none;
  display: flex;
  z-index: 1;
  transition: color 0.2s;
}

.login-input-wrap:focus-within .login-input-icon {
  color: var(--erp-primary);
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: none;
  border-radius: 12px;
  font-family: var(--erp-font);
  font-size: 0.9375rem;
  color: var(--erp-text);
  background: transparent;
  box-shadow: none;
}

.login-input::placeholder {
  color: #94A3B8;
}

.login-input:focus {
  outline: none;
  box-shadow: none;
}

.login-input--password {
  padding-right: 48px;
}

.login-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--erp-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.login-toggle-pw:hover {
  color: var(--erp-primary);
  background: rgba(37, 99, 235, 0.08);
}

.login-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
  min-height: 24px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--erp-text);
  user-select: none;
}

.login-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--erp-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.login-forgot {
  font-size: 0.8125rem;
  color: var(--erp-muted);
  line-height: 1.4;
  text-align: right;
  text-decoration: none;
  transition: color 0.2s;
}

.login-forgot span {
  color: var(--erp-primary);
  font-weight: 600;
}

.login-forgot:hover {
  color: var(--erp-text);
}

.login-forgot:hover span {
  text-decoration: underline;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  margin-top: 0;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: var(--app-purple);
  color: #fff;
  font-family: var(--erp-font);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.login-submit svg {
  opacity: 0.9;
  transition: transform 0.2s;
}

.login-submit:hover {
  background: var(--app-purple-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(48, 43, 99, 0.4);
}

.login-submit:hover svg {
  transform: translateX(2px);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(48, 43, 99, 0.3);
}

.login-help-text {
  margin: 28px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--erp-border);
  font-size: 0.8125rem;
  color: var(--erp-muted);
  text-align: center;
  line-height: 1.55;
}

.login-help-text strong {
  color: var(--erp-text);
  font-weight: 600;
}

.login-trust {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #047857;
  background: #ECFDF5;
  border-radius: 10px;
}

[data-theme="dark"] .login-trust {
  background: rgba(6, 78, 59, 0.25);
  color: #6EE7B7;
}

/* Legacy form classes (update pages) */
.erp-input {
  border-radius: 12px !important;
  border-color: var(--erp-border) !important;
  background: var(--erp-surface) !important;
  color: var(--erp-text) !important;
}

.erp-input:focus {
  border-color: var(--erp-primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
}

.erp-input-group { position: relative; }
.erp-input-group .erp-input { padding-right: 48px; }

.erp-input-addon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--erp-muted);
  cursor: pointer;
}

/* FOOTER */
.erp-footer {
  height: 80px;
  border-top: 1px solid var(--erp-border);
  background: var(--erp-surface);
}

.erp-footer-inner {
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.erp-footer-copy { font-size: 0.85rem; color: var(--erp-muted); }

.erp-footer-links { display: flex; gap: 20px; }
.erp-footer-links a {
  font-size: 0.85rem;
  color: var(--erp-muted);
  text-decoration: none;
  font-weight: 500;
}

.erp-footer-links a:hover { color: var(--erp-primary); }

/* MODULE PAGES */
.erp-module-bar {
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
  padding: 20px 0;
}

.erp-module-bar--compact { padding: 16px 0; }

.erp-module-bar .container-fluid {
  max-width: 1320px;
}

.erp-module-back { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.erp-module-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.erp-module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--erp-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.erp-module-title h1 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.erp-module-title p { margin: 4px 0 0; color: var(--erp-muted); font-size: 0.875rem; }

.erp-module-h1 { margin: 8px 0 0; font-size: 1.25rem; font-weight: 800; }

.erp-module-tabs {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

.erp-segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: 999px;
  box-shadow: var(--erp-shadow);
}

.erp-segmented a {
  padding: 10px 22px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--erp-text);
  border-radius: 999px;
  transition: background var(--erp-transition), color var(--erp-transition);
}

.erp-segmented a.active {
  background: var(--app-purple-deep);
  color: #fff;
}

.erp-module-content {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.erp-record-card {
  display: block;
  height: 100%;
  padding: 20px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--erp-shadow);
  transition: transform var(--erp-transition), box-shadow var(--erp-transition);
}

.erp-record-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--erp-shadow-md);
  color: inherit;
}

.erp-record-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--erp-border);
}

.erp-record-top time { font-size: 0.8rem; font-weight: 600; color: var(--erp-muted); }

.erp-priority {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: capitalize;
}

.erp-priority.badge-minor { background: #FFF3CD; color: #B8860B; }
.erp-priority.badge-critical { background: #FFE4E4; color: #C62828; }
.erp-priority.badge-approved, .erp-priority.badge-major { background: #E8F5E9; color: #2E7D32; }

.erp-record-meta { margin: 0; display: grid; gap: 8px; }
.erp-record-meta div { display: flex; justify-content: space-between; font-size: 0.875rem; }
.erp-record-meta dt { color: var(--erp-muted); font-weight: 500; }
.erp-record-meta dd { margin: 0; font-weight: 600; }

.erp-record-link {
  display: block;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--erp-primary);
}

.erp-panel {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 24px;
  box-shadow: var(--erp-shadow);
}

.erp-detail-grid {
  display: grid;
  gap: 16px;
  margin: 0;
}

@media (min-width: 768px) {
  .erp-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

.erp-detail-item dt {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--erp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.erp-detail-item dd { margin: 0; font-weight: 500; }

.erp-doc-link {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--erp-text);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.erp-doc-link:hover { border-color: var(--erp-primary); color: var(--erp-primary); }
.erp-doc-view { font-weight: 700; color: var(--erp-primary); font-size: 0.8rem; }

.erp-empty-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--erp-surface);
  border: 1px dashed var(--erp-border);
  border-radius: var(--erp-radius);
}

.erp-sticky-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: linear-gradient(0deg, var(--erp-bg) 50%, transparent);
  z-index: 100;
}

.erp-sticky-action .btn { max-width: 1320px; margin: 0 auto; display: block; }

.erp-alert { border-radius: 12px; }

.dept-icon-svg { width: 26px; height: 26px; }

/* Forms (update) */
.item-card {
  grid-column: 1 / -1;
  width: 100%;
  padding: 18px 18px 48px;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  position: relative;
  display: grid;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

@media (min-width: 576px) {
  .item-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.item-card .portal-field {
  margin-bottom: 0;
  min-width: 0;
}

.portal-field label, .field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--erp-muted);
  margin-bottom: 6px;
  display: block;
}

.portal-input, .portal-select, .portal-textarea,
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  font-family: var(--erp-font);
  font-size: 0.95rem;
  line-height: 1.4;
  background: var(--erp-surface);
  color: var(--erp-text);
  box-sizing: border-box;
}

.portal-input,
.portal-select {
  min-height: 46px;
}

.portal-textarea {
  min-height: 88px;
  resize: vertical;
}

.btn-add-item {
  width: 100%;
  padding: 12px;
  background: #10B981;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  margin: 12px 0;
}

.item-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #EF4444;
  color: #fff;
  cursor: pointer;
}

.upload-zone {
  display: block;
  padding: 24px;
  border: 2px dashed #4CAF50;
  border-radius: 12px;
  text-align: center;
  color: #2E7D32;
  font-weight: 600;
  cursor: pointer;
  background: #F9FFF9;
}

.upload-zone .portal-file-input {
  display: none;
}

.upload-zone .portal-file-hint {
  color: #388E3C;
}

.portal-content { padding-bottom: 100px; }

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--erp-transition), transform var(--erp-transition);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* DEPARTMENTS (home) */
.landing-depts {
  padding: 48px 0 56px;
  background: var(--erp-bg);
}

.landing-depts .container-fluid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-depts-head {
  margin-bottom: 32px;
}

.landing-depts-head h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--erp-text);
}

.landing-depts-head p {
  margin: 0;
  color: var(--erp-muted);
  max-width: 640px;
}

.erp-dept-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--erp-shadow);
  transition: transform var(--erp-transition), box-shadow var(--erp-transition), border-color var(--erp-transition);
}

.erp-dept-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--erp-shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
  color: inherit;
}

.erp-dept-card.is-locked,
.erp-dept-card.is-static {
  opacity: 0.88;
  cursor: not-allowed;
}

.erp-dept-card.is-static:hover {
  transform: none;
  box-shadow: var(--erp-shadow);
  border-color: var(--erp-border);
}

.erp-dept-card.is-locked:not(.is-static):hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.35);
}

.erp-dept-card.is-signin-only:hover {
  border-color: rgba(71, 85, 105, 0.45);
}

.erp-dept-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tone-indigo .erp-dept-card-icon { background: #EEF2FF; color: #4F46E5; }
.tone-sky .erp-dept-card-icon { background: #E0F2FE; color: #0284C7; }
.tone-amber .erp-dept-card-icon { background: #FEF3C7; color: #D97706; }
.tone-slate .erp-dept-card-icon { background: #F1F5F9; color: #475569; }
.tone-emerald .erp-dept-card-icon { background: #D1FAE5; color: #059669; }
.tone-rose .erp-dept-card-icon { background: #FFE4E6; color: #E11D48; }

.erp-dept-card-body { flex: 1; }

.erp-dept-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.erp-dept-card-body p {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--erp-muted);
  line-height: 1.5;
}

.erp-dept-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
}

.status-ok { background: #DBEAFE; color: #1D4ED8; }
.status-denied { background: #FEE2E2; color: #991B1B; }
.status-login { background: #F1F5F9; color: #475569; }

.erp-dept-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--erp-border);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--erp-primary);
}

.erp-dept-cta--muted {
  color: var(--erp-muted);
}

.erp-dept-cta--denied {
  color: #991B1B;
}

.erp-denied-card h2 { margin-bottom: 12px; }

/* APP WORKSPACE (dashboard / task / update) */
body.erp-page-module {
  background: var(--app-page-bg);
}

.app-page-hero {
  color: #fff;
  padding: 28px 0 32px;
  border-bottom: none;
  background: var(--app-header-blue);
}

.app-page-hero-inner,
.app-page-body-inner,
.app-page-toolbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* All departments — same light blue header as mobile app */
.app-page-hero.tone-indigo,
.app-page-hero.tone-sky,
.app-page-hero.tone-amber,
.app-page-hero.tone-slate,
.app-page-hero.tone-emerald,
.app-page-hero.tone-rose {
  background: var(--app-header-blue);
}

.app-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

.app-breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.app-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.app-breadcrumb span:last-child { font-weight: 600; }

.app-page-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.app-page-hero-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.app-page-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-page-hero-icon .dept-icon-svg { width: 28px; height: 28px; color: #fff; }

.app-page-hero-title h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-page-hero-title p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  opacity: 0.88;
}

.app-page-actions { display: flex; gap: 10px; align-items: center; }

.btn-app-light {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: #fff !important;
  color: #0F172A !important;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 12px;
  text-decoration: none !important;
  border: 2px solid #fff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-app-light:hover,
.btn-app-light:focus,
.btn-app-light:active,
.btn-app-light:focus-visible {
  background: #F5F5F5 !important;
  color: var(--app-purple) !important;
  border-color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  text-decoration: none !important;
  outline: none;
}

/* On blue module header — never inherit white link color from hero */
.app-page-hero .btn-app-light,
.app-page-hero a.btn-app-light {
  background: #fff !important;
  color: #0F172A !important;
}

.app-page-hero .btn-app-light:hover,
.app-page-hero .btn-app-light:focus,
.app-page-hero .btn-app-light:active {
  background: #F8F8F8 !important;
  color: var(--app-purple) !important;
  border: 2px solid rgba(255, 255, 255, 0.95) !important;
}

.btn-app-outline {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: transparent;
  color: var(--erp-text);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid var(--erp-border);
}

.btn-app-outline:hover { background: var(--erp-bg); color: var(--erp-text); }

.app-page-toolbar {
  padding: 20px 0;
  border-bottom: 1px solid var(--erp-border);
  background: var(--erp-surface);
}

.app-page-body { padding: 28px 0 48px; flex: 1; }

.app-alert {
  border-radius: 12px;
  margin-bottom: 20px;
}

.app-card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 24px;
  box-shadow: var(--erp-shadow);
}

.app-card--sticky {
  position: sticky;
  top: calc(var(--erp-header-h) + 16px);
}

.app-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--erp-border);
}

.app-card-meta {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-muted);
}

.app-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.app-summary-list li span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-muted);
  margin-bottom: 4px;
}

.app-summary-list li strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--erp-text);
  word-break: break-word;
}

.app-section-title {
  margin: 0 0 20px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--erp-muted);
}

.app-field-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 576px) {
  .app-field-grid { grid-template-columns: repeat(2, 1fr); }
}

.app-field {
  padding: 14px 16px;
  background: var(--erp-bg);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color var(--erp-transition);
}

.app-field:hover { border-color: var(--erp-border); }

.app-field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-muted);
  margin-bottom: 6px;
}

.app-field-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--erp-text);
  line-height: 1.45;
  word-break: break-word;
}

/* Portal update form — required markers & validation */
.portal-required {
  color: #DC2626;
  font-weight: 700;
  margin-left: 3px;
}

.portal-form-note {
  margin: -8px 0 20px;
  font-size: 0.8125rem;
  color: var(--erp-muted);
}

.portal-form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--erp-border);
}

.portal-form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.portal-field-grid--form {
  display: grid;
  gap: 18px;
  width: 100%;
  align-items: start;
}

.portal-field-grid--form > * {
  min-width: 0;
}

.portal-field {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.portal-handover-inline {
  grid-column: 1 / -1;
  width: 100%;
}

.portal-field-grid--form > .portal-field,
.portal-field-grid--form > .portal-handover-inline,
.portal-field-grid--form > .portal-form-note,
.portal-field-grid--form > .portal-form-section,
.portal-field-grid--form > .portal-purchase-conditional,
.portal-field-grid--form > .portal-purchase-add-item-wrap,
.portal-field-grid--form > .upload-zone-wrap,
.portal-field-grid--form > [id^="portal_"] {
  align-self: stretch;
}

.portal-purchase-conditional {
  grid-column: 1 / -1;
  width: 100%;
}

.portal-handover-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* Engineering — Select Handover Team (mobile app: label + rows, checkbox right) */
.portal-handover-inline .portal-label {
  display: block;
  margin-bottom: 8px;
}

.portal-handover-list {
  border: 1px solid var(--erp-border, #cbd5e1);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.portal-handover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 14px 16px;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--erp-text, #1e293b);
  border-bottom: 1px solid var(--erp-border, #e2e8f0);
  -webkit-tap-highlight-color: transparent;
}

.portal-handover-row:last-child {
  border-bottom: none;
}

.portal-handover-row:active {
  background: var(--erp-page-bg, #eeeeee);
}

.portal-handover-row-label {
  flex: 1;
  line-height: 1.35;
  padding-right: 8px;
}

.portal-handover-row-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--erp-primary, #302b63);
  cursor: pointer;
}

.portal-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--erp-text, #1e293b);
  cursor: pointer;
}

.portal-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--erp-primary, #312e81);
}

.portal-engineering-update .portal-eng-conditional {
  grid-column: 1 / -1;
}

@media (min-width: 576px) {
  .portal-field-grid--form {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-field--required .portal-label {
  font-weight: 700;
}

.portal-field--optional .portal-label {
  font-weight: 600;
}

.portal-update-card .portal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--erp-text);
  margin-bottom: 6px;
}

.portal-form-note--info {
  padding: 12px 14px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--erp-radius-sm);
  color: #1E40AF;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.portal-update-card .portal-input:invalid:not(:placeholder-shown),
.portal-update-card .portal-select:invalid,
.portal-update-card .portal-textarea:invalid:not(:placeholder-shown) {
  border-color: #FCA5A5;
}

.portal-update-card .portal-input:valid,
.portal-update-card .portal-select:valid,
.portal-update-card .portal-textarea:valid {
  border-color: var(--erp-border);
}

.portal-update-form .portal-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  font-family: var(--erp-font);
  font-size: 0.95rem;
  background: var(--erp-bg);
  color: var(--erp-text);
}

.portal-update-form .portal-select:focus {
  outline: none;
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--erp-surface);
}

.app-muted { color: var(--erp-muted); font-size: 0.9rem; }

.app-doc-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-muted);
  margin: 16px 0 10px;
}

.app-doc-group-label:first-of-type { margin-top: 0; }

.app-task-detail-docs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--erp-border, #e2e8f0);
}

.app-doc-list { display: grid; gap: 8px; margin-bottom: 8px; }

.app-doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--erp-text);
  transition: border-color var(--erp-transition), background var(--erp-transition);
}

.app-doc-item:hover {
  border-color: var(--erp-primary);
  background: rgba(37, 99, 235, 0.04);
  color: var(--erp-text);
}

.app-doc-icon {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 6px 8px;
  background: #FEE2E2;
  color: #991B1B;
  border-radius: 6px;
}

.app-doc-name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.app-doc-open { font-size: 0.8rem; font-weight: 700; color: var(--app-purple); }

.app-doc-item--view {
  justify-content: flex-start;
}

.app-doc-item--view .app-doc-name {
  flex: 0 0 auto;
}

.app-doc-icon--pdf {
  color: #DC2626;
}

.app-orders-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .app-orders-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .app-orders-grid { grid-template-columns: repeat(3, 1fr); }
}

.app-order-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--erp-shadow);
  transition: transform var(--erp-transition), box-shadow var(--erp-transition), border-color var(--erp-transition);
  min-height: 100%;
}

.app-order-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--erp-shadow-md);
  border-color: rgba(86, 180, 233, 0.45);
  color: inherit;
}

.app-order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.app-order-card-top time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-date-accent);
}

.app-order-client {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
}

.app-order-meta {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--erp-muted);
}

.app-order-dl {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.app-order-dl div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  padding-top: 10px;
  border-top: 1px solid var(--erp-border);
  min-width: 0;
}

.app-order-dl dt {
  flex: 0 1 48%;
  min-width: 0;
  color: var(--erp-muted);
  font-weight: 500;
  margin: 0;
  padding-right: 4px;
  line-height: 1.4;
}

.app-order-dl dd {
  flex: 1 1 52%;
  min-width: 0;
  margin: 0;
  font-weight: 700;
  text-align: right;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-order-dl--app {
  margin-top: 4px;
}

.app-order-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--app-purple);
}

/* Add proposal — mobile FAB */
.portal-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 300;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--app-purple);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(48, 43, 99, 0.45);
  transition: transform var(--erp-transition), box-shadow var(--erp-transition);
}

.portal-fab:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(49, 46, 129, 0.5);
}

/* Task detail — mobile app list */
.app-card--task-detail {
  padding: 0;
  overflow: hidden;
}

.app-task-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--erp-border);
  background: var(--erp-surface-2, var(--erp-bg));
}

.app-task-detail-head time {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-date-accent);
}

.app-task-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-task-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--erp-border);
  width: 100%;
}

.app-task-detail-row:last-child {
  border-bottom: none;
}

.app-task-detail-label {
  flex: 0 1 46%;
  max-width: 50%;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--erp-text);
  line-height: 1.4;
}

.app-task-detail-value {
  flex: 1 1 50%;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--erp-muted);
  text-align: right;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-task-detail-row--block {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.app-task-detail-row--block .app-task-detail-value {
  text-align: left;
  white-space: pre-wrap;
}

.app-task-detail-extras {
  padding: 16px 22px 8px;
  border-top: 1px solid var(--erp-border);
  background: var(--erp-surface-2, #f8fafc);
}

.app-card--task-detail .app-task-detail-docs {
  margin: 0;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--erp-border);
}

.app-material-procured-block + .app-material-procured-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--erp-border, #e2e8f0);
}

.app-material-procured-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
}

.app-material-procured-title {
  font-weight: 600;
  color: #0284c7;
  font-size: 0.95rem;
}

.app-task-detail-list--inset {
  margin: 0;
  padding: 0;
}

.app-material-empty {
  margin: 0;
  padding: 12px;
  font-style: italic;
  color: var(--erp-muted, #64748b);
  background: #f8fafc;
  border-radius: 8px;
}

.portal-purchase-update .portal-material-items,
.portal-manufacturing-update .portal-production-processes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 1 / -1;
}

.portal-purchase-update .item-card,
.portal-manufacturing-update .item-card {
  position: relative;
  padding: 16px;
  padding-bottom: 44px;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.portal-purchase-update .item-remove,
.portal-manufacturing-update .item-remove {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.portal-purchase-add-item-wrap {
  grid-column: 1 / -1;
  text-align: center;
}

.portal-purchase-add-item-wrap .btn-add-item {
  min-width: 140px;
}

.portal-field--upload {
  grid-column: 1 / -1;
}

.portal-file-preview {
  margin-top: 12px;
}

.portal-file-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-file-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  min-width: 0;
}

.portal-file-preview-icon {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: #dc2626;
  background: #fef2f2;
  padding: 4px 6px;
  border-radius: 4px;
}

.portal-file-preview-name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--erp-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-file-preview-size {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--erp-muted);
}

.erp-header-actions .btn-erp-primary.btn-sm {
  padding: 8px 18px;
  min-height: 36px;
  font-size: 0.8125rem;
  border-radius: 10px;
  white-space: nowrap;
}

@media (max-width: 575px) {
  .app-task-detail-row {
    flex-direction: column;
    gap: 6px;
  }
  .app-task-detail-label,
  .app-task-detail-value {
    max-width: 100%;
    text-align: left;
  }
}

.app-empty {
  text-align: center;
  padding: 56px 32px;
}

.app-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.app-empty h3 { margin: 0 0 8px; font-weight: 800; }
.app-empty p { margin: 0; color: var(--erp-muted); max-width: 400px; margin-inline: auto; }

.app-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
}

/* Mobile app Submit / Update Task — pill purple button */
body.erp-page-module .app-form-actions .btn-erp-primary {
  border-radius: 999px !important;
  min-height: 48px;
  padding-left: 28px !important;
  padding-right: 28px !important;
  font-weight: 700;
  background: var(--app-purple) !important;
}

body.erp-page-module .app-form-actions .btn-erp-primary:hover {
  background: var(--app-purple-hover) !important;
}

@media (max-width: 575px) {
  body.erp-page-module .app-form-actions {
    flex-direction: column-reverse;
  }

  body.erp-page-module .app-form-actions .btn-erp-primary {
    width: 100%;
    justify-content: center;
  }
}

.app-card .item-card { background: var(--erp-bg); }

.portal-update-card {
  padding: 24px;
  overflow: hidden;
}

.portal-update-card .portal-field-grid--form > .portal-field {
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .app-card--sticky { position: static; }
  .app-page-actions { width: 100%; }
  .btn-app-light { width: 100%; justify-content: center; }
}

/* PUBLIC SITE (home / about / contact) */
.landing-hero--premium {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 88px) 0;
  border-bottom: none;
  background: transparent;
}

.landing-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 138, 0.78) 48%, rgba(37, 99, 235, 0.55) 100%),
    url('../images/landing-hero.jpg') center/cover no-repeat;
  z-index: 0;
}

.landing-hero--premium .landing-hero-grid {
  position: relative;
  z-index: 1;
}

.landing-hero--premium .landing-hero-copy {
  color: #fff;
}

.landing-hero--premium .landing-eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.landing-hero--premium .landing-hero-copy h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.landing-hero--premium .landing-lead {
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.landing-hero--premium .btn-erp-ghost {
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.landing-trust-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-trust-list--inline li {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
}

.landing-hero-frame {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.landing-hero-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

.landing-kpi-strip {
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
  padding: 20px 0;
}

.landing-kpi-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .landing-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.landing-kpi {
  text-align: center;
  padding: 16px;
  background: var(--erp-bg);
  border-radius: 12px;
  border: 1px solid var(--erp-border);
}

.landing-kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--erp-primary);
}

.landing-kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--erp-muted);
}

.landing-features {
  padding: 56px 0;
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
}

.landing-features .container-fluid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.landing-section-head h2 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 800;
}

.landing-section-head p {
  margin: 0;
  color: var(--erp-muted);
}

.site-feature-card {
  height: 100%;
  padding: 28px;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  transition: transform var(--erp-transition), box-shadow var(--erp-transition);
}

.site-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--erp-shadow-md);
}

.site-feature-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.site-feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

.site-feature-card p {
  margin: 0;
  color: var(--erp-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.landing-cta-band {
  padding: 48px 0 56px;
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
}

.landing-cta-band-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
}

.landing-cta-band h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.landing-cta-band p {
  margin: 0;
  opacity: 0.9;
}

.landing-depts-head .landing-eyebrow {
  margin-bottom: 8px;
}

/* Site footer */
.site-footer {
  margin-top: auto;
  background: var(--erp-dark);
  color: #CBD5E1;
}

.site-footer-main {
  padding: 48px 0 32px;
}

.site-footer-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 32px;
}

@media (min-width: 768px) {
  .site-footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
}

.site-footer-brand strong {
  display: block;
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.site-footer-brand p {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 280px;
}

.site-footer h4 {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
}

.site-footer-links,
.site-footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer-links li,
.site-footer-contact li {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.site-footer-links a,
.site-footer-contact a {
  color: #E2E8F0;
  text-decoration: none;
}

.site-footer-links a:hover,
.site-footer-contact a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer-muted { color: #94A3B8; font-size: 0.85rem; }

.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
}

.site-footer-bottom-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748B;
}

/* Inner pages */
.site-page-hero {
  padding: 40px 0 36px;
  background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-page-hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 16px;
  opacity: 0.85;
}

.site-breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-breadcrumb a:hover { color: #fff; text-decoration: underline; }

.site-page-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
}

.site-page-hero p {
  margin: 12px 0 0;
  max-width: 720px;
  font-size: 1.05rem;
  opacity: 0.9;
  line-height: 1.55;
}

.site-page-content {
  padding: 40px 0 56px;
  flex: 1;
}

.site-page-content .container-fluid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 28px 32px;
  box-shadow: var(--erp-shadow);
}

.site-card h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
}

.site-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.site-card--accent {
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.08) 0%, var(--erp-surface) 60%);
  border-color: rgba(37, 99, 235, 0.2);
}

.site-lead {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--erp-text);
  margin-bottom: 24px;
}

.site-muted {
  color: var(--erp-muted);
  font-size: 0.9rem;
  margin: 0;
}

.site-split-stats {
  display: grid;
  gap: 20px;
}

@media (min-width: 576px) {
  .site-split-stats { grid-template-columns: 1fr 1fr; }
}

.site-split-stats strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-primary);
  margin-bottom: 6px;
}

.site-split-stats p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--erp-muted);
  line-height: 1.5;
}

.site-values {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-values li {
  padding: 14px 0;
  border-bottom: 1px solid var(--erp-border);
}

.site-values li:last-child { border-bottom: none; }

.site-values strong {
  display: block;
  margin-bottom: 4px;
}

.site-values p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--erp-muted);
}

.site-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-timeline li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--erp-border);
}

.site-timeline li:last-child { border-bottom: none; }

.site-timeline-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 12px;
  background: var(--erp-bg);
  border-radius: 8px;
  color: var(--erp-primary);
  max-width: 140px;
  line-height: 1.3;
}

.site-timeline p {
  margin: 0;
  color: var(--erp-muted);
  line-height: 1.55;
}

.site-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-contact-list li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--erp-border);
}

.site-contact-list li:last-child { border-bottom: none; }

.site-contact-icon { font-size: 1.25rem; line-height: 1; }

.site-contact-list strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--erp-muted);
  margin-bottom: 4px;
}

.site-contact-list p {
  margin: 0;
  font-size: 0.95rem;
}

.site-contact-list a {
  color: var(--erp-primary);
  text-decoration: none;
  font-weight: 600;
}

.site-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--erp-muted);
  margin-bottom: 6px;
}

.site-input,
.site-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  font-family: var(--erp-font);
  font-size: 0.95rem;
  background: var(--erp-bg);
  color: var(--erp-text);
}

.site-input:focus,
.site-textarea:focus {
  outline: none;
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.site-alert {
  border-radius: 12px;
  margin-bottom: 24px;
}

/* Contact page — details only */
.site-page-content--contact .container-fluid {
  max-width: 960px;
}

.contact-details-wrap {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: 24px;
  padding: 36px 32px 32px;
  box-shadow: var(--erp-shadow-md);
}

.contact-details-head {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--erp-border);
}

.contact-details-head h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.contact-details-head p {
  margin: 0;
  color: var(--erp-muted);
  font-size: 0.95rem;
}

.contact-detail-card {
  height: 100%;
  padding: 24px;
  background: var(--erp-bg);
  border: 1px solid var(--erp-border);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-detail-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--erp-shadow);
}

.contact-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--erp-primary);
}

.contact-detail-card h3 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-muted);
}

.contact-detail-card p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--erp-text);
  line-height: 1.5;
}

.contact-detail-card a {
  color: var(--erp-primary);
  text-decoration: none;
}

.contact-detail-card a:hover {
  text-decoration: underline;
}

.contact-detail-sub {
  margin-top: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: var(--erp-muted) !important;
}

.contact-detail-sub span {
  margin-right: 6px;
  font-weight: 600;
}

.contact-details-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--erp-border);
}

/* Admin CMS pages (About / Contact / Privacy) */
.site-card--cms {
  padding: 32px 28px;
}

.site-cms-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--erp-text);
  word-wrap: break-word;
}

.site-cms-content h1,
.site-cms-content h2,
.site-cms-content h3,
.site-cms-content h4 {
  margin: 1.25em 0 0.5em;
  font-weight: 800;
  line-height: 1.3;
  color: var(--erp-text);
}

.site-cms-content h1:first-child,
.site-cms-content h2:first-child,
.site-cms-content h3:first-child {
  margin-top: 0;
}

.site-cms-content p {
  margin: 0 0 1em;
}

.site-cms-content ul,
.site-cms-content ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.site-cms-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.site-cms-content table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1em;
  border-collapse: collapse;
}

.site-cms-content table td,
.site-cms-content table th {
  border: 1px solid var(--erp-border);
  padding: 8px 12px;
}

.site-cms-content a {
  color: var(--erp-primary);
  text-decoration: underline;
}

.site-cms-content--contact .contact-details-wrap,
.site-cms-content--contact {
  padding: 0;
}

.contact-details-wrap:has(.site-cms-content--contact) {
  padding: 32px 28px;
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
}

/* ——— Portal panel: global alignment ——— */
.app-page-body-inner,
.app-page-hero-inner,
.app-page-toolbar-inner {
  width: 100%;
  box-sizing: border-box;
}

.app-page-toolbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.app-page-hero-row {
  align-items: center;
}

.app-field-grid > *,
.app-orders-grid > * {
  min-width: 0;
}

.app-summary-list li {
  min-width: 0;
}

.app-doc-list,
.app-task-detail-docs {
  width: 100%;
}

.app-doc-item {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.app-doc-item .app-doc-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-form-actions {
  align-items: center;
  width: 100%;
}

.app-form-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-card--task-detail .app-task-detail-list,
.app-card--task-detail .app-task-detail-extras {
  width: 100%;
}

.app-material-procured-head {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 576px) {
  .app-task-detail-row {
    align-items: center;
  }
}

@media (max-width: 767px) {
  .erp-header-inner {
    padding: 0 16px;
    gap: 10px;
  }

  .app-page-hero-inner,
  .app-page-body-inner,
  .app-page-toolbar-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-page-hero-row {
    flex-direction: column;
    align-items: stretch;
  }

  .app-page-actions {
    width: 100%;
  }

  .app-page-actions .btn-app-light {
    width: 100%;
    justify-content: center;
  }

  .portal-update-card {
    padding: 18px 16px;
  }
}
