:root {
  --sidebar-bg: #232742;
  --sidebar-muted: #9ea5cf;
  --sidebar-text: #eef1ff;
  --sidebar-accent: #5a7cff;
  --page-bg: #f4f5fb;
  --panel-bg: #ffffff;
  --border: #e3e5f1;
  --border-strong: #d3d8ec;
  --text: #23273f;
  --muted: #6f7696;
  --danger: #dd4952;
  --primary: #5a7cff;
  --primary-dark: #4468f5;
  --shadow: 0 18px 40px rgba(29, 35, 78, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--text);
  background: linear-gradient(180deg, #f7f8fd 0%, #eef1f9 100%);
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #252a48 0%, #1d2138 100%);
  color: var(--sidebar-text);
}

.sidebar-overlay {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(90, 124, 255, 0.2);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-logo {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: contain;
}

.brand-label,
.brand-subtitle {
  margin: 0;
}

.brand-label {
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 0.525rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(90, 124, 255, 0.18);
}

.nav-icon {
  color: #c8d0ff;
}

.nav-item-expandable .nav-label {
  flex: 1;
}

.nav-caret,
.nav-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #c8d0ff;
}

.nav-lock {
  color: #ffd166;
}

.nav-group-item.expanded .nav-caret {
  transform: rotate(90deg);
}

.nav-item .nav-lock,
.nav-subitem .nav-lock {
  margin-left: auto;
  opacity: 0;
  pointer-events: none;
}

.nav-item.admin-only .nav-lock,
.nav-subitem.admin-only .nav-lock {
  opacity: 1;
}

.nav-item.is-disabled,
.nav-subitem.is-disabled {
  opacity: 0.72;
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #d4dafb;
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-subitem:hover,
.nav-subitem.active {
  background: rgba(90, 124, 255, 0.15);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px 12px;
}

.mobile-menu-button {
  display: none;
  flex-shrink: 0;
}

.search-shell {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 460px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(24, 33, 84, 0.04);
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 14px;
  color: #8e95b3;
}

.search-shell input {
  flex: 1;
  padding: 12px 14px 12px 10px;
  border: 0;
  outline: 0;
  background: transparent;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-settings {
  margin-left: auto;
}

.content {
  padding: 0 26px 26px;
}

.view-section {
  display: none;
}

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

.panel {
  border: 1px solid rgba(226, 229, 243, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 18px;
}

.quote-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.quotes-panel,
.clients-panel,
.invoices-panel,
.payments-panel {
  padding: 0;
  overflow: hidden;
}

.quotes-header,
.clients-header,
.invoices-header,
.payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.quotes-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.quotes-table-shell,
.clients-table-shell,
.invoices-table-shell,
.payments-table-shell {
  overflow-x: auto;
}

.quotes-table,
.invoices-table,
.payments-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.quotes-table th,
.quotes-table td,
.invoices-table th,
.invoices-table td,
.payments-table th,
.payments-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.quotes-table th,
.invoices-table th,
.payments-table th {
  color: #7881a3;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #fafbff;
}

.quotes-table td,
.invoices-table td,
.payments-table td {
  font-size: 0.92rem;
  background: #ffffff;
}

.quotes-table tbody tr:hover td,
.invoices-table tbody tr:hover td,
.payments-table tbody tr:hover td {
  background: #f8faff;
}

.quotes-table input[type="checkbox"],
.payments-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.payments-table input[type="number"] {
  width: 110px;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
}

.quotes-number-cell {
  color: var(--primary-dark);
  font-weight: 700;
}

.claims-list-panel,
.sav-list-panel {
  padding: 0;
  overflow: hidden;
}

.claims-header,
.sav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.claims-header-actions,
.sav-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.claims-header-actions .icon-button:first-child,
.sav-header-actions .icon-button:first-child {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  width: 44px;
  height: 44px;
  font-weight: 600;
}

.claims-header-actions .icon-button:first-child:hover,
.sav-header-actions .icon-button:first-child:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.claims-table-shell,
.sav-table-shell {
  overflow-x: auto;
}

.claims-table,
.sav-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.claims-table th,
.claims-table td,
.sav-table th,
.sav-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.claims-table th,
.sav-table th {
  background-color: var(--background-light);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.claims-table tbody tr:hover,
.sav-table tbody tr:hover {
  background-color: var(--background-light);
}

.claims-table .actions-cell,
.sav-table .actions-cell {
  display: flex;
  gap: 8px;
}

.claims-table .action-button,
.sav-table .action-button {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.claims-table .action-button:hover,
.sav-table .action-button:hover {
  background-color: var(--background-light);
  border-color: var(--primary);
  color: var(--primary);
}

.claims-table .delete-button,
.sav-table .delete-button {
  color: var(--error);
  border-color: var(--error);
}

.claims-table .delete-button:hover,
.sav-table .delete-button:hover {
  background-color: var(--error-light);
}

.quotes-amount-cell {
  text-align: right;
  font-weight: 700;
}

.quotes-actions-cell {
  text-align: right;
}

.quotes-row-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

.quotes-row-action:hover {
  background: #f5f8ff;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge.status-brouillon {
  background: #fff5dc;
  color: #ad6e00;
}

.status-badge.status-envoye {
  background: #edf3ff;
  color: #3567df;
}

.status-badge.status-accepted {
  background: #eef8ff;
  color: #0d79a6;
}

.status-badge.status-rejected {
  background: #fff0f0;
  color: #b23a3a;
}

.status-badge.status-deposit {
  background: #f3ebff;
  color: #7047d1;
}

.status-badge.status-partial {
  background: #fff1e4;
  color: #c56a16;
}

.status-badge.status-facture {
  background: #e9f9ef;
  color: #2f9b59;
}

.status-badge.status-archived {
  background: #eef1f6;
  color: #5b647d;
}

.status-badge.status-received {
  background-color: #e3f2fd;
  color: #1976d2;
}

.status-badge.status-in-progress {
  background-color: #fff3e0;
  color: #f57c00;
}

.status-badge.status-resolved,
.status-badge.status-completed {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.clients-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.clients-table th,
.clients-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.clients-table th {
  color: #7881a3;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #fafbff;
}

.clients-table td {
  font-size: 0.92rem;
  background: #ffffff;
}

.clients-table tbody tr:hover td {
  background: #f8faff;
}

.clients-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.table-link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 600;
  padding: 0;
}

.new-client-panel {
  padding: 24px 26px 30px;
}

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

.client-form-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.client-number-field {
  width: min(220px, 100%);
}

.client-number-field input[readonly] {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  background: #f7f9ff;
}

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

.client-form-note {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: #f9fbff;
  color: #66708f;
  font-size: 0.83rem;
}

.new-client-panel .field input,
.new-client-panel .field select,
.new-client-panel .field textarea {
  padding: 9px 11px;
}

.secondary-grid {
  margin-top: 18px;
}

.radio-row,
.contact-row,
.phone-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-type-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.client-type-card {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 160px;
  max-width: 220px;
}

.client-type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.client-type-card .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #4b5375;
}

.client-type-card input[type="radio"]:checked + .card-content {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.05);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.client-type-card .card-icon {
  font-size: 32px;
  line-height: 1;
}

.client-type-card .card-label {
  font-size: 16px;
}

.radio-option,
.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5375;
}

.contact-row select,
.contact-row input {
  flex: 1 1 0;
  min-width: 140px;
}

.phone-input {
  display: grid;
  grid-template-columns: auto 1fr;
  width: min(320px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #f6f8fe;
  color: #5d6688;
  border-right: 1px solid var(--border-strong);
}

.phone-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.client-tabs {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.client-tab {
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #606987;
}

.client-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.client-tab-panel {
  margin-top: 18px;
}

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

.address-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.address-column-header {
  min-height: 36px;
}

.address-column-header h2 {
  font-size: 1rem;
}

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

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-button:hover {
  background-color: var(--background-light);
  border-color: var(--primary);
  color: var(--primary);
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button:disabled:hover {
  background: white;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.icon-button svg {
  fill: currentColor;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: var(--background-light);
  color: var(--text);
}

.modal-close svg {
  fill: currentColor;
}

.modal-body {
  padding: 0 24px 24px;
}

.client-type-modal .modal-body {
  text-align: center;
}

.client-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.client-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.client-type-option:hover {
  border-color: var(--primary);
  background-color: var(--background-light);
}

.client-type-option.active {
  border-color: var(--primary);
  background: rgba(90, 124, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.12);
  color: var(--primary-dark);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.client-type-icon {
  margin-bottom: 16px;
  color: var(--primary);
}

.client-type-option h3 {
  margin: 0 0 8px 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.client-type-option p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.address-column-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.address-fields {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px 16px;
  align-items: center;
}

.address-fields input,
.address-fields select,
.address-fields textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.address-fields textarea {
  min-height: 60px;
  resize: vertical;
}

.address-fields input:focus,
.address-fields select:focus,
.address-fields textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.13);
}

.address-fields label,
.address-label-spacer {
  color: #3f4766;
  font-weight: 500;
}

.address-label-spacer {
  min-height: 1px;
}

.inline-phone {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0;
}

.inline-phone select {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.inline-phone input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

.address-note {
  margin-top: 24px;
  padding: 14px 18px;
  border-left: 3px solid #f0b429;
  background: #fffdf6;
  color: #4d546f;
}

.address-note p {
  margin-top: 8px;
}

.client-placeholder-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--muted);
  background: #fbfcff;
}

.client-notes-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.client-custom-panel {
  margin-top: 18px;
}

.custom-empty-state {
  padding: 26px 6px 8px;
  color: #6f7797;
}

.custom-empty-state p {
  max-width: 920px;
  line-height: 1.7;
}

.custom-empty-state .secondary-button {
  margin-top: 18px;
}

.custom-fields-container {
  padding-top: 10px;
}

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

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

.custom-field-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-field-card label {
  font-weight: 600;
  color: #465070;
}

.custom-field-card input,
.custom-field-card select,
.custom-field-card textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
}

.custom-field-card textarea {
  min-height: 100px;
  resize: vertical;
}

.settings-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 29, 57, 0.52);
  backdrop-filter: blur(6px);
  z-index: 16;
}

.settings-dialog {
  width: min(820px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(12, 19, 47, 0.24);
}

.settings-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.settings-help {
  margin-top: 12px;
  color: var(--muted);
}

.settings-data-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-data-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.settings-data-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.convert-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 29, 57, 0.58);
  backdrop-filter: blur(6px);
  z-index: 17;
}

.convert-dialog {
  width: min(760px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(12, 19, 47, 0.24);
}

.convert-header,
.convert-actions,
.convert-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.convert-summary,
.convert-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.convert-summary div,
.convert-preview div {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcff;
}

.convert-summary span,
.convert-preview span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.convert-summary strong,
.convert-preview strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.convert-options {
  display: flex;
  gap: 16px;
  margin-top: 18px;
}

.convert-deposit-fields {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.convert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  margin-top: 16px;
}

.convert-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.smart-device-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.smart-device-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.smart-device-copy {
  max-width: 320px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.smart-device-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.smart-device-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcff;
}

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

.smart-device-card-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.smart-device-card-title strong {
  font-size: 1rem;
}

.smart-device-card-title span {
  color: var(--muted);
  font-size: 0.84rem;
}

.smart-device-toggle {
  font-size: 0.88rem;
}

.smart-device-grid {
  margin-top: 14px;
}

.settings-fields-shell {
  margin-top: 18px;
  overflow-x: auto;
}

.settings-fields-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-fields-table th,
.settings-fields-table td {
  padding: 12px;
  border: 1px solid var(--border);
  text-align: left;
  background: #ffffff;
}

.settings-fields-table th {
  background: #fafbff;
  color: #596280;
  font-size: 0.82rem;
}

.settings-fields-table input,
.settings-fields-table select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
}

.settings-delete {
  width: 40px;
  height: 40px;
  border: 1px solid #f0c9cf;
  border-radius: 10px;
  background: #fff7f8;
  color: #cf5b69;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.settings-actions-right {
  display: flex;
  gap: 10px;
}

.settings-actions-end {
  justify-content: flex-end;
}

.notes-editor {
  padding: 24px 0 24px;
}

.notes-editor label {
  display: inline-block;
  margin-bottom: 10px;
  color: #2f3756;
  font-weight: 600;
}

.notes-muted {
  color: #7d86a7;
  font-weight: 500;
}

.notes-editor textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  resize: vertical;
  background: #ffffff;
}

.notes-editor textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.13);
}

