* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.auth-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.18), transparent 38%),
    radial-gradient(circle at 78% 18%, rgba(51, 65, 85, 0.55), transparent 34%),
    var(--bg-base);
}

.login-card {
  width: min(100%, 27rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.84);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38), var(--shadow-accent);
  backdrop-filter: blur(12px);
}

.brand-mark {
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem;
}

.login-brand {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark strong,
.member-cell strong,
.side-profile strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.brand-mark small,
.member-cell small,
.side-profile small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.brand-icon,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  background: var(--brand-primary);
  box-shadow: var(--shadow-accent);
}

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
}

.brand-icon svg {
  color: var(--bg-base);
}

.login-copy {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-copy h1 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to bottom, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.login-copy p,
.login-note,
.form-message {
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0;
  text-align: center;
}

.section-head p,
.panel-header p {
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0;
  text-align: left;
}

.type-picker {
  display: flex;
  gap: 0.5rem;
}

.type-picker .btn {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.type-picker .btn.active {
  background: var(--brand-faded);
  color: var(--brand-primary);
  border-color: rgba(20, 184, 166, 0.3);
}

.login-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}

.google-button {
  width: 100%;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: var(--bg-base);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.google-button:hover,
.google-button:focus {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
  outline: none;
}

.google-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.members-page {
  height: 100vh;
  background: var(--bg-base);
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  transition: grid-template-columns var(--transition-smooth);
  overflow: hidden;
}

.menu-collapsed .members-page {
  grid-template-columns: 5.25rem minmax(0, 1fr);
}

.side-menu {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.side-brand {
  min-height: auto;
  padding: 0;
  min-width: 0;
}

.collapse-button,
.mobile-menu-button {
  flex: 0 0 auto;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
  flex: 1;
  align-content: start;
}

.side-admin-nav {
  flex: 0;
  margin-top: auto;
  margin-bottom: 0.9rem;
}

.side-nav a {
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  transition: var(--transition-fast);
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--brand-primary);
  background: var(--brand-faded);
  border-color: rgba(20, 184, 166, 0.2);
}

.side-profile {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.5rem;
  margin-top: auto;
}

.side-profile .menu-text {
  min-width: 0;
}

.side-profile strong,
.side-profile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-profile .btn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  transition: var(--transition-fast);
  background: transparent;
  width: 100%;
  margin: 0;
}

.side-profile .btn:hover {
  color: var(--brand-primary);
  background: var(--brand-faded);
  border-color: rgba(20, 184, 166, 0.2);
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-header {
  min-height: 4.5rem;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
}

.mobile-menu-button {
  display: none;
}

.menu-collapsed .menu-text {
  display: none;
}

.menu-collapsed .side-menu {
  align-items: center;
}

.menu-collapsed .side-top,
.menu-collapsed .side-nav,
.menu-collapsed .side-profile {
  width: 100%;
}

.menu-collapsed .side-top {
  justify-content: center;
}

.menu-collapsed .side-brand {
  display: none;
}

.menu-collapsed .side-nav a {
  justify-content: center;
  padding-inline: 0.5rem;
}

.menu-collapsed .side-profile {
  justify-content: center;
  display: flex;
  padding: 0.5rem;
}

.menu-collapsed .profile-avatar {
  display: none;
}

.menu-collapsed .side-profile .btn {
  display: inline-flex;
  justify-content: center;
  width: auto;
  padding: 0.5rem;
}

.menu-collapsed .side-brand .brand-icon {
  display: none;
}

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

img.profile-avatar {
  display: block;
  object-fit: cover;
  border: 1px solid rgba(20, 184, 166, 0.35);
  box-shadow: var(--shadow-accent);
}

.members-shell {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 1.5rem;
}

.blank-view {
  min-height: calc(100vh - 4.5rem);
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--brand-primary);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  font-size: 1.8rem;
}

h2 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.section-head,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-head {
  margin-bottom: 1rem;
}

.invite-card {
  margin-bottom: 1rem;
}

.invite-card form {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 13rem) auto;
  gap: 0.85rem;
  align-items: end;
}

.invite-card label {
  display: grid;
  gap: 0.4rem;
}

.invite-card label span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.invite-card .input-field {
  padding-left: 1rem;
}

.invite-card .btn {
  min-height: 2.45rem;
  gap: 0.45rem;
}

.form-message {
  min-height: 1.4rem;
  margin-top: 0.7rem;
  color: var(--brand-primary);
}

.table-card {
  overflow: visible;
}

@media (max-width: 1024px) {
  .table-card {
    overflow-x: auto;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 46rem;
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  color: var(--text-secondary);
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.28);
}

.data-table tbody tr.accounting-row-muted td:not(.col-actions) {
  opacity: 0.34;
  filter: grayscale(1);
}

.data-table tbody tr.accounting-row-muted:hover td:not(.col-actions) {
  opacity: 0.46;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-cell img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
}

.accounting-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.accounting-tab {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.accounting-tab:hover,
.accounting-tab:focus {
  color: var(--text-primary);
  outline: none;
}

.accounting-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.accounting-tab-panel {
  display: none;
}

.accounting-tab-panel.active {
  display: block;
}

.mmr-form-card form {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)) auto;
  align-items: end;
}

.mmr-employee-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.mmr-employee-toolbar-actions {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.mmr-eur-rate-control {
  display: grid;
  gap: 0.35rem;
}

.mmr-eur-rate-control span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mmr-eur-rate-control input {
  width: 8.5rem;
}

.mmr-employee-toolbar h2,
.mmr-employee-toolbar p {
  margin: 0;
}

.mmr-package-form-card form {
  grid-template-columns: minmax(14rem, 24rem) auto;
  align-items: end;
}

.mmr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.mmr-table small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.mmr-table .input-sm,
.mmr-package-card .input-sm {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.mmr-table select.input-sm {
  min-width: 8.5rem;
}

.mmr-money-input {
  width: 7rem;
}

.mmr-employee-list {
  display: grid;
  gap: 1rem;
}

.mmr-role-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.mmr-role-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.45rem;
  background: rgba(15, 23, 42, 0.2);
  padding: 0.6rem 0.7rem;
}

.mmr-role-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.84rem;
}

.mmr-role-meta {
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-top: 0.1rem;
}

.mmr-role-avg {
  color: var(--brand-primary);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.3rem;
}

.mmr-role-avg-eur {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  margin-top: 0.12rem;
}

