:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #eef3f6;
  --ink: #17212b;
  --muted: #647382;
  --line: #d9e1e8;
  --accent: #0d7fbf;
  --accent-strong: #075f91;
  --accent-soft: #e5f4fb;
  --danger: #b33a3a;
  --warning: #a56611;
  --success: #287246;
  --shadow: 0 14px 36px rgba(23, 33, 43, 0.12);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

.app-shell,
.main,
.workspace {
  max-width: 100%;
  min-width: 0;
}

.workspace > *,
.panel,
.page-hero,
.dashboard-hero,
.clients-hero,
.settings-hero,
.accountant-hero {
  max-width: 100%;
}

.table-wrap,
.quote-items-editor,
.sale-items-editor,
.invoice-tax-items {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.modal .modal-panel,
.modal.modal-wide .modal-panel,
.modal.modal-document-wide .modal-panel {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100dvh - 32px);
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

select {
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #17212b 50%),
    linear-gradient(135deg, #17212b 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px !important;
}

select:disabled {
  background-image:
    linear-gradient(45deg, transparent 50%, #8795a1 50%),
    linear-gradient(135deg, #8795a1 50%, transparent 50%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #102536;
  color: #f8fbfc;
  display: flex;
  flex-direction: column;
  padding: 18px 10px;
  gap: 24px;
  height: 100vh;
  left: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  transition: width 180ms ease, padding 180ms ease, box-shadow 180ms ease;
  width: 72px;
  z-index: 20;
}

.sidebar:hover,
.sidebar:focus-within,
.sidebar.sidebar-open {
  box-shadow: 16px 0 38px rgba(16, 37, 54, 0.22);
  padding: 22px 16px;
  width: 280px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
  min-width: 248px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  padding: 4px;
  transition: width 180ms ease, height 180ms ease;
}

.sidebar:hover .brand-logo,
.sidebar:focus-within .brand-logo,
.sidebar.sidebar-open .brand-logo {
  width: 98px;
  height: 50px;
}

.brand strong,
.brand span {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.sidebar:hover .brand strong,
.sidebar:hover .brand span,
.sidebar:focus-within .brand strong,
.sidebar:focus-within .brand span,
.sidebar.sidebar-open .brand strong,
.sidebar.sidebar-open .brand span {
  opacity: 1;
  transform: translateX(0);
}

.brand span,
.sidebar-footer {
  color: #b9c6cd;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
  min-width: 248px;
}

.nav-item {
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  display: flex;
  gap: 12px;
  min-height: 44px;
  overflow: hidden;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.nav-item::before {
  background: #7fa8bf;
  border-radius: 999px;
  content: "";
  flex: 0 0 8px;
  height: 8px;
  opacity: 0.75;
}

.nav-item[hidden] {
  display: none;
}

.sidebar:hover .nav-item,
.sidebar:focus-within .nav-item,
.sidebar.sidebar-open .nav-item {
  color: #dce7eb;
}

.nav-item:hover,
.nav-item.active {
  background: #1d3a50;
}

.sidebar:hover .nav-item:hover,
.sidebar:hover .nav-item.active,
.sidebar:focus-within .nav-item:hover,
.sidebar:focus-within .nav-item.active,
.sidebar.sidebar-open .nav-item:hover,
.sidebar.sidebar-open .nav-item.active {
  color: #ffffff;
}

.nav-item.active::before {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  min-width: 248px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.sidebar:hover .sidebar-footer,
.sidebar:focus-within .sidebar-footer,
.sidebar.sidebar-open .sidebar-footer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.save-status {
  border: 1px solid #2d536c;
  border-radius: 8px;
  color: #dce7eb;
  display: block;
  font-size: 12px;
  padding: 10px 12px;
  text-align: center;
}

.admin-logout-button,
.admin-logout-top,
.portal-logout-button {
  border-color: rgba(218, 69, 69, 0.42);
  color: #b92828;
}

.sidebar .admin-logout-button {
  color: #ffd7d7;
}

.admin-logout-button:hover,
.admin-logout-top:hover,
.portal-logout-button:hover {
  background: #a91f2b;
  border-color: #a91f2b;
  color: #ffffff;
}

.portal-mode .admin-logout-top {
  display: none;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar-logo {
  display: block;
  width: 220px;
  max-width: 42vw;
  height: 54px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 0;
}

.topbar #viewTitle {
  display: none;
}

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

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

h1 {
  font-size: 29px;
  line-height: 1.15;
  margin-bottom: 0;
}

h2 {
  margin-bottom: 0;
}

h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(420px, 45vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 11px 0;
  background: transparent;
}

.workspace {
  padding: 26px 28px 42px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(13, 127, 191, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #0d7fbf, #102536);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(16, 37, 54, 0.16);
}

.page-hero h2,
.page-hero h3 {
  margin: 2px 0 6px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.15;
}

.page-hero .eyebrow {
  margin-bottom: 5px;
  color: #9ce4f7;
}

.page-hero p:not(.eyebrow) {
  margin-bottom: 0;
  color: #d7edf7;
  font-size: 14px;
}

.stats-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
}

.compact-stats .stat-card {
  padding: 14px;
}

.compact-stats .stat-card strong {
  font-size: 24px;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  min-height: 150px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(13, 127, 191, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 127, 191, 0.9), rgba(16, 37, 54, 0.98)),
    #102536;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(16, 37, 54, 0.18);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-hero-copy,
.dashboard-hero-side {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-hero-copy h2 {
  max-width: 780px;
  margin: 2px 0 6px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.15;
}

.dashboard-hero-copy p:not(.eyebrow) {
  max-width: 660px;
  margin: 0;
  color: #d7edf7;
  font-size: 14px;
}

.dashboard-hero .eyebrow {
  color: #9ce4f7;
}

.dashboard-hero-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 7px;
  flex: 0 1 560px;
  width: auto;
  max-width: 560px;
  margin-left: auto;
}

.dashboard-hero-side span {
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #d7edf7;
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.dashboard-hero-side strong {
  color: #ffffff;
  font-size: 16px;
}

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

.dashboard-privacy-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -6px 0 10px;
  color: #52687a;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-privacy-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(13, 127, 191, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: #496275;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dashboard-privacy-button:hover {
  border-color: #0d7fbf;
  color: #0d7fbf;
  transform: translateY(-1px);
}

.dashboard-privacy-button.is-visible {
  background: #eaf8f2;
  border-color: rgba(37, 191, 131, 0.4);
  color: #17855d;
}

.privacy-eye-icon {
  position: relative;
  width: 20px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 75% 15%;
  transform: rotate(45deg);
}

.privacy-eye-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}

.financial-privacy strong,
.financial-privacy b,
.financial-privacy small,
.financial-privacy .pipeline-track,
.financial-privacy .annual-chart {
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.financial-privacy.is-concealed strong,
.financial-privacy.is-concealed b,
.financial-privacy.is-concealed small,
.financial-privacy.is-concealed .pipeline-track,
.financial-privacy.is-concealed .annual-chart {
  filter: blur(8px);
  opacity: 0.28;
  user-select: none;
  pointer-events: none;
}

.dashboard-metrics .stat-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border: 1px solid rgba(13, 127, 191, 0.16);
  padding: 18px;
  color: var(--ink);
  box-shadow: 0 16px 38px rgba(15, 43, 61, 0.12);
}

.dashboard-metrics .stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 105px;
  height: 105px;
  border: 16px solid rgba(13, 127, 191, 0.08);
  border-radius: 999px;
}

.dashboard-metrics .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
}

.dashboard-metrics .stat-card span,
.dashboard-metrics .stat-card small {
  position: relative;
  z-index: 1;
  color: #42566b;
}

.dashboard-metrics .stat-card strong {
  position: relative;
  z-index: 1;
  margin: 12px 0 10px;
  color: #0b2032;
  overflow-wrap: anywhere;
}

.dashboard-metrics .stat-card small {
  display: block;
  font-weight: 700;
}

.dashboard-financial-stat {
  min-width: min(100%, 250px);
}

.dashboard-financial-breakdown {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
}

.dashboard-financial-breakdown small {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.dashboard-financial-breakdown b {
  color: #18374d;
  white-space: nowrap;
}

.dashboard-financial-detail {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(15, 43, 61, 0.1);
  font-size: 11px;
}

.metric-cyan {
  background: linear-gradient(135deg, rgba(18, 183, 200, 0.18), #ffffff 58%);
}

.metric-cyan::before {
  background: #12b7c8;
}

.metric-pink {
  background: linear-gradient(135deg, rgba(244, 90, 163, 0.18), #ffffff 58%);
}

.metric-pink::before {
  background: #f45aa3;
}

.metric-green {
  background: linear-gradient(135deg, rgba(37, 191, 131, 0.18), #ffffff 58%);
}

.metric-green::before {
  background: #25bf83;
}

.metric-violet {
  background: linear-gradient(135deg, rgba(141, 105, 242, 0.18), #ffffff 58%);
}

.metric-violet::before {
  background: #8d69f2;
}

.metric-amber {
  background: linear-gradient(135deg, rgba(242, 173, 54, 0.22), #ffffff 58%);
}

.metric-amber::before {
  background: #f2ad36;
}

.metric-blue {
  background: linear-gradient(135deg, rgba(37, 163, 223, 0.18), #ffffff 58%);
}

.metric-blue::before {
  background: #25a3df;
}

.modern-dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
}

.annual-comparison-band {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(13, 127, 191, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(18, 37, 54, 0.08);
}

.accountant-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.accountant-year-select {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: #d7edf7;
  font-size: 12px;
  font-weight: 800;
}

.accountant-year-select select {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
}

.accountant-alert {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #f1d39d;
  border-radius: 8px;
  background: #fff8e8;
  color: #76500e;
  font-size: 13px;
}

.accountant-simple-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  margin-bottom: 14px;
}

.accountant-save-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #08679a, #0d7fbf);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(8, 103, 154, 0.2);
}

.accountant-save-card span,
.accountant-save-card small {
  color: rgba(255, 255, 255, 0.86);
}

.accountant-save-card strong {
  font-size: 34px;
  line-height: 1.1;
}

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

.accountant-simple-item {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.accountant-simple-item > div {
  display: grid;
  gap: 4px;
}

.accountant-simple-item span {
  color: var(--muted);
  font-size: 12px;
}

.accountant-simple-item b {
  color: var(--accent-strong);
  font-size: 20px;
}

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

.accountant-threshold-status {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
}

.accountant-threshold-status.success {
  background: #eaf7ef;
  color: #17653a;
}

.accountant-threshold-status.warning {
  background: #fff3df;
  color: #80500a;
}

.accountant-threshold-status span {
  font-size: 12px;
}

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

.accountant-metrics .stat-card {
  min-height: 126px;
}

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

.accountant-summary-panel {
  min-width: 0;
}

.accountant-grand-total {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 20px;
}

.accountant-calculation {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.accountant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.accountant-row > div {
  display: grid;
  gap: 3px;
}

.accountant-row span {
  color: var(--muted);
  font-size: 12px;
}

.accountant-row b {
  flex: 0 0 auto;
  font-size: 16px;
}

.accountant-stamp-panel,
.accountant-settings-panel {
  margin-bottom: 14px;
}

.accountant-quarter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.accountant-quarter-grid > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid #dcecf4;
  border-radius: 8px;
  background: #f7fbfd;
}

.accountant-quarter-grid span,
.accountant-quarter-grid small {
  color: var(--muted);
}

.accountant-quarter-grid strong {
  font-size: 20px;
}

.annual-comparison-header,
.annual-summary,
.annual-legend {
  display: flex;
  align-items: center;
}

.annual-comparison-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.annual-comparison-header h2 {
  margin: 2px 0 0;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 800;
}

.year-selector select {
  min-width: 104px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.annual-summary {
  gap: 10px;
  margin-bottom: 18px;
}

.annual-summary-item {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-left: 4px solid #25a3df;
  background: #f6f9fb;
}

.annual-summary-item.amber {
  border-color: #f2ad36;
}

.annual-summary-item.green {
  border-color: #25bf83;
}

.annual-summary-item span,
.annual-summary-item strong,
.annual-summary-item small {
  display: block;
}

.annual-summary-item span,
.annual-summary-item small {
  color: var(--muted);
  font-weight: 700;
}

.annual-summary-item strong {
  margin: 5px 0;
  font-size: 21px;
}

.annual-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(34px, 1fr));
  gap: 8px;
  min-height: 245px;
  padding: 18px 10px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(13, 127, 191, 0.06) 1px, transparent 1px);
  background-size: 100% 25%;
}

.annual-chart-month {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.annual-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  min-height: 190px;
}

.annual-bars i {
  display: block;
  width: min(10px, 28%);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
}

.annual-bars .invoice,
.annual-legend .invoice {
  background: #f2ad36;
}

.annual-bars .sale,
.annual-legend .sale {
  background: #25a3df;
}

.annual-bars .margin,
.annual-legend .margin {
  background: #25bf83;
}

.annual-chart-month > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.annual-legend {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.annual-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.annual-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.modern-dashboard-grid .dashboard-panel:last-child {
  grid-column: 1 / -1;
}

.dashboard-panel {
  border-color: rgba(13, 127, 191, 0.14);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(18, 183, 200, 0.42), rgba(244, 90, 163, 0.25), rgba(242, 173, 54, 0.34)) border-box;
  box-shadow: 0 18px 45px rgba(18, 37, 54, 0.08);
}

.priority-panel {
  min-height: 440px;
}

.pipeline-list {
  display: grid;
  gap: 18px;
  padding-top: 6px;
}

.pipeline-row {
  display: grid;
  gap: 10px;
}

.pipeline-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pipeline-row strong {
  font-size: 16px;
}

.pipeline-row span {
  color: var(--muted);
  font-weight: 700;
}

.pipeline-track {
  overflow: hidden;
  height: 13px;
  border-radius: 999px;
  background: #e8eef3;
}

.pipeline-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.pipeline-track .violet {
  background: linear-gradient(90deg, #4a35a6, #8d69f2);
}

.pipeline-track .amber {
  background: linear-gradient(90deg, #a15c05, #f2ad36);
}

.pipeline-track .green {
  background: linear-gradient(90deg, #116d4a, #25bf83);
}

.futuristic-record-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.futuristic-record-grid .record-card {
  border-color: rgba(13, 127, 191, 0.14);
  background:
    linear-gradient(135deg, rgba(248, 251, 253, 0.96), rgba(255, 255, 255, 0.96)),
    linear-gradient(135deg, rgba(18, 183, 200, 0.14), transparent);
}

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

.client-type-card {
  border-radius: 8px;
  padding: 16px;
  color: #ffffff;
  min-height: 170px;
}

.client-type-card h3 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 22px;
}

.client-type-card div {
  display: grid;
  gap: 9px;
}

.client-type-card span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.client-type-card strong {
  color: #ffffff;
  font-size: 20px;
}

.client-type-blue {
  background: linear-gradient(135deg, #0d548f, #25a3df);
}

.client-type-amber {
  background: linear-gradient(135deg, #a15c05, #f2ad36);
}

.support-command {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 26px;
  border: 1px solid rgba(244, 90, 163, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 20%, rgba(244, 90, 163, 0.25), transparent 28%),
    radial-gradient(circle at 16% 10%, rgba(13, 127, 191, 0.28), transparent 28%),
    linear-gradient(135deg, #101827, #26314d);
  color: #ffffff;
  box-shadow: 0 20px 55px rgba(16, 24, 39, 0.18);
}

.support-command h2 {
  color: #ffffff;
  font-size: 38px;
  margin-bottom: 6px;
}

.support-command p:not(.eyebrow) {
  color: #dbeafe;
  margin: 0;
}

.support-command .eyebrow {
  color: #ffb7d7;
}

.support-metrics {
  margin-bottom: 16px;
}

.support-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.support-lane {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 250px;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(18, 37, 54, 0.07);
}

.support-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.support-lane-header span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eef8fb;
  color: var(--accent-strong);
  font-weight: 900;
}

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

.support-ticket-card {
  display: grid;
  gap: 10px;
  border: 1px solid #e2edf3;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbfd, #ffffff);
  padding: 12px;
}

.support-ticket-card strong,
.support-ticket-card span {
  display: block;
  overflow-wrap: anywhere;
}

.support-ticket-card span {
  color: var(--muted);
  margin-top: 4px;
}

.support-ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-ticket-meta small {
  color: var(--muted);
  font-weight: 800;
}

.portal-repair-list {
  display: grid;
  gap: 14px;
}

.portal-repair-card {
  border: 1px solid #d7e2e8;
  border-radius: 8px;
  padding: 16px;
}

.portal-repair-heading,
.portal-repair-meta {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.portal-repair-heading strong,
.portal-repair-heading span,
.portal-repair-meta strong,
.portal-repair-meta span {
  display: block;
}

.portal-repair-heading span,
.portal-repair-meta span {
  color: #60727e;
  font-size: 12px;
}

.repair-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(76px, 1fr));
  margin: 18px 0;
  overflow-x: auto;
}

.repair-progress > div {
  color: #8798a3;
  min-width: 76px;
  position: relative;
  text-align: center;
}

.repair-progress > div::before {
  background: #d7e2e8;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 7px;
}

.repair-progress span {
  background: #d7e2e8;
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: block;
  height: 16px;
  margin: 0 auto 7px;
  position: relative;
  width: 16px;
  z-index: 1;
}

.repair-progress .complete {
  color: #13704a;
  font-weight: 700;
}

.repair-progress .complete::before,
.repair-progress .complete span {
  background: #27a66b;
}

.portal-repair-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.support-table-panel {
  margin-top: 4px;
}

.panel,
.stat-card,
.record-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.03);
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.panel {
  padding: 18px;
}

.integration-panel {
  margin-bottom: 14px;
}

.panel-header,
.record-header,
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-toolbar {
  margin-bottom: 14px;
}

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

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.view-toggle button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
}

.view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.invoice-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.invoice-status-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-status-filter button span {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 6px;
  background: #edf2f5;
  color: #42515d;
  text-align: center;
}

.invoice-status-filter .filter-paid.active {
  background: #dff4e6;
  color: #17663a;
}

.invoice-status-filter .filter-unpaid.active {
  background: #fff1bd;
  color: #795600;
}

.invoice-status-filter .filter-all.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.inventory-availability-filter .filter-available.active {
  background: #dff4e6;
  color: #17663a;
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #ffffff;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.icon-record-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.icon-record-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
}

.icon-record-card .record-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.record-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid #c9e7f4;
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  flex: 0 0 42px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.icon-record-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.card-actions {
  margin-top: auto;
}

.group-list {
  display: grid;
  gap: 14px;
}

.clients-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background:
    radial-gradient(circle at 82% 22%, rgba(18, 183, 200, 0.22), transparent 28%),
    linear-gradient(135deg, #0b1d2b, #123956 58%, #17212b);
  color: #ffffff;
  border: 1px solid rgba(18, 183, 200, 0.22);
  border-radius: 8px;
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: 0 20px 55px rgba(16, 37, 54, 0.18);
}

.clients-hero .muted {
  color: #d7edf7;
}

.clients-hero .eyebrow {
  color: #8fe9dc;
}

.clients-hero h2 {
  color: #ffffff;
  font-size: 38px;
  margin-bottom: 6px;
}

.clients-hero p:last-child {
  margin-bottom: 0;
}

.client-list-page {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 16px;
}

.client-name-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  width: 100%;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98)),
    linear-gradient(135deg, rgba(18, 183, 200, 0.16), rgba(244, 90, 163, 0.1));
  color: var(--ink);
  min-height: 190px;
  padding: 20px;
  text-align: left;
  align-content: space-between;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.client-name-card:hover,
.client-name-card:focus {
  border-color: rgba(18, 183, 200, 0.55);
  box-shadow: 0 20px 42px rgba(23, 33, 43, 0.12);
  outline: 0;
  transform: translateY(-3px);
}

.client-name-card h3 {
  font-size: 20px;
  margin: 0;
}

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

.client-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.client-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, #0d7fbf, #13bfab);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.client-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-card-chips small {
  border-radius: 999px;
  background: #edf7fb;
  color: #0d548f;
  padding: 6px 9px;
  font-weight: 800;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e7eef4;
  padding-top: 12px;
}

.client-card-footer span {
  color: var(--muted);
  font-size: 13px;
}

.client-card-footer strong {
  color: var(--accent);
  font-weight: 700;
}

.client-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.client-detail-card {
  display: grid;
  gap: 18px;
}

.client-command-hero {
  background:
    radial-gradient(circle at 86% 12%, rgba(244, 90, 163, 0.18), transparent 24%),
    radial-gradient(circle at 18% 0%, rgba(18, 183, 200, 0.2), transparent 26%),
    linear-gradient(135deg, #0b2032, #113c56 58%, #f7fbff 58%);
  border: 1px solid rgba(18, 183, 200, 0.22);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  box-shadow: 0 22px 54px rgba(18, 37, 54, 0.16);
  overflow: hidden;
}

.client-command-main {
  align-items: flex-start;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  max-width: 760px;
}

.client-command-main .eyebrow,
.client-command-main h3,
.client-command-main p {
  color: #ffffff;
}

.client-command-main h3 {
  font-size: 34px;
  line-height: 1.05;
  margin: 2px 0 6px;
}

.client-command-main p {
  margin: 0;
  opacity: 0.82;
}

.client-command-avatar {
  background: linear-gradient(135deg, #12b7c8, #f45aa3);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  color: #ffffff;
  display: grid;
  font-size: 30px;
  font-weight: 900;
  height: 70px;
  place-items: center;
  width: 70px;
}

.client-command-actions {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  max-width: 430px;
}

.client-command-actions .secondary-button {
  background: rgba(255, 255, 255, 0.92);
}

.client-command-actions .danger-button {
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.16);
}

.client-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  grid-column: 2;
}

.client-hero-tags .badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.client-card h3,
.grouped-panel h3 {
  font-size: 26px;
  margin-bottom: 5px;
}

.client-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.client-command-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.client-metric {
  border: 1px solid rgba(13, 127, 191, 0.13);
  background: linear-gradient(135deg, #ffffff, #f5fbfd);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 104px;
  overflow: hidden;
  padding: 16px;
  position: relative;
  box-shadow: 0 12px 28px rgba(18, 37, 54, 0.07);
}

.client-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
}

.client-metric span,
.client-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.client-metric.blue::before,
.client-timeline-item.blue > span {
  background: #0d7fbf;
}

.client-metric.purple::before,
.client-timeline-item.purple > span {
  background: #7c3aed;
}

.client-metric.amber::before,
.client-timeline-item.amber > span {
  background: #f59e0b;
}

.client-metric.success::before,
.client-timeline-item.success > span {
  background: #159947;
}

.client-metric.danger::before,
.client-timeline-item.danger > span {
  background: #dc2626;
}

.client-intelligence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.client-spend-panel {
  padding: 18px;
  border: 1px solid rgba(13, 127, 191, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(18, 37, 54, 0.07);
}

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

.client-spend-header h4 {
  margin: 0;
  font-size: 20px;
}

.client-spend-total {
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 10px 13px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0d7fbf, #102536);
  color: #ffffff;
  text-align: right;
}

.client-spend-total span {
  color: #d7edf7;
  font-size: 11px;
  font-weight: 700;
}

.client-spend-total small {
  color: #d7edf7;
  font-size: 11px;
}

.client-spend-total strong {
  font-size: 20px;
}

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

.client-spend-year {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dcecf4;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbfd, #eef8fb);
}

.client-spend-year-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.client-spend-year-title strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.client-spend-year-title span,
.client-spend-breakdown span {
  color: var(--muted);
  font-size: 12px;
}

.client-spend-year > b {
  color: var(--ink);
  font-size: 24px;
}

.client-spend-year > small {
  color: var(--muted);
  font-size: 11px;
}

.client-priority {
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.client-priority.danger {
  background: #fde2e2;
  color: #a52020;
}

.client-priority.amber {
  background: #fff0bd;
  color: #765500;
}

.client-priority.blue {
  background: #e5f2f8;
  color: #176185;
}

.client-spend-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid #dcecf4;
}

.client-spend-breakdown span {
  display: grid;
  gap: 3px;
}

.client-spend-breakdown strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.client-spend-empty {
  margin: 0;
}

.client-intel-panel {
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(18, 37, 54, 0.07);
  padding: 18px;
}

.client-intel-panel.accent {
  background:
    linear-gradient(135deg, rgba(18, 183, 200, 0.1), rgba(244, 90, 163, 0.08)),
    #ffffff;
}

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

.client-signal {
  background: #f7fbfd;
  border: 1px solid #e0edf5;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 11px;
}

.client-signal span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-signal strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.client-timeline-item {
  align-items: flex-start;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
}

.client-timeline-item > span {
  border-radius: 999px;
  height: 12px;
  margin-top: 4px;
  width: 12px;
}

.client-timeline-item strong {
  display: block;
  font-size: 14px;
}

.client-timeline-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.client-section {
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  margin: 0;
  box-shadow: 0 12px 30px rgba(18, 37, 54, 0.06);
}

.client-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 37, 54, 0.05);
  padding: 10px;
}

.client-overview-primary {
  border-color: rgba(13, 127, 191, 0.24);
  box-shadow: 0 14px 34px rgba(18, 37, 54, 0.08);
}

.client-section-navigation {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(18, 37, 54, 0.06);
}

.client-section-navigation h4 {
  font-size: 18px;
  margin: 0;
}

.client-section-selectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-section-selector {
  border: 1px solid #dce8ef;
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 10px;
}

.client-section-selector > span {
  font-size: 12px;
  font-weight: 900;
}

.client-section-selector select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 38px;
  padding: 7px 9px;
  width: 100%;
}

.client-section-selector.commercial {
  background: #eef7fc;
}

.client-section-selector.commercial > span {
  color: #075f91;
}

.client-section-selector.technical {
  background: #eef9f5;
}

.client-section-selector.technical > span {
  color: #176b54;
}

.client-section-selector.management {
  background: #fff8e9;
}

.client-section-selector.management > span {
  color: #8a5a0a;
}

.client-section-tab {
  border: 1px solid rgba(13, 127, 191, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 13px;
  font-weight: 700;
}

.client-section-tab:hover,
.client-section-tab.active {
  background: linear-gradient(135deg, #0d7fbf, #13bfab);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(13, 127, 191, 0.18);
}

.client-active-section {
  display: grid;
  gap: 14px;
}

.credential-print-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.credential-print-options label {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #dce8ef;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 11px;
}

.credential-print-options input {
  accent-color: var(--accent);
  margin-top: 2px;
}

.credential-print-options span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.credential-print-options small {
  color: var(--muted);
  grid-column: 2;
  overflow-wrap: anywhere;
}

.modal-credential-options {
  grid-template-columns: 1fr;
}

.modal-credential-options label {
  min-height: 68px;
}

.client-modern-panel {
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(18, 37, 54, 0.06);
}

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

.client-overview-header h4 {
  font-size: 20px;
  margin: 0;
}

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

.client-info-tile {
  border: 1px solid #dcecf4;
  background: linear-gradient(135deg, #f8fbfd, #eef8fb);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.client-info-tile span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.machine-center {
  display: grid;
  gap: 14px;
}

.machine-list-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  align-items: start;
}

.machine-list {
  border: 1px solid #dce8ef;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.machine-list-item {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e4eef5;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.machine-list-item:last-child {
  border-bottom: 0;
}

.machine-list-item:hover,
.machine-list-item.active {
  background: #eef7fc;
}

.machine-list-item strong {
  display: block;
  font-size: 14px;
}

.machine-list-item small,
.machine-list-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.machine-detail-slot {
  min-width: 0;
}

.machine-grid {
  display: grid;
  gap: 14px;
}

.machine-card {
  background: linear-gradient(135deg, #ffffff, #f8fbfd);
  border: 1px solid #d9e8f2;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.machine-type {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.machine-card h5 {
  font-size: 22px;
  margin: 4px 0;
}

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

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

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

.machine-spec {
  background: #ffffff;
  border: 1px solid #e4eef5;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
}

.machine-spec span,
.machine-linked-row span,
.machine-linked-row small {
  color: var(--muted);
  font-size: 12px;
}

.machine-spec strong,
.machine-linked-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.machine-notes {
  background: #eef7fc;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

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

.machine-linked-panel {
  background: #ffffff;
  border: 1px solid #e4eef5;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.machine-linked-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.machine-linked-title span {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  min-width: 26px;
  padding: 4px 8px;
  text-align: center;
}

.machine-linked-row {
  align-items: flex-start;
  border-top: 1px solid #eef3f6;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 8px;
}

.machine-linked-row > div {
  display: grid;
  gap: 3px;
}

.machine-empty {
  align-items: center;
  background: #f8fbfd;
  border: 1px dashed #b8c5ce;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

.client-section h4 {
  font-size: 14px;
  margin: 0 0 8px;
}

.client-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.client-section-header h4 {
  margin: 0;
}

.client-detail-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid #eef3f6;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
}

.client-detail-row:first-of-type {
  margin-top: 0;
}

.client-detail-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-detail-row strong,
.client-detail-row span,
.client-detail-row small {
  overflow-wrap: anywhere;
}

.client-detail-row.expiration-expired,
.table-wrap tr.expiration-expired > td {
  background: #fff0f0;
}

.client-detail-row.expiration-expired {
  border-color: #e7aaaa;
}

.expiration-renew-button {
  border-color: #8bcfc0;
  color: #087a68;
  background: #f2fbf8;
}

.portal-expiration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.portal-expiration.expired {
  border-color: #e7aaaa;
  background: #fff0f0;
}

.portal-expiration > div:first-child,
.portal-expiration-status {
  display: grid;
  gap: 4px;
}

.portal-expiration-status {
  justify-items: end;
  text-align: right;
}

.settings-layout {
  display: grid;
  gap: 14px;
  padding-bottom: 86px;
}

.setup-wizard-shell {
  display: grid;
  min-height: calc(100vh - 138px);
  padding: 18px;
  place-items: center;
}

.setup-wizard-card {
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.16);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(18, 37, 54, 0.12);
  display: grid;
  gap: 18px;
  max-width: 980px;
  padding: 22px;
  width: 100%;
}

.setup-wizard-header {
  align-items: center;
  border-bottom: 1px solid #dce8ef;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 16px;
}

.setup-wizard-header h2 {
  font-size: 28px;
  margin: 4px 0 6px;
}

.setup-logo-preview {
  flex: 0 0 auto;
}

.setup-save-bar {
  position: static;
}

.settings-section {
  margin: 0;
}

.settings-logo-preview {
  display: grid;
  place-items: center;
  width: 150px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.settings-logo-preview.is-empty {
  display: none;
}

.settings-logo-preview img {
  display: block;
  max-width: 132px;
  max-height: 58px;
  object-fit: contain;
}

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

.menu-visibility-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.menu-visibility-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.menu-visibility-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.menu-visibility-option strong {
  color: var(--ink);
  font-size: 13px;
}

.menu-visibility-option small {
  color: var(--muted);
  font-size: 11px;
}

.menu-visibility-option.is-locked {
  background: #f7fbfd;
}

.supplier-plugin-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.supplier-plugin-box > div {
  display: grid;
  gap: 6px;
}

.supplier-plugin-box strong {
  color: var(--ink);
  font-size: 13px;
}

.supplier-plugin-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.copy-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.copy-line input {
  min-width: 0;
}

.settings-save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #bad5e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 34px rgba(17, 39, 56, 0.14);
}

.settings-save-bar span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .settings-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-logo-preview {
    width: 110px;
  }
}

.client-detail-row span,
.client-detail-row small {
  color: var(--muted);
  font-size: 14px;
}

.client-row-actions,
.client-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.client-row-actions {
  flex: 0 0 auto;
}

.client-quick-actions {
  background: #ffffff;
  border-top: 1px solid rgba(13, 127, 191, 0.12);
  padding: 12px;
}

.client-quick-menu {
  background: #ffffff;
  border: 1px solid rgba(13, 127, 191, 0.14);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(18, 37, 54, 0.05);
  overflow: hidden;
}

.client-quick-menu summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  padding: 13px 16px;
}

.client-quick-menu summary::-webkit-details-marker {
  display: none;
}

.client-quick-menu summary::after {
  content: "+";
  float: right;
}

.client-quick-menu[open] summary::after {
  content: "-";
}

.linked-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef3f6;
  color: var(--muted);
  font-size: 14px;
}

.linked-row:first-of-type {
  border-top: 0;
}

.record-card {
  padding: 16px;
}

.record-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.meta-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  background: #dff2e6;
  color: var(--success);
}

.badge.warning {
  background: #fff0d4;
  color: var(--warning);
}

.badge.danger {
  background: #f8dddd;
  color: var(--danger);
}

.table-wrap tr.admin-invoice-paid > td {
  background: #e8f7ed;
  border-color: #c5e8d0;
}

.table-wrap tr.admin-invoice-sent > td {
  background: #fff7d6;
  border-color: #f1dfa0;
}

.table-wrap tr.admin-invoice-credit > td {
  background: #fde8e8;
  border-color: #efbcbc;
}

.record-card.admin-invoice-paid {
  border-color: #8fd0a5;
  background: #e8f7ed;
}

.record-card.admin-invoice-sent {
  border-color: #e5c85d;
  background: #fff7d6;
}

.record-card.admin-invoice-credit {
  border-color: #df8181;
  background: #fde8e8;
}

.invoice-credit-reference {
  color: #9d2424;
  font-size: 11px;
  font-weight: 800;
}

.margin-positive {
  color: var(--success);
  font-weight: 900;
}

.margin-negative {
  color: var(--danger);
  font-weight: 900;
}

.quote-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.danger-button,
.import-label,
.icon-button,
.link-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

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

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

.secondary-button,
.import-label,
.icon-button,
.link-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.sidebar .secondary-button,
.sidebar .import-label {
  background: #1d3a50;
  color: #ffffff;
  border-color: #2d536c;
  text-align: center;
}

.danger-button {
  background: #fff3f3;
  color: var(--danger);
  border-color: #f1c1c1;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.import-label input {
  display: none;
}

.empty-state {
  border: 1px dashed #b8c5ce;
  border-radius: 8px;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.modal {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal.modal-medium {
  width: min(980px, calc(100vw - 48px));
}

.modal.modal-wide {
  width: min(1380px, calc(100vw - 48px));
}

.modal.modal-document-wide {
  width: min(1760px, calc(100vw - 24px));
}

.modal::backdrop {
  background: rgba(12, 20, 25, 0.48);
}

.modal-panel {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
}

.modal-wide .modal-header,
.modal-wide .modal-actions {
  position: sticky;
  z-index: 3;
  background: #ffffff;
}

.modal-wide .modal-header {
  top: -20px;
  margin: -20px -20px 18px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-wide .modal-actions {
  bottom: -20px;
  margin: 18px -20px -20px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}

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

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

.field {
  display: grid;
  gap: 7px;
}

.field[hidden] {
  display: none !important;
}

.trust-device-check[hidden] {
  display: none !important;
}

.auth-setup-qr[hidden] {
  display: none !important;
}

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

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

.field-disabled {
  opacity: 0.48;
}

.field-disabled input,
.field-disabled select,
.field-disabled textarea {
  background: #eef3f6;
  cursor: not-allowed;
}

.quote-items-field {
  gap: 10px;
}

.quote-items-editor {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.quote-items-head,
.quote-items-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 76px 120px 120px 150px 115px 104px;
  gap: 0;
  min-width: 1040px;
}

.quote-items-head.invoice-tax-row,
.quote-items-row.invoice-tax-row {
  grid-template-columns: minmax(420px, 1fr) 120px 70px 110px 180px 110px 104px;
  min-width: 1260px;
}

.quote-product-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 5px 8px 7px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.quote-product-cell > input {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.assembly-toggle {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #087a68;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.quote-product-cell small {
  color: var(--muted);
  font-size: 10px;
}

.quote-items-row.is-assembly {
  background: #f2fbf8;
}

.quote-items-row.is-total-row {
  background: #f8fbfd;
  border-top: 2px solid #0d7fbf;
}

.quote-items-row.is-total-row .quote-product-cell {
  background: #eef7fc;
}

.quote-items-row.is-total-row input[name="quoteItemDescription"] {
  color: #0f3b66;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-items-row.is-total-row input[name="quoteItemCost"] {
  background: #eef7fc;
  color: #0f3b66;
  font-weight: 800;
}

.assembly-panel {
  grid-column: 1 / -1;
  padding: 12px;
  border-top: 1px solid #bfe4da;
  background: #f2fbf8;
}

.assembly-panel[hidden] {
  display: none;
}

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

.assembly-panel-heading > div {
  display: grid;
  gap: 2px;
}

.assembly-panel-heading strong {
  color: #075f53;
  font-size: 13px;
}

.assembly-panel-heading span {
  color: var(--muted);
  font-size: 11px;
}

.assembly-components {
  display: grid;
  gap: 6px;
}

.assembly-component-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 80px 120px 110px 40px;
  align-items: center;
  gap: 6px;
}

.assembly-component-row select,
.assembly-component-row input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.assembly-component-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.quote-row-tools {
  align-items: center;
  background: #eef3f6;
  border: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 2px;
  justify-content: center;
  margin: 6px;
  min-height: 30px;
  padding: 3px;
}

.quote-row-tools .icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #526575;
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  min-height: 24px;
  padding: 0;
  text-align: center;
  width: 24px;
}

.quote-row-tools .icon-button:hover {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 4px 10px rgba(16, 37, 54, 0.1);
  transform: translateY(-1px);
}

.quote-row-tools .quote-delete-row {
  border: 0;
  color: var(--danger);
  font-size: 18px;
  width: 24px;
}

.quote-row-tools .quote-delete-row:hover {
  background: #fff3f3;
  color: #9d2424;
}

.quote-import-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 8px;
}

.quote-add-assembly {
  border-color: #8bcfc0;
  color: #087a68;
  background: #f2fbf8;
}

.sale-items-head,
.sale-items-row {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(380px, 1fr) 68px 105px 105px 140px 140px 84px 112px 132px 112px 48px;
  min-width: 1420px;
}

.sale-pdf-identifiers {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 42px;
  padding: 5px;
  border-right: 1px solid var(--line);
  background: #f8fbfd;
  cursor: pointer;
}

.sale-pdf-identifiers input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid var(--line);
}

.sale-pdf-identifiers span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.quote-items-head span,
.sale-items-head span {
  background: #0f3b66;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 10px;
  text-transform: uppercase;
}

.quote-items-row,
.sale-items-row {
  border-top: 1px solid var(--line);
}

.quote-items-row input,
.quote-items-row select,
.sale-items-row input,
.sale-items-row select,
.quote-image-picker,
.quote-row-margin {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 42px;
  padding: 9px 10px;
}

.quote-items-row select {
  background: #ffffff;
}

.sale-product-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-bottom: 5px;
  border-right: 1px solid var(--line);
}

.sale-product-cell input {
  width: 100%;
  border-right: 0;
}

.sale-product-cell small {
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.invoice-price-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 5px 8px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.quote-items-row .invoice-price-cell input {
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.invoice-price-cell small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

  .invoice-price-cell small.available {
    color: var(--success);
    font-weight: 800;
  }

.invoice-items-totals {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.invoice-items-totals > div {
  display: grid;
  gap: 3px;
  min-width: 170px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfd;
}

.invoice-items-totals span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-items-totals strong {
  color: var(--ink);
  font-size: 20px;
}

.invoice-items-totals strong[data-invoice-margin-total] {
  color: var(--success);
}

.invoice-items-totals strong[data-invoice-margin-total].negative {
  color: var(--danger);
}

.quote-image-picker {
  align-items: center;
  background: #f8fbfd;
  cursor: pointer;
  display: flex;
}

.quote-image-picker input[type="file"],
.quote-image-picker input[type="hidden"] {
  display: none;
}

.quote-image-preview {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  min-width: 0;
}

.quote-image-preview img {
  border: 1px solid #d9e1e8;
  border-radius: 6px;
  height: 38px;
  object-fit: cover;
  width: 48px;
}

.quote-image-picker:hover .quote-image-preview img {
  border-color: #0d7fbf;
  box-shadow: 0 0 0 3px rgba(13, 127, 191, 0.12);
}

.quote-image-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-row-margin {
  display: flex;
  align-items: center;
  background: #f8fbfd;
}

.quote-items-row input:last-of-type {
  border-right: 0;
}

.quote-delete-row {
  border-radius: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--danger);
  width: 48px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
}

.sale-items-field .sale-items-row select {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 42px;
  padding: 9px 10px;
}

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

.photo-field input[type="file"] {
  border-style: dashed;
  background: #f8fbfd;
}

.record-photo-preview,
.record-photo-thumb {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 10px;
  max-width: 100%;
  padding: 8px;
  background: #ffffff;
}

.record-photo-preview img,
.record-photo-thumb img {
  border-radius: 6px;
  height: 58px;
  object-fit: cover;
  width: 78px;
}

.record-photo-preview span,
.record-photo-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.photo-remove-check {
  align-items: center;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 999px;
  color: #b91c1c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  padding: 6px 9px;
  white-space: nowrap;
}

.photo-remove-check input {
  width: auto;
  accent-color: #dc2626;
}

.photo-remove-check strong {
  align-items: center;
  background: #dc2626;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.record-photo-thumb {
  margin-top: 8px;
  cursor: pointer;
  text-align: left;
}

.record-photo-thumb:hover {
  border-color: rgba(13, 127, 191, 0.45);
  box-shadow: 0 8px 18px rgba(16, 37, 54, 0.1);
  transform: translateY(-1px);
}

.machine-photo-panel {
  display: flex;
  margin-top: 2px;
}

.checkbox-field {
  align-content: end;
}

.checkbox-field label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
}

.checkbox-field input {
  width: auto;
}

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

.muted {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.row-actions .secondary-button,
.row-actions .danger-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.action-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(13, 127, 191, 0.2);
  background: linear-gradient(180deg, #ffffff, #f5f9fc);
  box-shadow: 0 7px 16px rgba(16, 37, 54, 0.08);
}

.action-button::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 127, 191, 0.12);
  vertical-align: 1px;
}

.action-edit::before {
  background: #0d7fbf;
  box-shadow: 0 0 0 3px rgba(13, 127, 191, 0.12);
}

.action-open::before {
  background: #12b7c8;
  box-shadow: 0 0 0 3px rgba(18, 183, 200, 0.12);
}

.action-delete {
  border-color: rgba(220, 38, 38, 0.28);
  color: #b91c1c;
}

.action-delete::before {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.13);
}

.action-button:hover {
  border-color: rgba(13, 127, 191, 0.42);
  box-shadow: 0 10px 22px rgba(16, 37, 54, 0.12);
  transform: translateY(-1px);
}

.document-action-menu {
  position: relative;
}

.document-action-menu[open] {
  z-index: 3;
}

.document-action-trigger {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  list-style: none;
  min-height: 34px;
  user-select: none;
}

.document-action-trigger::-webkit-details-marker {
  display: none;
}

.document-action-trigger::after {
  color: var(--muted);
  content: "▾";
  font-size: 11px;
  line-height: 1;
}

.document-action-menu[open] .document-action-trigger {
  border-color: rgba(13, 127, 191, 0.42);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.document-action-list {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(16, 37, 54, 0.14);
  display: grid;
  gap: 6px;
  margin-top: 8px;
  min-width: 190px;
  padding: 8px;
}

.document-action-list .action-button {
  justify-content: flex-start;
  min-height: 32px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.action-pdf::before {
  background: #e34f5f;
  box-shadow: 0 0 0 3px rgba(227, 79, 95, 0.13);
}

.action-xml::before {
  background: #8d69f2;
  box-shadow: 0 0 0 3px rgba(141, 105, 242, 0.13);
}

.action-send::before,
.action-share::before {
  background: #25bf83;
  box-shadow: 0 0 0 3px rgba(37, 191, 131, 0.13);
}

.action-paid::before {
  background: #116d4a;
  box-shadow: 0 0 0 3px rgba(17, 109, 74, 0.14);
}

.action-credit {
  border-color: rgba(193, 48, 48, 0.3);
  color: #982828;
}

.action-credit::before {
  background: #d83b3b;
  box-shadow: 0 0 0 3px rgba(216, 59, 59, 0.14);
}

.action-print::before {
  background: #f2ad36;
  box-shadow: 0 0 0 3px rgba(242, 173, 54, 0.16);
}

.action-stock::before {
  background: #25a3df;
  box-shadow: 0 0 0 3px rgba(37, 163, 223, 0.13);
}

.action-mail::before {
  background: #12b7c8;
  box-shadow: 0 0 0 3px rgba(18, 183, 200, 0.13);
}

.invoice-send-panel {
  background:
    linear-gradient(135deg, rgba(141, 105, 242, 0.1), rgba(18, 183, 200, 0.08)),
    #ffffff;
}

.portal-only {
  display: none;
}

.portal-panel {
  max-width: 820px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px);
  grid-template-rows: auto auto;
  justify-content: center;
  gap: 0;
  align-items: center;
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  padding: 28px 18px;
}

.auth-project-credit {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: 3px;
  margin-top: 2px;
  color: #ffffff;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(4, 23, 33, 0.42);
  pointer-events: none;
  user-select: none;
}

.auth-project-credit strong {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-project-credit span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-motion {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  pointer-events: none;
}

.auth-motion::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 127, 191, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 127, 191, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: authGridDrift 16s linear infinite;
}

.auth-motion span {
  position: absolute;
  width: 42%;
  height: 2px;
  border-radius: 999px;
  opacity: 0.42;
  filter: blur(1px);
  transform: rotate(-18deg);
  animation: authLightSweep 7s ease-in-out infinite;
}

.auth-motion span:nth-child(1) {
  left: -12%;
  top: 20%;
  background: linear-gradient(90deg, transparent, rgba(13, 127, 191, 0.85), transparent);
}

.auth-motion span:nth-child(2) {
  right: -14%;
  top: 48%;
  background: linear-gradient(90deg, transparent, rgba(19, 191, 171, 0.7), transparent);
  animation-delay: -2s;
}

.auth-motion span:nth-child(3) {
  bottom: 18%;
  left: 18%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation-delay: -4s;
}

@keyframes authGridDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 88px 44px;
  }
}