.notes-actions {
  display: flex;
  gap: 12px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}

.contacts-panel {
  margin-top: 18px;
}

.contacts-table-shell {
  overflow-x: auto;
}

.contacts-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.contacts-table th,
.contacts-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  background: #ffffff;
}

.contacts-table th {
  color: #4c5476;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fafbff;
}

.contacts-table select,
.contacts-table input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #ffffff;
}

.contacts-phone-cell {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0;
}

.contacts-phone-cell select {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.contacts-phone-cell input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

.contacts-delete {
  width: 40px;
  height: 40px;
  border: 1px solid #f0c9cf;
  border-radius: 10px;
  background: #fff7f8;
  color: #cf5b69;
}

.add-contact-button {
  margin-top: 14px;
}

.align-start {
  justify-self: start;
}

.articles-panel {
  padding: 0;
  overflow: hidden;
}

.articles-header,
.new-article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.articles-table-shell {
  overflow-x: auto;
}

.articles-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.articles-table th,
.articles-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.articles-table th {
  color: #7881a3;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #fafbff;
}

.articles-table td {
  font-size: 0.92rem;
  background: #ffffff;
}

.articles-table tbody tr:hover td {
  background: #f8faff;
}

.empty-state-cell {
  padding: 28px 16px !important;
  color: #727b9d;
  text-align: center !important;
}

.new-article-panel {
  padding: 0 0 24px;
}

.article-form-grid,
.article-entry-grid,
.article-sales-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.article-entry-grid {
  padding: 24px 26px 0;
}

.article-left-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.article-media-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.article-image-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 184px;
  padding: 20px;
  border: 1px dashed #ccd3ec;
  border-radius: 14px;
  background: #ffffff;
  color: #7a82a3;
  text-align: center;
}

