:root {
  --bg: #edf0f4;
  --panel: #ffffff;
  --ink: #1f2529;
  --muted: #67717c;
  --line: #d9dee6;
  --accent: #265fd9;
  --accent-2: #6928d9;
  --danger: #ba2d2d;
  --dark: #1f2529;
  --soft: #f6f8fb;
  --radius: 8px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(100%, 380px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.login-logo {
  width: 156px;
  height: 60px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 10px;
}

.login-card h1 {
  margin-bottom: 18px;
}

.login-card button {
  width: 100%;
}

.login-error {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.login-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.app-launcher {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.launcher-card {
  width: min(100%, 1080px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.launcher-logo {
  width: 160px;
  height: 62px;
  object-fit: contain;
  object-position: left center;
}

.launcher-head {
  margin: 14px 0 18px;
}

.launcher-head p {
  color: var(--muted);
  margin-top: 5px;
}

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

.launcher-tile {
  min-height: 128px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  text-align: left;
  background: var(--soft);
}

.launcher-tile strong {
  font-size: 22px;
}

.launcher-tile span {
  color: var(--muted);
  line-height: 1.35;
}

.launcher-attendance,
.day-attendance-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.launcher-attendance strong,
.day-attendance-card strong {
  display: block;
  font-size: 15px;
}

.launcher-attendance span,
.day-attendance-card span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.launcher-attendance-actions,
.day-attendance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.launcher-logout {
  margin-top: 14px;
  color: var(--danger);
}

.toast-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}

.toast-message {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toast-message.success {
  border-left-color: #16803a;
}

.toast-message.error {
  border-left-color: var(--danger);
}

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

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  min-height: 42px;
}

button:hover {
  border-color: #aeb8c7;
}

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

button.dark {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

button.danger {
  color: var(--danger);
}

label {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

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

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

input[type="checkbox"] {
  width: auto;
  min-height: 0;
  accent-color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -2px 0 14px;
}

.checkbox-row span {
  color: var(--ink);
  font-size: 13px;
}

textarea {
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
  margin: 0 0 14px;
}

.app-shell {
  min-height: 100vh;
}

.crm-shell {
  min-height: 100vh;
}

.contacts-shell {
  min-height: 100vh;
}

.crm-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.contacts-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.product-workspace {
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  align-items: start;
}

.product-list-panel {
  min-height: calc(100vh - 44px);
}

.product-page-heading {
  align-items: end;
}

.product-page-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-workspace {
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  align-items: start;
}

.task-controls {
  overflow-x: hidden;
}

.task-controls .field-grid.two {
  grid-template-columns: 1fr;
}

.task-controls label,
.task-controls input,
.task-controls select,
.task-controls textarea {
  min-width: 0;
  width: 100%;
}

.task-list-panel {
  min-height: calc(100vh - 44px);
}

.task-page-heading {
  align-items: end;
}

.task-page-heading p,
.attendance-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.task-stat-card {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.task-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.task-filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, 220px);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

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

.task-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
}

.task-card-head,
.task-meta-row,
.task-time-row,
.task-actions,
.attendance-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.task-card-head {
  justify-content: space-between;
}

.task-card h3 {
  font-size: 17px;
  margin: 0;
}

.task-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-status,
.task-priority,
.task-running {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.task-status {
  background: #eaf0ff;
  color: #1746ad;
}

.task-priority.high,
.task-priority.urgent {
  color: var(--danger);
  background: #fff1f1;
}

.task-description {
  min-height: 20px;
}

.task-no-reason {
  border-left: 3px solid var(--danger);
  padding-left: 10px;
  color: var(--text) !important;
}

.task-time-row {
  justify-content: space-between;
  padding-top: 10px;
}

.task-elapsed {
  font-size: 20px;
}

.task-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.attendance-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.attendance-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attendance-row {
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.report-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0;
}

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

.report-summary div {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 10px;
}

.report-summary strong,
.report-summary span {
  display: block;
}

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

.report-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  font-size: 13px;
}

.report-table th {
  background: var(--soft);
  font-weight: 800;
}

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

.contacts-list-panel {
  padding: 18px;
  min-width: 0;
}

.contacts-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.contacts-list-head p {
  color: var(--muted);
  margin-top: 4px;
}

.contacts-list-head label {
  margin: 0;
}

.company-contact-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
}

.company-contact-title {
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.company-contact-number {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.phone-link-status {
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  width: fit-content;
}

.phone-link-status.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #16803a;
}

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

.contact-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
}

.contact-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.contact-title {
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.contact-phone {
  font-size: 16px;
  font-weight: 900;
}

.contact-meta,
.contact-address,
.contact-no-number {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contact-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.contact-sources span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 7px;
}

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

.contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}

.contact-action.call {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.contact-action.whatsapp {
  border-color: #1f8f4d;
  color: #16803a;
}

.contact-actions.compact {
  gap: 5px;
}

.contact-actions.compact .contact-action {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.crm-list-panel {
  padding: 18px;
  min-width: 0;
}

.crm-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.crm-list-head p {
  color: var(--muted);
  margin-top: 4px;
}

.crm-list-head label {
  margin: 0;
}

.crm-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.crm-filter-row select {
  width: min(220px, 100%);
}

.crm-side-new {
  width: 100%;
  margin-top: 10px;
}

.crm-add-stage {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.crm-add-stage input {
  width: 190px;
}

.crm-add-stage button {
  white-space: nowrap;
}

.odoo-sync-status,
.odoo-settings-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.crm-shell .odoo-sync-status {
  color: #b3bdcc;
}

.odoo-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
  margin: 8px 0 14px;
}

.odoo-settings h2 {
  margin-bottom: 12px;
}

.crm-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.crm-lead-dialog {
  width: min(760px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.modal-heading h2 {
  margin: 0;
}

.modal-heading button {
  min-height: 34px;
  padding: 6px 10px;
}

.crm-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.crm-stage {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.crm-stage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.crm-stage-head h2 {
  margin: 0;
}

.crm-stage-head span,
.crm-stage-head strong {
  color: var(--muted);
  font-size: 12px;
}

.crm-stage-list {
  display: grid;
  gap: 9px;
  padding: 10px;
  min-height: 420px;
  align-content: start;
  border: 1px dashed transparent;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.crm-stage-list.drag-over {
  background: #edf4ff;
  border-color: var(--accent);
}

.crm-card {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  cursor: grab;
  user-select: none;
}

.crm-card:active {
  cursor: grabbing;
}

.crm-card.dragging {
  opacity: 0.55;
  outline: 2px solid var(--accent);
}

.crm-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.crm-card-top strong {
  overflow-wrap: anywhere;
}

.crm-card-value {
  font-weight: 900;
  color: var(--ink);
}

.crm-card-meta,
.crm-card-note,
.crm-card-activity,
.crm-owner {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.crm-card-activity {
  color: #9a5a00;
  font-weight: 800;
}

.crm-owner {
  color: var(--accent);
  font-weight: 800;
}

.crm-priority {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  white-space: nowrap;
}

.crm-priority.high,
.crm-priority.very-high {
  color: #9a3412;
  border-color: #fed7aa;
  background: #fff7ed;
}

.crm-empty-stage {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.crm-load-more {
  margin: 10px;
  min-height: 38px;
  border-style: dashed;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}

.crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: start;
  justify-content: flex-end;
}

.crm-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.crm-shell {
  background: #1b1f2a;
  color: #f7f9ff;
}

.crm-shell .crm-workspace {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.crm-shell .crm-controls {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  max-height: none;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #343b4d;
  border-radius: 0;
  background: #242936;
  color: #fff;
}

.crm-shell .brand-row {
  margin: 0;
  min-width: 150px;
}

.crm-shell .brand-logo-wide {
  width: 138px;
  height: 48px;
  padding: 4px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.crm-shell .session-row {
  margin-left: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-end;
}

.crm-shell .session-row span {
  color: #d8dfec;
}

.crm-shell .session-row button,
.crm-shell .crm-side-new,
.crm-shell .crm-filter-row button,
.crm-shell .crm-detail-nav button,
.crm-shell .crm-chatter-actions button,
.crm-shell .crm-text-link,
.crm-shell .crm-detail-tabs button {
  border-color: #42495b;
  background: #303648;
  color: #f7f9ff;
}

.crm-shell .primary,
.crm-shell button.primary,
.crm-shell .crm-side-new {
  border-color: #8c4b83;
  background: #8c4b83;
  color: #fff;
}

.crm-shell .danger,
.crm-shell button.danger {
  border-color: #8f3845;
  background: #3a2630;
  color: #ffb9c2;
}

.crm-side-new {
  width: auto;
  margin-top: 0;
}

.crm-shell .crm-list-panel,
.crm-shell .crm-detail-panel {
  min-height: calc(100vh - 69px);
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #1b1f2a;
}

.crm-shell .crm-list-head {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 600px);
  align-items: center;
  border-color: #343b4d;
}

.crm-shell .crm-list-head h1 {
  color: #fff;
}

.crm-shell .crm-list-head p,
.crm-shell .crm-list-head span,
.crm-shell .list-count {
  color: #b3bdcc;
}

.crm-shell .crm-list-head input,
.crm-shell .crm-filter-row select,
.crm-shell .crm-add-stage input {
  border-color: #495164;
  background: #202637;
  color: #f7f9ff;
}

.crm-shell .crm-list-head input::placeholder,
.crm-shell .crm-add-stage input::placeholder {
  color: #8791a2;
}

.crm-shell .crm-filter-row {
  gap: 10px;
}

.crm-shell .crm-list {
  display: grid;
  grid-auto-columns: minmax(300px, 1fr);
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: 0;
  min-height: calc(100vh - 190px);
  padding-bottom: 10px;
}

.crm-shell .crm-stage {
  min-width: 300px;
  border: 0;
  border-right: 1px solid #343b4d;
  border-radius: 0;
  background: #202431;
}

.crm-shell .crm-stage-head {
  padding: 14px 16px 10px;
  border: 0;
  background: #1b1f2a;
  min-height: 72px;
}

.crm-shell .crm-stage-head h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.crm-shell .crm-stage-head span,
.crm-shell .crm-stage-head strong {
  color: #d7deeb;
}

.crm-stage-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.crm-stage-controls {
  display: flex;
  gap: 5px;
}

.crm-stage-controls button {
  min-width: 28px;
  min-height: 28px;
  padding: 3px 8px;
  border-color: #42495b;
  background: #303648;
  color: #f7f9ff;
  font-weight: 900;
  line-height: 1;
}

.crm-stage-controls .delete-stage-position {
  border-color: #8f3845;
  background: #3a2630;
  color: #ffb9c2;
}

.crm-stage-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.crm-shell .crm-stage-list {
  min-height: calc(100vh - 245px);
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
}

.crm-shell .crm-stage-list.drag-over {
  background: #293249;
  outline: 2px solid #22d3ee;
  outline-offset: -2px;
}

.crm-shell .crm-card {
  gap: 8px;
  padding: 14px 10px;
  border: 0;
  border-top: 1px solid #343b4d;
  border-radius: 0;
  background: #282d3a;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
}

.crm-shell .crm-card:hover {
  background: #303646;
}

.crm-shell .crm-card:active {
  cursor: grabbing;
}

.crm-shell .crm-card-value,
.crm-shell .crm-card-top strong {
  color: #fff;
}

.crm-card-company {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}

.crm-card-company strong,
.crm-card-company small {
  display: block;
  overflow-wrap: anywhere;
}

.crm-card-company small {
  color: #b8c2d4;
  font-size: 12px;
  margin-top: 2px;
}

.crm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.crm-tag-list.compact {
  margin-top: 0;
  gap: 4px;
}

.crm-tag-list span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #44506a;
  border-radius: 999px;
  background: #31384a;
  color: #e4e9f4;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.crm-tag-list.compact span {
  min-height: 19px;
  padding: 2px 6px;
  font-size: 11px;
}

.crm-initial,
.crm-kanban-owner,
.crm-detail-avatar,
.crm-timeline-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #33b679;
  color: #fff;
  font-weight: 900;
}

.crm-initial,
.crm-kanban-owner {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.crm-kanban-owner {
  flex: 0 0 auto;
  background: #7244d9;
}

.crm-shell .crm-card-meta,
.crm-shell .crm-card-note,
.crm-shell .crm-owner {
  color: #d5dbea;
}

.crm-shell .crm-card-activity {
  color: #94a3b8;
}

.crm-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #525a6d;
  font-size: 21px;
  line-height: 1;
}

.crm-stars .filled {
  color: #ffd43b;
}

.crm-stars .crm-clock {
  margin-left: 5px;
  color: #8ca0ba;
  font-size: 17px;
}

.crm-shell .contact-actions.compact .contact-action {
  min-height: 28px;
  padding: 5px 8px;
  border-color: #454d60;
  background: #202637;
  color: #f7f9ff;
}

.crm-shell .contact-actions.compact .contact-action.call,
.crm-shell .contact-actions .contact-action.call {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.crm-shell .contact-actions.compact .contact-action.whatsapp,
.crm-shell .contact-actions .contact-action.whatsapp {
  border-color: #22c55e;
  color: #8ef0ac;
}

.crm-shell .crm-empty-stage {
  margin: 12px;
  border-color: #394154;
  background: #242936;
  color: #aeb8c9;
}

.crm-shell .crm-load-more {
  margin: 10px;
  border-color: #475063;
  background: #303648;
  color: #dbeafe;
}

.crm-detail-topbar,
.crm-detail-status-row,
.crm-detail-nav,
.crm-chatter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-detail-topbar {
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #343b4d;
}

.crm-text-link {
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
}

.crm-detail-status-row {
  padding: 10px 0;
  overflow-x: auto;
}

.crm-won {
  border-color: #8c4b83;
  background: #8c4b83;
  color: #fff;
}

.crm-shell .detail-stage-chip.active {
  border-color: #00c8cf;
  background: #008b92;
  color: #fff;
}

.crm-status-bar {
  display: flex;
  align-items: center;
  min-width: max-content;
}

.crm-status-step {
  position: relative;
  min-height: 34px;
  min-width: 132px;
  margin-left: -10px;
  padding: 7px 22px 7px 28px;
  border: 1px solid #4a5265;
  background: #303648;
  color: #f7f9ff;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%);
}

.crm-status-step:first-child {
  margin-left: 0;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
}

.crm-status-step.done {
  background: #3b4255;
}

.crm-status-step.active {
  border-color: #00c8cf;
  background: #008b92;
  color: #fff;
}

.crm-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(340px, 0.9fr);
  gap: 16px;
}

.crm-detail-main,
.crm-chatter {
  min-height: 580px;
  border: 1px solid #343b4d;
  background: #282d3a;
}

.crm-detail-main {
  padding: 18px;
}

.crm-chatter {
  padding: 16px;
  background: #1d222d;
}

.crm-detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.crm-detail-title-row h1 {
  color: #fff;
  font-size: 34px;
  font-weight: 500;
}

.crm-detail-title-row p {
  margin-top: 6px;
  color: #98a4b8;
}

.crm-detail-avatar {
  width: 42px;
  height: 42px;
  background: #cc3a79;
  font-size: 18px;
}

.crm-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.crm-detail-metrics div,
.crm-detail-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.crm-detail-metrics span,
.crm-detail-field span {
  color: #c2cadd;
  font-size: 13px;
  font-weight: 800;
}

.crm-detail-metrics strong,
.crm-detail-field strong {
  color: #fff;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.crm-detail-metrics .crm-stars {
  display: flex;
  min-width: 92px;
}

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

.crm-detail-field.wide {
  grid-column: 1 / -1;
}

.crm-detail-field .contact-actions {
  margin-top: 4px;
}

.crm-detail-field .contact-action {
  border-color: #454d60;
  background: #202637;
  color: #f7f9ff;
}

.crm-detail-field .contact-no-number {
  color: #8f99ad;
  font-size: 12px;
  font-weight: 800;
}

.crm-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #343b4d;
}

.crm-detail-tabs button {
  min-height: 38px;
  border-radius: 0;
  border-bottom: 0;
}

.crm-detail-tabs button.active {
  border-top-color: #c45aa4;
  color: #ff9ce0;
}

.crm-detail-note {
  min-height: 170px;
  padding: 18px 4px;
  color: #d9dfeb;
  line-height: 1.45;
}

.crm-contact-tab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 26px;
  padding: 18px 4px;
}

.crm-pi-list {
  display: grid;
  gap: 10px;
  padding: 18px 4px;
}

.crm-pi-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #343b4d;
  background: #202637;
}

.crm-pi-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-pi-card strong {
  color: #f7f9ff;
}

.crm-pi-card span,
.crm-pi-card small {
  color: #aab4c4;
}

.crm-odoo-panel {
  display: grid;
  gap: 18px;
  padding: 18px 4px;
}

.crm-odoo-link {
  color: #93c5fd;
  font-weight: 900;
  width: max-content;
}

.crm-odoo-grid,
.crm-raw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.crm-odoo-grid div,
.crm-raw-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #343b4d;
  background: #242936;
}

.crm-odoo-grid span,
.crm-raw-grid span {
  color: #c2cadd;
  font-size: 12px;
  font-weight: 900;
}

.crm-odoo-grid strong,
.crm-raw-grid strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.crm-raw-grid {
  max-height: 360px;
  overflow: auto;
}

.crm-odoo-panel h3 {
  color: #f7f9ff;
  margin: 0;
  font-size: 16px;
}

.crm-note-events {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.crm-note-event {
  border-top: 1px solid #343b4d;
  padding-top: 10px;
}

.crm-note-event strong,
.crm-note-event small {
  display: block;
}

.crm-note-event small {
  color: #9aa6b8;
}

.crm-chatter-actions {
  margin-bottom: 26px;
}

.crm-composer {
  display: grid;
  gap: 11px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid #343b4d;
  background: #242936;
}

.crm-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crm-composer label {
  margin: 0;
}

.crm-composer span {
  color: #c2cadd;
}

.crm-composer textarea,
.crm-composer input {
  border-color: #495164;
  background: #202637;
  color: #f7f9ff;
}

.crm-composer textarea::placeholder {
  color: #8791a2;
}

.crm-timeline {
  display: grid;
  gap: 28px;
}

.crm-timeline-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #303746;
}

.crm-timeline-avatar {
  width: 34px;
  height: 34px;
  background: #cc3a79;
}

.crm-timeline-row strong {
  color: #f7f9ff;
}

.crm-timeline-row p,
.crm-timeline-row small {
  color: #aab4c4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.panel {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.controls {
  align-self: start;
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 18px;
  position: sticky;
  top: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand-logo-wide {
  width: 132px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.brand-row p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 20px;
}
.session-row #logoutBtn{
  color: red;
}

.session-row button {
  min-height: 32px;
  padding: 5px 9px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 18px;
}

.tab {
  border: 0;
  background: transparent;
  min-height: 36px;
  padding: 8px 6px;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.field-grid {
  display: grid;
  gap: 10px;
}

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

.field-grid.three {
  grid-template-columns: 88px 1fr 88px 86px;
  align-items: end;
}

.field-grid.product-fields {
  grid-template-columns: 1fr 90px 1fr;
}

.field-grid.add-product-fields {
  grid-template-columns: 1fr 1fr 94px;
  align-items: end;
}

.action-button {
  margin-bottom: 14px;
}

.full-add-button {
  width: 100%;
  margin-top: -2px;
}

.quote-variant-picker {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.quote-variant-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.quote-variant-head div {
  display: grid;
  gap: 3px;
}

.quote-variant-head strong {
  font-size: 15px;
}

.quote-variant-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-variant-head .quote-variant-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-variant-head .quote-variant-actions button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--accent);
  background: #fff;
}

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

.quote-variant-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 86px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
  color: var(--ink);
}

.quote-variant-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(38, 95, 217, 0.14);
}

.quote-variant-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.quote-variant-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quote-variant-info strong,
.quote-variant-info span {
  overflow-wrap: anywhere;
      font-size: 14px;
}

.quote-variant-info span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.quote-variant-price {
  grid-column: 1 / -1;
  justify-self: end;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.search-field {
  position: relative;
  margin: 0 0 14px;
}

.search-field label {
  margin: 0 0 6px;
}

.product-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.suggestion-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.client-option {
  grid-template-columns: 44px minmax(0, 1fr);
}

.suggestion-option:last-child {
  border-bottom: 0;
}

.suggestion-option:hover,
.suggestion-option.active {
  background: #edf4ff;
}

.suggestion-option img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.suggestion-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.suggestion-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  display: block;
}

.suggestion-price {
  font-weight: 900;
  white-space: nowrap;
}

.divider {
  border-top: 1px solid var(--line);
  margin: 6px 0 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.button-row button {
  flex: 1 1 96px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-heading-row h2 {
  margin: 0;
}

.section-heading-row button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 0;
}

.item-editor,
.product-list,
.client-list,
.saved-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
}

.edit-row,
.product-row,
.client-row,
.saved-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.saved-row {
  display: block;
}

.saved-owner.warning {
  color: #b91c1c;
}

.edit-row img,
.product-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.edit-main,
.product-main,
.saved-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.edit-title,
.product-title,
.saved-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.edit-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.mini-field {
  margin: 0;
  gap: 4px;
}

.mini-field span {
  font-size: 11px;
}

.edit-controls input {
  min-height: 36px;
  padding: 7px 8px;
}

.edit-summary {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.edit-total {
  font-weight: 800;
  white-space: nowrap;
}

.icon-button {
  min-height: 36px;
  padding: 6px;
}
.saved-actions{
  margin-top: 10px;
}

.product-actions,
.client-actions,
.saved-actions,
.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-actions button,
.client-actions button,
.saved-actions button,
.user-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.client-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.client-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.client-meta,
.client-address {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-list-search {
  margin-top: 16px;
}

.saved-owner {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.user-settings {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.user-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.user-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.user-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.totals-inputs {
  margin-top: 12px;
}

.product-list-search {
  margin-top: 16px;
}

.variant-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
  margin-bottom: 14px;
}

.variant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.variant-heading h2 {
  margin: 0;
}

.variant-heading button {
  min-height: 34px;
  padding: 6px 10px;
}

.variant-help {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.variant-rows {
  display: grid;
  gap: 8px;
}

.variant-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.variant-row label,
.variant-upload {
  margin: 0;
}

.variant-row input {
  min-height: 36px;
  padding: 7px 8px;
}

.variant-row button {
  min-height: 36px;
  padding: 6px;
}

.variant-photo {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.variant-preview {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.variant-upload {
  width: 100%;
}

.variant-upload span {
  display: block;
  text-align: center;
  margin-bottom: 4px;
}

.variant-upload input {
  font-size: 11px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.variant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.variant-badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 7px;
}

.variant-badges img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.list-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: -4px 0 8px;
}

.bank-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 12px;
  margin: 8px 0 14px;
}

.bank-settings h2 {
  margin-bottom: 12px;
}

.qr-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-top: -4px;
}

.qr-preview-row img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.status-line {
  color: var(--muted);
  font-size: 13px;
  margin: 0 auto 10px;
  width: min(100%, 210mm);
}

.preview-wrap {
  min-width: 0;
  overflow: auto;
}

.invoice-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 36px;
  background: #fff;
  color: #20272b;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18);
  position: relative;
  overflow: hidden;
  padding: 43mm 18mm 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-curve {
  position: absolute;
  top: 0;
  right: 0;
  width: 156mm;
  height: 41mm;
  background: linear-gradient(96deg, #3479e6 0%, #5825cc 76%, #a932f3 100%);
  border-bottom-left-radius: 90mm 52mm;
}

.invoice-title {
  position: absolute;
  top: 18mm;
  right: 39mm;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invoice-logo {
  position: absolute;
  left: 17mm;
  top: 7mm;
  display: grid;
  justify-items: center;
  gap: 2mm;
}

.invoice-logo img {
  width: 28mm;
  height: 28mm;
  object-fit: contain;
}

.invoice-logo strong {
  color: #5b5b5b;
  font-size: 25px;
  line-height: 1;
}

.invoice-meta {
  position: absolute;
  right: 18mm;
  top: 45mm;
  text-align: right;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.address-grid {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 18mm;
  margin-bottom: 6mm;
  padding-top: 0;
}

.address-block h3 {
  margin: 0 0 3mm;
  font-size: 14px;
  text-transform: uppercase;
}

.address-block strong,
.address-block p {
  font-size: 12.5px;
  line-height: 1.3;
}

.address-block strong {
  display: block;
  text-transform: uppercase;
  margin-bottom: 1mm;
}

.address-block p {
  margin: 0;
  font-weight: 700;
  white-space: pre-line;
}

.address-block .thin {
  font-weight: 600;
}

.invoice-table-wrap {
  position: relative;
}

.watermark {
  position: absolute;
  left: 69mm;
  top: 24mm;
  width: 75mm;
  height: 75mm;
  object-fit: contain;
  opacity: 0.07;
  pointer-events: none;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  position: relative;
  z-index: 1;
}

.invoice-table thead th {
  background: linear-gradient(90deg, #3346c5 0%, #5c24d5 100%);
  color: #fff;
  font-size: 16px;
  padding: 4mm 3mm;
  text-align: center;
}

.invoice-table thead th:nth-child(2) {
  text-align: left;
}

.invoice-table tbody tr:nth-child(even) {
  background: #e7e7e7;
}

.invoice-table td {
  padding: 2mm 3mm;
  min-height: 16mm;
  vertical-align: middle;
  font-size: 13.5px;
}

.invoice-table .image-col {
  width: 38mm;
  text-align: center;
}

.invoice-table .image-col img {
  width: 18mm;
  height: 18mm;
  object-fit: contain;
}

.invoice-table .description-col {
  width: 75mm;
  text-align: center;
  line-height: 1.22;
}

.invoice-table .qty-col {
  width: 22mm;
  text-align: center;
  font-size: 16px;
}

.invoice-table .price-col,
.invoice-table .total-col {
  width: 32mm;
  text-align: center;
  font-size: 15px;
  white-space: nowrap;
}

.invoice-lower {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 10mm;
  border-top: 1px solid #20272b;
  margin-top: 9mm;
  padding-top: 6mm;
}

.payment h3,
.terms h3 {
  margin: 0 0 3mm;
  font-size: 16px;
}

.bank-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6mm 2mm;
  font-size: 12.5px;
  font-weight: 700;
  color: #665a54;
}

.qr-row {
  display: grid;
  grid-template-columns: 1fr 30mm;
  gap: 6mm;
  align-items: start;
}

.qr {
  width: 24mm;
  height: 24mm;
  object-fit: contain;
}

.totals {
  display: grid;
  gap: 2mm;
  align-content: start;
  padding-top: 2mm;
}

.total-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8mm;
  font-size: 13.5px;
}

.grand-total {
  margin-top: 2mm;
  background: #1f2529;
  color: #fff;
  padding: 4mm 4mm;
  font-size: 19px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 4mm;
}

.terms {
  margin-top: 3mm;
}

.terms ol {
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
  font-size: 11.5px;
  line-height: 1.25;
}

.signature {
  display: grid;
  justify-items: center;
  margin-top: 18mm;
  font-size: 12px;
}

.signature::before {
  content: "";
  display: none;
}

.signature-stamp {
  width: 45mm;
  max-height: 28mm;
  object-fit: contain;
  margin-bottom: 2mm;
      padding-bottom: 4px;
    border-bottom: solid 2px #000;
}

.signature strong {
  font-size: 16px;
}

.invoice-footer {
  display: grid;
  grid-template-columns: 96mm 1fr;
  align-items: end;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  min-height: 24mm;
}

.more-products {
  align-self: stretch;
  display: flex;
  align-items: end;
  padding: 0 0 6mm 16mm;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  background: linear-gradient(98deg, #633fff 0%, #387dea 100%);
  border-top-right-radius: 96mm 38mm;
}

.thank-you {
  align-self: end;
  background: #e8edff;
  padding: 6mm 8mm;
  font-size: 12.5px;
  text-align: center;
}

.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 22px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

@media (max-width: 1120px) {
  .workspace,
  .crm-workspace,
  .contacts-workspace,
  .product-workspace,
  .task-workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
    max-height: none;
  }

  .preview-wrap {
    padding-bottom: 18px;
  }

  .crm-list-head {
    grid-template-columns: 1fr;
  }

  .contacts-list-head {
    grid-template-columns: 1fr;
  }

  .task-stats,
  .task-filter-row,
  .report-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .crm-detail-layout,
  .crm-detail-metrics,
  .crm-detail-fields,
  .crm-contact-tab-grid,
  .crm-odoo-grid,
  .crm-raw-grid {
    grid-template-columns: 1fr;
  }

  .crm-detail-main,
  .crm-chatter {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .workspace,
  .crm-workspace,
  .contacts-workspace,
  .product-workspace,
  .task-workspace,
  .app-launcher {
    padding: 12px;
  }

  .launcher-grid,
  .crm-list,
  .crm-add-stage,
  .task-stats,
  .task-filter-row,
  .report-filter-row,
  .report-summary {
    grid-template-columns: 1fr;
  }

  .crm-add-stage {
    display: grid;
    width: 100%;
    margin-left: 0;
  }

  .crm-add-stage input {
    width: 100%;
  }

  .crm-shell .crm-controls,
  .crm-detail-topbar,
  .crm-detail-status-row,
  .crm-detail-nav,
  .crm-chatter-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .crm-shell .brand-row,
  .crm-shell .session-row {
    width: 100%;
    margin-left: 0;
  }

  .crm-shell .crm-list-head {
    grid-template-columns: 1fr;
  }

  .crm-shell .crm-list {
    grid-auto-columns: minmax(285px, 86vw);
  }

  .crm-detail-title-row {
    display: grid;
  }

  .crm-detail-title-row h1 {
    font-size: 28px;
  }

  .field-grid.two,
  .field-grid.three,
  .field-grid.product-fields,
  .field-grid.add-product-fields,
  .variant-row,
  .variant-fields,
  .edit-controls {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .invoice-sheet {
    transform-origin: top left;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    background: #fff;
    width: 210mm;
    height: 296mm;
    margin: 0;
    overflow: hidden;
  }

  .app-shell,
  .workspace,
  .preview-wrap {
    width: 210mm;
    height: 296mm;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .controls,
  .status-line,
  .toast-wrap,
  .toast-message {
    display: none !important;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .preview-wrap {
    overflow: visible;
  }

  .invoice-sheet {
    width: 210mm;
    height: 296mm;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    overflow: hidden;
    break-after: avoid;
    page-break-after: avoid;
  }
}

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

/* Simple proforma invoice layout */
.invoice-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 36px;
  padding: 14mm;
  overflow: visible;
  color: #1f2529;
  position: relative;
  isolation: isolate;
}

.invoice-watermark {
  position: absolute;
  left: 50%;
  top: 148.5mm;
  width: 86mm;
  height: 86mm;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.invoice-document {
  display: block;
  position: relative;
  z-index: 1;
}

.invoice-short-document {
  min-height: 269mm;
  display: flex;
  flex-direction: column;
}

.invoice-header {
  display: grid;
  grid-template-columns: 64mm 1fr;
  gap: 10mm;
  align-items: center;
  border-bottom: 2px solid #1f2529;
  padding-bottom: 5mm;
  margin-bottom: 5mm;
}

.invoice-brand-logo {
  width: 52mm;
  max-height: 20mm;
  object-fit: contain;
  object-position: left center;
}

.invoice-header h2 {
  margin: 0;
  text-align: right;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.invoice-meta-simple {
  display: flex;
  justify-content: flex-end;
  gap: 7mm;
  margin-top: 3mm;
  font-size: 12px;
  font-weight: 800;
}

.invoice-sheet .address-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8mm;
  margin-bottom: 5mm;
}

.invoice-sheet .address-block {
  border: 1px solid #cfd6df;
  padding: 3mm;
}

.invoice-sheet .address-block h3 {
  margin: 0 0 2mm;
  font-size: 11px;
}

.invoice-sheet .address-block strong,
.invoice-sheet .address-block p {
  font-size: 10.5px;
  line-height: 1.22;
}

.invoice-sheet .address-block p {
  font-weight: 600;
}

.invoice-sheet .dispatch-label {
  margin-top: 2mm;
  font-size: 10px;
  font-weight: 900;
  color: #4e5966;
}

.invoice-sheet .invoice-table {
  border-collapse: collapse;
  width: 100%;
  position: static;
}

.invoice-sheet .invoice-table th {
  background: #f1f3f6;
  color: #1f2529;
  border: 1px solid #b9c2ce;
  font-size: 11px;
  padding: 2mm 1.5mm;
  text-align: center;
}

.invoice-sheet .invoice-table td {
  border: 1px solid #d5dbe3;
  padding: 1mm 1.5mm;
  font-size: 10.8px;
  line-height: 1.15;
  vertical-align: middle;
}

.invoice-sheet .invoice-table tbody tr:nth-child(even) {
  background: #fafafa59;
}

.invoice-sheet .sr-col {
  width: 10mm;
  text-align: center;
}

.invoice-sheet .image-col {
  width: 19mm;
  text-align: center;
}

.invoice-sheet .image-col img {
  width: 13mm;
  height: 13mm;
  object-fit: contain;
}

.invoice-sheet .description-col {
  width: auto;
  text-align: left;
}

.invoice-sheet .qty-col {
  width: 13mm;
  text-align: center;
  font-size: 10.8px;
}

.invoice-sheet .price-col,
.invoice-sheet .gst-col,
.invoice-sheet .total-col {
  width: 22mm;
  text-align: right;
  font-size: 10.8px;
  white-space: nowrap;
}

.invoice-sheet .gst-col {
  width: 13mm;
  text-align: center;
}

.invoice-sheet .invoice-lower {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8mm;
  border-top: 2px solid #1f2529;
  margin-top: 5mm;
  padding-top: 4mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.invoice-sheet .invoice-short-document > .invoice-lower {
  margin-top: auto;
}

.invoice-sheet .payment h3,
.invoice-sheet .terms h3 {
  font-size: 12px;
  margin-bottom: 2mm;
}

.invoice-sheet .bank-grid {
  font-size: 10.5px;
  color: #1f2529;
}

.invoice-sheet .payment-method-row {
  display: grid;
  grid-template-columns: 1fr 22mm;
  gap: 4mm;
  align-items: start;
}

.invoice-sheet .payment-qr {
  width: 22mm;
  height: 22mm;
  object-fit: contain;
  border: 1px solid #d5dbe3;
  padding: 1.5mm;
  background: #fff;
}

.invoice-sheet .terms ol {
  padding-left: 3.5mm;
  list-style-position: outside;
  font-size: 9.5px;
  line-height: 1.24;
}

.invoice-sheet .grand-total {
  background: #1f2529;
  color: #fff;
  font-size: 15px;
  padding: 3mm;
}

.invoice-sheet .signature {
  margin-top: 6mm;
}

.invoice-sheet .signature-stamp {
  width: 42mm;
  max-height: 18mm;
}

.client-initial {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #eaf1ff;
  color: var(--accent);
  font-weight: 900;
}

.saved-details,
.saved-client {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

  html,
  body,
  .app-shell,
  .workspace,
  .preview-wrap {
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    background: #fff;
  }

  .invoice-sheet {
    width: auto;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
    break-after: auto;
    page-break-after: auto;
  }

  .invoice-watermark {
    position: fixed;
    top: 50%;
  }

  .invoice-short-document {
    min-height: 280mm;
  }

  .invoice-table thead {
    display: table-header-group;
  }

  .invoice-table tfoot {
    display: table-footer-group;
  }

  .invoice-table tr,
  .invoice-lower,
  .address-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .toast-wrap,
  .toast-message {
    display: none !important;
  }
}