@keyframes authLightSweep {
  from {
    transform: translate3d(-40px, 0, 0) rotate(-18deg);
  }
  to {
    transform: translate3d(90px, 0, 0) rotate(-18deg);
  }
}

.auth-brand-panel {
  align-self: stretch;
  min-height: 520px;
  border: 1px solid rgba(13, 127, 191, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(229, 244, 251, 0.82)),
    repeating-linear-gradient(90deg, rgba(13, 127, 191, 0.06) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(13, 127, 191, 0.05) 0 1px, transparent 1px 36px);
  box-shadow: 0 18px 42px rgba(23, 33, 43, 0.09);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 34px;
}

.auth-brand-panel h2 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.96;
  max-width: 620px;
}

.auth-brand-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  max-width: 560px;
}

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

.auth-status-grid span {
  min-height: 82px;
  border: 1px solid rgba(13, 127, 191, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 14px;
}

.auth-status-grid strong {
  color: var(--ink);
  display: block;
  font-size: 22px;
  line-height: 1;
}

.auth-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(217, 225, 232, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(23, 33, 43, 0.16);
  display: grid;
  gap: 16px;
  padding: 28px;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #0d7fbf, #13bfab, #075f91);
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: -42% -20% auto;
  height: 160px;
  background: radial-gradient(circle, rgba(13, 127, 191, 0.16), transparent 62%);
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.admin-auth,
.customer-auth {
  grid-template-columns: minmax(320px, 430px);
  justify-content: center;
}

.admin-login-card,
.customer-login-card {
  padding: 30px 28px 28px;
}

.admin-login-card .auth-logo,
.customer-login-card .portal-logo {
  width: min(190px, 58vw);
  margin: 0 auto 4px;
}

.auth-card-header {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  text-align: center;
}

.auth-card-header h3 {
  font-size: 24px;
  margin: 0;
}

.auth-card-header span {
  color: var(--muted);
  font-size: 14px;
}

.auth-logo,
.portal-logo {
  display: block;
  width: min(220px, 68vw);
  height: auto;
  filter: drop-shadow(0 12px 20px rgba(23, 33, 43, 0.08));
}

.auth-card .field label {
  color: #344756;
}

.auth-card .field input {
  min-height: 48px;
  border-color: #cad8e2;
  background: #fbfdfe;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.auth-card .field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 127, 191, 0.12);
  outline: 0;
  background: #ffffff;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  background: linear-gradient(135deg, #0d7fbf, #075f91);
  box-shadow: 0 12px 24px rgba(13, 127, 191, 0.24);
}

.auth-link-button {
  width: 100%;
}

.trust-device-check {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.trust-device-check input {
  margin-top: 2px;
}

.trusted-reset {
  justify-self: center;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.customer-auth .auth-brand-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 250, 0.64)),
    repeating-linear-gradient(90deg, rgba(211, 82, 174, 0.06) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(240, 172, 78, 0.06) 0 1px, transparent 1px 36px);
}

.portal-app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.portal-menu {
  background: #102536;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 20px;
  padding: 18px;
  position: sticky;
  top: 110px;
}

.portal-menu-logo {
  display: block;
  width: 100%;
  max-width: 210px;
  height: 88px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
  margin-bottom: 12px;
}

.portal-menu .eyebrow {
  color: #b9c6cd;
}

.portal-menu h2 {
  font-size: 20px;
}

.portal-menu nav {
  display: grid;
  gap: 6px;
}

.portal-menu a,
.portal-menu-item {
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #e8f0f3;
  padding: 10px 12px;
  text-decoration: none;
  text-align: left;
}

.portal-menu a:hover,
.portal-menu-item:hover,
.portal-menu-item.active {
  background: #1d3a50;
}

.portal-logout-button {
  width: 100%;
  margin-top: auto;
}

.portal-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.portal-app .portal-panel {
  max-width: none;
  margin: 0;
}

.portal-welcome {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

.portal-summary span {
  background: var(--panel-soft);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 3px;
  padding: 12px;
}

.portal-summary strong {
  color: var(--ink);
  font-size: 24px;
}

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

.portal-info-item {
  background: var(--panel-soft);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.portal-info-item span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.portal-section {
  padding: 18px;
  scroll-margin-top: 96px;
}

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

.portal-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.portal-row-with-actions {
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.45fr) auto auto;
}

.portal-invoice-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.portal-invoice-paid {
  background: #e8f7ee;
  border-color: #9fd6b4;
}

.portal-invoice-sent {
  background: #fff4df;
  border-color: #f0bd69;
}

.portal-invoice-cancelled {
  background: #fdecec;
  border-color: #ef9a9a;
}

.portal-invoice-draft {
  background: #f8fbfd;
}

.portal-invoice-status {
  align-items: center;
  border-radius: 8px;
  color: #17212b;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  text-transform: uppercase;
}

.portal-invoice-paid .portal-invoice-status {
  background: #1f8f4d;
  color: #ffffff;
}

.portal-invoice-sent .portal-invoice-status {
  background: #e18a07;
  color: #ffffff;
}

.portal-invoice-cancelled .portal-invoice-status {
  background: #c92a2a;
  color: #ffffff;
}

.portal-invoice-draft .portal-invoice-status {
  background: #e7eef5;
}

.license-generator-form {
  align-items: end;
}

.license-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.license-actions .secondary-button,
.license-actions .danger-button {
  min-height: 34px;
  padding: 7px 10px;
}

.license-expiry-editor {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  min-width: 205px;
}

.license-expiry-editor input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 34px;
  padding: 6px 8px;
}

.license-expiry-editor .secondary-button {
  min-height: 34px;
  padding: 6px 9px;
}

.recovery-code-panel {
  margin-bottom: 16px;
}

.recovery-code-panel code {
  background: #eef4f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-block;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 10px 14px;
}

.license-device-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  min-width: 180px;
}

