@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
  --bg: #f5f3ee;
  --sidebar: #2f3044;
  --sidebar-soft: #3d3f58;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #1f2142;
  --muted: #6a6d86;
  --accent: #9f7fa3;
  --accent-strong: #725f82;
  --highlight: #d8cce9;
  --border: rgba(31, 33, 66, 0.12);
  --shadow: 0 24px 70px rgba(31, 33, 66, 0.08);
  --time-tint: #f8f8f9;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 1px 1px, rgba(31, 33, 66, 0.06) 1px, transparent 0) 0 0 / 14px 14px,
    linear-gradient(135deg, #f9f7f2, var(--bg));
  overflow: hidden;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  color: #f3f7f7;
  background:
    linear-gradient(180deg, rgba(26, 35, 52, 0.78), rgba(21, 27, 41, 0.88)),
    var(--sidebar-image, none) center / cover no-repeat,
    radial-gradient(circle at top right, rgba(216, 204, 233, 0.22), transparent 38%),
    linear-gradient(180deg, var(--sidebar), #292a3d);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.brand-block {
  padding: 8px 8px;
}

.brand-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.brand-copy {
  margin: 10px 0 0;
  color: rgba(243, 247, 247, 0.78);
  line-height: 1.42;
}

.menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.menu-group-admin {
  margin-top: auto;
  padding-top: 6px;
}

.menu-group-operations[open] .menu-summary-icon::before {
  content: "▾";
  font-size: 0.9rem;
}

.menu-group-operations:not([open]) .menu-summary-icon::before {
  content: "▸";
  font-size: 0.9rem;
}

.menu-group-operations .menu-summary-icon {
  font-size: 0;
}

.menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  padding: 0 10px;
  margin-bottom: 2px;
}

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

.menu-summary .menu-label {
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(243, 247, 247, 0.76);
}

.menu-summary-icon {
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  color: rgba(243, 247, 247, 0.7);
}

.menu-group-admin[open] .menu-summary-icon::before {
  content: "▾";
  font-size: 0.9rem;
}

.menu-group-admin:not([open]) .menu-summary-icon::before {
  content: "▸";
  font-size: 0.9rem;
}

.menu-group-admin .menu-summary-icon {
  font-size: 0;
}

.menu-group-nested {
  padding-top: 6px;
  margin-top: 2px;
}

.menu-group-nested .menu-summary-icon {
  font-size: 0;
}

.menu-group-nested[open] .menu-summary-icon::before {
  content: "▾";
  font-size: 0.9rem;
}

.menu-group-nested:not([open]) .menu-summary-icon::before {
  content: "▸";
  font-size: 0.9rem;
}

.menu-button-nested {
  margin-left: 10px;
  width: calc(100% - 10px);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px;
}

.sidebar-gear {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  color: #f3f7f7;
}

.sidebar-profile-copy {
  display: grid;
  gap: 2px;
}

.sidebar-profile-copy strong {
  font-size: 0.95rem;
}

.sidebar-profile-copy span {
  font-size: 0.82rem;
  color: rgba(243, 247, 247, 0.68);
}

.sidebar-profile-organisation {
  color: rgba(243, 247, 247, 0.86);
  line-height: 1.2;
}

.sidebar-organisation-switch {
  display: grid;
  gap: 4px;
  padding: 0 8px;
  font-size: 0.85rem;
  color: rgba(243, 247, 247, 0.8);
}

.sidebar-organisation-switch select {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f7f7;
}

.sidebar-logout {
  width: calc(100% - 16px);
  margin: 0 8px;
  border-radius: 16px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f7f7;
}

.menu-group {
  display: grid;
  gap: 5px;
}

.menu-label {
  margin: 0 0 4px;
  padding: 0 10px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(243, 247, 247, 0.56);
}

button.menu-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 10px 14px;
  text-align: left;
  background: transparent;
  color: #f3f7f7;
  filter: none;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
}

button.menu-button:hover,
button.menu-button.active {
  background: linear-gradient(135deg, rgba(179, 163, 201, 0.32), rgba(153, 139, 179, 0.36));
  border-color: rgba(216, 204, 233, 0.26);
}

button.menu-button-admin {
  padding: 9px 13px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 15px;
}

.menu-button-nested {
  font-size: 0.9rem;
  font-weight: 500;
}

.main-content {
  padding: 30px;
  padding-bottom: 120px;
  overflow: auto;
  min-width: 0;
  min-height: 0;
}

.secret-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.compact-button {
  padding: 12px 16px;
  white-space: nowrap;
}

body.modal-open {
  overflow: hidden;
}

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

.page-title-block {
  display: grid;
  gap: 0;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  min-height: 1px;
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.help-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
}

.help-link:hover {
  background: #ffffff;
  filter: brightness(1.02);
}

.eyebrow {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  background: rgba(201, 179, 229, 0.34);
}

.brand-block .eyebrow {
  background: transparent;
  color: rgba(243, 247, 247, 0.72);
  padding: 0;
  letter-spacing: 0.16em;
}

