/* ERP Shell Layer */
html,
body {
  height: 100%;
}

body.app-shell:not(.app-shell--default) {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--erp-bg) !important;
  color: var(--erp-text) !important;
  font-family: var(--erp-font) !important;
  font-size: 13.5px;
  letter-spacing: 0;
}

body.app-shell:not(.app-shell--default) .card:not(.erp-grid-card),
body.app-shell:not(.app-shell--default) .content-card,
body.app-shell:not(.app-shell--default) .dashboard-mode-card,
body.app-shell:not(.app-shell--default) .dashboard-kpi-card,
body.app-shell:not(.app-shell--default) .dashboard-section-card,
body.app-shell:not(.app-shell--default) .open-work-card {
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-surface) !important;
  box-shadow: var(--erp-shadow) !important;
  color: var(--erp-text) !important;
}

body.app-shell:not(.app-shell--default) .card-header,
body.app-shell:not(.app-shell--default) .modal-header {
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--erp-line-soft) !important;
  background: var(--erp-surface-soft) !important;
}

body.app-shell:not(.app-shell--default) .card-body {
  padding: 14px !important;
  overflow: visible !important;
}

body.app-shell:not(.app-shell--default) h1,
body.app-shell:not(.app-shell--default) .h1 {
  font-size: 22px !important;
  font-weight: 650 !important;
}

body.app-shell:not(.app-shell--default) h2,
body.app-shell:not(.app-shell--default) .h2,
body.app-shell:not(.app-shell--default) .h3 {
  font-size: 18px !important;
  font-weight: 650 !important;
}

body.app-shell:not(.app-shell--default) h3,
body.app-shell:not(.app-shell--default) .h4,
body.app-shell:not(.app-shell--default) .h5 {
  font-size: 15px !important;
  font-weight: 650 !important;
}

body.app-shell:not(.app-shell--default) p,
body.app-shell:not(.app-shell--default) .text-muted,
body.app-shell:not(.app-shell--default) .admin-subtext,
body.app-shell:not(.app-shell--default) .form-text {
  color: var(--erp-text-muted) !important;
}

body.app-shell:not(.app-shell--default) .btn {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: var(--erp-radius-sm) !important;
  font-size: 13px;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.app-shell:not(.app-shell--default) .btn-primary,
body.app-shell:not(.app-shell--default) button[type="submit"].btn-primary {
  border-color: var(--erp-primary) !important;
  background: var(--erp-primary) !important;
  color: #ffffff !important;
}

body.app-shell:not(.app-shell--default) .btn-primary:hover,
body.app-shell:not(.app-shell--default) .btn-primary:focus {
  border-color: var(--erp-primary-hover) !important;
  background: var(--erp-primary-hover) !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-secondary,
body.app-shell:not(.app-shell--default) .btn-light,
body.app-shell:not(.app-shell--default) .btn-secondary {
  border-color: var(--erp-line) !important;
  background: var(--erp-surface) !important;
  color: #334155 !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-secondary:hover,
body.app-shell:not(.app-shell--default) .btn-light:hover,
body.app-shell:not(.app-shell--default) .btn-secondary:hover {
  border-color: #b8cff8 !important;
  background: var(--erp-primary-soft) !important;
  color: var(--erp-primary) !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-danger {
  border-color: #e2b4b4 !important;
  background: #ffffff !important;
  color: #9f1d1d !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-danger:hover,
body.app-shell:not(.app-shell--default) .btn-outline-danger:focus {
  border-color: #d18d8d !important;
  background: #fff1f1 !important;
  color: #8b1a1a !important;
}

body.app-shell:not(.app-shell--default) .btn-danger {
  border-color: #b42318 !important;
  background: #b42318 !important;
  color: #ffffff !important;
}

body.app-shell:not(.app-shell--default) .btn-danger:hover,
body.app-shell:not(.app-shell--default) .btn-danger:focus {
  border-color: #961c14 !important;
  background: #961c14 !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-success {
  border-color: #9fd0ae !important;
  background: #ffffff !important;
  color: #166534 !important;
}

body.app-shell:not(.app-shell--default) .btn-outline-success:hover,
body.app-shell:not(.app-shell--default) .btn-outline-success:focus {
  border-color: #83be97 !important;
  background: #ecf9f1 !important;
  color: #14532d !important;
}

body.app-shell:not(.app-shell--default) .btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
}

body.app-shell:not(.app-shell--default) .btn:disabled,
body.app-shell:not(.app-shell--default) .btn.disabled {
  opacity: 0.62 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

body.app-shell:not(.app-shell--default) .session-context-chip {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--erp-line);
  border-radius: var(--erp-radius-sm);
  background: var(--erp-surface);
  color: var(--erp-text);
  text-decoration: none;
}

body.app-shell:not(.app-shell--default) .session-context-chip__line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
}

body.app-shell:not(.app-shell--default) .session-context-chip__line span,
body.app-shell:not(.app-shell--default) .session-context-chip small {
  color: var(--erp-text-muted);
}

body.app-shell:not(.app-shell--default) .session-context-chip__line strong {
  color: var(--erp-text);
  font-weight: 700;
}

@media (max-width: 991.98px) {
  body.app-shell:not(.app-shell--default) {
    min-height: 100dvh;
    overflow-y: auto !important;
  }
}

@media (max-width: 575.98px) {
  body.app-shell:not(.app-shell--default) {
    font-size: 13px;
  }
}

.erp-body {
  margin: 0;
  min-height: 100vh;
  background: #f3f6fa;
  color: #0f172a;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.erp-shell {
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
  min-height: 100vh;
}

.erp-workspace {
  display: grid;
  grid-template-rows: 64px 44px minmax(0, 1fr) 34px;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.erp-shell--auth .erp-workspace,
.erp-workspace--auth {
  grid-template-rows: 64px 44px minmax(0, 1fr);
}

.erp-shell--auth-single {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1100px) {
  .erp-shell {
    grid-template-columns: 1fr;
  }

  .erp-workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
}

