:root {
  --ink: #0f172a;
  --accent: #0d1b2a;
  --accent-2: #0ea5e9;
  --bg-1: #f8f4ee;
  --bg-2: #f1e7d8;
  --card: #ffffff;
  --shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
  --nav-bg: #0f172a;
  --nav-text: #f8fafc;
  --nav-hover: rgba(255, 255, 255, 0.08);
}

.d-none {
  display: none !important;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: white;
  color: var(--ink);
  margin: 0;
}

body.feedback-open {
  overflow: hidden;
}

body.auth {
  background: #0d1b2a;
  min-height: 100vh;
}

body.auth .brand-bar,
body.auth .sidebar {
  display: none;
}

body.auth .layout {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

body.auth .content {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.auth-shell {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  position: relative;
  overflow: hidden;
}

.auth-shell.auth-shell-center {
  width: min(520px, 100%);
  grid-template-columns: 1fr;
  padding: 28px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-shell::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 111, 60, 0.15);
  top: -120px;
  right: -120px;
}

.auth-shell::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.12);
  bottom: -120px;
  left: -120px;
}

.auth-shell.auth-shell-center::before,
.auth-shell.auth-shell-center::after {
  content: none;
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.auth-panel-info {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 18px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-brand.auth-brand-center {
  justify-content: center;
  width: 100%;
  margin-bottom: 12px;
}

.auth-brand i {
  font-size: 1.4rem;
}

.auth-panel-info h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  margin: 6px 0 4px;
}

.auth-panel-info p {
  color: rgba(248, 250, 252, 0.8);
  margin: 0;
}

.auth-features {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.auth-feature i {
  color: #ff6f3c;
  font-size: 1.1rem;
}

.auth-panel-form {
  justify-content: center;
}

.auth-form-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.auth-form-card h2 {
  margin-bottom: 8px;
}

.auth-links {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.auth-links a {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.premium-lock-page {
  width: 100%;
}

.premium-lock-shell {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.premium-lock-kicker {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(13, 27, 42, 0.14);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.premium-lock-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
}

.premium-lock-price-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.premium-lock-price-period {
  font-size: 0.92rem;
  color: #64748b;
}

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

.premium-lock-box {
  background: #fff;
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-radius: 12px;
  padding: 14px;
}

.premium-lock-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.premium-lock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.premium-lock-chip {
  border: 1px solid rgba(13, 27, 42, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.86rem;
  color: #334155;
  background: #f8fafc;
}

.premium-lock-chip.is-current {
  background: #0d1b2a;
  color: #f8fafc;
  border-color: #0d1b2a;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-panel-info {
    order: 2;
  }
  .auth-panel-form {
    order: 1;
  }
  .auth-shell.auth-shell-center {
    padding: 20px;
  }
  .premium-lock-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 16px;
  }
  .auth-panel {
    padding: 12px;
  }
  .auth-feature {
    font-size: 0.85rem;
  }
}

.brand-bar {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 12px 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 1100;
}

.brand-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-page-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 60%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  pointer-events: none;
  font-size: 21px;
}

.page-title-hidden {
  display: none !important;
}

.brand-bar .btn-link {
  color: var(--nav-text);
}

.brand-bar .btn-link:hover {
  color: var(--nav-text);
}

.brand-actions {
  display: flex;
  align-items: center;
}

.nav-color-form {
  display: flex;
  align-items: center;
}

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

.nav-color-trigger {
  border: 1px solid var(--nav-text);
  color: var(--nav-text);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.nav-color-trigger:hover {
  background: var(--nav-hover);
  color: var(--nav-text);
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
  width: 100%;
  min-width: 0;
}

.sidebar {
  background: var(--nav-bg);
  padding: 24px 16px;
  color: var(--nav-text);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  width: 220px;
  z-index: 200000;
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nav-text);
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 6px;
}

.sidebar-link i {
  color: inherit;
}

.sidebar-link:hover {
    background: var(--nav-hover);
    color: var(--nav-text);
  }

  .sidebar-link.is-active {
    background: var(--nav-hover);
    color: var(--nav-text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  }

.sidebar .btn-accent {
  background: var(--nav-text);
  color: var(--nav-bg);
  border: 0;
}

.costs-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.costs-tab {
  border: 1px solid #d7dde5;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}
.creditors-tab {
  position: relative;
}
.creditors-tab-status {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.creditors-tab-status--idle {
  color: #94a3b8;
}
.creditors-tab-status--loading {
  color: #0ea5e9;
}
.creditors-tab-status--loading i {
  animation: creditors-spin 0.9s linear infinite;
}
.creditors-tab-status--ok {
  color: #16a34a;
}
.creditors-tab-status--empty {
  color: #f59e0b;
}
.creditors-tab-status--debug {
  color: #7c3aed;
}
.creditors-tab-status--none,
.creditors-tab-status--error {
  color: #ef4444;
}
@keyframes creditors-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.costs-tab.is-active {
  background: var(--nav-bg, #0f172a);
  color: var(--nav-text, #fff);
  border-color: transparent;
}
.costs-pane {
  display: none;
}
.costs-pane.is-active {
  display: block;
}
.cost-card iframe,
.costs-inbox-preview iframe {
  width: 100%;
  height: 320px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.costs-inbox {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}
.costs-inbox-list {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  min-height: 320px;
}
.costs-inbox-item {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.costs-inbox-item:hover {
  background: #f1f5f9;
}
.costs-inbox-preview {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  min-height: 320px;
}
.costs-inbox-preview-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.costs-inbox-form {
  display: flex;
  flex-direction: column;
}
.costs-archive-table td {
  vertical-align: middle;
}
.costs-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.costs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}
.costs-modal-panel {
  position: relative;
  width: min(1200px, 96vw);
  height: min(90vh, 900px);
  margin: 4vh auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}
.costs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.costs-modal-panel iframe {
  flex: 1;
  width: 100%;
  border: 0;
}
@media (max-width: 900px) {
  .costs-inbox {
    grid-template-columns: 1fr;
  }
  .costs-inbox-preview-body {
    grid-template-columns: 1fr;
  }
}

.sidebar .btn-accent:hover {
  background: var(--nav-hover);
  color: var(--nav-text);
}

.btn-icon {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.btn-icon i,
.btn-icon svg,
.btn-icon-mail i,
.btn-icon-mail svg,
.doc-mail-icon i,
.doc-mail-icon svg {
  font-size: 1.4rem;
  width: 1.4rem;
  height: 1.4rem;
  line-height: 1;
  display: block;
}

.btn-icon-view {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.btn-icon-view:hover {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-2);
}

.btn-icon-edit {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon-edit:hover {
  background: rgba(0, 0, 0, 0.2);
  color: var(--accent);
}

.btn-icon-pdf {
  border-color: #dc2626;
  color: #dc2626;
}

.btn-icon-pdf:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.btn-icon-convert {
  border-color: #10b981;
  color: #10b981;
}

.btn-icon-convert:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.btn-icon-agenda.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(148, 163, 184, 0.4);
  color: #94a3b8;
  background: transparent;
}

.btn-icon-agenda.is-disabled i {
  color: inherit;
}

.btn-icon-delete {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-icon-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.content {
  padding: 24px 32px;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
  max-width: 100%;
  align-self: stretch;
  justify-self: stretch;
  box-sizing: border-box;
}

body:not(.sidebar-collapsed) .content {
  width: 100%;
  min-width: 0;
}

body.sidebar-collapsed .content {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1200px) {
  .layout,
  body.sidebar-collapsed .layout,
  body:not(.sidebar-collapsed) .layout {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
  }
  .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    grid-column: 1 / -1;
  }
}

@media (max-width: 991px) {
  body:not(.sidebar-collapsed) .content,
  body.sidebar-collapsed .content {
    width: 100%;
    min-width: 0;
  }
}

.sidebar-toggle {
  font-size: 20px;
}

body.sidebar-collapsed .layout {
  grid-template-columns: 72px 1fr;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
  padding: 24px 10px;
}

body.sidebar-collapsed .sidebar-link span {
  display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
  }

.sidebar-feedback-link {
  margin-top: auto;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 300000;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.feedback-modal-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.feedback-modal-body {
  padding: 16px;
  overflow: auto;
}

.feedback-status.is-success {
  color: #15803d !important;
}

.feedback-rendered {
  max-width: 420px;
}

.feedback-rendered p:last-child {
  margin-bottom: 0;
}

  body.sidebar-collapsed .sidebar-link[data-tooltip] {
    position: relative;
  }

body.sidebar-collapsed .sidebar-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0.96);
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 99999;
  }

body.sidebar-collapsed .sidebar-link[data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--nav-bg);
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    rotate: 45deg;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 99998;
  }

  body.sidebar-collapsed .sidebar-link:hover {
    z-index: 100000;
  }

  body.sidebar-collapsed .sidebar-link[data-tooltip]:hover::after,
  body.sidebar-collapsed .sidebar-link[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  body.sidebar-collapsed .sidebar-link[data-tooltip]:hover::before,
  body.sidebar-collapsed .sidebar-link[data-tooltip]:focus-visible::before {
    opacity: 1;
  }

body.sidebar-collapsed .logout-text {
  display: none;
}

body.embedded .brand-bar,
body.embedded .sidebar {
  display: none;
}

body.embedded .layout {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

body.embedded .content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}

body.embedded .agenda-card,
body.embedded .agenda-grid,
body.embedded .agenda-days {
  width: 100%;
  max-width: 100%;
}

body.embedded .agenda-grid {
  overflow-x: hidden;
}

body.embedded .agenda-days {
  min-width: 0;
}

.row-clickable {
  cursor: pointer;
}

.row-iframe-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 720px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.row-iframe-view {
  width: 100%;
  max-width: 100%;
  height: 80vh;
  min-height: 720px;
  border: 0;
  display: block;
  background: #ffffff;
}

.customer-suggestions {
  border-radius: 12px;
  border: 0;
  background: transparent;
}

.customer-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.customer-suggestions-list {
  border-radius: 12px;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}

.customer-suggestions-list .list-group-item {
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.customer-suggestions.is-open {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.nice-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

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

.nice-check .nice-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #fff;
  transition: all 0.2s ease;
}

.nice-check input:checked + .nice-box {
  background: #0d1b2a;
  border-color: #0d1b2a;
}

.nice-check input:checked + .nice-box::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-bottom: 2px;
}

.nice-check .nice-text {
  color: #0f172a;
}

.drag-handle {
  cursor: grab;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

tr.dragging {
  opacity: 0.6;
}

.qty-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-unit .form-control {
  max-width: 110px;
}

.qty-unit .form-select {
  max-width: 130px;
}

.add-row-btn {
  color: var(--accent);
  padding: 10px 0;
  font-size: 20px;
}

.add-row-btn:hover {
  color: #ff8658;
}

.fixed-actions {
  position: fixed;
  left: calc(220px + 24px);
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fixed-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 56px;
  border-radius: 999px;
  font-size: 22px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
  flex: 1 1 auto;
  width: 100%;
}

.fixed-delete-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.totals-box {
  max-width: 320px;
  margin-left: auto;
}

.totals-box-wide {
  max-width: none;
  width: 100%;
}

.payments-box {
  max-width: 520px;
  margin-left: auto;
}

.payment-link-box {
  max-width: 520px;
  margin-left: auto;
}

.payment-link-box .payment-link-line {
  word-break: break-all;
}

.payment-link-preview {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.payment-link-preview img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 6px;
}

.payments-box-wide {
  max-width: none;
  width: 100%;
}

.appointments-box,
.appointments-view {
  width: auto;
}

.payments-box {
  width: 100%;
}

.payment-link-box {
  width: 100%;
  float:left;
}

.totals-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.totals-stack .payments-box,
.totals-stack .appointments-view,
.totals-stack .appointments-box {
  align-self: auto;
}

.payment-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.payment-row .btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.payment-delete {
  margin-left: 8px;
}

.payment-add .btn.btn-accent {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
}

.payment-row .form-select,
.payment-row .form-control {
  font-size: 0.9rem;
  height: 42px;
}

.payment-row .input-group-text {
  height: 42px;
  display: inline-flex;
  align-items: center;
}

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

.payment-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  gap: 10px;
}

.payment-pill span {
  min-width: 120px;
}

.payment-pill strong {
  margin-left: auto;
  min-width: 90px;
  text-align: right;
}

.payment-summary strong {
  font-size: 0.95rem;
}

.payment-summary .is-negative {
  color: #dc2626;
  font-weight: 700;
}

.paid-badge {
  color: #16a34a;
  font-weight: 600;
  margin-left: 6px;
}

.collapse-pane {
  display: none;
}

.collapse-pane.is-open {
  display: block;
}

@media (max-width: 991px) {
  .layout {
    grid-template-columns: 1fr;
  }
  body.sidebar-collapsed .layout {
    grid-template-columns: 1fr !important;
  }
  .brand-page-title {
    max-width: 50%;
    font-size: 0.9rem;
    position: static;
    transform: none;
    margin-left: auto;
    margin-right: 10px;
    text-align: right;
    pointer-events: auto;
  }
  .content {
    padding: 16px;
    padding-bottom: 200px;
    max-width: 100%;
    overflow-x: hidden;
    width: 100% !important;
    grid-column: 1 / -1;
  }
  .content > * {
    max-width: 100%;
  }
  .fixed-actions {
    left: 16px;
    right: 16px;
  }
  .totals-box {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
  }
  .payments-box {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
  }
  .appointments-box,
  .appointments-view {
    width: 100%;
    margin-left: 0;
  }
  .payment-row {
    grid-template-columns: 1fr 1fr;
  }
  .payment-row .js-payment-date {
    grid-column: span 2;
  }
  .fixed-actions {
    left: 16px;
    right: 16px;
  }
  .fixed-actions .fixed-save-btn {
    flex: 1;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    z-index: 1000;
    width: 220px;
    height: calc(100vh - 56px);
    overflow-y: auto;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .doc-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .doc-title-box {
    align-items: flex-start;
  }
  .doc-actions-right {
    justify-content: flex-start;
  }
  .doc-company-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .doc-company-row > :nth-child(2) {
    justify-self: start;
  }
  .doc-company-meta .doc-meta-item {
    justify-content: flex-start;
    gap: 8px;
  }
  .doc-meta-item {
    min-width: 0;
    text-align: left;
  }
  .doc-actions-bottom {
    left: 16px;
    right: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

body.sidebar-collapsed .fixed-actions {
  left: calc(72px + 24px);
}

.card {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.content .card.p-4 {
  border-top-left-radius: 5px;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

.btn-accent:hover {
  background: #6b94b2;
  color: #fff;
}

.btn-outline-accent {
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline-accent:hover {
  background: #6b94b2;
  color: #fff;
}

.nav-link.active {
  color: var(--accent) !important;
  font-weight: 600;
}

.table thead th {
  background: #f8fafc;
  font-weight: 600;
}

.table td,
.table th {
  vertical-align: middle;
}

.vat-excluded .col-tax,
.vat-excluded .col-tax-amount {
  display: none;
}

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

.filter-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.filter-submit-btn {
  min-width: 140px;
}

.filter-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.filter-chip:hover {
  background: rgba(15, 23, 42, 0.16);
}

.filter-chip i {
  font-size: 1rem;
}

.pagination-wrap {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-limit-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.table-limit-label {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-limit-select {
  width: auto;
  min-width: 96px;
  border-radius: 999px;
  padding-right: 34px;
}

.th-actions {
  text-align: right;
  white-space: nowrap;
}

.th-actions > span {
  margin-right: 8px;
}

.pagination-meta {
  color: #64748b;
  font-size: 0.9rem;
}

.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  padding: 6px;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.pagination-nav .page-link {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  text-decoration: none;
  border: 0;
  background: transparent;
  transition: all 0.2s ease;
}

.pagination-nav .page-link:hover {
  background: rgba(148, 163, 184, 0.18);
  color: #fff;
}

.pagination-nav .page-link.is-active {
  background: #6b94b2;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.pagination-nav .page-link.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.pagination-nav .page-ellipsis {
  color: rgba(226, 232, 240, 0.6);
  padding: 0 6px;
}

@media (max-width: 767px) {
  .pagination-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .pagination-nav {
    width: 100%;
    justify-content: center;
  }
}

.invoice-status-open td:first-child {
  border-left: 4px solid #ef4444;
  padding-left: 12px;
}

.invoice-status-partial td:first-child {
  border-left: 4px solid #f59e0b;
  padding-left: 12px;
}

.invoice-status-paid td:first-child {
  border-left: 4px solid #22c55e;
  padding-left: 12px;
}

.badge-soft {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 4px 10px;
}

.dashboard-card {
  cursor: default;
}

.dashboard-col.is-dragging {
  opacity: 0.6;
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.doc-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  margin-bottom: 24px;
}

.doc-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.doc-title-center {
  align-items: center;
}

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

.doc-logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.workorders-panel {
  margin-top: 1.5rem;
}
.workorders-panel .workorders-panel-inner {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
.workorder-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.workorder-internal {
  background: rgba(15, 23, 42, 0.04);
  padding: 10px;
  border-radius: 8px;
}
.workorder-internal.d-none {
  display: none !important;
}
.workorder-doc-link {
  color: #2563eb;
  text-decoration: underline;
}
.workorder-detail-row td {
  background: transparent;
  padding-top: 12px;
}
@media (max-width: 767px) {
  .workorder-detail-row td {
    display: block;
    width: 100%;
  }
  .workorder-detail-row .card {
    width: 100%;
  }
}
.form-section-title {
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 8px 0 12px;
  color: #0b1220;
}

.doc-company-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.45;
}

.doc-company-col,
.doc-company-meta {
  min-width: 0;
}

.doc-company-row > :nth-child(2) {
  justify-self: center;
}

.doc-company-meta .doc-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.2;
}

.doc-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.doc-title-box .flag-group .flag-btn {
  opacity: 0.35;
}

.doc-title-box .flag-group .flag-btn.is-active,
.doc-title-box .flag-group input:checked + .flag-btn {
  opacity: 1;
}

.doc-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.doc-lang {
  display: none;
  align-items: center;
  gap: 8px;
}

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

.doc-meta-row {
  display: flex;
  gap: 24px;
  padding: 12px 0 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
  justify-content: flex-end;
}

.doc-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  text-align: right;
}

.doc-meta-item span {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.doc-meta-item strong {
  font-size: 1rem;
  color: var(--ink);
}

.doc-actions-bottom {
  position: fixed;
  left: calc(220px + 24px);
  bottom: 24px;
  justify-content: flex-end;
  z-index: 1200;
}

body.sidebar-collapsed .doc-actions-bottom {
  left: calc(72px + 24px);
}

.doc-view-card {
  padding-bottom: 180px;
  min-height: 80vh;
}

.doc-pdf-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: 0;
}

.doc-mail-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #16a34a;
  border: 1px solid #16a34a;
}

.doc-mail-icon:hover {
  background: #16a34a;
  color: #fff;
}

.doc-agenda-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
}

.doc-agenda-icon:hover {
  background: #0ea5e9;
  color: #fff;
}

.doc-convert-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
}

.doc-convert-icon:hover {
  background: #0ea5e9;
  color: #fff;
}

.btn-icon-mail {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #16a34a;
  border: 0;
}

.btn-icon-mail:hover {
  background: #16a34a;
  color: #fff;
}

.doc-mail-sent {
  font-size: 0.9rem;
  margin-bottom: 48px;
}

.doc-edit-btn {
  height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.customer-box .form-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}

.customer-docs-table tbody tr {
  cursor: pointer;
}

.customer-dialog {
  display: none;
  width: min(1100px, 96vw);
  height: min(90vh, 90vh);
  min-width: 640px;
  min-height: 420px;
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  position: fixed;
  inset: 0;
  margin: auto;
  transform: none;
  resize: both;
  overflow: hidden;
  flex-direction: column;
}

.customer-dialog[open] {
  display: flex;
}

.customer-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.customer-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  z-index: 1;
  cursor: move;
}

.customer-dialog-body {
  flex: 1;
  overflow: auto;
}

.customer-doc-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.audit-doc-preview {
  min-height: 480px;
}

.audit-doc-preview .customer-doc-frame {
  min-height: 480px;
}

.audit-doc-window {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 720px;
  height: 520px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1050;
  display: flex;
  flex-direction: column;
}

.audit-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0f172a;
  color: #f8fafc;
  cursor: grab;
  user-select: none;
}

.audit-doc-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.audit-doc-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.audit-doc-btn:hover {
  background: rgba(248, 250, 252, 0.2);
}

.audit-doc-body {
  flex: 1;
  background: #f8fafc;
}

.audit-doc-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.audit-doc-window.is-minimized {
  height: auto;
}

.audit-doc-window.is-minimized .audit-doc-body {
  display: none;
}

.settings-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.security-accordion {
  position: relative;
}

.security-actions {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  margin-bottom: 0 !important;
}

.settings-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  justify-items: center;
}

.settings-app {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.settings-app i {
  font-size: 1.4rem;
}

.settings-app span {
  display: block;
}

.settings-app.is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.settings-body .settings-section {
  display: none !important;
}

.appointments-view .appointment-list {
  display: grid;
  gap: 6px;
}

.appointments-view .appointment-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  max-height: 32px;
  min-height: 32px;
  overflow: hidden;
  display: block;
}

.appointments-view .appointment-time {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appointments-view .appointment-notes {
  margin-top: 4px;
  color: #334155;
  font-size: 0.9rem;
  display: none;
}

.appointments-view .appointment-link {
  color: inherit;
  text-decoration: none;
}

.appointments-view .appointment-link:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.4);
}

.appointments-box .appointment-row + .appointment-row {
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
  padding-top: 12px;
  margin-top: 12px;
}

.appointments-embed {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.appointment-iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
  background: #ffffff;
}

.appointment-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.appointment-item {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 12px 12px 24px;
  background: #f8fafc;
  overflow: hidden;
  min-height: 140px;
}

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

.appointment-item-meta {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 8px;
}

.appointment-time {
  margin-left: 6px;
  color: #0f172a;
  font-weight: 600;
}

.appointment-note {
  background: #ffffff;
}

.appointment-resize-handle {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.15);
  cursor: ns-resize;
}

.appointment-resize-handle:hover {
  background: rgba(15, 23, 42, 0.3);
}

@media (max-width: 767px) {
  .appointment-iframe {
    height: 320px;
  }
  .appointment-item {
    padding: 10px 10px 22px;
  }
  .appointment-time {
    display: block;
    margin-left: 0;
  }
}

.agenda-window {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 920px;
  height: 640px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  border-radius: 10px;
  overflow: hidden;
  z-index: 300220;
  display: flex;
  flex-direction: column;
}

.agenda-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0f172a;
  color: #f8fafc;
  cursor: grab;
  user-select: none;
}

.agenda-window-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.agenda-window-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agenda-window-btn:hover {
  background: rgba(248, 250, 252, 0.2);
}

.agenda-window-btn.js-agenda-max {
  font-size: 0;
  position: relative;
}

.agenda-window-btn.js-agenda-max::before {
  content: '';
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-top-width: 3px;
  border-radius: 2px;
  display: block;
}

.agenda-window-body {
  flex: 1;
  background: #f8fafc;
}

.agenda-window-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.agenda-window.is-minimized .agenda-window-body {
  display: none;
}

.agenda-window.is-minimized {
  height: 46px;
  width: 280px;
  right: 24px;
  bottom: 0;
  top: auto;
  left: auto;
  border-radius: 10px 10px 0 0;
}

.agenda-window.is-maximized {
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
}

.agenda-resize-handle {
  position: absolute;
  z-index: 300221;
  background: transparent;
}

.agenda-resize-handle.handle-n,
.agenda-resize-handle.handle-s {
  left: 6px;
  right: 6px;
  height: 6px;
  cursor: ns-resize;
}

.agenda-resize-handle.handle-n {
  top: 0;
}

.agenda-resize-handle.handle-s {
  bottom: 0;
}

.agenda-resize-handle.handle-e,
.agenda-resize-handle.handle-w {
  top: 6px;
  bottom: 6px;
  width: 6px;
  cursor: ew-resize;
}

.agenda-resize-handle.handle-e {
  right: 0;
}

.agenda-resize-handle.handle-w {
  left: 0;
}

.agenda-resize-handle.handle-ne,
.agenda-resize-handle.handle-nw,
.agenda-resize-handle.handle-se,
.agenda-resize-handle.handle-sw {
  width: 12px;
  height: 12px;
}

.agenda-resize-handle.handle-ne {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.agenda-resize-handle.handle-nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.agenda-resize-handle.handle-se {
  bottom: 0;
  right: 0;
  cursor: nwse-resize;
}

.agenda-resize-handle.handle-sw {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.agenda-window.is-minimized .agenda-resize-handle,
.agenda-window.is-maximized .agenda-resize-handle {
  display: none;
}

.agenda-card {
  min-height: 70vh;
}

.agenda-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: static;
}

.agenda-title h2 {
  margin: 0;
  font-size: 1.6rem;
}

.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agenda-controls #agenda-date {
  width: 140px;
  max-width: 140px;
  min-width: 120px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 8px 12px;
  background: #ffffff;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  appearance: none;
}

.agenda-controls #agenda-date:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.agenda-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
}

.agenda-toggle button {
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  color: #0f172a;
  font-weight: 600;
}

.agenda-toggle button.is-active {
  background: #0f172a;
  color: #ffffff;
}

.agenda-grid {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  max-height: 70vh;
  overflow-y: auto;
}

.agenda-time-col {
  background: #f1f5f9;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
}

.agenda-time-header {
  height: 44px;
  background: #0f172a;
  position: sticky;
  top: 0;
  z-index: 5;
}

.agenda-time-slot {
  height: 64px;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: #64748b;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.5);
}

.agenda-days {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.agenda-day {
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  position: relative;
}

.agenda-day:last-child {
  border-right: 0;
}

.agenda-day-header {
  padding: 10px 12px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  position: sticky;
  top: 0;
  z-index: 6;
  cursor: default;
}

.agenda-time-header {
  position: sticky;
  top: 0;
  z-index: 7;
  background: #f1f5f9;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.agenda-day.is-selected .agenda-day-header {
  background: rgba(14, 165, 233, 0.16);
  color: #0f172a;
  border-bottom: 1px solid rgba(14, 165, 233, 0.4);
}

.agenda-day.is-today .agenda-day-header {
  background: rgba(14, 165, 233, 0.16);
  color: #0f172a;
}

.agenda-day-body {
  position: relative;
  height: calc(64px * 24);
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 100% 64px;
}

.agenda-event {
  position: absolute;
  left: 8px;
  right: 8px;
  background: rgba(14, 165, 233, 0.16);
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  padding: 6px 8px 34px;
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}
@media (max-width: 991px) {
  .agenda-event {
    touch-action: none;
  }
}

.agenda-event-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
  background: transparent;
}

.agenda-event.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.agenda-event.is-resizing {
  cursor: ns-resize;
}

.agenda-day-body.is-hovering .agenda-event {
  opacity: 0.2;
  filter: saturate(0.6);
}

.agenda-event.is-hover {
  opacity: 1 !important;
  filter: none;
  z-index: 8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  background: #d2f0ff;
}

.agenda-event.is-focus {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.6), 0 10px 24px rgba(15, 23, 42, 0.18);
}


.agenda-event-main {
  pointer-events: none;
}

.agenda-event strong {
  display: block;
  font-weight: 700;
}

.agenda-event small {
  color: #475569;
}

.agenda-event.is-compact {
  font-size: 0.76rem;
}

.agenda-event.is-compact strong,
.agenda-event.is-compact small,
.agenda-event.is-compact div {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agenda-event.is-hover {
  font-size: 0.85rem;
  overflow: visible;
  z-index: 6;
}

.agenda-event.is-hover strong,
.agenda-event.is-hover small,
.agenda-event.is-hover div {
  -webkit-line-clamp: unset;
}

.agenda-event.is-hover .agenda-event-notes {
  display: block;
}

.agenda-event-notes {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #1f2937;
  display: none;
  max-height: 120px;
  overflow: auto;
}

.agenda-event-notes p {
  margin: 0 0 6px;
}

.agenda-event-notes p:last-child {
  margin-bottom: 0;
}

.agenda-event.is-notes-open .agenda-event-notes {
  display: block;
}

.agenda-event-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.agenda-event-mail {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.agenda-event:hover .agenda-event-mail {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.agenda-event[data-can-mail="0"] .agenda-event-mail {
  display: none;
}

.agenda-event-action {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(248, 250, 252, 0.8);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  pointer-events: auto;
}

.agenda-event-action:hover {
  background: #0f172a;
  color: #ffffff;
}

.agenda-event-delete {
  border-color: rgba(220, 38, 38, 0.4);
  color: #dc2626;
  background: rgba(254, 226, 226, 0.6);
}

.agenda-event-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.agenda-event-action.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.agenda-event.is-hover .agenda-event-actions {
  opacity: 1;
}

.agenda-event.is-hover .agenda-event-mail {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.agenda-hover-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
}

.agenda-hover-line.is-visible {
  opacity: 1;
}

.agenda-hover-time {
  position: absolute;
  right: 8px;
  top: -10px;
  font-size: 0.75rem;
  color: #0f172a;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.agenda-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #0f172a;
  opacity: 0.8;
  pointer-events: none;
}

.agenda-doc-window {
  position: fixed;
  right: 48px;
  top: 120px;
  width: 720px;
  height: 520px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  min-width: 420px;
  min-height: 280px;
  resize: both;
}

.agenda-detail-dock {
  position: fixed;
  left: 220px;
  right: 24px;
  bottom: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  z-index: 1065;
  pointer-events: none;
  padding-bottom: 0;
}

body.sidebar-collapsed .agenda-detail-dock {
  left: 72px;
}

body.embedded .agenda-detail-dock {
  left: 0;
  right: 0;
}

.agenda-detail-window {
  width: 380px;
  max-width: 48vw;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  resize: both;
  min-width: 280px;
  min-height: 160px;
  flex: 0 0 auto;
}

.agenda-detail-window.is-minimized {
  height: 46px;
  width: 220px;
  min-height: 110px;
  resize: none;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  align-self: flex-end;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.agenda-detail-window.is-minimized .agenda-detail-body {
  display: none;
}

.agenda-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid rgba(248, 250, 252, 0.2);
  cursor: grab;
}

.agenda-detail-title {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: grab;
}

.agenda-detail-sub {
  font-size: 0.78rem;
  color: rgba(248, 250, 252, 0.8);
}

.agenda-detail-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.agenda-detail-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  color: #f8fafc;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agenda-detail-btn:hover {
  background: rgba(248, 250, 252, 0.2);
}

.agenda-detail-body {
  padding: 12px;
  display: grid;
  gap: 8px;
  overflow: auto;
}

.agenda-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: #0f172a;
}

.agenda-detail-row span {
  color: #64748b;
}

.agenda-detail-notes {
  border-top: 1px dashed rgba(15, 23, 42, 0.16);
  padding-top: 8px;
  font-size: 0.85rem;
  color: #0f172a;
  max-height: 160px;
  overflow: auto;
}

.agenda-detail-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.agenda-detail-mail-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.agenda-detail-mail-btn:hover {
  background: #16a34a;
  color: #ffffff;
}

.agenda-detail-window.is-mail-sent .agenda-detail-mail-btn {
  background: #16a34a;
  color: #ffffff;
}

.agenda-detail-invoice-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
}

.agenda-detail-invoice-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

@media (max-width: 1200px) {
  .agenda-grid {
    overflow-x: auto;
  }
  .agenda-days {
    min-width: 840px;
    grid-auto-columns: minmax(120px, 1fr);
  }
}

@media (max-width: 991px) {
  .agenda-card {
    padding: 16px;
  }
  .agenda-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .agenda-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .agenda-controls #agenda-date {
    width: 120px;
  }
  .agenda-grid {
    overflow-x: auto;
  }
  .agenda-days {
    grid-auto-columns: minmax(140px, 1fr);
    min-width: 720px;
  }
  .agenda-detail-window {
    width: 92vw;
    max-width: 92vw;
  }
}

@media (max-width: 767px) {
  .customer-dialog {
    width: 96vw;
    height: 90vh;
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
  }
  .customer-dialog-body {
    overflow: auto;
  }
  .content {
    padding: 16px;
  }
  #items-table.table-responsive-cards tbody td {
    flex-direction: column;
    align-items: flex-start;
  }
  #items-table.table-responsive-cards tbody td::before {
    min-width: 0;
    margin-bottom: 6px;
  }
  #items-table .qty-unit,
  #items-table .input-group,
  #items-table .form-control,
  #items-table .form-select,
  #items-table textarea {
    width: 100%;
    min-width: 0;
  }
  #items-table .js-line-total,
  #items-table .js-tax-amount {
    font-weight: 600;
    align-self: flex-end;
  }
  #items-table .drag-handle {
    margin-bottom: 6px;
  }
  #items-table td[data-label="Sorteren"] {
    display: none;
  }
  #items-table td[data-label="Prijs p.e."] .input-group {
    flex-wrap: nowrap;
    max-width: 180px;
  }
  #items-table td[data-label="Prijs p.e."] .input-group-text {
    padding: 0 8px;
  }
  .agenda-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "prev date next"
      "today today today"
      "toggle toggle toggle"
      "add add add";
    align-items: center;
    width: 100%;
  }
  .agenda-controls #agenda-prev {
    grid-area: prev;
  }
  .agenda-controls #agenda-date {
    grid-area: date;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .agenda-controls #agenda-next {
    grid-area: next;
  }
  .agenda-drawer-header {
    padding: 12px;
    margin: -16px -16px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .agenda-drawer form,
  .agenda-view-body {
    padding-top: 12px;
  }
  .agenda-toggle {
    grid-area: toggle;
    width: 100%;
    justify-content: space-between;
  }
  #agenda-add {
    grid-area: add;
    width: 100%;
    justify-content: center;
  }
  #agenda-today {
    grid-area: today;
    width: 100%;
    justify-content: center;
  }
  #agenda-range {
    display: none;
  }
  #agenda-today {
    width: 100%;
  }
  .agenda-grid {
    max-height: calc(100vh - 320px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .agenda-time-col {
    min-width: 56px;
  }
  .agenda-time-slot {
    padding: 4px 6px;
    font-size: 0.75rem;
  }
  .agenda-day-header {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
  .agenda-days {
    min-width: 560px;
    grid-auto-columns: minmax(120px, 1fr);
  }
  .agenda-detail-dock {
    left: 0;
    right: 0;
    padding: 0 12px 8px;
  }
  .agenda-detail-window.is-minimized {
    width: 160px;
  }
  .agenda-detail-window {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    min-width: 0;
    max-height: 70vh;
    resize: none;
  }
  .agenda-drawer {
    left: 12px;
    right: 12px;
    top: 80px;
    width: auto;
    max-height: calc(100vh - 120px);
    min-width: 0;
    resize: none;
  }
  .agenda-view-drawer {
    left: 12px;
    right: 12px;
    top: 80px;
    width: auto;
    max-height: calc(100vh - 120px);
    min-width: 0;
    resize: none;
  }
}

@media (max-width: 575px) {
  .agenda-card {
    min-height: auto;
  }
  .agenda-grid {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 280px);
    overflow-x: hidden;
  }
  .agenda-time-col {
    display: none;
  }
  .agenda-days {
    display: grid;
    min-width: 0;
    grid-auto-columns: minmax(0, 1fr);
  }
  .agenda-toggle {
    display: none;
  }
  .agenda-day {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    min-width: 0;
  }
  .agenda-day:last-child {
    border-bottom: 0;
  }
  .agenda-day-body {
    min-width: 0;
  }
  .agenda-day-header span {
    word-break: break-word;
  }
  .agenda-event strong,
  .agenda-event small,
  .agenda-event div {
    word-break: break-word;
  }
  .agenda-time-slot {
    height: 56px;
  }
  .agenda-day-body {
    height: calc(56px * 24);
    background-size: 100% 56px;
  }
  .agenda-event {
    left: 6px;
    right: 6px;
    padding: 6px 8px 30px;
  }
  .agenda-view-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .row-iframe-wrap {
    min-height: 60vh;
    border-radius: 12px;
  }
  .row-iframe-view {
    height: 60vh;
    min-height: 480px;
  }
  #items-table,
  #partials-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  #items-table thead th,
  #items-table tbody td,
  #partials-table thead th,
  #partials-table tbody td {
    white-space: nowrap;
  }
  .doc-header {
    gap: 10px;
  }
  .doc-logo img {
    height: 42px;
  }
  .doc-title {
    font-size: 0.95rem;
    padding: 6px 10px;
  }
  .doc-lang {
    flex-wrap: wrap;
  }
  .doc-company-row {
    font-size: 0.82rem;
  }
  .doc-company-meta .doc-meta-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .doc-company-meta .doc-meta-item span,
  .doc-company-meta .doc-meta-item strong {
    max-width: 100%;
    word-break: break-word;
  }
  .payment-summary .d-flex,
  .payment-summary .payment-pill {
    flex-wrap: wrap;
  }
  .payment-summary .d-flex > * {
    min-width: 0;
  }
  .payment-summary strong {
    margin-left: auto;
    text-align: right;
    max-width: 100%;
    word-break: break-word;
  }
  .payment-summary .d-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .payment-summary .d-flex strong {
    width: 100%;
    text-align: left;
  }
  .doc-meta-item span {
    font-size: 0.75rem;
  }
  .doc-meta-item strong {
    font-size: 0.9rem;
  }
  .doc-actions-bottom {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  #document-form {
    padding-bottom: 200px;
  }
  .doc-view-card {
    padding-bottom: 240px;
  }
  .fixed-actions {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .payment-pill {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .payment-pill span,
  .payment-pill strong {
    min-width: 0;
    width: 100%;
    text-align: left;
    margin-left: 0;
  }
  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .table.table-responsive-cards {
    display: block;
    overflow: visible;
    white-space: normal;
  }
  .table.table-responsive-cards thead {
    display: none;
  }
  .table.table-responsive-cards tbody {
    display: block;
  }
  .table.table-responsive-cards tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #ffffff;
    padding: 8px 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  }
  .table.table-responsive-cards tbody tr.js-row-detail {
    margin-bottom: 16px;
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .table.table-responsive-cards tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px;
    border: 0;
    font-size: 0.9rem;
  }
  .table.table-responsive-cards tbody tr.js-row-detail td {
    display: block;
    padding: 0;
    width: 100%;
  }
  .table.table-responsive-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #475569;
    min-width: 110px;
  }
  .table.table-responsive-cards tbody tr.js-row-detail td::before {
    content: none;
  }
  .table.table-responsive-cards tbody tr.workorder-detail-row {
    margin-bottom: 16px;
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .table.table-responsive-cards tbody tr.workorder-detail-row td {
    display: block;
    padding: 0;
    width: 100%;
  }
  .table.table-responsive-cards tbody tr.workorder-detail-row td::before {
    content: none;
  }
  .table.table-responsive-cards tbody tr.workorder-detail-row .card {
    width: 100%;
    max-width: 100%;
  }
  .table.table-responsive-cards tbody td.td-actions {
    align-items: flex-start;
  }
  .table.table-responsive-cards tbody td.td-actions::before {
    align-self: center;
  }
  .table.table-responsive-cards tbody td.td-blank {
    display: none;
  }
  .table.table-responsive-cards .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .table.table-responsive-cards .js-row-detail .card {
    margin: 0;
  }
  .table thead th,
  .table tbody td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .table-actions {
    gap: 6px;
  }
  .table-actions .btn-icon,
  .table-actions .btn-icon-mail,
  .table-actions .doc-mail-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

.agenda-doc-window.d-none {
  display: none;
}

.agenda-doc-window.is-minimized .agenda-doc-body {
  display: none;
}

.agenda-doc-window.is-minimized {
  height: 46px;
  width: 260px;
  min-height: 110px;
  right: auto;
  resize: none;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  left: auto;
  flex: 0 0 auto;
}


.agenda-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid rgba(248, 250, 252, 0.2);
  cursor: grab;
  user-select: none;
}

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

.agenda-doc-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agenda-doc-btn:hover {
  background: rgba(248, 250, 252, 0.2);
}

.agenda-doc-body {
  flex: 1;
  background: #ffffff;
  overflow: auto;
}

.agenda-doc-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.agenda-drawer {
  position: fixed;
  right: 24px;
  top: 120px;
  width: 360px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 16px;
  z-index: 1045;
  display: none;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  resize: none;
  min-width: 300px;
  min-height: 320px;
}

.agenda-drawer.is-open {
  display: block;
}

.agenda-mail-drawer {
  width: 520px;
  max-width: calc(100vw - 32px);
}

.agenda-view-drawer {
  position: fixed;
  right: 24px;
  top: 120px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 16px;
  z-index: 1046;
  display: none;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  resize: none;
  min-width: 280px;
  min-height: 240px;
}

.agenda-view-drawer.is-open {
  display: block;
}

.agenda-drawer form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
}