h2,
h3,
h4 {
  margin: 0;
  line-height: 1.1;
  font-family: "Sora", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.35rem;
}

h4 {
  font-size: 1rem;
}

.brand-title {
  font-family: "Sora", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

.view-panel {
  display: grid;
  gap: 20px;
  min-width: 0;
  min-height: 0;
}

.hidden {
  display: none !important;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  min-width: 0;
}

.section-heading {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}

.section-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel-subtitle {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.dashboard-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 176px;
  padding: 28px 30px;
  background:
    radial-gradient(circle at top right, rgba(159, 127, 163, 0.16), transparent 28%),
    radial-gradient(circle at 18% 115%, rgba(114, 95, 130, 0.08), transparent 25%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 250, 0.94));
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto 24px 22px auto;
  width: 132px;
  height: 132px;
  border-radius: 36px;
  border: 1px solid rgba(114, 95, 130, 0.08);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(216, 204, 233, 0.16)),
    radial-gradient(circle at 30% 30%, rgba(159, 127, 163, 0.14), transparent 65%);
  transform: rotate(10deg);
  pointer-events: none;
}

.dashboard-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.dashboard-primary-action {
  min-width: 240px;
  min-height: 60px;
  border-radius: 20px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(114, 95, 130, 0.16);
}

.dashboard-metrics {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dashboard-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.dashboard-metric-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.dashboard-metric-card {
  display: grid;
  gap: 10px;
  height: 170px;
  position: relative;
  overflow: hidden;
  padding: 24px 24px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 251, 0.94));
  min-width: 0;
}

.dashboard-metric-card-clickable {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dashboard-metric-card-clickable:hover,
.dashboard-metric-card-clickable:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(41, 33, 64, 0.08);
}

.dashboard-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, rgba(159, 127, 163, 0.65), rgba(114, 95, 130, 0.18));
}

.dashboard-metric-card:nth-child(2)::before {
  background: linear-gradient(180deg, rgba(114, 152, 130, 0.55), rgba(114, 152, 130, 0.12));
}

.dashboard-metric-card:nth-child(3)::before {
  background: linear-gradient(180deg, rgba(121, 86, 99, 0.45), rgba(121, 86, 99, 0.12));
}

.dashboard-metric-card:nth-child(4)::before,
.dashboard-metric-card:nth-child(5)::before,
.dashboard-metric-card:nth-child(6)::before {
  background: linear-gradient(180deg, rgba(114, 95, 130, 0.38), rgba(114, 95, 130, 0.12));
}

.dashboard-metrics-row:first-child .dashboard-metric-card:nth-child(2)::before {
  background: linear-gradient(180deg, rgba(114, 152, 130, 0.55), rgba(114, 152, 130, 0.12));
}

.dashboard-metrics-row:first-child .dashboard-metric-card:nth-child(3)::before {
  background: linear-gradient(180deg, rgba(121, 86, 99, 0.45), rgba(121, 86, 99, 0.12));
}

.dashboard-metrics-row:last-child .dashboard-metric-stack .dashboard-metric-card:first-child::before {
  background: linear-gradient(180deg, rgba(159, 127, 163, 0.65), rgba(114, 95, 130, 0.18));
}

.dashboard-metrics-row:last-child .dashboard-metric-stack .dashboard-metric-card:last-child::before {
  background: linear-gradient(180deg, rgba(114, 152, 130, 0.55), rgba(114, 152, 130, 0.12));
}

.dashboard-metrics-row:last-child > .dashboard-metric-card:nth-child(2)::before,
.dashboard-metrics-row:last-child > .dashboard-metric-card:nth-child(3)::before {
  background: linear-gradient(180deg, rgba(114, 95, 130, 0.38), rgba(114, 95, 130, 0.12));
}