.mmr-overhead-table-title {
  margin: 0.9rem 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mmr-employees-table {
  min-width: 54rem;
}

.text-right {
  text-align: right;
}

.mmr-col-center {
  text-align: center;
}

.mmr-ga-table {
  min-width: 34rem;
}

.mmr-ga-table .input-sm {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.mmr-inline-field {
  display: grid;
  gap: 0.25rem;
}

.mmr-inline-field span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mmr-table-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.85rem;
}

.mmr-employees-table td {
  height: 3.35rem;
}

.mmr-table-actions {
  width: 2.5rem;
  text-align: right;
  white-space: nowrap;
}

.mmr-employee-menu .dropdown-content {
  min-width: 7rem;
}

.mmr-employee-menu-trigger svg,
.mmr-employee-menu-trigger i {
  width: 1rem;
  height: 1rem;
}

.mmr-cost-tooltip {
  position: relative;
  cursor: default;
  text-decoration: underline;
  text-decoration-color: rgba(20, 184, 166, 0.45);
  text-decoration-style: dotted;
  text-underline-offset: 0.2rem;
}

.mmr-cost-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  z-index: 80;
  min-width: 13rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: rgba(2, 8, 23, 0.96);
  color: var(--text-secondary);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.mmr-cost-tooltip:hover::after,
.mmr-cost-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.mmr-employee-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.mmr-employee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.65rem 0.85rem;
}

.mmr-employee-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.mmr-employee-name {
  min-width: 13rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mmr-job-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.4rem;
  color: var(--brand-primary);
  background: rgba(20, 184, 166, 0.08);
}

.mmr-job-title-icon svg,
.mmr-job-title-icon i {
  width: 1rem;
  height: 1rem;
}

.mmr-job-title-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.mmr-employee-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.mmr-employee-totals strong {
  color: var(--text-primary);
}

.mmr-month-table-wrap {
  overflow-x: auto;
}

.mmr-month-table {
  min-width: 42rem;
}

.mmr-month-table th,
.mmr-month-table td {
  padding: 0.55rem 0.65rem;
}

.mmr-package-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mmr-package-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.65rem;
  padding: 0.15rem 0.42rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.28);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.mmr-package-checkboxes input {
  accent-color: var(--brand-primary);
}

.mmr-mini-empty {
  margin: 0;
  text-align: left;
}

.mmr-employee-modal {
  width: min(96rem, calc(100vw - 2rem));
  min-width: 800px;
  max-height: 80vh;
}

.mmr-employee-modal .modal-body {
  overflow: auto;
}

.mmr-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem;
}

.mmr-modal-grid label {
  display: grid;
  gap: 0.35rem;
}

.mmr-modal-grid .mmr-modal-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.mmr-modal-coverage-checkbox {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 0.25rem;
  background: rgba(2, 6, 23, 0.42);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mmr-modal-coverage-checkbox:hover {
  border-color: var(--brand-primary);
}

.mmr-modal-coverage-checkbox:checked {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.25 8.2 6.4 11.35 12.75 4.65' fill='none' stroke='%23020a13' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.85rem 0.85rem;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.mmr-modal-grid label span,
.mmr-modal-months h3 {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mmr-modal-months {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.mmr-modal-months h3 {
  margin: 0;
}

.mmr-package-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.25);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.mmr-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.85rem;
}

.mmr-package-card {
  padding: 0.95rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.24);
}

.mmr-ga-card {
  width: 100%;
}

.mmr-package-head,
.mmr-package-entry,
.mmr-entry-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mmr-package-head {
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.mmr-package-head h3 {
  margin: 0;
  font-size: 1rem;
}

.mmr-package-title-input {
  width: min(100%, 16rem);
  font-weight: 800;
}

.mmr-package-head small {
  color: var(--text-muted);
}

.mmr-package-entries {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.mmr-package-entry {
  min-height: 2rem;
  padding: 0.25rem 0.35rem 0.25rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(2, 6, 23, 0.22);
}

.mmr-package-entry span,
.mmr-package-entry input:first-child {
  flex: 1;
}

.mmr-package-entry strong {
  color: var(--text-primary);
}

.mmr-entry-form {
  align-items: stretch;
}

.mmr-entry-form input:first-child {
  flex: 1;
}

.mmr-entry-form input:nth-child(2) {
  width: 7rem;
}

.mmr-ga-total {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
}

.mmr-ga-total strong {
  color: var(--text-primary);
}

.accounting-bank-table {
  margin-top: 1rem;
}

.accounting-report-chart-full {
  padding: 0 0.5rem 1.5rem;
  width: 100%;
}

.accounting-report-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 0.75rem;
}

.accounting-report-split {
  display: grid;
  gap: 1rem;
}

.accounting-report-subsection {
  min-width: 0;
}

.accounting-report-subsection h3 {
  margin: 0.85rem 0 0.35rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.accounting-report-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.35rem 0 0.65rem;
}

.accounting-report-metric {
  display: grid;
  gap: 0.12rem;
  padding: 0.45rem 0.6rem;
  border-left: 3px solid #60a5fa;
  background: rgba(15, 23, 42, 0.22);
}

.accounting-report-metric span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-report-metric strong {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.1;
}

.accounting-report-metric small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.accounting-report-category-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.26);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}

.accounting-report-category-filter input {
  accent-color: var(--brand-primary);
}

.accounting-report-category-filter:has(input:not(:checked)) {
  opacity: 0.45;
  filter: grayscale(1);
}

.accounting-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 0 1.5rem 1.5rem;
  align-items: start;
}

.accounting-setup-grid .accounting-settings-merged {
  padding: 0;
  border-bottom: 0;
  margin-bottom: 0;
}

.accounting-field-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: -0.25rem 0 1rem;
}

.admin-settings-form {
  display: grid;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
  max-width: 42rem;
}

.roi-settings-card .admin-settings-form {
  max-width: none;
}

.roi-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.roi-settings-column {
  min-width: 0;
}

.roi-setting-inline {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 0.75rem;
}

.roi-setting-inline .input-field {
  width: 5.5rem;
  padding-right: 0.5rem;
}

.roi-currency-input {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.roi-currency-input span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.roi-settings-actions {
  margin-top: 0.75rem;
}

@media (max-width: 760px) {
  .roi-settings-grid {
    grid-template-columns: 1fr;
  }

  .roi-setting-inline {
    grid-template-columns: 1fr;
  }

  .roi-setting-inline .input-field {
    width: 5.5rem;
  }
}

.admin-settings-status {
  color: var(--text-muted);
  font-size: 0.85rem;
}


.accounting-report-accounts {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.22);
}

