:root {
  --ink: #172026;
  --muted: #60717d;
  --line: #d9e1e5;
  --surface: #f6f8f7;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #c2410c;
  --blue: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --shadow: 0 18px 45px rgba(22, 39, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  background:
    linear-gradient(rgba(12, 36, 33, 0.78), rgba(12, 36, 33, 0.78)),
    url("https://images.unsplash.com/photo-1581093458791-9d09f1128f94?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-brand {
  color: white;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f97316;
  color: white;
  font-weight: 800;
  font-size: 20px;
  box-shadow: var(--shadow);
}

.login-brand h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 590px;
  color: rgba(255, 255, 255, 0.83);
  font-size: 18px;
  line-height: 1.55;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 56px);
  background: rgba(246, 248, 247, 0.94);
}

.login-card {
  width: min(100%, 460px);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h2,
.panel h2,
.section-title h2 {
  margin: 0;
  font-size: 24px;
}

.login-card p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

label {
  color: #31424d;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 7px;
  min-height: 40px;
  padding: 0 14px;
  color: white;
  background: var(--brand);
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn.secondary {
  color: var(--ink);
  background: #e8eef0;
}

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

.btn.danger {
  background: var(--red);
}

.btn.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 266px 1fr;
}

.mobile-app-header,
.menu-backdrop {
  display: none;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  place-content: center;
  gap: 5px;
}

.menu-toggle span {
  width: 19px;
  height: 2px;
  display: block;
  background: #102128;
  border-radius: 999px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: #102128;
  color: white;
  overflow-y: auto;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
}

.side-head strong {
  display: block;
  line-height: 1.15;
}

.side-head span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.nav-btn {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.77);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  text-align: left;
  font-weight: 700;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-title {
  display: none;
}

.topbar h1 {
  margin: 0 0 5px;
  font-size: clamp(26px, 3vw, 36px);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fed7aa;
  color: #9a3412;
  font-weight: 850;
}

img.avatar {
  object-fit: cover;
}

.profile-upload-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
  color: #31424d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.profile-upload-btn input {
  display: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.two-col {
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  align-items: start;
}

.panel,
.metric,
.record-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(18, 28, 35, 0.07);
}

.panel {
  padding: 18px;
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.overview-charts-panel {
  margin-top: 0;
}

.overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.pie-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  box-shadow: 0 4px 12px rgba(18, 28, 35, 0.06);
}

.pie-copy h3 {
  margin: 0;
  font-size: 16px;
}

.pie-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pie-visual-wrap {
  display: grid;
  place-items: center;
}

.pie-visual {
  position: relative;
  width: 118px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pie);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.pie-visual::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 1px rgba(217, 225, 229, 0.9);
}

.pie-visual strong,
.pie-visual span {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.pie-visual strong {
  align-self: end;
  font-size: 22px;
}

.pie-visual span {
  align-self: start;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pie-legend {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pie-legend-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #31424d;
  font-size: 13px;
}

.pie-legend-row span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  word-break: break-word;
}

.pie-legend-row i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--swatch);
}

.pie-legend-row strong {
  white-space: nowrap;
}

.pie-legend-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title p.muted {
  display: none;
}

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

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

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

.conversion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.conversion-actions span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar input {
  max-width: 360px;
}

#docPreview {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.document-switcher {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.document-switcher .field {
  margin: 0;
}

.accounting-tabs-panel {
  margin-bottom: 16px;
}

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

.tab-count {
  margin-left: 4px;
  opacity: 0.78;
  font-size: 11px;
}