.dashboard-metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-metric-value {
  font-family: "Sora", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.dashboard-metric-meta {
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-metric-card-action {
  background:
    linear-gradient(180deg, rgba(249, 245, 252, 0.98), rgba(255, 255, 255, 0.96));
}

.dashboard-metric-card-action::before {
  width: 100%;
  height: 100%;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(159, 127, 163, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(159, 127, 163, 0.08), transparent 62%);
}

.dashboard-quick-action {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  align-content: center;
  height: 100%;
}

.dashboard-quick-action-title {
  font-family: "Sora", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.45rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.dashboard-metric-card-action .dashboard-primary-action {
  width: 100%;
  min-width: 0;
  margin-top: 2px;
  padding: 12px 18px;
}

.dashboard-chart-panel {
  display: grid;
  gap: 18px;
}

.dashboard-chart-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-chart-heading .ghost-button {
  min-width: 96px;
}

.dashboard-chart-heading .ghost-button.active {
  background: rgba(123, 132, 154, 0.16);
  border-color: rgba(123, 132, 154, 0.28);
  color: var(--text);
}

.dashboard-chart-panel .section-heading {
  margin-bottom: 4px;
}

.dashboard-hours-chart {
  min-height: 320px;
}

.dashboard-hours-chart-empty {
  color: var(--muted);
  padding: 8px 0 4px;
}

.dashboard-chart-card {
  display: grid;
  gap: 14px;
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.dashboard-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dashboard-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.dashboard-chart-axis-label {
  font-size: 12px;
  fill: var(--muted);
  font-family: "Plus Jakarta Sans", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

.dashboard-chart-grid-line {
  stroke: rgba(31, 33, 66, 0.12);
  stroke-width: 1;
}

.dashboard-chart-axis-line {
  stroke: rgba(31, 33, 66, 0.2);
  stroke-width: 1;
}

.dashboard-chart-line-expected {
  fill: none;
  stroke: rgba(111, 99, 131, 0.48);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-chart-line-actual {
  fill: none;
  stroke: #6f6383;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-chart-dot {
  cursor: pointer;
  transition: opacity 120ms ease;
}

.dashboard-chart-dot-expected {
  fill: #fff;
  stroke: rgba(111, 99, 131, 0.55);
  stroke-width: 2.4;
}

.dashboard-chart-dot-actual {
  fill: #6f6383;
  stroke: #fff;
  stroke-width: 1.8;
}

.dashboard-chart-dot:hover,
.dashboard-chart-dot:focus-visible {
  opacity: 0.92;
  outline: none;
}

.dashboard-chart-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid rgba(162, 147, 186, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 36px rgba(41, 33, 64, 0.14);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.dashboard-chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.organisation-settings-heading {
  margin-top: 8px;
  padding-top: 8px;
}

.organisation-settings-accordion {
  margin-top: 0;
}

.organisation-settings-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 16px 16px;
  align-items: end;
}

.client-form-accordion-content {
  padding-top: 16px;
}

.lookup-action-wrap {
  display: grid;
  gap: 8px;
  align-content: start;
}

.lookup-action-wrap > .ghost-button {
  align-self: end;
  margin-top: auto;
}

.lookup-status-text {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}

.lookup-status-text.lookup-status-disabled {
  color: #7a5f5f;
}

.lookup-results {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.lookup-result-button {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.lookup-result-button strong {
  font-size: 0.96rem;
}

.lookup-result-button span {
  color: var(--muted);
  font-size: 0.88rem;
}

.organisation-logo-field {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.organisation-logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.organisation-logo-preview {
  width: 120px;
  height: 54px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  padding: 6px;
}

.offer-template-preview-wrap {
  margin-top: 4px;
}

.branding-split {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

#offer-builder-split {
  grid-template-columns: minmax(520px, 1.2fr) minmax(420px, 0.8fr);
}

#offer-builder-split.preview-collapsed {
  grid-template-columns: 1fr;
}

#offer-builder-split.preview-collapsed .branding-right {
  display: none;
}

.branding-left {
  min-width: 0;
}

.branding-right {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.branding-right-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.logo-layout-controls {
  display: grid;
  gap: 8px;
}

.logo-position-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.logo-position-group label {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logo-position-group input[type="radio"] {
  accent-color: var(--primary);
}

.logo-width-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.logo-width-control span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.colour-swatch-field input[type="color"] {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.colour-swatch-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.colour-swatch-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.branding-pdf-frame-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

#branding-pdf-frame {
  width: 100%;
  height: 72vh;
  min-height: 680px;
  border: 0;
  background: #fff;
}

#offer-page-pdf-frame {
  width: 100%;
  height: 72vh;
  min-height: 680px;
  border: 0;
  background: #fff;
}

@media (max-width: 1540px) {
  #offer-builder-split {
    grid-template-columns: 1fr;
  }

  #offer-page-pdf-frame {
    height: 68vh;
    min-height: 560px;
  }
}

@media (max-width: 1540px) {
  #offer-builder-split {
    grid-template-columns: 1fr;
  }

  #offer-page-pdf-frame {
    min-height: 560px;
    height: 62vh;
  }
}

.offer-template-preview {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  min-height: 260px;
  display: grid;
  gap: 12px;
}

.offer-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.offer-preview-logo {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
}

.offer-preview-box {
  display: grid;
  gap: 4px;
  text-align: right;
}

.offer-preview-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.offer-preview-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.panel-topbar {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.panel-search input {
  width: 100%;
}

.inline-filter {
  min-width: 260px;
}

.filter-control {
  gap: 8px;
}

.stack,
.client-form,
.time-entry-form {
  display: grid;
  gap: 14px;
}

.time-export-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.time-export-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

#time-export-preview-button {
  grid-column: 1;
}

#time-export-button {
  grid-column: 2;
}

#time-export-api-button {
  grid-column: 3;
}

.export-history-heading {
  margin-top: 18px;
}

.time-export-month-button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.time-export-month-button.active {
  background: rgba(123, 132, 154, 0.16);
  border-color: rgba(123, 132, 154, 0.28);
  color: var(--accent-strong);
}

#time-export-preview-wrap {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

#view-export .panel {
  display: grid;
  gap: 18px;
}

#view-export .section-heading {
  margin-bottom: 0;
}

#view-export .table-wrap {
  overflow: auto;
}