.accounting-report-accounts h3 {
  margin: 0 0 0.7rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
}

.accounting-report-account-list {
  display: grid;
  gap: 0.15rem;
}

.accounting-report-folder {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.accounting-report-folder summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  cursor: pointer;
  padding: 0.12rem 0.2rem 0.12rem calc(0.2rem + var(--folder-indent, 0rem));
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 400;
}

.accounting-report-folder summary::-webkit-details-marker {
  display: none;
}

.accounting-report-folder summary i {
  width: 0.82rem;
  height: 0.82rem;
  color: #facc15;
}

.accounting-report-folder-children {
  display: grid;
  gap: 0.05rem;
  padding: 0;
}

.accounting-report-account {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.15rem 0.4rem;
  align-items: center;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 620;
}

.accounting-report-account-file {
  padding: 0.08rem 0.15rem 0.08rem calc(0.15rem + var(--folder-indent, 0rem));
  border-radius: 0;
  border: 1px solid transparent;
}

.accounting-report-account-file:hover {
  border-color: transparent;
  background: rgba(30, 41, 59, 0.14);
}

.accounting-report-account-file i {
  width: 0.78rem;
  height: 0.78rem;
  color: #60a5fa;
}

.accounting-report-account small {
  grid-column: 4;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-report-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.22rem;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  font-weight: 650;
}

.accounting-report-lock-badge i {
  width: 0.62rem;
  height: 0.62rem;
  color: #facc15;
}

.accounting-report-chart {
  min-width: 0;
}

.accounting-stacked-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: flex-end;
  justify-content: stretch;
  gap: 0.5rem;
  margin-top: 0.8rem;
  min-height: 22rem;
  width: 100%;
  overflow-x: hidden;
  padding-bottom: 0.8rem;
  position: relative;
}

.accounting-report-loading {
  grid-column: 1 / -1;
  min-height: 20rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.accounting-report-loading strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 650;
}

.accounting-stacked-row {
  width: 100%;
  display: grid;
  grid-template-rows: auto 16rem auto;
  gap: 0.45rem;
  align-items: end;
}

.accounting-stacked-month {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.accounting-stacked-track {
  width: 3.5rem;
  height: 16rem;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.42);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.accounting-stacked-fill {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: var(--bar-height);
}

.accounting-stacked-fill span {
  width: 100%;
  min-height: 0.2rem;
}

.accounting-dual-track {
  width: 4.6rem;
  display: grid;
  grid-template-columns: 0.27fr 1.2fr;
  gap: 0.3rem;
  border: 0;
  background: transparent;
  overflow: visible;
}

.accounting-stacked-track-mini {
  width: 100%;
  height: 16rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.42);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.accounting-stacked-row strong {
  color: var(--text-primary);
  font-size: 0.72rem;
  text-align: center;
}

.accounting-line-chart {
  position: relative;
  width: 100%;
  height: 21rem;
  margin-top: 0.8rem;
}

.accounting-line-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.accounting-line-grid {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1;
}

.accounting-line-path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accounting-line-path-funds {
  stroke: #14b8a6;
}

.accounting-line-path-spent {
  stroke: #60a5fa;
}

.accounting-line-point {
  position: absolute;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  border: 2px solid #0f172a;
  background: #14b8a6;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 3;
}

.accounting-line-point-spent {
  background: #60a5fa;
}

.accounting-line-label {
  position: absolute;
  bottom: -0.15rem;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.accounting-chart-tooltip {
  position: fixed;
  z-index: 1000;
  transform: translate(-50%, calc(-100% - 10px));
  min-width: 16rem;
  max-width: 22rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(12, 22, 41, 0.96);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.38);
  color: var(--text-primary);
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.accounting-chart-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.accounting-chart-tooltip strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
}

.accounting-chart-tooltip-section {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
}

.accounting-chart-tooltip-section div,
.accounting-chart-tooltip-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.accounting-chart-tooltip-divider {
  height: 1px;
  margin: 0.25rem 0 0.45rem;
  background: var(--border-subtle);
}

.color-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}


.accounting-chart-tooltip-section span,
.accounting-chart-tooltip-total span {
  color: var(--text-muted);
}

.accounting-chart-tooltip-section b,
.accounting-chart-tooltip-total b {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.accounting-chart-tooltip-header span,
.accounting-chart-tooltip-header b {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.accounting-report-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 1rem;
}

.accounting-report-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.accounting-report-legend-item {
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.accounting-report-category-filter {
  cursor: help;
}

.accounting-report-legend i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.accounting-settings {
  margin-bottom: 1rem;
  padding: 0;
  overflow: hidden;
}

.accounting-settings summary {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
  font-weight: 700;
}

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

.accounting-settings[open] .accounting-settings-closed,
.accounting-settings:not([open]) .accounting-settings-open {
  display: none;
}

.accounting-settings-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.accounting-field {
  display: grid;
  gap: 0.4rem;
  flex: 1;
}

.accounting-scan-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.accounting-settings-merged {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.accounting-field span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accounting-settings-actions .btn {
  gap: 0.45rem;
}

.accounting-status-text {
  min-height: 1.1rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}


.accounting-file-info {
  flex: 1;
  min-width: 0;
}

.accounting-file-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accounting-file-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accounting-file-badges i {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5;
}

.accounting-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(250, 204, 21, 0.1);
  color: #facc15;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
}

.accounting-lock-badge i {
  width: 0.85rem !important;
  height: 0.85rem !important;
}

.badge-saved {
  color: var(--brand-primary);
}

.badge-cached {
  color: #facc15;
}

.accounting-csv-results {
  margin-top: 1rem;
}

.accounting-file-browser {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.28);
}

.accounting-scan-loading {
  min-height: 12rem;
  display: grid;
  place-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-align: center;
}

.accounting-scan-loading strong {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 650;
}

.accounting-scan-spinner {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--brand-primary);
  animation: accountingScanSpin 0.85s linear infinite;
}

@keyframes accountingScanSpin {
  to {
    transform: rotate(360deg);
  }
}

.accounting-browser-folder {
  display: grid;
  gap: 0.3rem;
}

.accounting-browser-folder summary {
  min-height: 2.35rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem 0.45rem calc(0.65rem + var(--folder-indent, 0rem));
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  list-style: none;
}

