:root {
  --bg: #eef3f0;
  --panel: #ffffff;
  --ink: #14221d;
  --muted: #66746e;
  --line: #d9e2dd;
  --brand: #0f7a61;
  --brand-strong: #0b4b3e;
  --accent: #2f80ed;
  --yellow: #bd8f1d;
  --red: #b8332b;
  --sidebar: #f9fbfa;
  --sidebar-ink: #15231e;
  --shadow: 0 18px 45px rgba(28, 45, 38, 0.11);
}

* {
  box-sizing: border-box;
}

button,
select,
input,
textarea,
a {
  touch-action: manipulation;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbf9 0, #eef3f0 340px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body.login-required .sidebar,
body.login-required .app {
  display: none;
}

.login-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #eef4f0;
}

body.login-required .login-screen {
  display: grid;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.mini-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-card strong {
  font-size: 1.25rem;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 15px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 2.2rem;
}

.login-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-message {
  display: none;
  border: 1px solid #e7bbb1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fdf0ed;
  color: #7b271f;
  font-weight: 800;
}

.login-message.show {
  display: block;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 800;
  text-align: left;
  padding: 0;
}

.forgot-card {
  position: relative;
  z-index: 2;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 15px;
  margin: 12vh auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reset-result {
  display: none;
  border: 1px solid #b9dbc9;
  border-radius: 8px;
  padding: 12px;
  background: #e8f4ee;
  color: var(--brand-strong);
  font-weight: 800;
}

.reset-result.show {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  min-height: 44px;
  font-size: 16px;
}

button,
a,
label,
input,
select,
textarea {
  touch-action: manipulation;
}

button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

button.touch-active {
  transform: translateY(1px);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 292px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 18px;
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px rgba(20, 34, 29, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  padding: 8px;
  border-radius: 8px;
  background: #eef7f3;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  color: #082017;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid #d5e6df;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
}

.brand span {
  color: #5c6f67;
  font-size: 0.78rem;
  margin-top: 3px;
  line-height: 1.3;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.storage-panel button,
.import-button {
  border: 0;
  border-radius: 7px;
  padding: 11px 13px;
  color: inherit;
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  background: #e1f1eb;
  color: var(--brand-strong);
}

.storage-panel {
  margin-top: auto;
  display: grid;
  gap: 9px;
  font-size: 0.9rem;
}

.storage-panel span {
  color: #6a7973;
}

.storage-panel button,
.import-button {
  border: 1px solid #c9d8d1;
  background: #fff;
  text-align: center;
}

.import-button input {
  display: none;
}

.app {
  margin-left: 292px;
  min-height: 100vh;
  padding: 30px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 4px 2px 10px;
}

.topbar-slogan {
  margin: 8px 0 0;
  color: var(--brand-strong);
  font-weight: 700;
}

.legal-disclaimer {
  margin: -10px 0 24px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 255, 0, 0.45);
  background: rgba(184, 255, 0, 0.12);
  color: #17231f;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legal-disclaimer strong,
.supplier-legal-note strong {
  color: #10201d;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h3 {
  margin: 14px 0 10px;
  font-size: 1rem;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-filter-panel {
  margin-bottom: 18px;
}

.dashboard-filters {
  align-items: end;
  flex-wrap: wrap;
}

.dashboard-filters label {
  min-width: 150px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel canvas {
  width: 100%;
  max-width: 100%;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.documents-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.integration-docs-shell {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid #cfd5d1;
  background: #f1f3f2;
}

.document-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #cfd5d1;
  background: #ecefed;
  color: #1f2d27;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.document-tab.active {
  background: #fff;
  box-shadow: inset 0 0 0 2px #1b2a24;
}

.document-tab span {
  color: #aeb7b2;
}

.document-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.document-toolbar h2 {
  margin: 2px 0 0;
}

.document-toolbar-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.document-toolbar-filters select {
  min-width: 180px;
}

.supplier-management-panel {
  background: #f4f8f5;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.supplier-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.supplier-directory {
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.supplier-directory h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.supplier-delete-control {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 800;
}

.danger-button {
  border-color: #b00020;
  color: #b00020;
  margin-bottom: 12px;
}

.supplier-directory-list {
  display: grid;
  gap: 8px;
}

.supplier-directory-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.supplier-directory-item.active,
.supplier-directory-item:hover {
  border-color: var(--accent);
  background: #efffdc;
}

.supplier-directory-item span,
.supplier-directory-item small {
  color: var(--muted);
}

.documents-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.75fr);
  gap: 18px;
  padding: 18px;
  background: #f7faf8;
}

.document-table-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.integration-table-wrap {
  max-height: 620px;
}

.integration-table {
  font-size: 0.84rem;
}

.integration-table th {
  background: #f0f1f0;
  color: #2d3934;
  font-size: 0.78rem;
}

.integration-table th,
.integration-table td {
  border: 1px solid #cfd5d1;
  padding: 7px 8px;
  vertical-align: middle;
}

.integration-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.document-row-pending .document-title-dot::before,
.legend-dot.red {
  background: #f31616;
}

.document-row-ok .document-title-dot::before,
.legend-dot.green {
  background: #2d8b3d;
}

.document-row-pending td:nth-child(3),
.document-row-pending td:nth-child(2):last-child {
  color: #e00000;
}

.document-title-dot::before,
.legend-dot {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 999px;
  vertical-align: middle;
}

.document-summary-line,
.document-table-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 0.84rem;
}

.document-table-footer {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #f0f1f0;
}

.doc-red {
  color: #d90000;
}

.doc-green {
  color: #2c7c2f;
}

.document-legend {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  font-size: 0.86rem;
  line-height: 1.45;
}

.icon-table-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #b8d4e9;
  border-radius: 6px;
  background: #eef8ff;
  color: #0069a8;
  font-weight: 800;
}

.client-area {
  min-height: 100vh;
  padding: 24px;
  background: #eef3f0;
}

.client-area-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.client-area-header,
.client-area-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.client-area-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.client-document-grid {
  display: grid;
  gap: 10px;
}

.client-doc-item {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr 1fr;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.client-doc-title {
  align-self: center;
  font-weight: 800;
}

.document-requirements-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.compact-panel-header {
  margin-bottom: 10px;
}

.form-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.client-credentials,
.client-status-legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.client-credentials code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #e7eee9;
  font-weight: 800;
}

.client-status-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.client-status-chip,
.client-status-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
}

.client-status-green {
  background: #dcefe7;
  color: #0b5f42;
}

.client-status-yellow {
  background: #f6e7bd;
  color: #6a4308;
}

.client-status-red {
  background: #fde1df;
  color: #8a1f16;
}

@media (max-width: 980px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .client-area {
    padding: 12px;
  }

  .client-area-header {
    align-items: stretch;
    flex-direction: column;
  }

  .client-doc-item {
    grid-template-columns: 1fr;
  }
}

.panel {
  padding: 22px;
}

.brand-config {
  display: grid;
  gap: 18px;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  min-width: min(100%, 390px);
  padding: 14px;
  border: 1px solid #d4e4dd;
  border-radius: 8px;
  background: #f4faf7;
}

.brand-preview strong,
.brand-preview span {
  display: block;
}

.brand-preview strong {
  font-size: 1.15rem;
}

.brand-preview span {
  margin-top: 3px;
  color: var(--muted);
}

.brand-mark-large {
  width: 64px;
  height: 64px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 12px;
}

.permit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.permit-card strong {
  font-size: 1rem;
}

.permit-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef3ef;
  color: #32413b;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag.high,
.tag.critical {
  color: #fff;
  background: var(--red);
}

.tag.medium {
  background: #f3deaa;
  color: #573d08;
}

.tag.low {
  background: #dceee5;
  color: #104836;
}

.primary-button,
.secondary-button,
.ghost-button,
.table-button {
  border: 0;
  border-radius: 7px;
  min-height: 42px;
  padding: 0 15px;
  font-weight: 700;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button {
  background: #e7eee9;
  color: var(--brand-strong);
}

.ghost-button,
.table-button {
  background: transparent;
  color: var(--brand-strong);
  border: 1px solid var(--line);
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.status-approved {
  background: #dcefe7;
  color: #0b5f42;
}

.status-rejected {
  background: #f6e3df;
  color: #7b271f;
}

.status-pending {
  background: #eef3ef;
  color: #405048;
}

.status-expired {
  background: #fde1df;
  color: #8a1f16;
}

.status-warning {
  background: #f6e7bd;
  color: #6a4308;
}

.approve-button {
  background: #e0f1e9;
  border-color: #b9dbc9;
}

.reject-button {
  background: #f6e3df;
  border-color: #e7bbb1;
  color: #7b271f;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters input {
  min-width: 320px;
}

.document-control-panel {
  position: sticky;
  top: 24px;
}

.document-filters {
  flex-direction: column;
  margin-bottom: 14px;
}

.document-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.document-summary div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.document-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.document-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 1.35rem;
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.document-card-head strong,
.document-card-head span {
  display: block;
}

.document-card-head > div > span,
.document-card small,
.review-note {
  color: var(--muted);
}

.document-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.document-meta div {
  min-width: 0;
}

.document-meta dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.document-meta dd {
  margin: 3px 0 0;
  word-break: break-word;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfc;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfdad4;
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: #3b4842;
  font-size: 0.9rem;
  font-weight: 700;
}

textarea {
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  gap: 7px;
}

.checklist-table-wrap table {
  min-width: 980px;
}

.checklist-choice {
  text-align: center;
}

.checklist-choice input {
  width: auto;
}

.form-warning {
  align-self: center;
  color: #7b271f;
  font-weight: 700;
}

.permit-form {
  display: grid;
  gap: 18px;
}

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

.wide {
  grid-column: 1 / -1;
}

.helper-text {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--brand);
  background: #f2f8f5;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.access-control-box {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand) 5%, #ffffff);
  padding: 14px;
}

.subsection-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.subsection-title span {
  color: var(--muted);
  font-size: 0.9rem;
}

.client-access-box {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: #f7fbf8;
  padding: 12px;
}

.client-access-box p {
  margin: 6px 0 0;
}

.supplier-portal-body {
  background: #f7f7f7;
  color: #333;
}

.supplier-portal {
  min-height: 100vh;
}

.supplier-login-panel {
  width: min(520px, calc(100vw - 32px));
  margin: 8vh auto;
  background: #fff;
  border: 1px solid #cfcfcf;
  padding: 32px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.supplier-workspace {
  min-height: 100vh;
  background: #fff;
}

.supplier-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #cfcfcf;
  background: #efefef;
  overflow-x: auto;
}

.supplier-tab {
  border: 0;
  border-right: 1px solid #d2d2d2;
  background: #e9e9e9;
  color: #17221d;
  padding: 9px 14px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 0;
}

.supplier-tab.active {
  background: #fff;
  outline: 2px solid #1c1c1c;
  outline-offset: -3px;
}

.supplier-logout {
  margin-left: auto;
}

.supplier-content {
  padding: 18px 24px;
}

.supplier-view {
  display: none;
}

.supplier-view.active {
  display: block;
}

.supplier-split {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 34px;
}

.supplier-scroll-panel {
  height: calc(100vh - 130px);
  overflow: auto;
  border: 1px solid #ddd;
  background: #fff;
  padding: 18px;
}

.supplier-help-panel {
  font-size: 0.95rem;
  line-height: 1.45;
}

.supplier-legal-note {
  padding: 10px 12px;
  border-left: 4px solid #b8ff00;
  background: #f5ffe4;
}

.supplier-banner {
  margin-top: 22px;
  min-height: 260px;
  background: linear-gradient(135deg, #16211f, #41534b);
  color: #c8ff00;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 14px;
  font-size: 2rem;
}

.supplier-banner span {
  color: #fff;
  font-size: 1rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.supplier-table-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.supplier-employee-field {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.supplier-submit-button {
  border: 0;
  border-radius: 0;
  background: var(--accent-strong, #9cff00);
  color: var(--sidebar-bg, #0d1b1b);
  font-weight: 800;
  padding: 12px 18px;
  min-height: 44px;
  cursor: pointer;
}

.supplier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.supplier-table th,
.supplier-table td {
  border: 1px solid #c8c8c8;
  padding: 9px 10px;
  vertical-align: top;
}

.supplier-table th {
  background: #f0f0f0;
  color: #11221d;
  font-weight: 900;
  text-transform: uppercase;
  text-align: left;
}

.supplier-table small {
  display: block;
  margin-top: 4px;
  color: #51615a;
  font-size: 0.78rem;
}

.supplier-date-input {
  width: 145px;
  border: 1px solid #bfcac6;
  border-radius: 0;
  padding: 7px 8px;
  font: inherit;
}

.attach-icon-button {
  border: 0;
  background: transparent;
  color: #008bd2;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0;
}

.supplier-status,
.status-dot {
  width: 13px;
  height: 13px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.supplier-status.green,
.status-dot.green {
  background: #107c22;
}

.supplier-status.yellow,
.status-dot.yellow {
  background: #ffa600;
}

.supplier-status.red,
.status-dot.red {
  background: #e00000;
}

.supplier-placeholder {
  border: 1px solid #d5d5d5;
  padding: 24px;
}

.supplier-reset-form {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.color-grid label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.color-grid input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 4px;
}

.settings-fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.settings-fieldset legend {
  padding: 0 6px;
  color: var(--brand-strong);
  font-weight: 900;
}

.database-status {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfb;
}

.database-status span {
  color: var(--muted);
}

.check-item {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: #2c3833;
}

.check-item input {
  width: 18px;
  height: 18px;
}

.subsection {
  margin-top: 18px;
}

.renewal-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.renewal-row {
  display: grid;
  grid-template-columns: 1fr 1fr 150px 130px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.participants-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.participant-list {
  display: grid;
  gap: 12px;
}

.participant-row {
  display: grid;
  grid-template-columns: 1fr 1fr 260px auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.participant-signature-pad {
  width: 100%;
  height: 118px;
  border: 1px dashed #aebeb5;
  border-radius: 7px;
  background: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.face-clock-box {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
}

.face-camera-frame {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f4f8f6;
  border: 1px dashed #9fb9ad;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  max-width: 420px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.face-camera-frame video,
.face-camera-frame canvas,
.face-camera-frame img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.face-camera-frame canvas {
  display: none;
}

.face-camera-frame img {
  display: none;
}

.face-camera-frame.has-photo img,
.face-camera-frame.camera-on video {
  display: block;
}

.face-camera-frame.has-photo video,
.face-camera-frame.has-photo #timeClockCameraPlaceholder,
.face-camera-frame.camera-on #timeClockCameraPlaceholder {
  display: none;
}

#timeClockCameraPlaceholder {
  color: #52635c;
  padding: 18px;
  text-align: center;
}

.face-thumb {
  border: 1px solid #cbdad3;
  border-radius: 6px;
  height: 54px;
  object-fit: cover;
  width: 72px;
}

.muted-text {
  color: #52635c;
  margin: 0;
}

.participant-actions {
  display: flex;
  gap: 8px;
}

.risk-output {
  border-radius: 999px;
  padding: 7px 11px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.risk-output.medium {
  background: var(--yellow);
}

.risk-output.high {
  background: var(--accent);
}

.risk-output.critical {
  background: var(--red);
}

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

.signature-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfdfb;
}

.signature-pad {
  width: 100%;
  height: 150px;
  border: 1px dashed #aebeb5;
  border-radius: 7px;
  background: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.signature-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.signature-footer span.signed {
  color: var(--brand-strong);
  font-weight: 800;
}

.signature-save-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.signature-save-bar .primary-button {
  min-width: 190px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 16, 0.55);
}

.modal-panel {
  position: relative;
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

.print-document {
  padding: 26px;
  color: #111;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 3px solid #17221d;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.print-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 48%;
}

.print-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.print-brand strong {
  display: block;
  font-size: 1.1rem;
  color: #0b332a;
}

.print-brand span {
  display: block;
  margin-top: 4px;
  color: #50605a;
  line-height: 1.35;
}

.print-permit-title {
  text-align: right;
}

.print-permit-title .tags {
  justify-content: flex-end;
}

.print-header h2 {
  font-size: 1.7rem;
}

.print-section {
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  margin-top: 14px;
  padding: 14px;
}

.print-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.print-field strong {
  display: block;
  color: #50605a;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.print-field span,
.print-field p {
  display: block;
  margin: 3px 0 0;
}

.print-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

.print-wide {
  grid-column: 1 / -1;
}

.print-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.print-signature {
  min-height: 150px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  padding: 10px;
}

.print-signature img {
  width: 100%;
  height: 76px;
  object-fit: contain;
  border-bottom: 1px solid #1f2b25;
}

.print-signature .blank-signature {
  height: 76px;
  border-bottom: 1px solid #1f2b25;
}

.participant-print-item {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.participant-print-item img {
  width: 220px;
  height: 58px;
  object-fit: contain;
  border-bottom: 1px solid #1f2b25;
}

.participant-print-item .blank-signature {
  width: 220px;
  height: 58px;
  border-bottom: 1px solid #1f2b25;
}

.renewal-print-item {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.renewal-print-signatures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.renewal-print-signatures img {
  width: 190px;
  height: 56px;
  object-fit: contain;
  border-bottom: 1px solid #1f2b25;
}

.action-bar {
  position: sticky;
  bottom: 0;
  background: rgba(238, 243, 240, 0.92);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 4px;
}

.library-list {
  margin: 14px 0 0;
  padding-left: 22px;
  color: #35423c;
  line-height: 1.75;
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(80px);
  opacity: 0;
  background: #12241d;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  body {
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 12px;
  }

  .brand {
    align-items: center;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .storage-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .storage-panel span:first-child,
  .storage-panel span:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .app {
    margin-left: 0;
    padding: 16px;
  }

  .topbar h1 {
    font-size: 40px;
  }

  .panel {
    padding: 18px;
  }

  .metrics,
  .analytics-grid,
  .split-layout,
  .documents-layout,
  .documents-workspace,
  .supplier-management-grid,
  .form-grid,
  .signature-grid,
  .settings-grid,
  .color-grid,
  .brand-config,
  .renewal-row,
  .participant-row,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .participants-header {
    align-items: stretch;
    flex-direction: column;
  }

  .table-tools,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .filters input,
  .filters select,
  .filters button {
    min-width: 0;
    width: 100%;
  }

  .document-control-panel {
    position: static;
  }

  .document-summary,
  .document-meta {
    grid-template-columns: 1fr;
  }

  .document-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-table-wrap {
    max-height: none;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .table-button {
    min-height: 50px;
    padding-inline: 16px;
  }

  .table-actions {
    min-width: 300px;
    gap: 8px;
  }

  .signature-pad {
    height: 190px;
  }

  .participant-signature-pad {
    height: 150px;
  }

  .modal-panel {
    width: min(100vw - 20px, 980px);
    max-height: calc(100vh - 20px);
  }
}

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

  .topbar h1 {
    font-size: 32px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

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

  .panel {
    padding: 14px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .action-bar,
  .modal-buttons,
  .compact-actions,
  .signature-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .action-bar button,
  .modal-buttons button,
  .compact-actions button,
  .signature-save-bar button {
    width: 100%;
  }

  .action-bar {
    z-index: 4;
    padding: 12px 0 calc(10px + env(safe-area-inset-bottom));
  }

  .signature-pad {
    height: 220px;
  }

  .participant-signature-pad {
    height: 170px;
  }

.login-card,
.forgot-card {
    width: min(100vw - 24px, 440px);
    padding: 22px;
  }

  #toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}

/* Permitec corporate skin */
:root {
  --bg: #e8efeb;
  --panel: #ffffff;
  --ink: #152020;
  --muted: #65706c;
  --line: #d6dfda;
  --brand: #1a8f76;
  --brand-strong: #111c1f;
  --accent: #b8ff00;
  --yellow: #c79a12;
  --red: #c43d34;
  --sidebar: #111c1f;
  --sidebar-ink: #eff8f1;
  --shadow: 0 22px 65px rgba(12, 23, 22, 0.12);
}

body {
  background:
    radial-gradient(circle at 84% 12%, rgba(184, 255, 0, 0.16), transparent 26%),
    linear-gradient(180deg, #f5faf6 0, #e8efeb 360px),
    var(--bg);
}

.sidebar {
  background:
    linear-gradient(180deg, #111c1f 0%, #172626 64%, #101819 100%);
  color: var(--sidebar-ink);
  border-right: 0;
  box-shadow: 16px 0 50px rgba(0, 0, 0, 0.18);
}

.brand {
  min-height: 82px;
  border: 1px solid rgba(184, 255, 0, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.brand-mark {
  background: #f9f1d9;
  border-color: rgba(184, 255, 0, 0.45);
  color: #111c1f;
}

.brand strong {
  color: #ffffff;
}

.brand span,
.storage-panel span {
  color: #cad8d0;
}

.nav {
  gap: 5px;
}

.nav-item,
.storage-panel button,
.import-button {
  border-radius: 6px;
  color: #f4fff8;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent);
  color: #111c1f;
}

.storage-panel button,
.import-button {
  border-color: rgba(184, 255, 0, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.storage-panel button:hover,
.import-button:hover {
  background: rgba(184, 255, 0, 0.12);
}

.app {
  padding: 34px 38px;
}

.topbar {
  position: relative;
  margin-bottom: 26px;
  padding: 22px 24px;
  border: 1px solid rgba(17, 28, 31, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.94) 0 72%, rgba(184, 255, 0, 0.22) 72% 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 78%, rgba(17, 28, 31, 0.08) 78% 79%, transparent 79%);
  pointer-events: none;
}

.topbar h1 {
  color: #0e1b1b;
  letter-spacing: 0;
}

.topbar-slogan,
.settings-fieldset legend {
  color: #0c5f4d;
}

.eyebrow {
  color: #50605b;
}

.panel,
.metric,
.client-area-card,
.client-area-header,
.integration-docs-shell {
  border-color: rgba(17, 28, 31, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  background: rgba(255, 255, 255, 0.96);
}

.metric {
  border-top: 4px solid var(--accent);
}

.metric strong {
  color: #111c1f;
}

.panel-header {
  border-bottom: 1px solid rgba(17, 28, 31, 0.08);
  padding-bottom: 13px;
}

.primary-button {
  background: #111c1f;
  color: var(--accent);
}

.primary-button:hover {
  background: #263433;
}

.secondary-button {
  background: var(--accent);
  color: #111c1f;
}

.ghost-button,
.table-button {
  border-color: #cbd8d2;
  color: #0e5546;
  background: #ffffff;
}

.approve-button {
  background: #dff7ea;
  border-color: #a8d9bd;
  color: #0f664c;
}

.reject-button {
  background: #fde8e3;
  border-color: #f0b8ad;
  color: #8a2219;
}

input,
select,
textarea {
  border-color: #c8d5cf;
  border-radius: 6px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(184, 255, 0, 0.7);
  outline-offset: 1px;
  border-color: #9bbf43;
}

label {
  color: #263633;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #111c1f;
  color: #dff7df;
}

td {
  background: #fff;
}

tbody tr:nth-child(even) td {
  background: #f7faf7;
}

.integration-table th {
  background: #111c1f;
  color: #dff7df;
}

.integration-table th,
.integration-table td {
  border-color: #d2dcd7;
}

.document-tabs {
  background: #111c1f;
  border-bottom-color: #111c1f;
}

.document-tab {
  background: #1b2b2d;
  color: #e9f4ee;
  border-right-color: rgba(255, 255, 255, 0.08);
}

.document-tab.active {
  background: var(--accent);
  color: #101819;
  box-shadow: none;
}

.document-tab span {
  color: rgba(17, 28, 31, 0.5);
}

.documents-workspace,
.document-toolbar,
.document-summary-line,
.document-table-footer {
  background: #f4f8f5;
}

.document-legend,
.document-card,
.empty-state,
.database-status,
.check-item,
.participant-row,
.renewal-row,
.client-doc-item {
  background: #fbfdfb;
  border-color: #d2dcd7;
}

.icon-table-button {
  border-color: #b9d37a;
  background: #f2ffd3;
  color: #152020;
}

.tag {
  background: #eef6e5;
  color: #24332f;
}

.tag.low,
.status-approved {
  background: #dff7ea;
  color: #0f664c;
}

.status-pending {
  background: #edf1ee;
  color: #33423d;
}

.status-warning,
.tag.medium {
  background: #fff2c2;
  color: #604200;
}

.status-rejected,
.status-expired {
  background: #fde8e3;
  color: #8a2219;
}

.modal-panel,
.forgot-card {
  border-radius: 8px;
  border-color: rgba(17, 28, 31, 0.12);
}

.modal-actions {
  background: #111c1f;
}

.signature-pad,
.participant-signature-pad,
.face-camera-frame,
.chart-panel canvas {
  border-color: #bfd0c8;
  background: #fff;
}

.client-area {
  background:
    radial-gradient(circle at 80% 14%, rgba(184, 255, 0, 0.18), transparent 24%),
    linear-gradient(180deg, #f5faf6 0, #e8efeb 100%);
}

.client-area-header {
  background:
    linear-gradient(120deg, #111c1f 0 62%, #b8ff00 62% 100%);
  color: #fff;
}

.client-area-header .eyebrow,
.client-area-header p {
  color: #e8f5ec;
}

.client-area-header .brand-mark {
  color: #111c1f;
}

button,
.primary-button,
.secondary-button,
.ghost-button,
.table-button,
.icon-table-button,
.nav-item,
.storage-panel button,
.import-button,
.link-button {
  border-radius: 2px;
}

@media (max-width: 820px) {
  .topbar {
    padding: 18px;
    background: #ffffff;
  }
}

@page {
  size: A4;
  margin: 10mm;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    background: #fff;
    color: #111;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .login-screen,
  #forgotPasswordModal,
  #passwordModal,
  .sidebar,
  .topbar,
  .action-bar,
  .modal-actions,
  #toast {
    display: none;
  }

  body.printing-permit .app,
  body.printing-permit .modal-backdrop {
    display: none;
  }

  body.printing-permit .modal {
    display: none !important;
  }

  body.printing-permit #permitModal {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.printing-permit #permitModal .modal-panel {
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .app {
    margin: 0;
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
  }

  .signature-pad,
  .participant-signature-pad {
    height: 110px;
  }

  .signature-footer button {
    display: none;
  }

  .print-document {
    padding: 0;
    width: 100%;
    font-size: 10pt;
  }

  .print-header {
    break-inside: avoid;
    page-break-inside: avoid;
    border-bottom: 2px solid #17221d;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .print-brand img {
    width: 58px;
    height: 58px;
  }

  .print-header h2 {
    font-size: 18pt;
  }

  .print-section {
    break-inside: avoid;
    page-break-inside: avoid;
    border-radius: 0;
    margin-top: 9px;
    padding: 9px;
  }

  .print-grid {
    gap: 7px 12px;
  }

  .print-list {
    line-height: 1.35;
  }

  .print-signature {
    border-radius: 0;
    min-height: 120px;
  }

  .print-signature img,
  .print-signature .blank-signature {
    height: 60px;
  }

  .print-brand img {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