.client-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.client-editor-panel {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  height: auto;
  opacity: 1;
  transform: translateY(0);
  transition: height 500ms ease, opacity 320ms ease, transform 500ms ease, margin-bottom 500ms ease, padding 500ms ease, border-color 320ms ease;
}

.client-editor-panel.hidden {
  height: 0;
  opacity: 0;
  transform: translateY(-8px);
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

.client-mva-checkbox {
  align-self: end;
  min-height: 50px;
  padding-bottom: 12px;
}

.table-contact-cell {
  display: grid;
  gap: 2px;
}

.time-entry-form {
  grid-template-columns: minmax(150px, 0.95fr) minmax(210px, 1.2fr) minmax(210px, 1.2fr) minmax(90px, 0.56fr) minmax(90px, 0.56fr) minmax(90px, 0.56fr);
  column-gap: 14px;
  row-gap: 14px;
}

.time-entry-form .time-date-field {
  min-width: 0;
  grid-column: 1;
}

.time-entry-form > label,
.time-entry-form .time-block {
  min-width: 0;
}

#time-entry-client {
  min-width: 0;
}

.time-entry-form .time-client-field {
  grid-column: 2 / span 2;
  padding-left: 10px;
}

.time-entry-form .time-start-field {
  grid-column: 4;
}

.time-entry-form .time-end-field {
  grid-column: 5;
}

.time-entry-form .time-hours-field {
  grid-column: 6;
}

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

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

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

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

.narrow-form {
  max-width: 480px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.time-block {
  display: grid;
  gap: 6px;
  align-self: start;
}

.time-block-label {
  font-size: 0.95rem;
}

.time-entry-form .time-project-block {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.time-entry-form .time-description-block {
  grid-column: 3 / span 4;
  grid-row: 2 / span 2;
  align-self: stretch;
  min-height: 0;
}

.time-entry-form .time-description-block textarea {
  height: 100%;
  min-height: 0;
  resize: none;
  overflow-y: auto;
}

.time-entry-form .time-description-block .time-block-label {
  margin-bottom: -20px;
}

.time-entry-form .time-note-block textarea {
  resize: none;
  overflow-y: auto;
}

.time-entry-form .time-note-block {
  grid-column: 1 / span 2;
  grid-row: 3;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-strong);
  color: var(--text);
}

input.auto-id-locked[readonly] {
  background: rgba(31, 33, 66, 0.05);
  border-style: dashed;
  color: rgba(31, 33, 66, 0.72);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

.time-date-field input {
  padding-right: 10px;
  border-radius: 16px;
  min-height: 48px;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.time-date-field input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.78;
  border-radius: 10px;
  padding: 2px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.04);
}

.ghost-button {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--border);
}

.header-filter {
  min-width: 260px;
}

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

.checkbox input {
  width: auto;
}

.checkbox .meta {
  margin-top: 0;
  font-size: 0.82rem;
}

.list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.list li {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  margin-top: 10px;
}

.badge.active {
  background: rgba(13, 107, 97, 0.12);
  color: var(--accent-strong);
}

.badge.inactive {
  background: rgba(132, 35, 35, 0.12);
  color: #7b1c1c;
}

.message {
  min-height: 24px;
  margin: 0 0 18px;
  color: var(--accent-strong);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  isolation: isolate;
}

.accordion-panel {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.accordion-panel summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 16px 48px 16px 18px;
  font-weight: 600;
  color: var(--accent-strong);
  background: rgba(29, 42, 51, 0.03);
  border-radius: 20px 20px 0 0;
}

.accordion-panel:not([open]) > summary {
  border-radius: 20px;
}

.accordion-panel summary::-webkit-details-marker {
  display: none;
}

.accordion-panel summary::after {
  content: attr(data-indicator);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  line-height: 1;
}

.accordion-panel .table-wrap {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.time-entry-groups {
  display: grid;
  gap: 8px;
}

#view-time .accordion-panel {
  margin-top: 8px;
}

#view-time .accordion-panel summary {
  padding: 12px 44px 12px 16px;
}

#view-time .time-week-panel .time-summary > span:first-child {
  margin-left: 20px;
}

#view-time .time-entry-groups .accordion-panel summary .time-summary-secondary {
  margin-left: 20px;
}

.time-entry-load-older-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.time-entry-load-older-wrap .ghost-button {
  min-width: 220px;
}

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

.time-summary-meta {
  display: grid;
  grid-template-columns: 112px 92px minmax(220px, 1fr);
  column-gap: 16px;
  align-items: center;
  justify-items: start;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

.time-summary-status-col,
.time-summary-hours-col,
.time-summary-amount-col {
  width: 100%;
}

.time-summary-status-col {
  display: flex;
  align-items: center;
}

.time-summary-status-col > .status-pill,
.time-summary-status-col > .week-status-button,
.time-summary-status-col > .week-status-dropdown {
  width: 100%;
}

.time-summary-status-col > .status-pill {
  justify-content: flex-start;
}

.time-summary-secondary {
  color: var(--accent-strong);
  font-weight: 600;
}

.time-summary-amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#view-time > article.panel:first-child {
  background: var(--time-tint);
  border-color: rgba(153, 139, 179, 0.18);
}