.article-image-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f5f7ff;
  color: #7078a0;
}

.article-image-text {
  font-size: 0.84rem;
}

.article-image-alt {
  font-size: 0.78rem;
}

.article-image-link {
  color: var(--primary-dark);
  font-size: 0.83rem;
  font-weight: 600;
}

.article-image-list {
  margin-top: 0;
}

.article-sales-section {
  margin-top: 18px;
  padding: 18px 26px 0;
  border-top: 1px solid var(--border);
}

.article-sales-section h2 {
  margin-bottom: 18px;
  font-size: 1rem;
}

.home-hero {
  overflow: hidden;
  padding: 26px 30px 0;
  background:
    radial-gradient(circle at 18px 18px, rgba(90, 124, 255, 0.1) 0, rgba(90, 124, 255, 0.1) 2px, transparent 2px) 0 0 / 82px 82px,
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.home-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  color: var(--primary-dark);
  font-weight: 700;
}

.home-profile p {
  margin-top: 6px;
  color: #647092;
}

.home-tabs {
  display: flex;
  gap: 24px;
  margin-top: 26px;
  border-bottom: 1px solid var(--border);
}

.home-tab {
  padding: 0 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #39415e;
  font-size: 1.02rem;
}

.home-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

.dashboard-panel {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}

.dashboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.dashboard-balance-bar {
  padding: 18px 26px;
}