.accounting-browser-folder summary::-webkit-details-marker {
  display: none;
}

.accounting-browser-folder summary:hover,
.accounting-browser-file:hover {
  background: rgba(51, 65, 85, 0.34);
}

.accounting-browser-folder summary span,
.accounting-browser-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-browser-folder summary small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.accounting-browser-children {
  display: grid;
  gap: 0.2rem;
}

.accounting-browser-file {
  min-height: 2.55rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem 0.45rem calc(0.65rem + var(--file-indent, 0rem));
  border-radius: var(--radius-md);
}

.accounting-browser-file>div {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.accounting-browser-file small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.accounting-browser-file .btn {
  width: auto;
  min-width: 2.35rem;
  height: 2rem;
  padding: 0 0.55rem;
}

.accounting-csv-shell {
  display: grid;
  gap: 1rem;
}

.accounting-csv-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.accounting-ignore-terms {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.3rem;
}

.accounting-ignore-terms label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.accounting-match-status {
  min-height: 1rem;
  margin: -0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.accounting-match-log {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.accounting-invoice-scan-progress {
  margin: 0.75rem 0;
  padding: 0.85rem;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: var(--radius-md);
  background: rgba(20, 184, 166, 0.08);
}

.accounting-invoice-scan-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accounting-invoice-scan-head strong {
  color: var(--text-primary);
  font-size: 0.92rem;
}

.accounting-invoice-scan-head p {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.accounting-invoice-scan-steps {
  display: grid;
  gap: 0.35rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.accounting-invoice-scan-steps li {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.accounting-invoice-scan-steps span {
  width: 1rem;
  height: 1rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: var(--brand-primary);
  font-size: 0.65rem;
}

.accounting-invoice-scan-steps .is-current span {
  border-top-color: var(--brand-primary);
  animation: accountingScanSpin 0.85s linear infinite;
}

.accounting-invoice-scan-steps p {
  margin: 0;
}

.accounting-match-log summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.accounting-match-log .panel-header {
  margin-bottom: 0.45rem;
}

.accounting-match-log h2 {
  font-size: 0.92rem;
}

.accounting-match-log p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.accounting-match-log ol {
  display: grid;
  gap: 0.2rem;
  max-height: 16rem;
  margin: 0;
  padding: 0.65rem 0.65rem 0.65rem 1.7rem;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.32);
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.accounting-csv-table {
  margin-top: 0.2rem;
}

.accounting-details-cell {
  display: grid;
  gap: 0.45rem;
}

.accounting-details-name {
  color: #ffffff;
  font-weight: 700;
}

.accounting-details-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.accounting-match-highlight {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
  border-radius: 0.2rem;
  padding: 0 0.12rem;
}

.accounting-match-ignored {
  color: #facc15;
  background: rgba(250, 204, 21, 0.16);
  border-radius: 0.2rem;
  padding: 0 0.12rem;
}

.accounting-match-own-iban {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.18);
  border-radius: 0.2rem;
  padding: 0 0.12rem;
}

.data-table td.accounting-amount-found,
.accounting-amount-found {
  color: #22c55e;
  font-weight: 700;
}

.data-table td.accounting-amount-missing,
.accounting-amount-missing {
  color: #f87171;
  font-weight: 700;
}

.accounting-row-category-select {
  width: 6rem;
  min-height: 2rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
}

.accounting-category-cell {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.accounting-category-suggestion {
  width: 1.8rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-muted);
  flex: 0 0 auto;
  cursor: pointer;
}

.accounting-category-suggestion.has-suggestion {
  color: var(--brand-primary);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.accounting-category-suggestion.has-suggestion.is-different {
  color: #06131f;
  border-color: rgba(20, 184, 166, 0.95);
  background: var(--brand-primary);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.28), 0 8px 20px rgba(20, 184, 166, 0.2);
  cursor: pointer;
}

.accounting-category-suggestion svg {
  width: 1rem;
  height: 1rem;
}

.accounting-category-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.accounting-category-tooltip {
  position: fixed;
  z-index: 1200;
  transform: translate(-50%, calc(-100% - 10px));
  max-width: 18rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(12, 22, 41, 0.96);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.38);
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 120ms ease;
}

.accounting-category-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.accounting-category-tooltip.is-different {
  border-color: rgba(20, 184, 166, 0.65);
  background: linear-gradient(180deg, rgba(18, 48, 59, 0.98), rgba(12, 22, 41, 0.98));
  box-shadow: 0 10px 32px rgba(2, 6, 23, 0.42), 0 0 0 1px rgba(20, 184, 166, 0.14);
}

.accounting-category-tooltip-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
}

.accounting-category-tooltip-row + .accounting-category-tooltip-row {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
}

.accounting-category-tooltip-row strong {
  color: var(--text-primary);
  font-weight: 700;
}

.accounting-category-tooltip-row span {
  color: var(--text-muted);
  font-weight: 400;
}

.accounting-category-tooltip-row .accounting-category-tooltip-separator {
  color: var(--text-primary);
}

.accounting-category-tooltip-note {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.accounting-categories-table th:last-child,
.accounting-categories-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.accounting-categories-actions {
  text-align: right;
}

.accounting-breadcrumb {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
}

.accounting-breadcrumb .btn {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.4);
}

.accounting-breadcrumb .btn:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: var(--brand-faded);
}

.csv-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  line-height: 1.25;
}

.csv-title-link:hover {
  color: var(--brand-primary);
}

/* Action Dropdown */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), var(--shadow-accent);
  z-index: 50;
  min-width: 136px;
  overflow: hidden;
  padding: 0.3rem;
}