#view-time .accordion-panel > summary {
  background: var(--time-tint);
}

.week-status-button {
  padding: 6px 14px;
  border-radius: 999px;
  min-width: 0;
  justify-content: flex-start;
  box-sizing: border-box;
}

.week-status-icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.time-status-pill.open {
  background: rgba(159, 127, 163, 0.14);
  color: #5f476f;
}

.time-status-pill.approved {
  background: rgba(13, 107, 97, 0.12);
  color: #0b6157;
}

.time-status-pill.exported {
  background: rgba(71, 88, 165, 0.14);
  color: #3f4d90;
}

.time-status-pill.mixed {
  background: rgba(97, 104, 120, 0.14);
  color: #5c6374;
}

.week-status-dropdown {
  position: relative;
  display: flex;
  min-width: 0;
}

.week-status-dropdown-trigger {
  width: 100%;
  gap: 8px;
  border: 0;
  cursor: pointer;
  justify-content: flex-start;
}

.week-status-dropdown-trigger:hover {
  filter: brightness(0.98);
}

.week-status-dropdown-caret {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.82;
  margin-left: auto;
}

.week-status-dropdown .split-action-menu {
  top: calc(100% + 12px);
  right: 0;
  min-width: 150px;
  border-radius: 14px;
  z-index: 60;
}

.offer-status-pill.draft {
  background: rgba(132, 35, 35, 0.1);
  color: #8a3f3f;
}

.offer-status-pill.sent {
  background: rgba(205, 128, 33, 0.14);
  color: #9a6114;
}

.offer-status-pill.accepted {
  background: rgba(13, 107, 97, 0.12);
  color: #0b6157;
}

.offer-status-pill.exported {
  background: rgba(71, 88, 165, 0.14);
  color: #3f4d90;
}

.offer-status-pill.rejected {
  background: rgba(132, 35, 35, 0.12);
  color: #7b1c1c;
}

.offer-status-pill.expired {
  background: rgba(97, 104, 120, 0.14);
  color: #5c6374;
}


.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.data-table tbody tr {
  position: relative;
}

.data-table tbody tr:has(.split-action.is-open) {
  z-index: 12;
}

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

.data-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(29, 42, 51, 0.03);
}

#time-entry-groups .data-table th,
#time-entry-groups .data-table td {
  padding: 11px 14px;
}

#time-entry-groups .data-table td {
  line-height: 1.35;
}

.data-table tbody tr:hover {
  background: rgba(13, 107, 97, 0.04);
}

.floating-time-entry-tooltip {
  position: fixed;
  z-index: 9999;
  display: grid;
  gap: 6px;
  width: min(640px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(26, 32, 60, 0.16);
  color: var(--text);
  pointer-events: none;
}

.floating-time-entry-tooltip.hidden {
  display: none;
}

.floating-time-entry-tooltip strong {
  font-size: 0.84rem;
  color: var(--accent-strong);
}

.floating-time-entry-tooltip span {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.accordion-panel:has(.data-table tbody tr.has-time-entry-tooltip:hover) {
  z-index: 30;
}

.table-name {
  font-weight: 600;
}

.table-subline {
  display: block;
  margin-top: 4px;
  font-size: 0.86rem;
  color: var(--muted);
}

.table-subline-flow {
  margin-top: 5px;
  font-size: 0.8rem;
  color: #5d6174;
}

.table-subline-tight {
  margin-top: 0;
}

.audit-details-cell {
  max-width: 520px;
  white-space: normal;
  word-break: break-word;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  box-sizing: border-box;
}

.status-pill.active {
  background: rgba(13, 107, 97, 0.12);
  color: var(--accent-strong);
}

.status-pill.inactive {
  background: rgba(132, 35, 35, 0.12);
  color: #7b1c1c;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  padding: 0;
  font-size: 1rem;
}

.table-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.offer-action-cell {
  position: relative;
  justify-content: flex-start;
  z-index: 2;
}

.split-action {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 188px;
  max-width: 100%;
}

.split-action-main {
  min-width: 0;
  flex: 1;
  justify-content: center;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.split-action-toggle {
  min-width: 44px;
  padding-inline: 12px;
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.split-action-toggle span {
  display: inline-block;
  font-size: 0.82rem;
  line-height: 1;
}

.split-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(23, 28, 45, 0.12);
  display: grid;
  gap: 4px;
  z-index: 40;
}

.split-action.open-upward .split-action-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.split-action-item {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 600;
}

.split-action-item:hover {
  background: rgba(111, 99, 131, 0.08);
  filter: none;
}

.table-action-row-split {
  width: 100%;
}

.table-action-row-split .delete-organisation-button {
  margin-left: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 24, 28, 0.48);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 34px 80px rgba(10, 24, 28, 0.18);
}

.modal-card-compact {
  width: min(520px, 100%);
}

.modal-card-client {
  width: min(980px, 100%);
}

.modal-card-approve-hours {
  width: min(1460px, 100%);
}

#approve-hours-modal .table-wrap {
  overflow-x: auto;
}

#approve-hours-modal .data-table {
  min-width: 1120px;
}