.dashboard-balance-bar p {
  color: #687292;
}

.balance-track {
  height: 14px;
  margin-top: 14px;
  border-radius: 999px;
  background: #edf1fb;
  overflow: hidden;
}

.balance-track-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6a87ff 0%, #4bc8a3 100%);
}

.dashboard-aging-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.aging-card {
  padding: 18px 24px;
  border-right: 1px solid var(--border);
}

.aging-card:last-child {
  border-right: 0;
}

.aging-card span,
.aging-card small {
  display: block;
  color: #657091;
}

.aging-card span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aging-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

.aging-current span {
  color: var(--primary-dark);
}

.aging-late span {
  color: #f26936;
}

.dashboard-sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 22px;
  padding: 24px 26px 12px;
}

.dashboard-sales-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(36px, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 280px;
  padding: 14px 14px 0;
  border-right: 1px solid var(--border);
}

.dashboard-month-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dashboard-month-bars {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 210px;
}

.dashboard-bar {
  width: 10px;
  min-height: 0;
  border-radius: 999px 999px 4px 4px;
}

.sales-bar {
  background: #5d7cff;
}

.receipts-bar {
  background: #53c89e;
}

.dashboard-month-label {
  display: block;
  color: #66708f;
  text-align: center;
  font-size: 0.83rem;
}

.dashboard-month-label small {
  display: block;
  margin-top: 4px;
}

.dashboard-month-row.is-current-month .dashboard-month-label {
  color: #24325e;
  font-weight: 700;
}

.dashboard-sales-summary {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 8px 18px 0;
}

.dashboard-sales-summary span {
  color: #6880ff;
}

.dashboard-sales-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  color: #1f2744;
}

.dashboard-sales-summary div:nth-child(2) span {
  color: #57a62b;
}

.dashboard-sales-summary div:nth-child(3) span {
  color: #eb5656;
}

.dashboard-footnote {
  padding: 0 26px 24px;
  color: #76809f;
  font-size: 0.84rem;
}

.new-payment-panel,
.detail-panel {
  padding: 0 0 24px;
}

.new-payment-header,
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.payment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding: 24px 26px;
}

.payment-invoices-panel {
  margin: 0 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.payment-invoices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: #fafbff;
  border-bottom: 1px solid var(--border);
}

.payment-invoices-header p {
  margin-top: 6px;
  color: #6c7597;
}

.payments-empty-state {
  padding: 28px 20px;
  color: #6f7898;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding: 24px 26px 0;
}

.detail-card,
.detail-table-card,
.detail-summary-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

.detail-card {
  padding: 18px 20px;
}

.detail-label {
  display: block;
  margin-bottom: 10px;
  color: #6b7493;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.detail-card p + p {
  margin-top: 8px;
}

.detail-table-card {
  margin: 18px 26px 0;
  overflow: hidden;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.detail-table th {
  background: #fafbff;
  color: #7881a3;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}

.detail-summary-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 26px 0;
  padding: 20px;
}

.detail-summary-card div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-summary-card span {
  color: #6e7898;
  font-size: 0.84rem;
}

.detail-summary-card strong {
  font-size: 1.05rem;
}

.currency-input {
  display: grid;
  grid-template-columns: auto 1fr;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.currency-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--border-strong);
  background: #f6f8fe;
  color: #5d6688;
}

.currency-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-kicker {
  margin: 0 0 4px;
  color: #8b91ae;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.08rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #dce2f6;
  transition: background 0.2s ease;
}

.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(27, 33, 74, 0.16);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-track {
  background: rgba(90, 124, 255, 0.45);
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(24px);
}

.quote-status-preview {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.form-panel,
.table-panel {
  padding: 24px 26px;
}

.table-panel {
  margin-top: 18px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full-width {
  grid-column: 1 / -1;
}

.claim-documents-panel {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafbff;
  color: var(--text);
}

.claim-documents-section {
  margin-bottom: 14px;
}

.claim-documents-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #343f6c;
}

.claim-documents-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.claim-documents-section li {
  margin-bottom: 10px;
  color: #4c5476;
  font-size: 0.92rem;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4c5476;
}

.required {
  color: var(--danger);
  margin-left: 2px;
}

.field input,
.field select,
.field textarea,
.summary-inputs input,
.summary-inputs select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.summary-inputs input:focus,
.summary-inputs select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.13);
}

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

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.input-action {
  display: flex;
  align-items: stretch;
}