.license-device {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.license-device small {
  color: var(--muted);
  flex-basis: 100%;
}

.auth-setup-qr {
  align-items: center;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 148px 1fr;
  padding: 14px;
}

.auth-setup-qr img {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  width: 148px;
}

.auth-setup-qr div {
  display: grid;
  gap: 4px;
}

.auth-setup-qr code {
  background: #e7eef5;
  border-radius: 5px;
  font-size: 12px;
  padding: 5px 7px;
  word-break: break-all;
}

@media (max-width: 560px) {
  .auth-setup-qr {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.license-runtime-blocker {
  align-items: center;
  background: rgba(237, 243, 248, 0.96);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9999;
}

.license-runtime-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-width: 460px;
  padding: 26px;
  text-align: center;
}

.license-runtime-card img {
  justify-self: center;
  max-height: 46px;
}

.license-runtime-card h2,
.license-runtime-card p {
  margin: 0;
}

.page-hero.dashboard-hero,
.page-hero.clients-hero,
.page-hero.support-command,
.page-hero.list-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #0d7fbf, #102536);
}

.page-hero.dashboard-hero h2,
.page-hero.clients-hero h2,
.page-hero.support-command h2,
.page-hero.list-toolbar h2 {
  margin: 2px 0 6px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.15;
}

.page-hero.dashboard-hero .eyebrow,
.page-hero.clients-hero .eyebrow,
.page-hero.support-command .eyebrow,
.page-hero.list-toolbar .eyebrow {
  color: #9ce4f7;
}

.portal-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.portal-row:first-child {
  border-top: 0;
}

.portal-row div {
  display: grid;
  gap: 4px;
}

.portal-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.portal-row:has(.badge.warning),
.client-detail-row.ticket:has(.badge.warning) {
  border-color: #f1dfa0;
  background: #fffaf0;
}

.invoice-preview {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
}

.portal-copy,
.login-panel > div {
  margin-bottom: 18px;
}

.customer-form,
.login-form {
  display: grid;
  gap: 14px;
}

.ticket-success {
  margin-top: 16px;
  border: 1px solid #b8dfc4;
  border-radius: 8px;
  background: #e9f7ee;
  color: var(--success);
  padding: 12px;
  font-weight: 700;
}

.field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field-action-row .secondary-button {
  white-space: nowrap;
}

.company-lookup-status {
  display: block;
  margin-top: 6px;
}

.company-lookup-warning {
  color: #8a5a0a;
  font-weight: 700;
}

.company-lookup-fallbacks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.company-lookup-fallbacks .secondary-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .field-action-row {
    grid-template-columns: 1fr;
  }

  .company-lookup-fallbacks {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.form-error {
  color: var(--danger);
  font-weight: 700;
  margin: 0;
}

.portal-mode .sidebar {
  display: none;
}

.portal-mode,
.locked-mode {
  background:
    linear-gradient(180deg, #f8fbfd 0%, #eef3f7 58%, #f7f8fb 100%);
}

.portal-mode .app-shell,
.locked-mode .app-shell {
  grid-template-columns: 1fr;
}

.portal-mode .search-box,
.portal-mode #quickAdd,
.locked-mode .search-box,
.locked-mode #quickAdd,
.locked-mode .admin-logout-top {
  display: none;
}

.locked-mode .sidebar {
  display: none;
}

.locked-mode .topbar {
  display: none;
}

.locked-mode .workspace {
  min-height: 100vh;
  padding: 0;
}

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

  .sidebar {
    height: auto;
    overflow: visible;
    padding: 18px 16px;
    position: static;
    width: auto;
  }

  .brand,
  .nav-list,
  .sidebar-footer {
    min-width: 0;
  }

  .brand-logo {
    width: 98px;
    height: 50px;
  }

  .brand strong,
  .brand span,
  .sidebar-footer {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-item {
    color: #dce7eb;
  }

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

  .topbar,
  .topbar-actions,
  .list-toolbar,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .stats-grid,
  .dashboard-metrics,
  .dashboard-grid,
  .client-type-breakdown,
  .support-board,
  .form-grid,
  .client-list-page,
  .client-info,
  .client-command-stats,
  .client-intelligence-grid,
  .client-signal-grid,
  .client-overview-grid,
  .machine-linked-grid,
  .client-section-navigation,
  .client-section-selectors,
  .portal-row,
  .portal-row-with-actions,
  .portal-app,
  .auth-shell,
  .portal-summary,
  .portal-info-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px;
  }

  .dashboard-hero-side {
    justify-content: stretch;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .modern-dashboard-grid .dashboard-panel:last-child {
    grid-column: auto;
  }

  .annual-comparison-header,
  .annual-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .annual-chart {
    overflow-x: auto;
    grid-template-columns: repeat(12, minmax(48px, 1fr));
  }

  .machine-list-layout {
    grid-template-columns: 1fr;
  }

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

  .auth-card {
    order: -1;
  }

  .auth-brand-panel {
    min-height: auto;
    gap: 16px;
    padding: 24px;
  }

  .auth-brand-panel h2 {
    font-size: 36px;
  }

  .auth-brand-panel p:not(.eyebrow) {
    font-size: 16px;
  }

  .auth-logo,
  .portal-logo {
    width: min(190px, 58vw);
  }

  .auth-status-grid {
    display: none;
  }

  .portal-menu {
    position: static;
  }

  .clients-hero {
    flex-direction: column;
  }

  .client-command-hero,
  .client-overview-header {
    flex-direction: column;
  }

  .client-command-main {
    grid-template-columns: 1fr;
  }

  .client-hero-tags {
    grid-column: auto;
  }

  .client-command-actions,
  .client-row-actions,
  .client-quick-actions,
  .machine-actions {
    justify-content: flex-start;
  }

  .machine-card-header,
  .machine-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .client-detail-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  body {
    background: #eef3f7;
  }

  .locked-mode .topbar {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.sidebar-open {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    gap: 8px;
    overflow: hidden;
    padding: 8px 10px;
    border-bottom: 1px solid #2d536c;
    box-shadow: 0 8px 24px rgba(16, 37, 54, 0.16);
  }

  .brand {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .nav-list::-webkit-scrollbar,
  .sidebar-footer::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #dce7eb;
    font-size: 13px;
    scroll-snap-align: start;
  }

  .nav-item::before {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }

  .sidebar-footer {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    scrollbar-width: none;
  }

  .sidebar-footer .secondary-button,
  .sidebar-footer .import-label {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .save-status {
    display: none;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
  }

  .topbar-logo {
    width: 88px;
    height: 42px;
    max-width: none;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .search-box {
    min-width: 0;
    padding: 0 9px;
  }

  .search-box span {
    display: none;
  }

  .search-box input {
    padding: 9px 0;
    font-size: 13px;
  }

  #quickAdd,
  #backOffice {
    min-width: 42px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .workspace {
    padding: 12px 10px 28px;
  }

  .page-hero,
  .page-hero.dashboard-hero,
  .page-hero.clients-hero,
  .page-hero.support-command,
  .page-hero.list-toolbar {
    min-height: 0;
    margin-bottom: 10px;
    padding: 14px;
    gap: 10px;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(16, 37, 54, 0.14);
  }

  .page-hero h2,
  .page-hero h3,
  .page-hero.dashboard-hero h2,
  .page-hero.clients-hero h2,
  .page-hero.support-command h2,
  .page-hero.list-toolbar h2 {
    font-size: 21px;
  }

  .page-hero p:not(.eyebrow) {
    display: none;
  }

  .page-hero .toolbar-actions,
  .page-hero .row-actions,
  .client-command-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .page-hero .toolbar-actions > *,
  .page-hero .row-actions > *,
  .client-command-actions > * {
    flex: 0 0 auto;
  }

  .dashboard-hero-copy {
    order: -1;
  }

  .dashboard-hero-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero-side span {
    min-width: 0;
    padding: 7px 8px;
  }

  .stats-grid,
  .dashboard-metrics,
  .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .dashboard-metrics .stat-card,
  .stat-card,
  .compact-stats .stat-card {
    min-height: 104px;
    padding: 12px;
  }

  .dashboard-metrics .stat-card strong,
  .compact-stats .stat-card strong {
    margin: 7px 0 5px;
    font-size: 20px;
  }

  .dashboard-metrics .stat-card small {
    font-size: 11px;
  }

  .annual-comparison-band,
  .panel,
  .portal-welcome,
  .client-intel-panel {
    padding: 14px;
  }

  .annual-chart {
    grid-template-columns: repeat(12, 42px);
  }

  .annual-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .record-grid,
  .client-list-page {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .icon-record-card,
  .client-name-card {
    padding: 14px;
    box-shadow: 0 8px 22px rgba(23, 33, 43, 0.08);
  }

  .view-toggle {
    flex: 0 0 auto;
  }

  .table-wrap {
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 0;
  }

  .modal.modal-document-wide {
    width: 100%;
    max-width: none;
  }

  .modal-panel {
    max-height: 92vh;
    overflow-y: auto;
    padding: 16px 12px;
    border-radius: 8px 8px 0 0;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: #ffffff;
  }

  .form-grid {
    gap: 10px;
  }

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

  .portal-app {
    gap: 10px;
  }

  .portal-menu {
    gap: 10px;
    padding: 10px;
  }

  .portal-menu > div:first-child {
    display: none;
  }

  .portal-menu nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .portal-menu-item {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 13px;
  }

  .portal-logout-button {
    min-height: 38px;
  }

  .auth-shell {
    padding: 12px;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-card {
    padding: 18px 14px;
  }

  .auth-logo,
  .portal-logo {
    width: min(145px, 48vw);
  }

  .client-command-hero {
    padding: 14px;
    background: linear-gradient(135deg, #0d7fbf, #102536);
  }

  .client-command-main {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .client-command-avatar {
    width: 48px;
    height: 48px;
    font-size: 21px;
  }

  .client-command-main h3 {
    font-size: 22px;
  }

  .client-hero-tags {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .client-spend-panel {
    padding: 14px;
  }

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

  .client-spend-total {
    min-width: 0;
    text-align: left;
  }

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

  .accountant-hero,
  .accountant-alert,
  .accountant-row {
    align-items: stretch;
    flex-direction: column;
  }

  .accountant-year-select {
    min-width: 0;
  }

  .accountant-metrics,
  .accountant-quarter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .accountant-grid,
  .accountant-simple-summary,
  .accountant-simple-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .accountant-simple-breakdown {
    grid-template-columns: 1fr;
  }

  .accountant-save-card {
    min-height: 160px;
  }

  .accountant-metrics .stat-card {
    min-height: 108px;
  }

  .accountant-row b {
    font-size: 18px;
  }

  .invoice-items-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-items-totals > div {
    min-width: 0;
  }
}
[data-auth-mode-panel][hidden],
[data-license-mode-panel][hidden] {
  display: none !important;
}

.nav-group {
  display: grid;
  gap: 3px;
  position: relative;
}

.nav-submenu {
  display: none;
  gap: 2px;
  padding-left: 12px;
}

.nav-group:hover .nav-submenu {
  display: grid;
}

.nav-submenu button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 10px;
  text-align: left;
}

.nav-submenu button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@media (hover: none) {
  .nav-group:focus-within .nav-submenu {
    display: grid;
  }
}

@media (max-width: 680px) {
  .portal-repair-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-repair-meta {
    grid-template-columns: 1fr;
  }
}

/* Premium softwarehouse visual layer */
:root {
  --bg: #eef4f8;
  --panel: rgba(255, 255, 255, 0.91);
  --panel-soft: #edf6f8;
  --ink: #132331;
  --muted: #637685;
  --line: rgba(92, 119, 139, 0.18);
  --accent: #0b8bd3;
  --accent-strong: #066397;
  --accent-soft: #e3f5fb;
  --cyan: #12b7c8;
  --green: #22a976;
  --amber: #d49425;
  --coral: #d95757;
  --danger: #b42d3a;
  --warning: #9c6819;
  --success: #1f7a55;
  --shadow: 0 18px 46px rgba(18, 35, 49, 0.13);
  --shadow-soft: 0 10px 28px rgba(18, 35, 49, 0.08);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.48);
  --focus-ring: 0 0 0 4px rgba(11, 139, 211, 0.16);
}

@keyframes appBackgroundDrift {
  0% { background-position: 0 0, 0 0, 0 0; }
  50% { background-position: 48px 34px, -32px 24px, 0 0; }
  100% { background-position: 96px 68px, -64px 48px, 0 0; }
}

@keyframes panelSheen {
  0% { transform: translateX(-120%); opacity: 0; }
  22% { opacity: 0.48; }
  45% { opacity: 0; }
  100% { transform: translateX(120%); opacity: 0; }
}

@keyframes subtleRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

body {
  background:
    linear-gradient(90deg, rgba(11, 139, 211, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 183, 200, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7fbfd 0%, #edf5f8 44%, #f9fbfb 100%);
  background-size: 42px 42px, 42px 42px, auto;
  animation: appBackgroundDrift 34s linear infinite;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(18, 183, 200, 0.08) 20% 20.5%, transparent 20.5% 45%, rgba(11, 139, 211, 0.07) 45% 45.5%, transparent 45.5%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.22));
}

::selection {
  background: rgba(18, 183, 200, 0.28);
  color: #0b1d2b;
}

.app-shell {
  background: transparent;
}

.main {
  position: relative;
}

.workspace {
  animation: subtleRise 260ms ease both;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(10, 26, 38, 0.96), rgba(10, 38, 54, 0.98)),
    #0a2636;
  border-right: 1px solid rgba(151, 211, 225, 0.16);
  box-shadow: 8px 0 30px rgba(10, 31, 44, 0.18);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 183, 200, 0.18), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 44%);
  opacity: 0.8;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--accent), var(--green));
  box-shadow: 0 0 22px rgba(18, 183, 200, 0.44);
}

.sidebar:hover,
.sidebar:focus-within,
.sidebar.sidebar-open {
  box-shadow: 20px 0 58px rgba(10, 31, 44, 0.28);
}

.brand,
.nav-list,
.sidebar-footer {
  position: relative;
  z-index: 1;
}

.brand-logo,
.topbar-logo,
.portal-menu-logo,
.auth-logo,
.portal-logo {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(4, 23, 33, 0.16);
}

.brand-logo[hidden],
.topbar-logo[hidden],
.portal-menu-logo[hidden],
.auth-logo[hidden],
.portal-logo[hidden] {
  display: none !important;
}

.nav-item {
  border: 1px solid transparent;
  color: transparent;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.nav-item::before {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, rgba(18, 183, 200, 0.9), rgba(11, 139, 211, 0.9));
  box-shadow: 0 0 0 4px rgba(18, 183, 200, 0.08);
}

.sidebar:hover .nav-item,
.sidebar:focus-within .nav-item,
.sidebar.sidebar-open .nav-item {
  color: rgba(239, 249, 252, 0.88);
}

.nav-item:hover,
.nav-item.active,
.nav-submenu button:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(18, 183, 200, 0.14));
  border-color: rgba(155, 219, 231, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 22px rgba(4, 23, 33, 0.12);
  transform: translateX(2px);
}

.nav-item.active::before {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(18, 183, 200, 0.22), 0 0 18px rgba(18, 183, 200, 0.56);
}

.nav-submenu {
  border-left: 1px solid rgba(155, 219, 231, 0.22);
  margin-left: 18px;
  padding-left: 10px;
}

.nav-submenu button {
  color: rgba(239, 249, 252, 0.74);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-footer .secondary-button,
.import-label,
.save-status {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 219, 231, 0.2);
  color: #e9f8fb;
}

.topbar {
  background: rgba(248, 252, 253, 0.76);
  border-bottom: 1px solid rgba(92, 119, 139, 0.15);
  box-shadow: 0 12px 30px rgba(18, 35, 49, 0.07);
}

@supports (backdrop-filter: blur(18px)) {
  .topbar,
  .modal-panel,
  .panel,
  .record-card,
  .client-detail-card,
  .client-section,
  .portal-panel,
  .table-wrap {
    backdrop-filter: blur(18px);
  }
}

.search-box {
  min-height: 44px;
  border-color: rgba(92, 119, 139, 0.18);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-line), 0 10px 24px rgba(18, 35, 49, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(11, 139, 211, 0.42);
  box-shadow: var(--focus-ring), 0 14px 28px rgba(18, 35, 49, 0.1);
  transform: translateY(-1px);
}

.search-box span {
  color: var(--accent-strong);
  font-weight: 900;
}

.primary-button,
.secondary-button,
.danger-button,
.import-label,
.icon-button,
.view-toggle button,
.invoice-status-filter button,
.document-action-trigger,
.nav-submenu button {
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.primary-button {
  border: 1px solid rgba(9, 108, 165, 0.22);
  background: linear-gradient(135deg, #0b8bd3, #12b7c8 58%, #22a976);
  box-shadow: 0 12px 26px rgba(11, 139, 211, 0.24);
}

.primary-button:hover {
  box-shadow: 0 16px 32px rgba(11, 139, 211, 0.3);
  transform: translateY(-1px);
}

.secondary-button,
.danger-button,
.import-label,
.icon-button {
  border: 1px solid rgba(92, 119, 139, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 251, 0.9));
  box-shadow: 0 8px 18px rgba(18, 35, 49, 0.07);
}

.secondary-button:hover,
.import-label:hover,
.icon-button:hover {
  border-color: rgba(11, 139, 211, 0.36);
  box-shadow: 0 12px 24px rgba(18, 35, 49, 0.11);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.danger-button:hover {
  box-shadow: 0 12px 26px rgba(180, 45, 58, 0.2);
  transform: translateY(-1px);
}

.page-hero,
.dashboard-hero,
.clients-hero,
.settings-hero,
.accountant-hero,
.integration-panel {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(135deg, #0b344c, #0b8bd3 54%, #12b7c8);
  box-shadow: 0 22px 54px rgba(10, 40, 58, 0.22);
}

.page-hero::before,
.dashboard-hero::before,
.clients-hero::before,
.settings-hero::before,
.accountant-hero::before,
.integration-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 82%);
}

.page-hero::after,
.dashboard-hero::after,
.clients-hero::after,
.settings-hero::after,
.accountant-hero::after,
.integration-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.18) 45%, transparent 56% 100%);
  animation: panelSheen 7s ease-in-out infinite;
}

.page-hero > *,
.dashboard-hero > *,
.clients-hero > *,
.settings-hero > *,
.accountant-hero > *,
.integration-panel > * {
  position: relative;
  z-index: 1;
}

.panel,
.record-card,
.client-detail-card,
.client-section,
.client-intel-panel,
.portal-panel,
.annual-comparison-band,
.accountant-alert,
.accountant-save-card,
.accountant-row,
.machine-card,
.grouped-panel,
.stat-card {
  background: var(--panel);
  border: 1px solid rgba(92, 119, 139, 0.16);
  box-shadow: var(--shadow-soft);
}

.panel,
.record-card,
.stat-card,
.client-section,
.portal-panel,
.machine-card,
.grouped-panel {
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.record-card:hover,
.stat-card:hover,
.client-name-card:hover,
.machine-card:hover,
.panel:hover {
  border-color: rgba(11, 139, 211, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-card {
  overflow: hidden;
  position: relative;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--green));
  opacity: 0.85;
}

.badge {
  border: 1px solid rgba(92, 119, 139, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-color: rgba(92, 119, 139, 0.16);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  max-width: 100%;
}

.table-wrap table {
  overflow: hidden;
  border-radius: 8px;
}

th {
  background: #f6fbfd;
  color: #526879;
}

td {
  background: rgba(255, 255, 255, 0.72);
}

tbody tr {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

tbody tr:hover td {
  background: #f9fdfe;
}

.document-action-menu[open] .document-action-list {
  animation: subtleRise 140ms ease both;
}

.document-action-list {
  border-color: rgba(92, 119, 139, 0.16);
  box-shadow: 0 18px 40px rgba(18, 35, 49, 0.18);
}

.action-button {
  background: linear-gradient(180deg, #ffffff, #f6fafc);
}

.modal::backdrop {
  background:
    linear-gradient(135deg, rgba(9, 28, 41, 0.62), rgba(6, 99, 151, 0.3)),
    rgba(9, 28, 41, 0.48);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 253, 0.93));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 26px 70px rgba(7, 32, 46, 0.32);
}

.modal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--green));
}