#approve-hours-modal .data-table th:nth-child(1),
#approve-hours-modal .data-table td:nth-child(1) {
  width: 120px;
}

#approve-hours-modal .data-table th:nth-child(2),
#approve-hours-modal .data-table td:nth-child(2) {
  width: 80px;
}

#approve-hours-modal .data-table th:nth-child(3),
#approve-hours-modal .data-table td:nth-child(3) {
  width: 150px;
}

#approve-hours-modal .data-table th:nth-child(4),
#approve-hours-modal .data-table td:nth-child(4) {
  width: 120px;
}

#approve-hours-modal .data-table th:nth-child(6),
#approve-hours-modal .data-table td:nth-child(6) {
  width: 130px;
}

#approve-hours-modal .data-table th:nth-child(7),
#approve-hours-modal .data-table td:nth-child(7) {
  width: 110px;
}

#approve-hours-modal .data-table th:nth-child(8),
#approve-hours-modal .data-table td:nth-child(8) {
  width: 120px;
}

.modal-card-user {
  width: min(720px, 100%);
}

.rate-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.offer-lines-wrap {
  display: grid;
  gap: 10px;
}

.offer-editor-wrap {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.offer-editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.offer-editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.offer-editor-checkbox {
  margin: 0;
}

.offer-editor-currency select {
  min-width: 150px;
}

.offer-editor-price-mode {
  display: inline-flex;
  gap: 6px;
}

.offer-editor-price-mode .ghost-button.active {
  background: rgba(123, 132, 154, 0.16);
  border-color: rgba(123, 132, 154, 0.28);
  color: var(--text);
}

.offer-editor-head {
  display: grid;
  grid-template-columns: 28px 90px minmax(260px, 1.5fr) 110px 110px 240px 42px;
  gap: 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.offer-page-lines {
  display: grid;
  gap: 14px;
}

.offer-page-line {
  display: grid;
  grid-template-columns: 90px minmax(260px, 1.5fr) 110px 110px 240px 116px;
  gap: 8px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.offer-page-group {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.6fr) 116px;
  gap: 8px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.offer-page-line input,
.offer-page-line textarea,
.offer-page-line select {
  margin-top: 0;
}

.offer-page-line-description {
  display: grid;
  gap: 8px;
}

.offer-page-line-description textarea {
  min-height: 74px;
  resize: vertical;
  overflow-y: hidden;
}

.offer-page-group-description textarea {
  min-height: 92px;
  resize: vertical;
  overflow-y: hidden;
}

#offer-page-terms-text {
  resize: vertical;
  overflow-y: hidden;
}

.offer-page-group-title input {
  font-weight: 700;
}

.offer-page-lines input[type="number"]::-webkit-outer-spin-button,
.offer-page-lines input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.offer-page-lines input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.offer-page-line-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.offer-page-line-vat {
  display: grid;
  gap: 8px;
  align-items: start;
  justify-items: start;
}

.offer-page-line-vat select {
  min-width: 0;
  width: 100%;
}

.offer-page-line-optional {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-self: start;
  align-self: start;
  gap: 10px;
  margin-left: 2px;
  color: var(--text);
  font-size: 0.92rem;
  min-height: 24px;
  line-height: 1.2;
  white-space: nowrap;
  width: auto;
  max-width: max-content;
}

.offer-page-line-optional input {
  margin: 0;
  flex: 0 0 auto;
}

.offer-page-line-optional span {
  display: inline-block;
}

.offer-page-line-total {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.offer-page-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 0;
}

.offer-page-line-remove {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.offer-page-group-remove {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.offer-page-row-duplicate,
.offer-page-row-drag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--border);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.offer-page-row-duplicate:hover,
.offer-page-row-drag:hover,
.offer-page-row-duplicate:focus-visible,
.offer-page-row-drag:focus-visible {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(120, 86, 99, 0.22);
}

.offer-page-row-duplicate:active,
.offer-page-row-drag:active {
  transform: translateY(1px);
}

.offer-page-row-duplicate::before,
.offer-page-row-duplicate::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 14px;
  border: 1.4px solid var(--accent-strong);
  border-radius: 3px;
  box-sizing: border-box;
  left: 50%;
  top: 50%;
}

.offer-page-row-duplicate::before {
  transform: translate(-14%, -52%);
  background: rgba(255, 255, 255, 0.9);
}

.offer-page-row-duplicate::after {
  transform: translate(-50%, -16%);
  background: transparent;
}

.offer-page-row-drag {
  cursor: grab;
}

.offer-page-row-drag:active {
  cursor: grabbing;
}

.offer-page-row-drag::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 18px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-image:
    radial-gradient(circle, var(--accent-strong) 1.25px, transparent 1.35px),
    radial-gradient(circle, var(--accent-strong) 1.25px, transparent 1.35px);
  background-size: 6px 6px;
  background-position: 0 0, 6px 0;
}

.offer-page-line.is-dragging,
.offer-page-group.is-dragging {
  opacity: 0.58;
}

.offer-page-line.drag-over-before,
.offer-page-group.drag-over-before {
  border-top: 2px solid rgba(120, 86, 99, 0.38);
  padding-top: 10px;
}

.offer-page-line.drag-over-after,
.offer-page-group.drag-over-after {
  border-bottom: 2px solid rgba(120, 86, 99, 0.38);
  padding-bottom: 10px;
}

.offer-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-top: 8px;
}