.input-action input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.client-name-field {
  position: relative;
}

.input-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  border: 1px solid var(--primary);
  border-left: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  background: var(--primary);
  color: #ffffff;
}

.autocomplete-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.14);
}

.autocomplete-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
  background: var(--background-light);
  outline: none;
}

.autocomplete-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.items-table-shell {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.items-table thead {
  background: #f5f7ff;
}

.items-table th,
.items-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.items-table th {
  color: #65709b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.items-table td {
  background: #ffffff;
}

.item-description {
  min-width: 240px;
}

.line-number {
  width: 40px;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
}

.item-name {
  min-width: 150px;
}

.item-row input,
.item-row select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #ffffff;
}

.amount-cell {
  text-align: right;
  font-weight: 700;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: #7c84a6;
}

.tax-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #f7f9ff;
  color: #596280;
  font-weight: 600;
}

.items-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.primary-button,
.ghost-button,
.secondary-button,
.link-button,
.icon-button {
  border-radius: 11px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-button:hover,
.ghost-button:hover,
.secondary-button:hover,
.link-button:hover,
.icon-button:hover,
.sidebar-button:hover,
.input-button:hover,
.row-action:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 11px 16px;
  border: 1px solid var(--primary);
  background: linear-gradient(180deg, #6486ff 0%, #4c73fb 100%);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(76, 115, 251, 0.2);
}

.ghost-button {
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
}

.danger-button {
  border-color: rgba(181, 50, 50, 0.28);
  background: rgba(181, 50, 50, 0.08);
  color: #8c2424;
}

.secondary-button {
  padding: 11px 14px;
  border: 1px solid rgba(90, 124, 255, 0.22);
  background: rgba(90, 124, 255, 0.08);
  color: var(--primary-dark);
}

.link-button {
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #596280;
}

.details-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.sav-info .summary-card {
  padding: 20px;
}

.sav-info .summary-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.sav-info .summary-card p {
  margin: 8px 0;
  color: #4c5476;
}

.sav-info .summary-card ul {
  margin: 0;
  padding-left: 18px;
  color: #4c5476;
}

.sav-info .summary-card li {
  margin-bottom: 8px;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  margin-right: 8px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--primary-dark);
  background: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.contact-button.whatsapp {
  border-color: #25d36633;
}

.contact-button.phone {
  border-color: #4a90e233;
}

.contact-button.email {
  border-color: #ffb82f33;
}

.notes-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f7ff 100%);
}

.summary-row,
.summary-total,
.print-totals div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.summary-input-row {
  grid-template-columns: 1fr auto auto;
}

.summary-input-row label {
  font-size: 0.93rem;
  color: #4a5377;
}

.summary-row strong,
.summary-total strong,
.print-totals strong {
  min-width: 74px;
  text-align: right;
}

.summary-inputs {
  display: flex;
  gap: 8px;
  width: min(180px, 100%);
}

.summary-inputs input {
  min-width: 0;
}

.summary-inputs select {
  width: 78px;
}

.summary-total {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed rgba(90, 124, 255, 0.38);
  border-radius: 14px;
  background: rgba(90, 124, 255, 0.04);
}

.upload-box input {
  width: 180px;
}

.upload-title {
  font-weight: 700;
}

.upload-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.85rem;
}

.upload-pill button {
  border: 0;
  background: transparent;
  color: #5f6580;
  padding: 0;
}

.bulk-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 29, 57, 0.58);
  backdrop-filter: blur(6px);
  z-index: 15;
}

.bulk-modal[hidden],
.toast[hidden],
.settings-modal[hidden],
.convert-modal[hidden] {
  display: none !important;
}

.bulk-dialog {
  width: min(680px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(12, 19, 47, 0.24);
}

.bulk-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.bulk-help {
  margin-top: 12px;
  color: var(--muted);
}

.bulk-dialog textarea {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  resize: vertical;
}

.bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(35, 39, 63, 0.95);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(13, 20, 45, 0.28);
}

.print-sheet {
  display: none;
  font-size: 0.8rem;
  line-height: 1.35;
}

.invoice-print-sheet {
  position: relative;
  padding: 22px 30px 26px;
  border: 1px solid #dfe3ee;
  background: #ffffff;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.35;
}

.invoice-print-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  gap: 19px;
  align-items: start;
  margin-top: 11px;
}

.invoice-print-title h1 {
  font-size: 1.76rem;
  letter-spacing: 0.01em;
}

.invoice-print-title > p {
  margin-top: 10px;
  color: #3a425f;
  font-size: 0.77rem;
  font-weight: 600;
}

