.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.panel-heading {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.panel-heading small {
  font-size: 10px;
}
.panel-heading .text {
  font-size: 10px;
}
.form-section {
  padding: 20px 22px;
  border-top: 1px solid var(--line);
}
.form-section:first-child {
  border-top: 0;
}
.form-section h3 {
  margin-bottom: 17px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 15px;
  min-width: 0;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px;
  margin-top: 7px;
  font-size: 12px;
  min-width: 0;
}
.field input[type="checkbox"] {
  width: auto;
  display: inline;
  margin: 0 8px 0 0;
  vertical-align: middle;
}
.field textarea {
  min-height: 85px;
  resize: vertical;
}
.section-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 18px;
}
.note {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
.note strong {
  color: var(--ink);
}
.note.error {
  border-color: var(--negative);
  color: var(--negative);
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface);
  color: var(--muted);
}
.badge.paid,
.badge.active,
.badge.accepted,
.badge.signed {
  color: var(--positive);
  background: color-mix(in srgb, var(--positive) 12%, var(--paper));
}
.badge.overdue,
.badge.partially_paid {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--paper));
}
.badge.issued {
  color: var(--link);
  background: var(--surface);
}
.badge.draft {
  color: #9974b6;
  background: color-mix(in srgb, #9974b6 12%, var(--paper));
}
.badge.void,
.badge.inactive {
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 10%, var(--paper));
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
.table-scroll {
  overflow-x: auto;
}
th {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.4px;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--muted);
  border-block: 1px solid var(--line);
}
td {
  padding: 14px 18px;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
.clickable {
  cursor: pointer;
}
.clickable:hover {
  background: var(--surface);
}
.table-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 9px;
}
.client-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}
.client-logo {
  width: 30px;
  height: 30px;
  background: var(--surface);
  color: var(--link);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 10px;
}
.empty button {
  margin-top: 17px;
}
.filterbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 7px;
}
.tabs button {
  border: 0;
  background: none;
  font-weight: 400;
  font-size: 10px;
  padding: 8px 12px;
  min-height: 32px;
}
.tabs button.selected {
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.search {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 13px;
  min-width: 230px;
  font-size: 11px;
  color: var(--ink);
}
.stat {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.stat-top {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-top svg {
  width: 16px;
  height: 16px;
}
.stat-value {
  font-size: 27px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin: 13px 0 10px;
  overflow-wrap: anywhere;
}
.stat-foot {
  font-size: 9px;
  color: var(--muted);
}
.project-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 23px;
}
.project-card > .client-logo {
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  font-size: 14px;
}
.project-card h2 {
  margin: 12px 0 8px;
}
.project-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
  font-size: 10px;
  color: var(--muted);
}
.progress {
  height: 5px;
  background: var(--surface);
  border-radius: 3px;
  margin: 22px 0 10px;
}
.progress > div {
  height: 100%;
  background: #58b5a8;
  border-radius: 3px;
}
.role-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px;
  border-top: 1px solid var(--line);
}
.role-row .actions {
  margin-left: auto;
}
.role-row p {
  font-size: 11px;
}
.role-row .badge {
  margin-left: auto;
}
.timeline {
  padding: 0 22px 20px;
}
.timeline > div {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.timeline > div:last-child {
  border: 0;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  width: calc(100% - 34px);
  max-width: 510px;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: 0 25px 90px #0003;
}
dialog::backdrop {
  background: #15252b99;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 20px;
  margin-bottom: 10px;
}
dialog .subtitle {
  margin-bottom: 20px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 20px;
}
dialog .wide {
  max-width: 800px;
}
.form-error {
  color: var(--negative);
  font-size: 11px;
  white-space: pre-line;
  margin: 12px 0;
}
.form-error:empty {
  display: none;
}
#toast {
  position: fixed;
  left: calc(50% + 90px);
  transform: translateX(-50%);
  bottom: 25px;
  z-index: 30;
  padding: 13px 20px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 11px;
  max-width: 85%;
  display: none;
}
.warning-text {
  color: var(--warning);
}
.nowrap {
  white-space: nowrap;
}
.check-field {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.check-field input {
  accent-color: var(--link);
}
@media (max-width: 760px) {
  #toast {
    left: 50%;
    width: max-content;
  }
  dialog {
    padding: 22px;
  }
  dialog .actions {
    flex-wrap: wrap;
  }
}
.logo-preview {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  margin-bottom: 18px;
  min-height: 100px;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}