.offer-editor-actions {
  display: flex;
  gap: 10px;
}

.offer-editor-totals {
  min-width: 220px;
  display: grid;
  gap: 8px;
}

.offer-editor-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.offer-editor-total-row-final {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.offer-editor-wrap.vat-hidden .offer-page-line-vat,
.offer-editor-wrap.vat-hidden .offer-editor-total-row-vat {
  display: none;
}

@media (max-width: 1320px) {
  .offer-editor-head,
  .offer-page-line {
    grid-template-columns: 28px 80px minmax(220px, 1.2fr) 96px 96px 210px 42px;
  }

  .offer-page-group {
    grid-template-columns: 28px minmax(180px, 0.9fr) minmax(220px, 1.4fr) 42px;
  }
}

.offer-lines-top {
  margin-bottom: 0;
}

.offer-lines-top h4 {
  margin: 0;
}

.client-contacts-wrap {
  display: grid;
  gap: 12px;
}

.client-contact-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.1fr) minmax(220px, 1.2fr) minmax(170px, 0.95fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.client-contact-recipient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding-bottom: 10px;
}

.client-contact-recipient input {
  margin: 0;
  width: auto;
}

.client-contact-remove {
  height: 46px;
  border-radius: 12px;
  padding: 0 12px;
}

.form-context-banner {
  margin: 2px 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.offer-source-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.offer-source-context {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(39, 43, 79, 0.72);
}

.offer-source-timeline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.offer-source-timeline-item {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.client-form.is-readonly .form-context-banner {
  background: transparent;
  border-color: transparent;
}

.client-form.is-readonly .offer-editor-wrap {
  background: rgba(255, 255, 255, 0.86);
}

.client-form.is-readonly .offer-editor-toolbar,
.client-form.is-readonly .offer-editor-head,
.client-form.is-readonly .offer-editor-footer,
.client-form.is-readonly label {
  color: rgba(39, 43, 79, 0.82);
}

.client-form.is-readonly input,
.client-form.is-readonly textarea,
.client-form.is-readonly select,
.client-form.is-readonly .offer-page-line-total {
  background: rgba(255, 255, 255, 0.86);
  color: rgba(39, 43, 79, 0.72);
  border-color: rgba(123, 132, 154, 0.16);
}

.client-form.is-readonly .offer-page-group,
.client-form.is-readonly .offer-page-line {
  background: transparent;
  border-color: rgba(123, 132, 154, 0.12);
}

.client-form.is-readonly .offer-editor-actions,
.client-form.is-readonly .offer-page-row-actions {
  display: none;
}

.client-form.is-readonly .offer-editor-footer {
  justify-content: flex-end;
}

.client-form.is-readonly .offer-editor-totals {
  margin-left: auto;
}

.client-form.is-readonly .offer-page-line {
  grid-template-columns: 90px minmax(260px, 1.5fr) 110px 110px 240px;
}

.client-form.is-readonly .offer-page-group {
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.6fr);
}

.client-form.is-readonly .offer-page-line-optional {
  opacity: 0.72;
}

.client-form.is-readonly .offer-page-line-optional input {
  pointer-events: none;
}

.panel-detail {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.is-selected-row {
  background: rgba(123, 132, 154, 0.08);
}

.offer-line {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(100px, 0.28fr)) minmax(120px, 0.28fr) auto;
  align-items: end;
  margin-bottom: 10px;
}

.offer-group {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
  align-items: end;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(123, 132, 154, 0.08);
}

.offer-line-description-field textarea {
  min-height: 74px;
  resize: none;
  overflow-y: auto;
}

.offer-group textarea {
  min-height: 88px;
  resize: none;
  overflow-y: auto;
}

.offer-line-optional-field input {
  width: auto;
  margin-top: 10px;
}

.offer-line-remove {
  height: 46px;
  border-radius: 12px;
  padding: 0 12px;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.time-entry-actions {
  justify-content: flex-end;
}

.time-entry-actions .ghost-button {
  margin-right: auto;
}

.time-entry-delete-button {
  margin-right: 8px;
  background: #fff7f7;
  color: #b3261e;
  border: 1px solid rgba(179, 38, 30, 0.35);
}

.time-entry-delete-button:hover {
  background: #ffecec;
  filter: none;
}

.login-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 0.9fr);
}