.invoice-print-company {
  text-align: right;
  color: #363e5b;
}

.document-header-company {
  margin: 2px 0 1px;
  color: #313956;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.05;
}

.invoice-print-logo {
  display: block;
  width: 194px;
  margin: 0 0 8px auto;
}

.document-header-contact {
  display: grid;
  gap: 2px;
  color: #5c6580;
  font-size: 0.64rem;
  line-height: 1.3;
}

.document-header-contact p {
  margin: 0;
}

.invoice-header-contact {
  justify-items: end;
  margin: 0 0 7px auto;
}

.invoice-header-company {
  margin: 2px 0 4px auto;
}

.invoice-print-company strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.invoice-print-company p {
  margin-top: 4px;
  line-height: 1.32;
}

.invoice-print-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 192px;
  gap: 27px;
  margin-top: 37px;
}

.invoice-print-meta-left {
  display: grid;
  gap: 11px;
}

.invoice-print-meta-left div {
  display: grid;
  grid-template-columns: 106px 1fr;
  gap: 8px;
}

.invoice-print-meta-left span {
  color: #323a56;
}

.invoice-print-meta-left strong {
  font-weight: 500;
}

.invoice-print-meta-right {
  color: #313956;
}

.invoice-print-meta-right span {
  display: block;
  margin-bottom: 6px;
}

.invoice-print-meta-right strong {
  display: block;
  margin-bottom: 5px;
  color: #3467df;
}

.invoice-print-meta-right div {
  line-height: 1.32;
}

.invoice-print-table-shell {
  margin-top: 19px;
}

.invoice-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.invoice-print-table thead th {
  padding: 9px 10px;
  background: #585858;
  color: #ffffff;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.invoice-print-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e5ed;
  color: #3a425e;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
}

.invoice-print-table thead th:nth-child(1),
.invoice-print-table tbody td:nth-child(1) {
  width: 34px;
  text-align: center;
}

.invoice-print-table thead th:nth-child(2),
.invoice-print-table tbody td:nth-child(2) {
  width: auto;
  text-align: left;
}

.invoice-print-table tbody td:nth-child(2) {
  white-space: pre-line;
  line-height: 1.45;
}

.invoice-item-main {
  display: block;
  color: #3c445f;
}

.invoice-item-sub {
  display: block;
  margin-top: 3px;
  color: #8b92a8;
  font-size: 0.64rem;
}

.invoice-print-table thead th:nth-child(3),
.invoice-print-table tbody td:nth-child(3) {
  width: 74px;
  text-align: center;
}

.invoice-print-table thead th:nth-child(4),
.invoice-print-table tbody td:nth-child(4) {
  width: 88px;
  text-align: center;
}

.invoice-print-table thead th:nth-child(5),
.invoice-print-table tbody td:nth-child(5) {
  width: 96px;
  text-align: center;
}

.invoice-print-table tbody td:nth-child(3),
.invoice-print-table tbody td:nth-child(4),
.invoice-print-table tbody td:nth-child(5) {
  white-space: nowrap;
}

.invoice-print-summary {
  display: grid;
  gap: 10px;
  width: 228px;
  margin: 16px 0 0 auto;
  justify-self: end;
}

.invoice-print-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: #2f3855;
  align-items: center;
}

.invoice-print-summary strong {
  text-align: right;
  white-space: nowrap;
}

.invoice-print-notes {
  margin-top: 32px;
  color: #4a536f;
}

.invoice-print-notes span {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 24px;
  border-bottom: 2px solid #1e2540;
}

.print-brand {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 19px;
  border-bottom: 2px solid #1e2540;
  align-items: flex-start;
}

.print-header-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 3px;
  min-height: 150px;
}

.print-brand-logo {
  width: 158px;
  max-width: 100%;
}