.agenda-form-actions {
  position: sticky;
  bottom: -16px;
  background: #ffffff;
  padding-top: 8px;
  margin-top: 12px;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
}

.agenda-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  padding-bottom: 8px;
}

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

.agenda-drawer-header:active {
  cursor: grabbing;
}

body.dragging-window {
  user-select: none;
  touch-action: none;
}

.agenda-drawer.is-dragging,
.agenda-view-drawer.is-dragging {
  overflow: hidden;
}

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

.agenda-view-actions .btn {
  color: #0f172a;
}

.agenda-view-actions .text-danger {
  color: #dc2626;
}

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

.email-var-list .btn {
  font-size: 0.78rem;
  padding: 2px 8px;
}

.agenda-view-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.92rem;
  overflow-x: hidden;
  word-break: break-word;
  padding-top: 6px;
}

.agenda-view-line {
  font-weight: 600;
  color: #0f172a;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  word-break: break-word;
}

.agenda-view-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agenda-view-meta span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.agenda-view-meta strong {
  display: block;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.agenda-view-notes {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.agenda-view-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agenda-view-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: transparent;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.agenda-view-btn:hover {
  background: rgba(15, 23, 42, 0.08);
}

.agenda-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  color: #0f172a;
  text-decoration: none;
}

.agenda-view-link:hover {
  background: rgba(15, 23, 42, 0.08);
}

.invoice-selected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.invoice-selected .js-invoice-clear {
  color: #64748b;
}

.invoice-selected .js-invoice-clear:hover {
  color: #0f172a;
}

.invoice-field.has-selection .agenda-invoice-search {
  display: none;
}

.resize-handle {
  position: absolute;
  z-index: 5;
  background: transparent;
}

.resize-n,
.resize-s {
  left: 0;
  right: 0;
  height: 12px;
  cursor: ns-resize;
}

.resize-n {
  top: 0;
}

.resize-s {
  bottom: 0;
}

.resize-e,
.resize-w {
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
}

.resize-e {
  right: 0;
}

.resize-w {
  left: 0;
}

.resize-ne,
.resize-nw,
.resize-se,
.resize-sw {
  width: 16px;
  height: 16px;
}

.resize-ne {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.resize-nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.resize-se {
  bottom: 0;
  right: 0;
  cursor: nwse-resize;
}

.resize-sw {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.agenda-drawer-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.agenda-invoice-results {
  position: absolute;
  z-index: 20;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  width: 100%;
  max-height: 220px;
  overflow: auto;
  display: none;
}

.agenda-invoice-results .list-group-item {
  cursor: pointer;
}

.agenda-invoice-results .list-group-item:hover {
  background: #f1f5f9;
}

.settings-body .settings-section.is-active {
  display: block !important;
}

.settings-body .settings-toggle {
  display: none !important;
}

.settings-body .settings-panel {
  display: block !important;
}

@media (max-width: 768px) {
  .settings-app-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.settings-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
}

.settings-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 6px 0;
}

.settings-panel {
  display: none;
  padding-top: 12px;
}

.settings-section.is-open .settings-panel {
  display: block;
}

.pdf-layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pdf-layout-toolbar .btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pdf-layout-canvas {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 210 / 297;
  border-radius: 16px;
  border: 2px dashed rgba(15, 23, 42, 0.15);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: #f8fafc;
  overflow: hidden;
}

.pdf-layout-block {
  position: absolute;
  border-radius: 10px;
  border: 2px solid rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.12);
  color: #0f172a;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 8px;
  cursor: grab;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.pdf-layout-block:active {
  cursor: grabbing;
}

.pdf-layout-block.is-hidden {
  display: none;
}

.pdf-layout-line {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
}

.pdf-layout-handle {
  width: 12px;
  height: 12px;
  background: #0ea5e9;
  border-radius: 4px;
  align-self: flex-end;
  cursor: se-resize;
}

.pdf-layout-hint {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #64748b;
}

.discount-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1300;
}

.discount-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  z-index: 1301;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.discount-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.discount-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discount-hint {
  font-size: 0.85rem;
  color: #64748b;
}

.discount-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.address-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.address-card-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.address-card.is-invoice {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
}

.address-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.address-grid.has-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .address-grid.has-secondary {
    grid-template-columns: 1fr;
  }
}