.field input,
.field textarea,
.field select,
.copy-line input {
  border-color: rgba(92, 119, 139, 0.2);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.copy-line input:focus {
  border-color: rgba(11, 139, 211, 0.46);
  box-shadow: var(--focus-ring);
  outline: 0;
  background: #ffffff;
}

.checkbox-field label,
.menu-visibility-option,
.supplier-plugin-box,
.machine-spec,
.portal-expiration,
.client-detail-row,
.backup-status-card {
  border-color: rgba(92, 119, 139, 0.16);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(18, 35, 49, 0.05);
}

.backup-status-card {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-section-navigation,
.client-quick-menu,
.view-toggle,
.invoice-status-filter {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(92, 119, 139, 0.16);
  box-shadow: var(--shadow-soft);
}

.view-toggle button.active,
.invoice-status-filter button.active {
  background: linear-gradient(135deg, var(--accent-soft), #e9fbf7);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(11, 139, 211, 0.12);
}

.auth-shell,
.portal-auth,
.customer-auth {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #082436, #0b6fa8 52%, #12b7c8);
  background-size: 44px 44px, 44px 44px, auto;
}

.auth-card,
.admin-login-card,
.customer-login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.54);
  box-shadow: 0 28px 72px rgba(5, 25, 36, 0.3);
}

.portal-app {
  background:
    linear-gradient(90deg, rgba(11, 139, 211, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 183, 200, 0.04) 1px, transparent 1px),
    #f4f9fb;
  background-size: 42px 42px;
}

.portal-menu {
  background:
    linear-gradient(180deg, rgba(10, 26, 38, 0.98), rgba(11, 52, 76, 0.96)),
    #0a2636;
}

.portal-menu-item {
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.portal-menu-item:hover,
.portal-menu-item.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(18, 183, 200, 0.14));
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(90deg, rgba(11, 139, 211, 0.04) 1px, transparent 1px),
      linear-gradient(0deg, rgba(18, 183, 200, 0.035) 1px, transparent 1px),
      #f4f9fb;
    background-size: 34px 34px;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }

  .topbar {
    background: rgba(248, 252, 253, 0.92);
  }

  .page-hero,
  .dashboard-hero,
  .clients-hero,
  .settings-hero,
  .accountant-hero,
  .integration-panel {
    box-shadow: 0 14px 32px rgba(10, 40, 58, 0.18);
  }

  .record-card:hover,
  .stat-card:hover,
  .client-name-card:hover,
  .machine-card:hover,
  .panel:hover {
    transform: none;
  }

  .modern-dashboard-grid,
  .dashboard-grid,
  .client-list-page,
  .support-board,
  .machine-list-layout,
  .accountant-grid,
  .portal-app {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .modern-dashboard-grid .dashboard-panel,
  .modern-dashboard-grid .dashboard-panel:last-child,
  .panel,
  .record-card,
  .client-section,
  .client-detail-card,
  .machine-card {
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .document-action-list {
    right: 0;
    left: auto;
    max-width: calc(100vw - 24px);
  }

  .nav-item,
  .sidebar:hover .nav-item,
  .sidebar:focus-within .nav-item,
  .sidebar.sidebar-open .nav-item {
    color: rgba(239, 249, 252, 0.9);
  }

  .dashboard-hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .dashboard-hero-side span {
    min-height: 92px;
    align-content: space-between;
  }

  .stat-card::before {
    width: 96px;
    height: 96px;
    right: -24px;
    bottom: -30px;
  }
}

.dashboard-metrics .stat-card::after {
  content: none;
  display: none;
}

/* Mobile app experience */
@media (max-width: 680px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .main {
    min-width: 0;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.sidebar-open {
    position: fixed;
    inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px;
    z-index: 80;
    width: auto;
    height: 66px;
    padding: 7px;
    border: 1px solid rgba(155, 219, 231, 0.24);
    border-radius: 22px;
    background:
      linear-gradient(135deg, rgba(10, 31, 46, 0.94), rgba(8, 61, 88, 0.92)),
      #092235;
    box-shadow: 0 18px 46px rgba(4, 23, 33, 0.34);
    overflow: hidden;
    backdrop-filter: blur(18px);
  }

  .sidebar::before,
  .sidebar::after,
  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 100%;
    padding: 0 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: contents !important;
  }

  .nav-group-toggle {
    display: none !important;
  }

  .nav-submenu {
    display: contents !important;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .nav-submenu button {
    position: relative;
    flex: 0 0 auto;
    width: 86px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 8px 8px;
    border: 1px solid transparent;
    border-radius: 17px;
    background: transparent;
    color: rgba(229, 247, 252, 0.78);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
    scroll-snap-align: center;
    box-shadow: none;
    transform: none;
  }

  .nav-submenu button::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: rgba(155, 219, 231, 0.22);
    transform: translateX(-50%);
  }

  .nav-submenu button:hover,
  .nav-submenu button:focus-visible,
  .nav-submenu button.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(18, 183, 200, 0.12));
    color: #ffffff;
    transform: none;
  }

  .nav-submenu button.active {
    border-color: rgba(155, 219, 231, 0.24);
    background: linear-gradient(135deg, rgba(18, 183, 200, 0.26), rgba(11, 139, 211, 0.28));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 24px rgba(5, 28, 41, 0.22);
  }

  .nav-submenu button.active::before {
    width: 28px;
    background: linear-gradient(90deg, #ffffff, #83f4ff);
    box-shadow: 0 0 15px rgba(18, 183, 200, 0.46);
  }

  .nav-item,
  .sidebar:hover .nav-item,
  .sidebar:focus-within .nav-item,
  .sidebar.sidebar-open .nav-item {
    position: relative;
    flex: 0 0 auto;
    width: 86px;
    min-height: 50px;
    justify-content: center;
    padding: 9px 8px 8px;
    border-radius: 17px;
    border-color: transparent;
    background: transparent;
    color: rgba(229, 247, 252, 0.84);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
    scroll-snap-align: center;
    box-shadow: none;
    transform: none;
  }

  .nav-item::before {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: rgba(155, 219, 231, 0.36);
    box-shadow: none;
    transform: translateX(-50%);
  }

  .nav-item:hover,
  .nav-item.active,
  .nav-submenu button:hover {
    transform: none;
  }

  .nav-item.active {
    background: linear-gradient(135deg, rgba(18, 183, 200, 0.26), rgba(11, 139, 211, 0.28));
    border-color: rgba(155, 219, 231, 0.26);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 24px rgba(5, 28, 41, 0.22);
  }

  .nav-item.active::before {
    width: 28px;
    background: linear-gradient(90deg, #ffffff, #83f4ff);
    box-shadow: 0 0 15px rgba(18, 183, 200, 0.46);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 48px 42px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(92, 119, 139, 0.13);
    background:
      linear-gradient(180deg, rgba(250, 253, 254, 0.96), rgba(245, 250, 252, 0.9));
    box-shadow: 0 12px 30px rgba(18, 35, 49, 0.08);
    backdrop-filter: blur(16px);
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar-logo {
    width: 76px;
    height: 38px;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(4, 23, 33, 0.12);
  }

  .topbar #viewTitle {
    display: none;
  }

  .topbar-actions {
    display: contents;
  }

  .search-box {
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(92, 119, 139, 0.12);
  }

  .search-box span {
    display: none;
  }

  .search-box input {
    min-width: 0;
    height: 100%;
    padding: 0;
    font-size: 13px;
  }

  #quickAdd {
    width: 48px;
    min-width: 48px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 15px;
    font-size: 0;
    box-shadow: 0 12px 26px rgba(10, 155, 205, 0.27);
  }

  #quickAdd::before {
    content: "+";
    font-size: 27px;
    line-height: 1;
    font-weight: 800;
  }

  .admin-logout-top,
  #backOffice {
    display: none !important;
  }

  .admin-logout-top {
    display: inline-flex !important;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 15px;
    font-size: 0;
  }

  .admin-logout-top::before {
    content: "Out";
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
  }

  #backOffice {
    display: none !important;
  }

  .workspace {
    padding: 12px 10px calc(104px + env(safe-area-inset-bottom));
  }

  .page-hero,
  .page-hero.dashboard-hero,
  .page-hero.clients-hero,
  .page-hero.support-command,
  .page-hero.list-toolbar {
    border-radius: 18px;
    padding: 16px;
  }

  .dashboard-hero {
    box-shadow: 0 18px 42px rgba(7, 43, 64, 0.24);
  }

  .dashboard-hero-copy h2,
  .page-hero h2,
  .page-hero h3,
  .page-hero.dashboard-hero h2,
  .page-hero.clients-hero h2,
  .page-hero.support-command h2,
  .page-hero.list-toolbar h2 {
    font-size: 20px;
    line-height: 1.12;
  }

  .dashboard-hero-side {
    gap: 8px;
  }

  .dashboard-hero-side span,
  .stat-card,
  .dashboard-metrics .stat-card,
  .compact-stats .stat-card,
  .panel,
  .record-card,
  .client-section,
  .machine-card,
  .client-detail-card {
    border-radius: 16px;
  }

  .stat-card,
  .dashboard-metrics .stat-card,
  .compact-stats .stat-card {
    min-height: 118px;
    padding: 14px;
  }

  .stats-grid,
  .dashboard-metrics,
  .compact-stats {
    gap: 10px;
  }

  .panel,
  .record-card,
  .client-section,
  .machine-card,
  .client-detail-card,
  .annual-comparison-band {
    padding: 14px;
    box-shadow: 0 12px 30px rgba(18, 35, 49, 0.08);
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .icon-button,
  .view-toggle button,
  .invoice-status-filter button {
    min-height: 42px;
    border-radius: 14px;
  }

  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 14px 12px calc(96px + env(safe-area-inset-bottom));
    border-radius: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal.modal-wide,
  .modal.modal-document-wide,
  .modal.modal-medium {
    width: 100vw;
    max-width: 100vw;
  }

  .modal-wide .modal-header,
  .modal-wide .modal-actions {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .modal-wide .modal-header {
    top: -14px;
    margin: -14px -12px 12px;
    padding: 14px 12px 12px;
  }

  .modal-header {
    align-items: center;
    gap: 10px;
  }

  .modal-header h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  .modal-header .eyebrow {
    margin-bottom: 2px;
  }

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

  .modal-document-wide .form-grid::after {
    content: "";
    display: block;
    height: 84px;
    grid-column: 1 / -1;
  }

  .field.full,
  .quote-items-field {
    min-width: 0;
  }

  .quote-items-editor,
  .sale-items-editor,
  .invoice-tax-items {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  .quote-items-head,
  .quote-items-row,
  .quote-items-head.invoice-tax-row,
  .quote-items-row.invoice-tax-row {
    min-width: 980px;
  }

  .sale-items-editor .quote-items-head,
  .sale-items-editor .quote-items-row {
    min-width: 1040px;
  }

  .modal-actions,
  .modal-wide .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin: 14px -12px 0;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(92, 119, 139, 0.16);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 32px rgba(18, 35, 49, 0.1);
    backdrop-filter: blur(14px);
  }

  .modal-actions .primary-button,
  .modal-actions .secondary-button,
  .modal-actions .danger-button {
    width: 100%;
    min-height: 46px;
  }

}