.print-header-left h2 {
  margin: 24px 0 auto;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.print-meta {
  display: grid;
  gap: 10px;
  min-width: 200px;
}

.print-meta div,
.print-card,
.print-table-card {
  border: 1px solid #d8deef;
  border-radius: 14px;
  background: #ffffff;
}

.print-meta div {
  padding: 10px 11px;
}

.print-meta span,
.print-label {
  display: block;
  margin-bottom: 5px;
  color: #6b7493;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.print-grid,
.print-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.print-footer-grid {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.print-card {
  padding: 13px 14px;
}

.print-card p + .print-label {
  margin-top: 14px;
}

.print-address-block {
  margin-top: 6px;
  line-height: 1.4;
}

.print-address-line {
  margin-top: 4px;
  line-height: 1.4;
  font-weight: 400;
}

.inline-gap {
  margin-top: 14px;
}

.print-table-card {
  margin-top: 14px;
  overflow: hidden;
}

.print-notes-card {
  margin-top: 14px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
}

.print-table th,
.print-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e5e9f5;
  text-align: left;
}

.print-table th {
  font-size: 0.67rem;
}

.print-table td {
  font-size: 0.74rem;
}

.print-table thead {
  background: #f6f8fc;
}

.print-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.print-card.print-totals {
  width: 290px;
  justify-self: end;
  max-width: 100%;
}

.print-card.print-totals > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.print-card.print-totals strong {
  text-align: right;
  white-space: nowrap;
}

.print-grand-total {
  padding-top: 10px;
  border-top: 1px solid #d8deef;
  font-size: 0.86rem;
}

.print-totals-shell {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.document-print-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #d8deef;
  color: #5d657c;
  font-size: 0.62rem;
  line-height: 1.35;
  flex-shrink: 0;
}

.document-print-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.document-print-footer-text {
  text-align: center;
}

.document-print-footer-text p {
  margin: 2px 0;
}

.document-print-footer-qr {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 18px;
  background:
    radial-gradient(circle at top right, rgba(90, 124, 255, 0.16), transparent 24%),
    radial-gradient(circle at bottom left, rgba(37, 42, 72, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f8fd 0%, #eef1f9 100%);
}

.auth-card {
  width: min(560px, 100%);
  padding: 30px;
  border: 1px solid rgba(226, 229, 243, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 56px rgba(23, 32, 79, 0.14);
}

.auth-brand {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.auth-brand-title {
  margin: 0;
}

.auth-brand h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.auth-brand p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-logo {
  width: 144px;
  max-width: 100%;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.auth-help {
  margin: 2px 0 0;
  padding: 12px 14px;
  border: 1px solid #d9def3;
  border-radius: 14px;
  background: #f7f9ff;
  color: #5d678b;
  line-height: 1.55;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-actions .primary-button {
  min-width: 180px;
}

.user-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.user-action-button {
  padding: 8px 10px;
  min-width: 52px;
}

.topbar-settings {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(24, 33, 84, 0.04);
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-user-meta strong {
  font-size: 0.92rem;
}

.topbar-user-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.internal-panel {
  padding: 24px 26px 26px;
}

.internal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.internal-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f8fd;
}

.internal-tab {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5c6486;
  font-weight: 600;
}

.internal-tab.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(24, 33, 84, 0.08);
}

.internal-tab-panel {
  display: none;
}

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

.internal-form-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.internal-logo-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfcff;
}

.internal-logo-preview {
  display: block;
  width: 100%;
  max-width: 160px;
  margin: 0 auto;
  object-fit: contain;
}

.internal-upload-button {
  justify-content: center;
}

.internal-actions {
  margin-top: 18px;
}

.internal-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 20px;
}

.internal-crud-shell,
.internal-overview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.internal-card {
  padding: 20px 22px;
}

.internal-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.internal-card-actions {
  display: flex;
  justify-content: flex-end;
}

.internal-card-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.employee-management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
  gap: 20px;
}

.employee-directory-header,
.employee-form-header,
.employee-subsection-header,
.employee-inline-actions,
.employee-table-actions,
.employee-form-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.employee-directory-card,
.employee-editor-card {
  padding: 20px 22px;
}

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

.employee-form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfcff;
}

.employee-section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.employee-section-header h3 {
  margin: 0;
  font-size: 1rem;
}

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

.employee-toggle-row {
  width: fit-content;
}

.employee-conditional-panel {
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: #ffffff;
}

.employee-repeatable-list,
.employee-documents-list,
.employee-audit-list {
  display: grid;
  gap: 12px;
}

.employee-repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.employee-document-item,
.employee-audit-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.employee-document-item.is-pending {
  border-style: dashed;
  background: #fff8ec;
}

.employee-document-item strong,
.employee-audit-item strong {
  display: block;
}

.employee-document-item span,
.employee-audit-item span {
  display: block;
  margin-top: 4px;
  color: #5c6486;
  font-size: 0.9rem;
}

.employee-row-active td {
  background: #f3f7ff;
}

.expense-row-active td {
  background: #f3f7ff;
}

.employee-editor-panel,
.expense-editor-panel {
  padding: 0;
  overflow: hidden;
}

.employee-editor-header,
.expense-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.employee-editor-body,
.expense-editor-body {
  padding: 24px 26px 0;
}

.employee-editor-actions-shell,
.expense-editor-actions-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 26px 26px;
}

.internal-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.table-icon-button {
  width: 36px;
  height: 36px;
}

.danger-icon-button {
  color: #cf5b69;
  border-color: #f0c9cf;
  background: #fff7f8;
}

.danger-icon-button:hover {
  color: #ad3140;
  border-color: #e7b1b9;
  background: #fff0f2;
}

.employee-name-button,
.expense-name-button {
  text-align: left;
  font-weight: 700;
}

.expense-notes-cell {
  max-width: 280px;
  white-space: normal !important;
  color: #5c6486;
}

.status-badge.status-active {
  background: #e9f9ef;
  color: #2f9b59;
}

.status-badge.status-upcoming {
  background: #edf3ff;
  color: #3567df;
}

.status-badge.status-ended {
  background: #fff0f0;
  color: #b23a3a;
}

.status-badge.status-pending {
  background: #eef1f6;
  color: #5b647d;
}

.settings-dialog {
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.settings-access-panel {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.access-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text);
}

.settings-user-form {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfcff;
}

.settings-access-panel .contacts-table-shell {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

body.simple-view .optional-field {
  display: none;
}

body.simple-view .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.simple-view .details-layout {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 90px 1fr;
  }

  .brand > div,
  .nav-item,
  .sidebar-button {
    font-size: 0;
  }

  .brand {
    justify-content: center;
  }

  .brand-mark {
    margin: 0 auto;
  }

  .nav-item {
    justify-content: center;
    padding: 11px 8px;
  }

  .nav-icon {
    margin: 0;
  }

  .nav-submenu,
  .nav-caret,
  .nav-lock {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .auth-card {
    padding: 22px;
  }

  .auth-brand {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .auth-logo {
    margin: 0 auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;
    width: min(320px, 84vw);
    gap: 24px;
    overflow-y: auto;
    box-shadow: 0 26px 54px rgba(18, 24, 48, 0.34);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: block;
    border: 0;
    background: rgba(21, 27, 52, 0.42);
    backdrop-filter: blur(2px);
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-mark {
    margin: 0;
  }

  .sidebar .nav-item {
    justify-content: flex-start;
    padding: 11px 12px;
    font-size: 0.95rem;
  }

  .sidebar .sidebar-button {
    font-size: 0.95rem;
  }

  .sidebar .nav-caret,
  .sidebar .nav-lock {
    display: inline-flex !important;
  }

  .sidebar .nav-submenu[hidden] {
    display: none !important;
  }

  .sidebar .nav-submenu:not([hidden]) {
    display: flex !important;
  }

  .mobile-menu-button {
    display: flex;
  }

  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar-settings,
  .topbar-user {
    flex-wrap: wrap;
  }

  .page-header,
  .form-panel,
  .table-panel {
    padding: 18px;
  }

  .page-header,
  .topbar,
  .toolbar-actions,
  .quotes-header,
  .quotes-header-actions,
  .clients-header,
  .invoices-header,
  .payments-header,
  .articles-header,
  .new-article-header,
  .new-payment-header,
  .detail-header,
  .custom-fields-header,
  .payment-invoices-header,
  .settings-actions,
  .settings-actions-right,
  .items-actions,
  .bulk-actions,
  .smart-device-header {
    flex-wrap: wrap;
  }

  .form-grid,
  .client-form-grid,
  .article-form-grid,
  .article-entry-grid,
  .article-sales-grid,
  .payment-form-grid,
  .address-grid,
  .custom-fields-grid,
  .convert-grid,
  .convert-summary,
  .convert-preview,
  .dashboard-aging-grid,
  .dashboard-sales-layout,
  .details-layout,
  .detail-grid,
  .detail-summary-card,
  .employee-management-layout,
  .employee-section-grid,
  .employee-repeatable-row,
  .internal-form-grid,
  .internal-fields-grid,
  .internal-split,
  .print-grid,
  .print-footer-grid {
    grid-template-columns: 1fr;
  }

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

  .contact-row,
  .phone-row {
    flex-direction: column;
  }

  .address-fields {
    grid-template-columns: 1fr;
  }

  .contacts-phone-cell {
    grid-template-columns: 1fr;
  }

  .contacts-phone-cell select {
    border-radius: 9px 9px 0 0;
  }

  .contacts-phone-cell input {
    border-radius: 0 0 9px 9px;
    border-left: 1px solid var(--border-strong);
    border-top: 0;
  }

  .address-label-spacer {
    display: none;
  }

  .inline-phone {
    grid-template-columns: 1fr;
  }

  .inline-phone select {
    border-radius: 10px 10px 0 0;
  }

  .inline-phone input {
    border-radius: 0 0 10px 10px;
    border-left: 1px solid var(--border-strong);
    border-top: 0;
  }

  .phone-input {
    width: 100%;
  }

  .dashboard-sales-chart {
    border-right: 0;
    padding-right: 0;
  }

  .employee-document-item,
  .employee-audit-item,
  .employee-directory-header,
  .employee-form-header,
  .employee-editor-header,
  .expense-editor-header,
  .employee-subsection-header,
  .employee-inline-actions,
  .employee-table-actions,
  .employee-form-actions,
  .employee-editor-actions-shell,
  .expense-editor-actions-shell,
  .internal-table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aging-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .aging-card:last-child {
    border-bottom: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 30px;
  }

  body {
    background: #ffffff;
    margin: 0;
  }

  .app-shell,
  .bulk-modal,
  .toast,
  .convert-modal {
    display: none !important;
  }

  .print-sheet {
    display: block;
    color: #151a2e;
  }

  #printSheet,
  #invoicePrintSheet,
  #paymentPrintSheet {
    display: flex;
    flex-direction: column;
    min-height: calc(297mm - 60px);
    box-sizing: border-box;
  }

  .invoice-print-sheet,
  .invoice-print-sheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