.pin-dialog {
  position: fixed;
  inset: 0;
  z-index: 300100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-dialog.d-none {
  display: none;
}

.pin-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.pin-dialog-card {
  position: relative;
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pin-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pin-dialog-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.pin-dialog-hint {
  margin: 0 0 8px;
  color: #64748b;
}

.pin-code-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pin-code-digit {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.pin-code-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 111, 60, 0.2);
  background: #fff;
}

.pin-code-digit.is-filled {
  background: #fff;
}

.pin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-card {
  position: relative;
  overflow: hidden;
}

.dashboard-lock-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #0d1b2a;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: auto;
}

.dashboard-card:not(.is-locked) .dashboard-lock-toggle {
  display: inline-flex;
}

.dashboard-lock-toggle:hover {
  color: #6b94b2;
}

.dashboard-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
}

.dashboard-card.is-locked .dashboard-lock-overlay {
  display: flex;
}

.dashboard-card.is-locked .dashboard-card-content {
  filter: blur(6px);
  opacity: 0.15;
  pointer-events: none;
}

.dashboard-lock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.dashboard-drag-handle {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #0d1b2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
}

.dashboard-drag-handle:active {
  cursor: grabbing;
}

.dashboard-drag-handle:hover {
  color: #6b94b2;
}

.chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
  white-space: nowrap;
}

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

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

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