.hr-tabs .btn,
.business-tabs .btn,
.inventory-tabs .btn,
.report-tabs .btn {
  min-width: 118px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.download-card {
  align-content: start;
}

.download-card p {
  margin: 0;
  line-height: 1.45;
}

.accounting-filter {
  align-items: end;
}

.accounting-filter label {
  min-width: 130px;
}

.accounting-filter select {
  max-width: 280px;
}

.access-note {
  padding: 10px 12px;
  border: 1px solid #dbe7df;
  border-radius: 7px;
  background: #f4faf6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf6f0;
  color: #315141;
  font-size: 11px;
  font-weight: 800;
}

.payment-request-card .actions {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.report-card-list {
  display: grid;
  gap: 10px;
}

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

.report-card-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #edf2f4;
  border-radius: 7px;
  background: #fbfcfc;
}

.report-card-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-card-grid strong {
  min-width: 0;
  font-size: 13px;
  word-break: break-word;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.client-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.mail-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.mail-filters .field {
  margin: 0;
}

.mail-address {
  color: #31424d;
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

.mail-body {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-signature-img {
  width: min(100%, 360px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.mail-draft-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.mail-draft-preview pre {
  margin: 0;
  white-space: pre-wrap;
  color: #31424d;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.mail-draft-preview img {
  width: min(100%, 360px);
  height: auto;
}

.client-filters .field {
  margin: 0;
}

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

.client-card {
  overflow: hidden;
}

.client-card .record-head strong {
  min-width: 0;
  word-break: break-word;
}

.serial-no {
  color: var(--brand-strong);
  font-weight: 900;
}

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

.client-card-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #edf2f4;
  border-radius: 7px;
  background: #fbfcfc;
}

.client-card-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-card-grid strong {
  min-width: 0;
  font-size: 13px;
  word-break: break-word;
}

.project-card-list {
  display: grid;
  gap: 10px;
}

.employee-card-list {
  display: grid;
  gap: 10px;
}

.project-filters,
.task-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.project-filters .field,
.employee-filters .field,
.task-filters .field {
  margin: 0;
}

.employee-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.project-card,
.employee-card {
  overflow: hidden;
}

.employee-card-head {
  align-items: center;
}

.employee-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-title strong {
  min-width: 0;
}

.employee-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

.table-avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.project-card .record-head strong,
.employee-card .record-head strong {
  min-width: 0;
  word-break: break-word;
}

.project-card-grid,
.employee-card-grid,
.responsive-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.project-card-grid div,
.employee-card-grid div,
.responsive-card-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #edf2f4;
  border-radius: 7px;
  background: #fbfcfc;
}

.project-card-grid span,
.employee-card-grid span,
.responsive-card-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card-grid strong,
.employee-card-grid strong,
.responsive-card-grid strong {
  min-width: 0;
  font-size: 13px;
  word-break: break-word;
}

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.project-card-actions .field {
  min-width: 190px;
  margin: 0;
}

.workflow-guide {
  margin-bottom: 16px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.workflow-steps div {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.workflow-steps span,
.mini-workflow span {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.workflow-steps span {
  width: 26px;
  height: 26px;
  background: #dff5ed;
  color: var(--brand-strong);
  flex: 0 0 auto;
}

.workflow-steps strong {
  font-size: 13px;
}

.task-workflow-list {
  display: grid;
  gap: 10px;
}

.task-timer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: #f8faf9;
  border: 1px solid var(--line);
}

.task-timer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-timer.active {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.task-timer.overdue {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--red);
}

.task-timer.complete {
  background: #eef2ff;
  border-color: #c7d2fe;
}

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

.task-detail-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #edf2f4;
  border-radius: 7px;
  background: #fbfcfc;
}

.task-detail-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-detail-grid strong {
  word-break: break-word;
  font-size: 13px;
}

.task-stage-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.task-stage-form .field {
  margin: 0;
}

.task-stage-form small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-workflow span {
  width: 24px;
  height: 24px;
  background: #e8eef0;
  color: #40515d;
  font-size: 12px;
}

.mini-workflow span.done {
  background: #dcfce7;
  color: var(--green);
}

.mini-workflow span.active {
  background: #fef3c7;
  color: var(--amber);
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.workflow-actions .field {
  min-width: 240px;
  margin: 0;
}

.workflow-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.quotation-items {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px;
  background: #fafcfc;
}

.quotation-items-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.quotation-line-item {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(90px, 1fr));
  gap: 0 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.quotation-line-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.quotation-line-item .field {
  margin: 6px 0;
}

.quotation-line-item .quote-description textarea {
  min-height: 43px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: #40515d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8faf9;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  background: #e8eef0;
  color: #40515d;
}

.badge.status-done,
.badge.status-paid,
.badge.status-active,
.badge.status-won,
.badge.status-present,
.badge.status-approved,
.badge.status-read,
.badge.status-replied,
.badge.status-sent {
  background: #dcfce7;
  color: var(--green);
}

.badge.status-pending,
.badge.status-quoted,
.badge.status-draft,
.badge.status-template,
.badge.status-unread,
.badge.status-in-progress,
.badge.status-follow-up,
.badge.status-proposal,
.badge.status-new {
  background: #fef3c7;
  color: var(--amber);
}

.badge.status-overdue,
.badge.status-critical,
.badge.status-lost,
.badge.status-unpaid,
.badge.status-absent,
.badge.status-inactive,
.badge.status-spam {
  background: #fee2e2;
  color: var(--red);
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-card {
  padding: 13px;
  display: grid;
  gap: 7px;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.record-head > span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.doc-preview {
  background: #fff;
  border: 1px solid #111;
  padding: 24px;
  min-height: 720px;
}

.service-doc {
  width: min(100%, 794px);
  margin: 0 auto;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.28;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.quotation-doc {
  width: min(100%, 794px);
  min-height: 720px;
  margin: 0 auto;
  padding: 42px 72px 54px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.22;
  border: 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.green-doc {
  width: min(100%, 794px);
  min-height: 720px;
  margin: 0 auto;
  padding: 38px 58px 48px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.22;
  border: 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.green-title-bar {
  background: #98d529;
  border-bottom: 3px solid #000;
  text-align: center;
  font-weight: 800;
  padding: 5px 8px;
}

.green-doc-header {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: center;
  padding: 8px 6px 18px;
}

.green-header-logo img {
  width: 155px;
  height: auto;
  object-fit: contain;
}

.green-doc-header h2 {
  margin: 0 0 8px;
  color: #8bd221;
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
}

.doc-preview .green-doc-header h2 {
  color: #8bd221;
}

.green-doc-header p {
  margin: 2px 0;
}

.green-contact {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 470px;
  margin-top: 8px;
}

.green-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  background: #98d529;
  border-bottom: 3px solid #000;
  padding: 6px;
}

.green-party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 8px 4px 18px;
}

.green-party-box strong {
  display: block;
  margin-bottom: 6px;
}

.green-party-box p {
  margin: 0;
  font-weight: 700;
}

.green-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.green-table th {
  background: #fff;
  border-bottom: 3px solid #000;
  color: #000;
  font-size: 12px;
  text-transform: none;
  padding: 4px 5px;
  text-align: center;
  white-space: nowrap;
}

.green-table th:first-child,
.green-table td:first-child {
  width: 38px;
  min-width: 38px;
  white-space: nowrap;
}

.green-table td {
  border: 0;
  padding: 5px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.green-table .green-desc {
  text-align: left;
  line-height: 1.17;
}

.green-work-row td {
  background: #b6dba8;
  font-size: 14px;
  text-align: center;
  font-weight: 800;
  padding: 6px;
}

.invoice-green-doc .green-work-row td {
  font-size: 12px;
  padding: 5px 6px;
}

.green-lower-grid {
  display: grid;
  grid-template-columns: 1fr 256px;
  gap: 26px;
  align-items: start;
  margin-top: 18px;
}

.green-bank-words {
  display: grid;
  gap: 22px;
  font-weight: 700;
}

.green-bank-words > div:first-child {
  min-height: 88px;
}

.green-summary {
  font-size: 12px;
  font-weight: 800;
}

.green-total-row,
.green-grand-row {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.9fr;
  background: #98d529;
  border-bottom: 3px solid #000;
  padding: 6px 10px;
  text-align: right;
}

.green-total-row span:first-child {
  text-align: center;
}

.green-tax-block {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.9fr;
  grid-template-rows: 26px 26px;
  padding: 0 10px;
  text-align: right;
  align-items: center;
}

.green-tax-block > strong:first-child {
  grid-row: 1 / 3;
  text-align: center;
}

.green-grand-row {
  grid-template-columns: 1fr 1fr;
  padding: 10px;
}

.green-signature {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.green-signature img {
  width: 220px;
  max-width: 40%;
  height: auto;
  object-fit: contain;
}

.green-client-box,
.green-note {
  background: #fff;
  padding: 10px 5px 16px;
  font-weight: 700;
}

.green-simple-table {
  margin-top: 8px;
}

.green-wcr-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 18px;
  border-top: 3px solid #000;
}

.green-wcr-sign div {
  min-height: 44px;
  padding: 10px;
  font-weight: 700;
}

.green-wcr-sign .green-seal {
  grid-column: 1 / -1;
  min-height: 82px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.green-dc-sign {
  margin-top: 56px;
  text-align: right;
  font-weight: 800;
}

.wcr-doc {
  width: min(100%, 794px);
  min-height: 720px;
  margin: 0 auto;
  padding: 70px 96px 64px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.18;
  border: 0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.wcr-title-bar {
  background: #98d529;
  border-bottom: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.wcr-reference-header {
  display: grid;
  grid-template-columns: 1fr 142px;
  gap: 14px;
  align-items: start;
  padding: 7px 4px 20px;
}

.wcr-company-block h2 {
  margin: 0 0 8px;
  color: #8bd221;
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.doc-preview .wcr-company-block h2 {
  color: #8bd221;
}

.wcr-company-block p {
  margin: 3px 0;
  font-weight: 800;
}

.wcr-contact-row {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  max-width: 395px;
  margin-top: 8px;
}

.wcr-reference-logo {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 2px;
}

.wcr-reference-logo img {
  width: 142px;
  height: auto;
  object-fit: contain;
}

.wcr-meta {
  display: grid;
  grid-template-columns: 142px 1fr 170px 82px;
  gap: 0;
  align-items: center;
  margin: 2px 0 20px;
  font-weight: 700;
}

.wcr-meta strong,
.wcr-meta span {
  min-height: 24px;
  display: flex;
  align-items: center;
  padding: 4px 5px;
  white-space: nowrap;
}

.wcr-meta strong {
  background: #98d529;
  font-weight: 800;
}

.wcr-meta span {
  font-weight: 800;
}

.wcr-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 0;
  border-bottom: 0;
}

.wcr-table th {
  color: #000;
  background: #98d529;
  border-bottom: 3px solid #000;
  text-transform: none;
  font-size: 12px;
  padding: 5px 6px;
  text-align: center;
}

.wcr-table th:first-child,
.wcr-table td:first-child {
  width: 42px;
  text-align: center;
  white-space: nowrap;
}

.wcr-table td {
  padding: 7px 6px;
  border-bottom: 0;
  font-weight: 700;
  text-align: center;
  vertical-align: top;
}

.wcr-table td:nth-child(2) {
  text-align: left;
}

.wcr-work-row td {
  background: #c5dfb8;
  text-align: center !important;
  font-weight: 800;
  padding: 6px;
  border-bottom: 0;
}

.wcr-note {
  min-height: 56px;
  margin-top: 22px;
  font-weight: 700;
  display: block;
}

.wcr-sign-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 0;
  margin-top: 2px;
  font-weight: 700;
}

.wcr-sign-lines div {
  min-height: 23px;
  padding: 0 4px;
  border-bottom: 0;
}

.wcr-sign-grid .wcr-seal {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 92px;
  background: #fff;
  padding: 0 34px 4px 0;
}

.quote-title-bar {
  background: #98d529;
  border-bottom: 3px solid #000;
  text-align: center;
  font-weight: 800;
  padding: 4px 8px;
}

.quote-header {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 18px;
  padding: 6px 5px 22px;
}

.quote-header h2 {
  color: #8bd221;
  font-size: 23px;
  line-height: 1;
  margin: 0 0 7px;
  font-weight: 800;
}

.doc-preview.quotation-doc .quote-header h2 {
  color: #8bd221;
}

.quote-contact {
  display: flex;
  justify-content: space-between;
  max-width: 452px;
  gap: 24px;
  margin-top: 5px;
}

.quote-logo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.quote-logo img {
  width: 118px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.quote-meta {
  display: grid;
  grid-template-columns: 1fr 0.74fr;
  background: #98d529;
  border-bottom: 3px solid #000;
  padding: 5px;
  gap: 14px;
  min-height: 62px;
  margin-bottom: 16px;
}

.quote-meta > div:last-child {
  text-align: right;
}

.quote-work-title,
.quote-work-row td {
  background: #b6dba8;
  text-align: center;
  font-weight: 800;
  padding: 5px;
}

.quote-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.quote-table th {
  background: #98d529;
  border-bottom: 3px solid #000;
  color: #000;
  font-size: 12px;
  text-transform: none;
  padding: 4px 5px;
  text-align: center;
  white-space: nowrap;
}

.quote-table th:first-child,
.quote-table td:first-child {
  width: 38px;
  min-width: 38px;
  white-space: nowrap;
}

.quote-table td {
  border: 0;
  padding: 5px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.quote-table .quote-work-row td {
  border: 0;
  padding: 5px;
  text-align: center;
}

.quote-table .quote-desc {
  text-align: left;
  line-height: 1.17;
}

.quote-lower-grid {
  display: grid;
  grid-template-columns: 1fr 256px;
  gap: 26px;
  align-items: start;
  margin-top: 18px;
}

.quote-amount-words {
  margin-top: 26px;
  font-weight: 700;
}

.quote-amount-words strong {
  display: block;
  margin-bottom: 0;
}

.quote-amount-words span {
  display: block;
}

.quote-terms strong {
  display: block;
  margin-bottom: 8px;
}

.quote-terms {
  margin-top: 24px;
}

.quote-terms ol {
  margin: 0;
  padding-left: 14px;
}

.quote-summary {
  font-size: 12px;
  font-weight: 800;
}

.quote-total-row,
.quote-grand-row {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.9fr;
  background: #98d529;
  border-bottom: 3px solid #000;
  padding: 6px 10px;
  text-align: right;
}

.quote-total-row strong:first-child {
  text-align: center;
}

.quote-tax-row {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.9fr;
  padding: 4px 10px;
  text-align: right;
  align-items: center;
  min-height: 26px;
}

.quote-tax-row strong:first-child {
  text-align: center;
}

.quote-tax-block {
  display: grid;
  grid-template-columns: 1fr 0.75fr 0.9fr;
  grid-template-rows: 26px 26px;
  padding: 0 10px;
  text-align: right;
  align-items: center;
}

.quote-tax-block > strong:first-child {
  grid-row: 1 / 3;
  text-align: center;
}

.quote-stamp {
  display: flex;
  justify-content: flex-end;
  margin-top: 34px;
}

.quote-stamp img {
  width: 270px;
  max-width: 45%;
  height: auto;
  object-fit: contain;
}

.quote-grand-row {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
  padding: 10px;
}

.doc-preview h2 {
  margin: 0;
  color: #000;
}

.doc-service-header {
  text-align: center;
  border: 1.5px solid #000;
  border-bottom: 0;
  padding: 10px 12px 8px;
  margin-bottom: 0;
}

.doc-service-header h2 {
  color: #000;
  font-size: 22px;
  margin-bottom: 7px;
  text-decoration: underline;
  font-weight: 800;
}

.doc-service-header .doc-company-name {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.doc-service-header span {
  display: inline-block;
  width: 48px;
}

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}

.doc-number-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid #000;
  border-bottom: 0;
  padding: 0;
}

.doc-number-row + .doc-number-row {
  border-top: 0;
}

.doc-number-row > div {
  padding: 8px 10px;
}

.doc-number-row > div + div {
  border-left: 1.5px solid #000;
}

.doc-box {
  border: 1.5px solid #000;
  border-bottom: 0;
  padding: 10px;
  min-height: 82px;
}

.doc-meta .doc-box + .doc-box {
  border-left: 0;
}

.work-title {
  border: 1.5px solid #000;
  border-bottom: 0;
  padding: 8px 10px;
  font-weight: 800;
  text-align: center;
  background: #f2f2f2;
}

.service-table table {
  min-width: 0;
  border: 1.5px solid #000;
}

.service-table th,
.service-table td {
  border: 1px solid #000;
  padding: 6px 7px;
}

.service-table th {
  background: #e8e8e8;
  color: #000;
  text-transform: none;
  font-size: 12px;
  font-weight: 800;
}

.service-table th:first-child,
.service-table td:first-child,
.service-table th:nth-child(n+3),
.service-table td:nth-child(n+3) {
  text-align: center;
}

.service-table th:last-child,
.service-table td:last-child,
.service-table th:nth-last-child(2),
.service-table td:nth-last-child(2) {
  text-align: right;
}

.doc-billing-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 0;
  margin-top: 0;
  align-items: start;
}

.summary-box {
  min-height: 0;
  border-left: 0;
}

.summary-box div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

.summary-box .grand-total {
  border-top: 1.5px solid #000;
  margin-top: 4px;
  padding-top: 8px;
}

.amount-words,
.terms,
.note-box {
  border: 1px solid #1f2937;
  border-color: #000;
  padding: 10px;
  margin-top: 0;
}

.terms ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.signature-block {
  margin-top: 36px;
  text-align: right;
  min-height: 70px;
  padding-right: 10px;
}

.wcr-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid #000;
  border-bottom: 0;
  margin-top: 0;
}

.wcr-sign div {
  border-bottom: 1px solid #000;
  padding: 12px;
  min-height: 44px;
}

.wcr-sign div:nth-child(odd) {
  border-right: 1px solid #000;
}

.wcr-sign .seal {
  grid-column: 1 / -1;
  min-height: 82px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.delivery-sign {
  margin-top: 60px;
  text-align: right;
  font-weight: 800;
  padding-right: 14px;
}

.doc-total {
  margin-left: auto;
  width: min(100%, 320px);
}

.empty {
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #fafcfc;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #102128;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}

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

  body * {
    visibility: hidden;
  }

  .doc-preview,
  .doc-preview * {
    visibility: visible;
  }

  .doc-preview {
    position: absolute;
    inset: 0;
    border: 0;
    width: 100%;
    min-height: auto;
    box-shadow: none;
    padding: 0;
  }

  .quotation-doc {
    padding: 32px 58px 42px;
  }

  .green-doc {
    padding: 32px 48px 42px;
  }

  .wcr-doc {
    padding: 70px 96px 64px;
  }
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell,
  .two-col,
  .metrics,
  .reports-grid,
  .document-switcher,
  .quotation-line-item {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding-top: 66px;
  }

  .mobile-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(246, 248, 247, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-title {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mobile-app-header strong,
  .mobile-app-header span {
    display: block;
  }

  .mobile-app-header strong {
    line-height: 1.1;
  }

  .mobile-app-header span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-user-chip {
    min-width: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
  }

  .mobile-user-chip .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  .mobile-user-chip div {
    min-width: 0;
  }

  .mobile-user-chip div strong,
  .mobile-user-chip div span {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-user-chip div strong {
    font-size: 12px;
    line-height: 1.1;
  }

  .mobile-user-chip div span {
    margin-top: 1px;
    font-size: 10px;
  }

  .mobile-logout {
    min-height: 28px;
    border: 0;
    border-radius: 6px;
    padding: 0 7px;
    background: #e8eef0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 850;
  }

  .menu-backdrop {
    position: fixed;
    inset: 66px 0 0 0;
    z-index: 30;
    width: 100%;
    border: 0;
    background: rgba(16, 33, 40, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.menu-open .menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 66px;
    left: 0;
    bottom: 0;
    z-index: 35;
    width: 70vw;
    max-width: 360px;
    min-width: 260px;
    height: auto;
    padding: 16px 12px;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 40px rgba(16, 33, 40, 0.22);
  }

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

  .side-head {
    padding: 0 6px 16px;
  }

  .side-head .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 17px;
    flex: 0 0 auto;
  }

  .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 7px;
    background: transparent;
    white-space: nowrap;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .metric strong {
    font-size: 24px;
  }

  .table-wrap {
    margin-inline: -2px;
  }

  .panel {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .form-grid,
  .doc-meta,
  .doc-number-row,
  .doc-billing-grid,
  .green-doc-header,
  .green-party-grid,
  .green-lower-grid,
  .quote-header,
  .quote-meta,
  .quote-lower-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 8px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }

  .topbar .user-chip {
    display: none;
  }

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

  .topbar .muted {
    font-size: 13px;
  }

  .user-chip {
    width: 100%;
    align-items: center;
  }

  .user-chip .btn,
  .user-chip .profile-upload-btn {
    margin-left: auto;
  }

  .login-card,
  .panel,
  .metric,
  .record-card {
    border-radius: 7px;
  }

  .panel {
    padding: 10px;
  }

  .login-card h2,
  .panel h2,
  .section-title h2 {
    font-size: 17px;
  }

  .section-title,
  .quotation-items-head,
  .record-head {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }

  .section-title p,
  .section-title .muted {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.3;
  }

  .actions,
  .conversion-actions,
  .accounting-tabs,
  .document-tabs,
  .hr-tabs,
  .business-tabs,
  .inventory-tabs,
  .report-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 5px;
  }

  .btn {
    width: auto;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .section-title .btn,
  .actions .btn,
  .conversion-actions .btn,
  .accounting-tabs .btn,
  .document-tabs .btn,
  .hr-tabs .btn,
  .business-tabs .btn,
  .inventory-tabs .btn,
  .report-tabs .btn,
  .workflow-actions .btn,
  .project-card-actions .btn {
    width: 100%;
  }

  .grid.two-col > .panel:has(form[data-add]),
  .grid.two-col > .panel:has(#userAccessForm),
  .grid.two-col > form {
    order: 2;
  }

  .grid.two-col > .panel:has(.record-list),
  .grid.two-col > .panel:has(.client-card-list),
  .grid.two-col > .panel:has(.project-card-list),
  .grid.two-col > .panel:has(.employee-card-list),
  .grid.two-col > div:has(.record-list) {
    order: 1;
  }

  .toolbar,
  .green-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 8px;
  }

  .toolbar input {
    max-width: none;
  }

  .document-switcher {
    gap: 6px;
  }

  .client-filters,
  .project-filters,
  .task-filters,
  .employee-filters,
  .mail-filters {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .client-card-grid,
  .project-card-grid,
  .employee-card-grid,
  .responsive-card-grid,
  .report-card-grid {
    grid-template-columns: 1fr;
  }

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

  .pie-card {
    grid-template-columns: 1fr;
  }

  .grid,
  .client-card-list,
  .project-card-list,
  .employee-card-list,
  .task-workflow-list,
  .mail-list,
  .report-card-list,
  .download-grid,
  .permission-grid {
    gap: 8px;
  }

  .record-list,
  .client-card-list,
  .project-card-list,
  .employee-card-list,
  .task-workflow-list,
  .mail-list,
  .report-card-list,
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-filters,
  .project-filters,
  .task-filters,
  .employee-filters,
  .mail-filters {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }

  .client-filters label,
  .project-filters label,
  .task-filters label,
  .employee-filters label,
  .mail-filters label {
    font-size: 10px;
  }

  .client-filters input,
  .client-filters select,
  .project-filters input,
  .project-filters select,
  .task-filters input,
  .task-filters select,
  .employee-filters input,
  .employee-filters select,
  .mail-filters input,
  .mail-filters select {
    min-height: 31px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .form-grid {
    gap: 0 8px;
  }

  .pie-card {
    align-items: stretch;
    padding: 7px;
    gap: 6px;
  }

  .pie-visual {
    width: 74px;
  }

  .pie-visual::after {
    inset: 18px;
  }

  .pie-visual strong {
    font-size: 16px;
  }

  .pie-visual span {
    font-size: 8px;
  }

  .pie-legend {
    gap: 5px;
    padding-top: 7px;
  }

  .pie-legend-row {
    font-size: 10px;
    gap: 6px;
  }

  .pie-legend-row span {
    gap: 4px;
  }

  .pie-legend-row i {
    width: 8px;
    height: 8px;
  }

  .project-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-detail-grid {
    grid-template-columns: 1fr;
  }

  .workflow-actions,
  .task-timer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-card-actions .field {
    min-width: 0;
  }

  .workflow-actions .field {
    min-width: 0;
  }

  .quotation-items {
    padding: 8px;
    margin: 8px 0;
  }

  .field {
    gap: 4px;
    margin: 7px 0;
  }

  label {
    font-size: 12px;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    padding: 8px 9px;
    font-size: 14px;
  }

  textarea {
    min-height: 68px;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 8px;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(82px, 36%) 1fr;
    gap: 7px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    word-break: break-word;
  }

  .record-card {
    padding: 7px;
    gap: 4px;
    box-shadow: 0 5px 14px rgba(18, 28, 35, 0.1);
  }

  .panel,
  .pie-card,
  .metric {
    box-shadow: 0 5px 14px rgba(18, 28, 35, 0.08);
  }

  .record-head {
    gap: 4px;
  }

  .record-head strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .record-head > span {
    gap: 4px;
  }

  .badge {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .client-card-grid,
  .project-card-grid,
  .employee-card-grid,
  .responsive-card-grid,
  .task-detail-grid,
  .report-card-grid {
    gap: 4px;
  }

  .client-card-grid div,
  .project-card-grid div,
  .employee-card-grid div,
  .responsive-card-grid div,
  .task-detail-grid div,
  .report-card-grid div {
    padding: 5px;
    gap: 1px;
    border-radius: 5px;
  }

  .client-card-grid span,
  .project-card-grid span,
  .employee-card-grid span,
  .responsive-card-grid span,
  .task-detail-grid span,
  .report-card-grid span {
    font-size: 10px;
  }

  .client-card-grid strong,
  .project-card-grid strong,
  .employee-card-grid strong,
  .responsive-card-grid strong,
  .task-detail-grid strong,
  .report-card-grid strong {
    font-size: 12px;
  }

  .project-card-actions,
  .workflow-actions,
  .conversion-actions {
    gap: 5px;
    padding-top: 5px;
    margin-top: 2px;
  }

  .task-stage-form {
    gap: 5px;
    padding: 6px;
    border-radius: 6px;
  }

  .task-timer {
    gap: 5px;
    padding: 6px;
    border-radius: 6px;
  }

  .task-timer span {
    font-size: 10px;
  }

  .workflow-note {
    font-size: 12px;
    line-height: 1.3;
  }

  .payment-request-card .actions {
    padding-top: 5px;
  }

  .download-card p,
  .pie-copy p,
  .mail-body {
    font-size: 11px;
    line-height: 1.3;
  }

  .mail-address {
    font-size: 11px;
  }

  .mail-signature-img,
  .mail-draft-preview img {
    width: 100%;
  }

  .mail-draft-preview {
    padding: 7px;
    gap: 6px;
  }

  .pie-copy h3 {
    font-size: 14px;
  }

  .employee-title {
    gap: 7px;
  }

  .employee-avatar {
    width: 34px;
    height: 34px;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .table-wrap td .badge,
  .table-wrap td select,
  .table-wrap td .btn {
    justify-self: end;
    width: auto;
  }

  #docPreview {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .quotation-doc {
    width: 794px;
    max-width: none;
    padding: 30px 46px 42px;
  }

  .green-doc {
    width: 794px;
    max-width: none;
    padding: 30px 42px 42px;
  }

  .wcr-doc {
    width: 794px;
    max-width: none;
    padding: 70px 96px 64px;
  }

  .wcr-contact {
    flex-direction: column;
    gap: 4px;
  }

  .wcr-meta,
  .wcr-sign-grid {
    grid-template-columns: 1fr;
  }

  .wcr-meta {
    grid-template-columns: 142px 1fr 170px 82px;
  }

  .wcr-sign-grid {
    grid-template-columns: 1fr 180px;
  }

  .quote-meta > div:last-child,
  .quote-contact {
    text-align: left;
  }

  .quote-contact {
    flex-direction: column;
    align-items: flex-start;
  }

  .quote-stamp {
    justify-content: flex-start;
  }

  .quote-stamp img {
    max-width: 100%;
  }

  .green-contact {
    flex-direction: column;
    gap: 4px;
  }

  .green-signature {
    justify-content: flex-start;
  }

  .green-signature img {
    max-width: 100%;
  }

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

  .login-brand {
    min-height: auto;
    padding: 24px;
    gap: 28px;
  }

  .login-brand h1 {
    font-size: 34px;
  }

  .login-brand p {
    font-size: 15px;
  }

  .login-panel {
    min-height: auto;
    padding: 18px;
  }

  .login-card {
    padding: 20px;
  }
}

@media (max-width: 430px) {
  .mobile-app-header {
    gap: 6px;
    padding: 6px 8px;
    min-height: 58px;
  }

  .app-shell {
    padding-top: 58px;
  }

  .menu-backdrop {
    inset: 58px 0 0 0;
  }

  .mobile-title strong {
    font-size: 13px;
  }

  .mobile-user-chip {
    gap: 6px;
    padding: 4px 5px;
  }

  .mobile-user-chip div strong {
    max-width: 58px;
  }

  .mobile-user-chip div span {
    display: none;
  }

  .mobile-logout {
    padding: 0 6px;
  }

  .sidebar {
    top: 58px;
    padding: 10px 10px 8px;
  }

  .side-head {
    gap: 10px;
  }

  .side-head span {
    display: none;
  }

  .nav-btn {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .main {
    padding: 6px;
  }

  .panel {
    padding: 8px;
  }

  .metrics {
    gap: 6px;
  }

  .metric {
    padding: 9px;
  }

  .metric strong {
    font-size: 19px;
  }

  .btn {
    min-height: 30px;
    padding: 0 7px;
    font-size: 11px;
  }

  .record-card {
    padding: 6px;
    gap: 3px;
  }

  .record-head strong {
    font-size: 12px;
  }

  .client-card-grid,
  .project-card-grid,
  .employee-card-grid,
  .responsive-card-grid,
  .task-detail-grid,
  .report-card-grid {
    gap: 3px;
  }

  .client-card-grid div,
  .project-card-grid div,
  .employee-card-grid div,
  .responsive-card-grid div,
  .task-detail-grid div,
  .report-card-grid div {
    padding: 4px;
  }

  .client-card-grid span,
  .project-card-grid span,
  .employee-card-grid span,
  .responsive-card-grid span,
  .task-detail-grid span,
  .report-card-grid span {
    font-size: 9px;
  }

  .client-card-grid strong,
  .project-card-grid strong,
  .employee-card-grid strong,
  .responsive-card-grid strong,
  .task-detail-grid strong,
  .report-card-grid strong {
    font-size: 11px;
  }

  .badge {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 10px;
  }

  input,
  select,
  textarea {
    min-height: 34px;
    padding: 7px 8px;
  }

  .client-filters,
  .project-filters,
  .task-filters,
  .employee-filters,
  .mail-filters {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 5px;
  }

  .client-filters input,
  .client-filters select,
  .project-filters input,
  .project-filters select,
  .task-filters input,
  .task-filters select,
  .employee-filters input,
  .employee-filters select,
  .mail-filters input,
  .mail-filters select {
    min-height: 29px;
    padding: 5px 6px;
    font-size: 11px;
  }

  .overview-chart-grid,
  .record-list,
  .client-card-list,
  .project-card-list,
  .employee-card-list,
  .task-workflow-list,
  .mail-list,
  .report-card-list,
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pie-card {
    padding: 5px;
  }

  .pie-copy h3 {
    font-size: 12px;
  }

  .pie-copy p {
    display: none;
  }

  .pie-visual {
    width: 62px;
  }

  .pie-visual::after {
    inset: 15px;
  }

  .pie-legend {
    display: none;
  }

  .user-chip {
    display: grid;
    grid-template-columns: 36px 1fr;
  }

  .user-chip .btn,
  .user-chip .profile-upload-btn {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  #docPreview {
    margin-inline: -12px;
    padding-inline: 12px;
  }
}