.action-dropdown.active .dropdown-content {
  display: block;
  animation: dropdownAppear 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownAppear {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  text-align: left;
}

.dropdown-item i, .dropdown-item svg {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.dropdown-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.dropdown-item:hover i, .dropdown-item:hover svg {
  color: var(--brand-primary);
}


.accounting-ignore-terms {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.ignore-terms-layout {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
}

.ignore-terms-field {
  flex: 1;
}

.ignore-terms-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.scan-all-btn {
  height: 2.75rem;
  padding: 0 1.5rem;
  white-space: nowrap;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.accounting-csv-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accounting-actions-td {
  text-align: right;
  vertical-align: middle;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

.col-lock {
  width: 2.2rem;
  min-width: 2.2rem;
  text-align: center;
}

.accounting-actions-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
}

.accounting-row-menu .dropdown-content {
  right: 0;
  left: auto;
  top: calc(100% + 0.25rem);
  z-index: 80;
  min-width: 9.5rem;
}

.accounting-row-menu-trigger {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-row-dropdown-content .dropdown-item {
  font-size: 0.74rem;
  padding: 0.4rem 0.5rem;
  gap: 0.45rem;
  width: 100%;
  height: auto;
  min-height: 1.9rem;
  justify-content: flex-start;
  white-space: nowrap;
}

.accounting-row-dropdown-content .dropdown-item i,
.accounting-row-dropdown-content .dropdown-item svg {
  width: 0.9rem;
  height: 0.9rem;
}

.accounting-row-dropdown-content .accounting-row-pdf-btn,
.accounting-row-dropdown-content .accounting-row-project-btn,
.accounting-row-dropdown-content .accounting-row-no-invoice-btn,
.accounting-row-dropdown-content .accounting-row-match-btn,
.accounting-row-dropdown-content .accounting-row-clear-btn {
  width: 100%;
  height: auto;
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.admin-rate-input {
  width: 13ch;
  min-width: 13ch;
  max-width: 13ch;
  text-align: right;
}

.admin-monthly-rates-table {
  width: auto;
  table-layout: auto;
  min-width: 0;
}

.admin-monthly-rates-table {
  max-width: 50%;
}

.admin-monthly-rates-table th,
.admin-monthly-rates-table td {
  white-space: nowrap;
  padding-right: 0.85rem;
}

.admin-monthly-rates-table th:nth-child(1),
.admin-monthly-rates-table td:nth-child(1),
.admin-monthly-rates-table th:nth-child(2),
.admin-monthly-rates-table td:nth-child(2),
.admin-monthly-rates-table th:nth-child(3),
.admin-monthly-rates-table td:nth-child(3) {
  width: 1%;
}

.admin-monthly-rates-card {
  width: 50%;
}

.admin-settings-split {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(24rem, auto);
  gap: 1rem;
  align-items: start;
}

.admin-settings-left {
  min-width: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.admin-monthly-rates-side {
  justify-self: end;
  width: auto;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

@media (max-width: 1100px) {
  .admin-settings-split {
    grid-template-columns: 1fr;
  }
  .admin-monthly-rates-side {
    justify-self: stretch;
  }
}

.accounting-row-pdf-btn {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-row-lock-btn {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #facc15 !important;
  opacity: 1 !important;
}

.accounting-row-lock-btn.is-locked {
  color: #facc15;
}

.accounting-row-project-btn {
  color: var(--text-muted);
  filter: grayscale(1);
  opacity: 0.55;
}

.accounting-row-project-btn,
.accounting-row-no-invoice-btn {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-row-project-btn.is-linked {
  color: var(--brand-primary);
  filter: none;
  opacity: 1;
}

.accounting-category-project-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.accounting-project-link-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: var(--radius-md);
  color: var(--brand-primary);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.28);
}

.accounting-project-link-indicator svg {
  width: 0.95rem;
  height: 0.95rem;
}

.accounting-project-link-indicator::after {
  content: attr(data-project-tooltip);
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  transform: translateX(-50%) translateY(0.2rem);
  min-width: 12rem;
  max-width: 18rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.accounting-project-link-indicator:hover::after,
.accounting-project-link-indicator:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.csv-title-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.22rem;
  color: rgba(148, 163, 184, 0.62);
  font-weight: 500;
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
}

.csv-title-crumb {
  color: rgba(148, 163, 184, 0.62);
  font-weight: 500;
}

.csv-title-sep {
  color: rgba(148, 163, 184, 0.45);
  font-weight: 500;
}

.csv-title-file {
  display: block;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.08em;
}

.csv-title-file-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  width: fit-content;
}

.accounting-row-focused td {
  background: rgba(20, 184, 166, 0.16);
}

.accounting-opening-row td {
  background: rgba(20, 184, 166, 0.08);
}

.accounting-closing-row td {
  background: rgba(20, 184, 166, 0.08);
}

.data-table tbody tr.accounting-row-invoice td {
  background: rgba(20, 184, 166, 0.08);
}

.data-table tbody tr.accounting-row-unknown td {
  background: rgba(248, 113, 113, 0.08);
}

.data-table tbody tr.accounting-row-unknown:hover td {
  background: rgba(248, 113, 113, 0.12);
}

.accounting-project-modal {
  width: min(42rem, calc(100vw - 2rem));
}

.accounting-project-current {
  display: grid;
  gap: 0.16rem;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius-md);
  background: rgba(20, 184, 166, 0.08);
}

.accounting-project-current span,
.accounting-project-current small {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-project-current strong {
  color: var(--text-primary);
}

.accounting-project-picker-list {
  display: grid;
  gap: 0.35rem;
  max-height: 28rem;
  overflow: auto;
  margin-top: 0.85rem;
}

.accounting-project-picker-item {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-primary);
  cursor: pointer;
}

.accounting-project-picker-item:hover {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.1);
}

.accounting-project-picker-item span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.ledger-csv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
}

.ledger-csv-amount {
  min-width: 0;
  text-align: right;
}

.ledger-csv-link {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-primary);
  text-decoration: none;
}

.ledger-csv-link span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.ledger-csv-link strong,
.ledger-csv-link small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-csv-link small {
  color: var(--text-muted);
}

.accounting-invoice-link {
  display: inline-grid;
  gap: 0.12rem;
  max-width: 16rem;
  color: var(--brand-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.accounting-invoice-link:hover {
  text-decoration: underline;
}

.accounting-invoice-path,
.accounting-invoice-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-invoice-path {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.accounting-invoice-path-sep {
  margin: 0 0.22rem;
  opacity: 0.7;
}

.accounting-invoice-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.accounting-invoice-candidates {
  display: grid;
  gap: 0.25rem;
}

.accounting-invoice-cell {
  display: grid;
  gap: 0.35rem;
  align-items: start;
}

.accounting-row-match-btn {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-row-clear-btn {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-invoice-not-required {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.accounting-invoice-candidate-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 16rem;
}

.accounting-invoice-candidate-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 13.6rem;
  padding: 0;
  color: var(--brand-primary);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.accounting-invoice-candidate-link:hover {
  text-decoration: underline;
}

.accounting-invoice-candidate-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-invoice-candidate-select {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accounting-invoice-hover-preview {
  position: fixed;
  top: 0.75rem;
  left: 0;
  right: auto;
  bottom: 0.75rem;
  width: min(68vw, 86rem);
  min-width: min(42rem, calc(100vw - 2rem));
  z-index: 2400;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 24px 80px rgba(2, 8, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-110%, 0, 0);
  transition: transform 180ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.accounting-invoice-hover-preview.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.accounting-invoice-hover-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.92);
}

.accounting-invoice-hover-preview-head > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.accounting-invoice-hover-preview-head strong,
.accounting-invoice-hover-preview-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-invoice-hover-preview-head strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.accounting-invoice-hover-preview-path {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.accounting-invoice-hover-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 22rem);
  min-height: 0;
}

.accounting-invoice-hover-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #111827;
}

.accounting-invoice-hover-row {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.96);
  padding: 1rem;
}

.accounting-invoice-hover-row dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.accounting-invoice-hover-row div {
  display: grid;
  gap: 0.35rem;
}

.accounting-invoice-hover-row dt {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounting-invoice-hover-row dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.accounting-date-cell {
  display: grid;
  gap: 0.05rem;
  line-height: 1.1;
  font-size: 0.72rem;
  font-weight: 600;
}

.accounting-date-cell small {
  color: var(--text-muted);
  font-size: inherit;
  font-weight: 600;
}

.accounting-pdf-modal {
  width: min(96vw, 88rem);
  max-height: 94vh;
}

.modal-overlay .accounting-pdf-modal {
  width: 96vw;
  max-width: none;
  height: 94vh;
}

.modal-overlay .accounting-pdf-modal .modal-body {
  flex: 1;
  min-height: 0;
}

.accounting-modal-status {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.accounting-pdf-modal-footer {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
}

.accounting-pdf-modal-footer #closePdfPickerBtn {
  margin-right: auto;
}

.accounting-pdf-modal-footer .accounting-modal-status {
  margin: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-pdf-scan-btn {
  justify-self: center;
  border-color: rgba(20, 184, 166, 0.45);
}

.accounting-pdf-scan-btn.is-loading,
.accounting-pdf-folder-refresh.is-loading {
  cursor: wait;
}

.accounting-pdf-scan-btn.is-loading svg,
.accounting-pdf-folder-refresh.is-loading svg {
  animation: accountingSpin 0.85s linear infinite;
}

@keyframes accountingSpin {
  to {
    transform: rotate(360deg);
  }
}

.accounting-pdf-direct-link {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.accounting-pdf-direct-link span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.accounting-pdf-direct-link .input-field {
  width: 100%;
  height: 2.25rem;
}

.accounting-pdf-scan-btn:hover,
.accounting-pdf-scan-btn:focus-visible {
  background: rgba(20, 184, 166, 0.22);
  border-color: rgba(20, 184, 166, 0.75);
  color: var(--text-primary);
}

.accounting-pdf-modal-footer #attachSelectedPdfBtn {
  justify-self: end;
}

.accounting-pdf-list {
  margin-top: 0.15rem;
  display: grid;
  gap: 0.15rem;
  align-content: start;
  align-items: start;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.accounting-pdf-folder {
  display: block;
  margin: 0;
  padding: 0;
}

.accounting-pdf-folder summary {
  min-height: 1.8rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.45rem 0.25rem calc(0.45rem + var(--folder-indent, 0rem));
  border-radius: var(--radius-md);
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  width: 100%;
  box-sizing: border-box;
}

.accounting-pdf-folder summary::-webkit-details-marker {
  display: none;
}

.accounting-pdf-folder:focus,
.accounting-pdf-folder:focus-visible {
  outline: none;
}

.accounting-pdf-folder summary:hover {
  background: rgba(51, 65, 85, 0.34);
}

.accounting-pdf-folder-refresh {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  color: var(--text-muted);
  opacity: 0;
}

.accounting-pdf-folder summary:hover .accounting-pdf-folder-refresh,
.accounting-pdf-folder summary:focus-visible .accounting-pdf-folder-refresh,
.accounting-pdf-folder-refresh:focus-visible {
  opacity: 1;
}

.accounting-pdf-folder-refresh:hover {
  color: var(--brand-primary);
  background: rgba(20, 184, 166, 0.18);
}

.accounting-pdf-folder-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.accounting-pdf-folder-refresh.is-loading {
  opacity: 1;
  color: var(--brand-primary);
  background: rgba(20, 184, 166, 0.16);
}

.accounting-pdf-folder summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-pdf-folder summary small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.accounting-pdf-children {
  display: none;
  gap: 0;
  align-content: start;
  align-items: start;
  margin: 0;
  padding: 0;
}

.accounting-pdf-folder>.accounting-pdf-children {
  margin: 0;
  padding: 0;
}

.accounting-pdf-folder[open]>.accounting-pdf-children {
  display: grid;
}

.accounting-pdf-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.45rem 0.22rem calc(0.45rem + var(--pdf-indent, 0rem));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.35);
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.accounting-pdf-item.active {
  border-color: rgba(20, 184, 166, 0.65);
  background: rgba(20, 184, 166, 0.12);
}

.accounting-pdf-item>div {
  min-width: 0;
  display: grid;
  gap: 0;
}

.accounting-pdf-item strong {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 650;
}

.accounting-pdf-item small {
  color: var(--text-muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-tree-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.accounting-tree-icon.folder-icon {
  color: #facc15;
}

.accounting-tree-icon.pdf-icon {
  color: #fb7185;
}

.accounting-pdf-modal-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) minmax(28rem, 1fr) minmax(17rem, 22rem);
  gap: 0.9rem;
  height: 100%;
}

.accounting-pdf-preview {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.55rem;
}

.accounting-pdf-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.accounting-pdf-preview-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 800;
  text-decoration: none;
}

.accounting-pdf-preview-title:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.accounting-pdf-preview-title.is-disabled {
  color: var(--text-muted);
  pointer-events: none;
}

.accounting-pdf-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.accounting-pdf-zoom-controls #pdfZoomValue {
  color: var(--text-muted);
  font-size: 0.74rem;
  width: 3rem;
  text-align: center;
}

.accounting-pdf-preview-frame {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: auto;
  height: 100%;
  background: #0b1220;
}

.accounting-pdf-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  transform-origin: top left;
}

.accounting-pdf-row-context {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.42);
}

.accounting-pdf-row-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.accounting-pdf-row-context-head strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.accounting-pdf-row-context-head span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.accounting-pdf-row-context-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  margin: 0;
}

.accounting-pdf-row-context-list div {
  display: grid;
  gap: 0.2rem;
}

.accounting-pdf-row-context-list dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounting-pdf-row-context-list dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.accounting-pdf-row-context-list dd .muted {
  color: var(--text-muted);
}

.accounting-pdf-row-context-list dd .details-name {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-weight: 800;
}

.accounting-pdf-row-context-list a {
  color: var(--brand-primary);
  font-weight: 750;
  text-decoration: none;
}

.accounting-pdf-row-context-list a:hover {
  text-decoration: underline;
}

.accounting-pdf-row-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
}

.accounting-pdf-row-nav .btn-icon {
  width: 2.4rem;
  height: 2.4rem;
}

.calendar-shell {
  width: min(100%, 88rem);
}

.calendar-head #calendarStatus {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

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

.metric-group-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-popover {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  display: none;
  max-height: 20rem;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-top: 0.5rem;
}

.metric-group-frame:hover .metric-popover {
  display: block;
}

.metric-popover-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-popover-item:last-child {
  border-bottom: 0;
}

.metric-popover-name {
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-popover-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.metric-group-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  min-width: 6.5rem;
}

.metric-group-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.metric-sub-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.metric-sub-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.metric-sub-item strong {
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.metric-card p,
.metric-card small {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0.18rem 0;
}

.metric-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  background: var(--brand-faded);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: var(--radius-lg);
}

.metric-icon-alt {
  color: var(--status-info);
  background: var(--status-info-bg);
  border-color: rgba(96, 165, 250, 0.2);
}

.calendar-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 1rem;
  align-items: start;
}