.login-hero {
  padding: 56px;
  color: #f3f7f7;
  background:
    linear-gradient(180deg, rgba(20, 36, 44, 0.72), rgba(15, 29, 34, 0.78)),
    var(--login-hero-image, none) center / cover no-repeat,
    radial-gradient(circle at top right, rgba(211, 106, 49, 0.18), transparent 28%),
    linear-gradient(180deg, #153138, #0f2529);
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 56px;
  background: rgba(255, 255, 255, 0.72);
}

.login-hint {
  padding: 14px 16px;
  border: 1px dashed rgba(13, 107, 97, 0.28);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

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

.profile-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.profile-hero-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, #7f8ea1, #5f6f83);
}

.profile-hero-copy {
  display: grid;
  gap: 2px;
}

.mail-preview-section {
  display: grid;
  gap: 18px;
  margin-top: 8px;
  padding-top: 8px;
}

.section-heading-inline {
  margin-bottom: 0;
}

.section-heading-inline h4 {
  margin: 0;
  font-size: 1rem;
}

.mail-preview-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.mail-preview-card {
  display: grid;
  gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  grid-template-rows: auto auto 1fr;
  align-content: start;
}

.mail-preview-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-weight: 700;
}

.mail-preview-subject {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
  min-height: 2.6em;
  display: block;
}

.mail-preview-body {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  align-content: start;
}

.mail-preview-body p {
  margin: 0;
}

.profile-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.profile-name-strong {
  font-size: 1.15rem;
  line-height: 1.2;
}

.profile-email-line {
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.profile-role-wrap {
  text-align: right;
}

.profile-role-badge {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3f4d60;
  background: rgba(127, 142, 161, 0.18);
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.profile-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.profile-value {
  font-size: 1rem;
  line-height: 1.4;
}

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

  .sidebar {
    gap: 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .menu {
    display: grid;
    flex: initial;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .main-content {
    padding: 20px;
  }

  .modal-card {
    padding: 18px;
  }

  .profile-hero-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .profile-role-wrap {
    text-align: left;
  }

  .client-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .time-entry-form {
    grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr) 90px 90px 90px;
  }

  .offer-line {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .offer-group {
    grid-template-columns: 1fr;
  }

  .time-export-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #time-export-preview-button,
  #time-export-button,
  #time-export-api-button {
    grid-column: auto;
  }

  .branding-split {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: start;
    flex-direction: column;
  }

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

  .login-hero,
  .login-card {
    padding: 28px 20px;
  }
}

@media (max-width: 1320px) {
  .time-entry-form {
    grid-template-columns: 146px minmax(180px, 1fr) minmax(180px, 1fr) 86px 86px 86px;
    column-gap: 12px;
  }

  .time-entry-form .time-client-field {
    padding-left: 8px;
  }
}

@media (max-width: 1160px) {
  .time-entry-form {
    grid-template-columns: 150px minmax(200px, 1fr) 86px 86px 86px;
  }

  .time-entry-form .time-client-field {
    grid-column: 2 / span 4;
    padding-left: 12px;
  }

  .time-entry-form .time-start-field {
    grid-column: 3;
  }

  .time-entry-form .time-end-field {
    grid-column: 4;
  }

  .time-entry-form .time-hours-field {
    grid-column: 5;
  }

  .time-entry-form .time-project-block {
    grid-column: 1 / span 2;
  }

  .time-entry-form .time-description-block {
    grid-column: 3 / span 3;
  }

  .time-entry-form .time-note-block {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 720px) {
  .main-content {
    padding: 16px;
  }

  .panel,
  .sidebar {
    padding: 18px;
  }

  .page-header,
  .section-heading,
  .panel-topbar,
  .toolbar,
  .header-right {
    align-items: start;
    flex-direction: column;
  }

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

  .menu {
    display: grid;
    grid-template-columns: 1fr;
  }

  .menu-group-admin {
    margin-top: 0;
    padding-top: 0;
  }

  .client-form,
  .time-entry-form,
  .time-export-toolbar {
    grid-template-columns: 1fr;
  }

  .time-entry-form .time-client-field {
    padding-left: 0;
  }

  .time-entry-form .time-client-field,
  .time-entry-form .time-date-field,
  .time-entry-form .time-start-field,
  .time-entry-form .time-end-field,
  .time-entry-form .time-hours-field,
  .time-entry-form .time-project-block,
  .time-entry-form .time-description-block,
  .time-entry-form .time-note-block {
    grid-column: auto;
  }

  .time-export-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .offer-line {
    grid-template-columns: 1fr;
  }

  .offer-group,
  .offer-page-group {
    grid-template-columns: 1fr;
  }

  .dashboard-primary-action {
    min-width: 100%;
  }

  .span-2,
  .span-1,
  .span-3,
  .span-4,
  .span-6 {
    grid-column: auto;
  }

  .rate-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}
.offer-overview-row {
  cursor: pointer;
}

.offer-overview-row:hover td:not(:last-child) {
  background: rgba(111, 99, 131, 0.04);
}
.offer-source-status {
  display: inline-flex;
  margin-left: 0;
  vertical-align: middle;
}
