/* 3DPartner · Domain Workspaces UI (v2) */
.domain-workspace {
  padding: 0 0 32px;
  color: var(--ink, #1f2d3d);
}
.vat-period-header,
.vat-period-tabs,
.vat-period-views,
.vat-period-pages,
.vat-period-register-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.vat-period-header { justify-content: space-between; margin-bottom: 10px; }
.vat-period-header h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.vat-period-tabs:not(.vat-period-header .vat-period-tabs) { margin-bottom: 12px; }
.vat-period-tabs [aria-current="page"],
.vat-period-views [aria-pressed="true"] {
  border-color: var(--blue, #2463eb);
  color: var(--blue, #2463eb);
  background: #edf4ff;
}
.vat-period { min-width: 0; }
.vat-period-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(138px, 155px)) minmax(108px, 135px) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
}
.vat-period-filters label { display: grid; min-width: 0; gap: 3px; font-size: 12px; }
.vat-period-filters :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.vat-period-filters .dw-btn { min-height: 32px; padding-block: 4px; }
.vat-period-summary { margin-bottom: 10px; }
.vat-period-summary h3 { margin: 6px 0; font-size: 13px; }
.vat-period-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 7px;
  background: var(--line, #dce3ed);
}
.vat-period-cards button {
  position: relative;
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 8px 24px 8px 12px;
  border: 0;
  background: var(--surface, #fff);
  color: var(--ink, #1f2d3d);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.vat-period-cards button::after {
  content: '›' / '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #4673a9;
  font-size: 19px;
}
.vat-period-cards button:hover { background: #f4f8fe; }
.vat-period-cards button:focus-visible { outline: 2px solid var(--blue, #2463eb); outline-offset: -2px; }
.vat-period-metric { font-size: 12px; font-weight: 600; line-height: 1.3; }
.vat-period-cards strong, .vat-period-missing { line-height: 1.25; }
.vat-period-cards strong { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vat-period-missing { font-size: 14px; font-weight: 600; color: #4c6076; }
.vat-period-caption, .vat-period-document-meta { color: var(--muted, #59697a); font-size: 12px; }
.vat-period-register-header { justify-content: space-between; margin: 0 0 5px; }
.vat-period-register-header h3 { margin: 0; font-size: 15px; }
.vat-period-help { font-size: 12px; }
.vat-period-help summary { cursor: pointer; color: #285d9c; }
.vat-period-help:not([open]) { margin-left: auto; }
.vat-period-help[open] { width: 100%; }
.vat-period-help p { max-width: 84ch; margin: 5px 0 2px; color: var(--muted, #59697a); }
.vat-period-views { gap: 5px; margin-bottom: 6px; }
.vat-period-views .dw-btn.sm, .vat-period-pages .dw-btn.sm { padding: 3px 8px; }
.vat-period-pages { margin-top: 7px; font-size: 12px; }
.vat-period .dw-table-wrap { overflow: auto; }
.vat-period .dw-table { table-layout: auto; }
.vat-period .dw-table :is(th, td) { padding: 6px 8px; vertical-align: middle; }
.vat-period .dw-table :is(th, td):is(:first-child, :last-child),
.vat-period .dw-table time, .vat-period-amount { white-space: nowrap; }
.vat-period .dw-table .vat-period-amount { text-align: right; font-variant-numeric: tabular-nums; }
.vat-period-link { padding: 2px 0; border: 0; background: none; font: inherit; color: #285d9c; cursor: pointer; text-decoration: underline; }
.vat-period-empty {
  margin: 0;
  padding: 14px 12px;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 6px;
  color: var(--muted, #59697a);
}
.vat-period-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.vat-period-evidence {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--ink, #1f2d3d);
  overflow-wrap: anywhere;
}
.vat-period-evidence [data-vat-close-evidence] { float: right; margin: 0 0 6px 8px; }
.vat-period-evidence :is(h3,h4,p,ul) { margin: 0 0 6px; }
.vat-period-evidence section { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line, #dce3ed); }
.vat-period-evidence ul { padding-left: 18px; }
@media (max-width: 1100px) {
  .vat-period-filters { grid-template-columns: 1fr 1fr auto; }
  .vat-period-org { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .vat-period-header h2 { font-size: 19px; }
  .vat-period-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vat-period-cards { grid-template-columns: 1fr; }
  .vat-period-cards button { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1px 8px; }
  .vat-period-cards strong { font-size: 16px; }
  .vat-period-caption { grid-column: 1 / -1; }
}

.dw-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.dw-header-info h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #1f2d3d);
}
.dw-header-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #6c7a8c);
  max-width: 720px;
}
.dw-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Buttons */
.dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--line, #dce3ed);
  background: var(--surface, #ffffff);
  color: var(--ink, #1f2d3d);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.dw-btn:hover {
  background: var(--soft, #f4f7fc);
  border-color: #cbd5e1;
}
.dw-btn.primary {
  background: var(--blue, #2463eb);
  border-color: var(--blue, #2463eb);
  color: #ffffff;
}
.dw-btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.dw-btn.danger {
  background: #fff0f0;
  border-color: #fca5a5;
  color: #b91c1c;
}
.dw-btn.danger:hover {
  background: #fee2e2;
  border-color: #ef4444;
}
.dw-btn.sm {
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 5px;
}

/* KPIs */
.dw-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.dw-kpi-card {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line, #dce3ed);
  background: var(--surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.dw-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #6c7a8c);
  margin-bottom: 6px;
}
.dw-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #1f2d3d);
  letter-spacing: -0.02em;
}
.dw-kpi-delta {
  font-size: 11px;
  margin-top: 4px;
  color: var(--muted, #6c7a8c);
}
.dw-kpi-delta.pos { color: #16a34a; }
.dw-kpi-delta.neg { color: #dc2626; }

/* Filter Toolbar */
.dw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--soft, #f8fafc);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
}
.dw-toolbar-left, .dw-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dw-search-input {
  min-width: 240px;
  padding: 7px 11px;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink, #1f2d3d);
  font-size: 13px;
}
.dw-select {
  padding: 7px 10px;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink, #1f2d3d);
  font-size: 13px;
  cursor: pointer;
}
.dw-count-badge {
  font-size: 12px;
  color: var(--muted, #6c7a8c);
}

/* Data Table */
.dw-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 8px;
  background: var(--surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.dw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.dw-table th {
  padding: 11px 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line, #dce3ed);
  white-space: nowrap;
}
.dw-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
  color: var(--ink, #1f2d3d);
}
.dw-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.dw-table tbody tr:hover {
  background: #f1f5f9;
}
.dw-table tbody tr:last-child td {
  border-bottom: 0;
}
.dw-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

/* Badges & Chips */
.dw-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}
.dw-chip.green, .dw-chip.ok, .dw-chip.success {
  background: #dcfce7;
  color: #15803d;
}
.dw-chip.yellow, .dw-chip.warn, .dw-chip.warning, .dw-chip.soon {
  background: #fef3c7;
  color: #b45309;
}
.dw-chip.red, .dw-chip.danger, .dw-chip.late, .dw-chip.critical {
  background: #fee2e2;
  color: #b91c1c;
}
.dw-chip.blue, .dw-chip.info, .dw-chip.in-progress {
  background: #e0f2fe;
  color: #0369a1;
}
.dw-chip.gray, .dw-chip.draft, .dw-chip.muted {
  background: #f1f5f9;
  color: #475569;
}

/* Queue Split View */
.dw-queue-split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  border: 1px solid var(--line, #dce3ed);
  border-radius: 8px;
  background: #ffffff;
  min-height: 540px;
  overflow: hidden;
}
.dw-queue-list {
  border-right: 1px solid var(--line, #dce3ed);
  overflow-y: auto;
  max-height: 720px;
  background: #fcfdfe;
}
.dw-queue-item {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dw-queue-item:hover {
  background: #f1f5f9;
}
.dw-queue-item.active {
  background: #e0f2fe;
  border-left: 4px solid var(--blue, #2463eb);
}
.dw-queue-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.dw-queue-item-title {
  font-weight: 650;
  font-size: 13.5px;
  color: var(--ink, #1f2d3d);
}
.dw-queue-item-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #6c7a8c);
}

.dw-queue-inspector {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 720px;
}
.dw-inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}
.dw-inspector-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.dw-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.dw-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.dw-field-card {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.dw-field-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.dw-field-val {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}

/* Kanban Board */
.dw-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: flex-start;
}
.dw-board-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  min-height: 400px;
}
.dw-board-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13.5px;
}
.dw-board-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dw-board-card {
  padding: 12px 14px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #dce3ed;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.dw-board-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

/* Settings Form */
.dw-settings-container {
  max-width: 860px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
}
.dw-settings-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  gap: 16px;
  margin-bottom: 20px;
}
.dw-settings-tab {
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted, #6c7a8c);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.dw-settings-tab.active {
  color: var(--blue, #2463eb);
  border-bottom-color: var(--blue, #2463eb);
}
.dw-form-row {
  margin-bottom: 18px;
}
.dw-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink, #1f2d3d);
  margin-bottom: 6px;
}
.dw-form-input, .dw-form-textarea, .dw-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink, #1f2d3d);
  font: inherit;
  font-size: 13px;
}
.dw-form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Modals and Drawers */
.dw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.dw-modal-box {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dw-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dw-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.dw-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
}
.dw-modal-close:hover { color: #0f172a; }
.dw-modal-body {
  padding: 20px;
  overflow-y: auto;
}
.dw-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Responsive */
@media (max-width: 768px) {
  .dw-queue-split {
    grid-template-columns: 1fr;
  }
}