.calendar-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-topbar h2,
.keyword-breakdown-card h2 {
  margin-bottom: 0.25rem;
}

.calendar-topbar p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.calendar-controls .btn,
.calendar-settings-btn {
  gap: 0.45rem;
}

.calendar-date-input {
  width: 10rem;
  padding-left: 0.85rem;
  color-scheme: dark;
}

.calendar-icon-btn {
  width: 2.35rem;
  height: 2.35rem;
}

.calendar-results {
  display: block;
  padding-top: 1rem;
}

.calendar-grid-wrap {
  width: 100%;
  overflow: visible;
  padding-bottom: 0.15rem;
}

.calendar-month-grid {
  min-width: 52rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}

.calendar-weekday {
  min-height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--status-info);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calendar-day {
  position: relative;
  min-height: 7rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.4);
}

.calendar-day:hover,
.calendar-day:focus {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(15, 23, 42, 0.68);
  outline: none;
}

.calendar-day-placeholder {
  visibility: hidden;
}

.calendar-day-today {
  border-color: rgba(20, 184, 166, 0.9);
  background: rgba(20, 184, 166, 0.16);
}

.calendar-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.calendar-day-head strong {
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1;
}

.calendar-day-head span {
  color: var(--status-info);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.calendar-day-keyword-bar,
.calendar-day-empty-bar {
  align-self: end;
  width: 100%;
  height: 0.8rem;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.calendar-day-empty-bar {
  background: transparent;
}

.calendar-bar-segment {
  min-width: 0.25rem;
  height: 100%;
}

.calendar-bar-work {
  background: #3b82f6;
}

.calendar-bar-other {
  background: #06b6d4;
}

.calendar-bar-all-day {
  background: #8b5cf6;
}

.calendar-bar-uncategorized {
  background: #94a3b8;
}

.calendar-day-count {
  min-height: 1rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.calendar-day-popover {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  top: calc(100% - 0.3rem);
  z-index: 8;
  display: none;
  min-width: 15rem;
  max-height: 17rem;
  overflow: auto;
  padding: 0.8rem;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow-card);
}

.calendar-day:nth-child(7n) .calendar-day-popover,
.calendar-day:nth-child(7n + 6) .calendar-day-popover {
  left: auto;
  right: 0.6rem;
}

.calendar-day:hover .calendar-day-popover,
.calendar-day:focus .calendar-day-popover {
  display: grid;
  gap: 0.65rem;
}

.calendar-day-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-day-popover-head strong,
.calendar-day-popover-event strong {
  color: var(--text-primary);
}

.calendar-day-popover-head span,
.calendar-day-popover-event span,
.calendar-day-popover p {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.calendar-day-popover p {
  margin: 0;
}

.calendar-day-popover-events {
  display: grid;
  gap: 0.55rem;
}

.calendar-day-popover-event {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.calendar-day-popover-event strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

.calendar-grid-note {
  margin: 1rem 0 0;
  color: var(--text-muted);
  text-align: center;
}

.calendar-access-message {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 1.25rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed rgba(20, 184, 166, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(20, 184, 166, 0.06);
}

.calendar-access-message p {
  margin: 0;
}

.calendar-access-message .btn {
  gap: 0.45rem;
  text-decoration: none;
}

.calendar-event {
  display: grid;
  grid-template-columns: minmax(8.5rem, 13rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.34);
}

.calendar-event:hover {
  border-color: rgba(20, 184, 166, 0.28);
  background: rgba(20, 184, 166, 0.06);
}

.calendar-event-date strong,
.calendar-event-date span {
  display: block;
}

.calendar-event-date strong {
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.45;
}

.calendar-event-date span,
.calendar-event-main p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.calendar-event-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.calendar-event-title-row h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.35;
}

.calendar-event-main p {
  margin: 0.35rem 0 0;
}

.calendar-side-panel {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 1rem;
}

.calendar-keyword-editor {
  padding: 0;
  overflow: visible;
}

.calendar-keyword-editor summary {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.calendar-keyword-editor summary::-webkit-details-marker {
  display: none;
}

.calendar-keyword-editor[open] .calendar-editor-icon-closed,
.calendar-keyword-editor:not([open]) .calendar-editor-icon-open {
  display: none;
}

.calendar-keyword-editor-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.calendar-field {
  display: grid;
  gap: 0.4rem;
}

.calendar-field span,
.calendar-picker-header {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-keyword-input {
  min-height: 5.5rem;
  resize: vertical;
  padding: 0.75rem;
  font-family: var(--font-family);
}

.calendar-dropdown {
  position: relative;
}

.calendar-dropdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.4rem;
  gap: 0.5rem;
}

.calendar-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-left: 0.85rem;
  cursor: pointer;
  text-align: left;
}

.calendar-list-box {
  position: absolute;
  z-index: 20;
  inset: calc(100% + 0.35rem) 0 auto 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.calendar-check-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.calendar-check-row:hover {
  background: rgba(51, 65, 85, 0.34);
}

.calendar-check-row input {
  accent-color: var(--brand-primary);
}

.calendar-color {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.16);
}

.calendar-check-row small {
  color: var(--brand-primary);
  font-weight: 700;
}

.keyword-breakdown-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-keyword-stats {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.85rem;
}

.keyword-stat-group {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.3);
}

.keyword-stat-group-head,
.keyword-stat-row {
  display: grid;
  gap: 0.45rem;
}

.keyword-stat-group-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.keyword-stat-group-head span {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.keyword-stat-group-head strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.keyword-stat-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.keyword-stat-copy span {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.keyword-stat-copy small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.keyword-stat-bar {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.keyword-stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.keyword-stat-work .keyword-stat-bar span {
  background: #3b82f6;
}

.keyword-stat-other .keyword-stat-bar span {
  background: #06b6d4;
}

@media (max-width: 760px) {
  .members-page {
    display: block;
  }

  .side-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: 17rem;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
  }

  .menu-open .side-menu {
    transform: translateX(0);
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .collapse-button {
    display: none;
  }

  .menu-collapsed .menu-text {
    display: initial;
  }

  .menu-collapsed .side-menu {
    align-items: stretch;
  }

  .menu-collapsed .side-profile .btn {
    display: inline-flex;
  }

  .app-header,
  .section-head,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .members-shell {
    padding: 1rem;
  }

  .invite-card form {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 42rem;
  }

  .calendar-metrics,
  .calendar-page-layout,
  .calendar-event {
    grid-template-columns: 1fr;
  }

  .calendar-topbar {
    flex-direction: column;
  }

  .calendar-controls {
    width: 100%;
    justify-content: stretch;
  }

  .calendar-controls .btn,
  .calendar-date-input {
    flex: 1 1 9rem;
  }

  .calendar-grid-wrap {
    overflow-x: auto;
  }

  .calendar-list-box {
    position: static;
    margin-top: 0.5rem;
  }
}

.role-select {
  appearance: none;
  padding: 0.4rem 2rem 0.4rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2314b8a6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 8rem;
}

.role-select:hover {
  border-color: var(--primary-color);
}

.role-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.role-select option {
  background-color: #1e293b;
  color: #f1f5f9;
}

.client-project-group {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.client-project-group.is-drop-target {
  background: rgba(20, 184, 166, 0.08);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.45);
}

.project-row-draggable {
  cursor: grab;
}

.project-row-draggable.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.client-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.client-group-header:hover {
  background: rgba(51, 65, 85, 0.4);
  border-color: var(--brand-primary);
}

.client-group-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}



.client-group-content {
  margin-top: 0.5rem;
  animation: slideDown 0.2s ease-out;
}

.client-group-content.collapsed {
  display: none;
}

.client-group-toggle-icon {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.client-group-header.collapsed .client-group-toggle-icon {
  transform: rotate(-90deg);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
  min-width: 9rem;
  margin-top: 0.25rem;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 0.4rem;
  display: none;
  animation: dropdownFade 0.15s ease-out;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  min-height: auto;
}

.dropdown .btn {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.dropdown-menu button,
.dropdown-menu a {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: block;
  text-decoration: none;
}

.dropdown-menu button:hover,
.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dropdown-menu button.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.text-success {
  color: var(--status-success) !important;
}

.text-info {
  color: var(--status-info) !important;
}

.text-warning {
  color: var(--status-warning) !important;
}

.text-danger {
  color: var(--status-danger) !important;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.project-link {
  text-decoration: none;
  color: var(--brand-primary);
  font-weight: 600;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.roi-client-refresh-btn.is-refreshing i {
  animation: roiClientRefreshSpin 0.9s linear infinite;
}

@keyframes roiClientRefreshSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide number input controls */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Projects Summary */
.projects-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  transition: transform 0.2s, border-color 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.3);
}

.summary-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-lg);
  font-size: 1.5rem;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-details small {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  white-space: nowrap;
}

.summary-details strong {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.summary-subamount {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.modal-card {
  background: var(--bg-card);
  width: min(100%, 500px);
  max-height: 90vh;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ledger-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
  animation: slideInLeft 0.2s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ledger-item input {
  flex: 1;
}

border-top: 1px solid var(--border-subtle);
display: flex;
justify-content: flex-end;
gap: 0.75rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ledger-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
  animation: slideInLeft 0.2s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ledger-item input {
  flex: 1;
}

@media print {
  @page {
    margin: 0;
  }

  body {
    margin: 1.5cm !important;
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    overflow: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  body::-webkit-scrollbar {
    display: none !important;
  }

  .side-menu,
  .app-header,
  .accounting-breadcrumb,
  .accounting-top-nav,
  .accounting-ignore-terms,
  .accounting-csv-actions,
  .action-dropdown,
  .accounting-row-match-btn,
  .accounting-row-clear-btn,
  .accounting-row-pdf-btn,
  .accounting-row-lock-btn,
  .mobile-menu-button,
  .col-category,
  .col-actions,
  #saveSetupBtn,
  #csvMeta,
  #invoiceMatchStatus,
  .accounting-status-text,
  i,
  svg {
    display: none !important;
  }

  .panel-header {
    display: block !important;
    border: none !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0 !important;
  }

  .panel-header h2 {
    color: #000 !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
  }

  .csv-title-link {
    color: #000 !important;
    text-decoration: none !important;
  }

  .members-page,
  .workspace,
  .accounting-csv-shell,
  .card {
    display: block !important;
    height: auto !important;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 1rem !important;
    border: none !important;
  }

  .data-table,
  .data-table th,
  .data-table td,
  .data-table tr {
    border-left: 0 !important;
    border-right: 0 !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .data-table tbody tr.accounting-row-muted,
  .data-table tbody tr.accounting-row-muted * {
    color: #ccc !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .data-table th,
  .data-table td {
    color: #000 !important;
    border-top: 0 !important;
    border-bottom: 1px solid #ccc !important;
    padding: 8px 4px !important;
    background: #fff !important;
    font-size: 0.85rem !important;
  }

  .data-table th {
    border-bottom: 2px solid #000 !important;
    text-align: left !important;
    font-weight: 800 !important;
  }

  /* Force all nested text to black */
  .data-table * {
    color: #000 !important;
    background: transparent !important;
  }

  .accounting-invoice-link {
    color: #14b8a6 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
  }

  tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  thead {
    display: table-row-group;
  }
}