.dashboard-chart-controls .form-label {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.dashboard-chart-controls .form-range {
  width: 200px;
}

.dashboard-range-value {
  font-weight: 600;
  color: #0f172a;
}

@media (max-width: 768px) {
  .dashboard-chart-controls .form-range {
    width: 160px;
  }
}


.flag-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.flag-btn {
  width: 36px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.flag-nl {
  background: linear-gradient(#ae1c28 0 33%, #ffffff 33% 66%, #21468b 66%);
}

.flag-en {
  background:
    linear-gradient(90deg, transparent 45%, #c8102e 45% 55%, transparent 55%),
    linear-gradient(transparent 45%, #c8102e 45% 55%, transparent 55%),
    #ffffff;
}

.flag-tr {
  background: #e30a17;
}

.flag-tr::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
}

.flag-tr::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e30a17;
}

.flag-group input:checked + .flag-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 111, 60, 0.25);
}

.flag-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 111, 60, 0.25);
}

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

.inventory-suggestions {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.inventory-suggestions .list-group-item {
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.inventory-suggestions .list-group-item:last-child {
  border-bottom: 0;
}

.inventory-suggestions .inventory-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 999px;
}

.inventory-suggestion-name {
  font-weight: 600;
  color: #0f172a;
}

td.position-relative {
  position: relative;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.85rem;
}

.attachment-chip i:last-child {
  font-size: 0.75rem;
  margin-left: 4px;
}

.attachment-chip.is-locked {
  background: #f1f5f9;
  border-color: #cbd5f5;
  cursor: default;
}

.attachment-chip.attachment-remove {
  border-color: #fecaca;
  color: #991b1b;
}

.attachment-chip.attachment-add {
  border-style: dashed;
  color: #1d4ed8;
}

.template-preview {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  min-height: 80px;
  white-space: pre-wrap;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px dashed #cbd5f5;
  border-radius: 8px;
  background: #f1f5f9;
}

.template-tag {
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  background: #ffffff;
  color: #0f172a;
}

.template-tag:hover {
  background: #e2e8f0;
}

.creditors-page {
  background: #fff;
}
.creditors-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.creditors-tab {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-weight: 600;
  position: relative;
}
.creditors-tab--with-status {
  padding-right: 14px;
}
.creditors-tab-status {
  position: static;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  pointer-events: none;
  line-height: 1;
}
.creditors-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.creditors-tab-content {
  display: none;
}
.creditors-tab-content.is-active {
  display: block;
}
.creditors-pane {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 20px;
}
.creditors-pane-upload {
  grid-template-columns: minmax(260px, 380px) minmax(0, 1.7fr);
}
.creditors-side {
  width: 100%;
}
.creditors-card {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
}
.creditors-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.creditors-filter-group {
  display: flex;
  flex-direction: column;
}
.creditors-filter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.creditors-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.creditors-close {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  padding: 4px;
}
.creditors-close:hover {
  color: #0f172a;
}
.creditors-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.creditors-archive-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}
.creditors-archive-list.is-compact {
  max-height: 360px;
}
.creditors-empty {
  background: #f8fafc;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: #64748b;
}
.creditor-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  text-align: left;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.creditor-item:hover {
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.creditor-item.is-selected {
  border-color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  background: #f8fafc;
}
.creditor-item.is-paid {
  border-left: 4px solid #22c55e;
}
.creditor-item.is-partial {
  border-left: 4px solid #f59e0b;
}
.creditor-item.is-unpaid {
  border-left: 4px solid #ef4444;
}
.creditor-item-main {
  flex: 1;
}
.creditor-title {
  font-weight: 600;
  color: #0f172a;
}
.creditor-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
}
.creditor-amount {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.creditor-vat-tag {
  font-size: 11px;
  color: #94a3b8;
  text-transform: lowercase;
  letter-spacing: 0.2px;
}
.creditor-subline {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.creditor-status {
  font-size: 12px;
  color: #64748b;
}
.creditors-preview {
  min-height: 320px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}
.creditors-preview-empty {
  color: #64748b;
  text-align: center;
  padding: 40px 20px;
}
.creditors-preview-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.creditors-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.creditors-preview-header h4 {
  margin: 0;
}
.creditors-preview-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
}
.creditors-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}
.creditors-preview-body.is-narrow-form {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}
.creditors-preview-body.is-narrow-form .creditors-form .row > [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
}
.creditors-preview-frame iframe {
  width: 100%;
  height: 620px;
  border: none;
  border-radius: 12px;
  background: #e2e8f0;
}
.creditors-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.creditors-paid {
  margin-top: 10px;
  font-size: 12px;
  color: #0f172a;
  font-weight: 600;
}
.creditors-paid.is-paid {
  color: #16a34a;
}
.creditors-paid.is-partial {
  color: #f59e0b;
}
.creditors-paid.is-unpaid {
  color: #ef4444;
}
.creditors-ocr-actions {
  margin-right: auto;
}

@media (max-width: 992px) {
  .creditors-pane {
    grid-template-columns: 1fr;
  }
  .creditors-pane-upload {
    grid-template-columns: 1fr;
  }
  .creditors-preview-body {
    grid-template-columns: 1fr;
  }
  .creditors-preview-frame iframe {
    height: 320px;
  }
  .creditors-filter-bar {
    grid-template-columns: 1fr;
  }
}
