@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

html {
  font-size: var(--content-font-size, 16px);
}

body {
  margin: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f4f7fa;
  color: #1a202c;
  --pie-open: #f59e0b;
  --pie-paid: #10b981;
  --pie-unpaid: #ef4444;
  --card-bg: #fff;
  --border-color: #e2e8f0;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

.recent-currency-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 20px;
  background: none;
  border-bottom: none;
  font-size: 14px;
}
.currency-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.currency-label {
  color: var(--text-muted);
  font-weight: 500;
}

.link-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.copy-icon-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.copy-icon-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}
.company-link-inline {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.company-link-inline:hover {
  text-decoration: underline;
}

.bank-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  transition: all 0.2s;
  text-decoration: none !important;
}

.bank-link-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.copy-text {
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  font-family: monospace;
  transition: all 0.2s;
}

body.theme-dark .copy-text {
  background: rgba(255, 255, 255, 0.1);
}

.copy-text:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

body.theme-dark {
  background: #0f172a;
  color: #f1f5f9;
  --card-bg: #1e293b;
  --border-color: #334155;
  --text-muted: #94a3b8;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

/* Scrollbar – light theme */
.invoice-list::-webkit-scrollbar,
.invoice-detail-section::-webkit-scrollbar,
.vies-result-toast::-webkit-scrollbar {
  width: 10px;
}
.invoice-list::-webkit-scrollbar-track,
.invoice-detail-section::-webkit-scrollbar-track,
.vies-result-toast::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 5px;
}
.invoice-list::-webkit-scrollbar-thumb,
.invoice-de.custom-logo-select-dropdown::-webkit-scrollbar { width: 4px; }
.custom-logo-select-dropdown::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

/* Premium Bank Details UI */
.bank-details-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.bank-detail-pill {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  gap: 8px;
  transition: all 0.2s ease;
}

body.theme-dark .bank-detail-pill {
  background: rgba(255, 255, 255, 0.03);
}

.bank-detail-pill:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}

.bank-detail-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}

.bank-detail-value {
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  color: var(--text-color);
  font-weight: 500;
}

.bank-copy-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.bank-copy-btn:hover {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}

.bank-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  border-radius: 6px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  transition: all 0.2s;
}

.bank-link-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}
.invoice-list::-webkit-scrollbar-thumb,
.invoice-detail-section::-webkit-scrollbar-thumb,
.vies-result-toast::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.invoice-list::-webkit-scrollbar-thumb:hover,
.invoice-detail-section::-webkit-scrollbar-thumb:hover,
.vies-result-toast::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.invoice-list {
  scrollbar-color: #cbd5e1 #e2e8f0;
}
.invoice-detail-section {
  scrollbar-color: #cbd5e1 #e2e8f0;
}
.vies-result-toast {
  scrollbar-color: #cbd5e1 #e2e8f0;
}

/* Scrollbar – dark theme */
body.theme-dark .invoice-list::-webkit-scrollbar-track,
body.theme-dark .invoice-detail-section::-webkit-scrollbar-track,
body.theme-dark .vies-result-toast::-webkit-scrollbar-track {
  background: #1e293b;
}
body.theme-dark .invoice-list::-webkit-scrollbar-thumb,
body.theme-dark .invoice-detail-section::-webkit-scrollbar-thumb,
body.theme-dark .vies-result-toast::-webkit-scrollbar-thumb {
  background: #475569;
}
body.theme-dark .invoice-list::-webkit-scrollbar-thumb:hover,
body.theme-dark .invoice-detail-section::-webkit-scrollbar-thumb:hover,
body.theme-dark .vies-result-toast::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
body.theme-dark .invoice-list {
  scrollbar-color: #475569 #1e293b;
}
body.theme-dark .invoice-detail-section {
  scrollbar-color: #475569 #1e293b;
}
body.theme-dark .vies-result-toast {
  scrollbar-color: #475569 #1e293b;
}

body.theme-dark .main-title span {
  color: #94a3b8;
}

body.theme-dark .invoice-list-card,
body.theme-dark .invoice-detail-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.theme-dark .filter-input {
  background: #0f172a;
  border-color: var(--border-color);
  color: #e2e8f0;
}

body.theme-dark .filter-input::placeholder {
  color: #64748b;
}

body.theme-dark .data-table th,
body.theme-dark .data-table td {
  border-color: var(--border-color);
}

body.theme-dark .stat-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.theme-dark .company-card--selected {
  background: rgba(59, 130, 246, 0.15);
}

body.theme-dark .modal-content {
  background: var(--card-bg);
  color: #e2e8f0;
}

body.theme-dark .modal-content label {
  color: #cbd5e1;
}

body.theme-dark .company-detail-meta-text {
  color: var(--text-muted);
}

body.theme-dark .invoice-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

body.theme-dark .invoice-item-meta {
  color: var(--text-muted);
}

body.theme-dark .sortable-th:hover {
  background: rgba(59, 130, 246, 0.2);
}

body.theme-dark .pie-segment--open {
  fill: #f59e0b;
}
body.theme-dark .pie-segment--paid {
  fill: #22c55e;
}
body.theme-dark .pie-segment--unpaid {
  fill: #ef4444;
}

body.theme-dark select.filter-input {
  background: #0f172a;
  color: #e2e8f0;
}

body.theme-dark textarea.filter-input {
  background: #0f172a;
  border-color: var(--border-color);
  color: #e2e8f0;
}

body.theme-dark .data-table th {
  background: #0f172a;
  color: #94a3b8;
}

body.theme-dark .data-table tr:hover td {
  background: rgba(59, 130, 246, 0.15); /* Increased contrast from 0.1 */
}

body.theme-dark .profile-menu-dropdown {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.theme-dark .profile-menu-item {
  color: #e2e8f0;
}

body.theme-dark .profile-menu-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

body.theme-dark .stats {
  color: var(--text-muted);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
iframe {
  max-width: 100%;
}

a {
  color: #0f8cff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
a {
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

button {
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.sidebar-icon:focus-visible,
.user-pill:focus-visible {
  outline: 2px solid #0f8cff;
  outline-offset: 2px;
}

.app {
  display: grid;
  grid-template-columns: 80px 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

.sidebar {
  background: #0f172a;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  gap: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  align-self: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.sidebar-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}
.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-nav {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sidebar-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-icon .sidebar-svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}
.sidebar-icon:hover .sidebar-svg {
  transform: scale(1.1);
}
.sidebar-icon .sidebar-tooltip {
  display: none;
  position: absolute;
  left: 100%;
  margin-left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.sidebar-icon .sidebar-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e293b;
}
.sidebar-icon:hover .sidebar-tooltip {
  display: block;
}

.sidebar-nav a.sidebar-icon {
  text-decoration: none;
  color: inherit;
}

.sidebar-icon--active,
.sidebar-icon:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}
.sidebar-icon--active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.main {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  font-size: var(--content-font-size, 16px);
}

.main--dashboard {
  gap: 12px;
  padding-top: 16px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}

.main-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: nowrap;
  min-width: 0;
}

.font-size-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 106px;
}

.font-size-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  color: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.font-size-btn:hover {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

.font-size-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.font-size-btn--reset {
  font-size: 14px;
  font-weight: 600;
}

.profile-menu {
  position: relative;
  z-index: 100;
}

.main-header-actions .btn-outline {
  white-space: nowrap;
}

.main-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 1;
}

.main-title h1 {
  margin: 0;
  font-size: 28px;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-color);
}

.main-title span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}

.user-pill {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #0f8cff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

/* Top right - theme on login only */
.top-right-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

/* Bottom right - language + theme (theme only when not login) */
.bottom-right-controls {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Language switch - single flag, expands upward on click */
.lang-dropdown-wrap {
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.lang-trigger:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
}

.lang-trigger-flag {
  width: 28px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

.lang-dropdown-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  min-width: 120px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown-wrap--open .lang-dropdown-panel {
  max-height: 160px;
  opacity: 1;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.lang-option:hover {
  background: rgba(51, 65, 85, 0.6);
}

.lang-option.active {
  background: rgba(15, 140, 255, 0.25);
  color: #7dd3fc;
}

.lang-option-flag {
  width: 28px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

body:not(.theme-dark) .lang-trigger {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.3);
}

body:not(.theme-dark) .lang-trigger:hover {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.5);
}

body:not(.theme-dark) .lang-dropdown-panel {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.4);
}

body:not(.theme-dark) .lang-option {
  color: #334155;
}

body:not(.theme-dark) .lang-option:hover {
  background: rgba(241, 245, 249, 0.9);
}

body:not(.theme-dark) .lang-option.active {
  background: rgba(15, 140, 255, 0.12);
  color: #0369a1;
}

/* Theme switch - iOS-style toggle */
.theme-switch {
  padding: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.theme-switch-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  position: relative;
  transition: background 0.2s;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch--dark .theme-switch-track {
  background: rgba(15, 140, 255, 0.5);
}

.theme-switch--dark .theme-switch-thumb {
  transform: translateX(20px);
}

body:not(.theme-dark) .theme-switch-track {
  background: rgba(148, 163, 184, 0.35);
}

body:not(.theme-dark) .theme-switch--dark .theme-switch-track {
  background: rgba(15, 140, 255, 0.35);
}

/* Theme in profile menu - above Settings */
.profile-menu-item--theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  width: 100%;
  cursor: default;
  font-size: 13px;
  color: inherit;
  border-radius: 8px;
}

.profile-menu-item--theme:hover {
  background: rgba(51, 65, 85, 0.4);
}

body:not(.theme-dark) .profile-menu-item--theme:hover {
  background: rgba(241, 245, 249, 0.9);
}

.profile-menu-item--theme .profile-menu-theme-label {
  flex: 1;
  text-align: left;
}

.profile-menu-item--theme .theme-switch {
  flex-shrink: 0;
  cursor: pointer;
}

/* Fallback for pages that still use text button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.theme-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.9);
}

body:not(.theme-dark) .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
}

body:not(.theme-dark) .theme-toggle-btn:hover {
  background: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.pdf-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  padding: 6px 8px;
  min-width: 32px;
}

.copy-value-wrap,
.link-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

.copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  vertical-align: middle;
}

.copy-icon-btn:hover {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.copy-icon-btn:active {
  transform: translateY(0);
}

.input-with-copy {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.input-with-copy .filter-input {
  flex: 1;
}
.vies-link,
.vies-check-btn {
  font-size: 12px;
  margin-left: 6px;
  color: var(--primary, #2563eb);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.vies-link:hover,
.vies-check-btn:hover:not(:disabled) {
  text-decoration: underline;
}
.vies-check-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}
.vies-result-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-bg, #1e293b);
  color: inherit;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color, #334155);
  max-width: 90%;
  max-height: 200px;
  overflow-y: auto;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 9999;
  pointer-events: none;
}
.vies-result-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.vies-result--valid {
  border-left: 4px solid #16a34a;
}
.vies-result--invalid {
  border-left: 4px solid #dc2626;
}
.vies-result-name {
  display: block;
  margin-top: 4px;
  font-weight: 500;
}
.vies-result-addr {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.vies-result-err {
  display: block;
  margin-top: 4px;
  color: #dc2626;
  font-size: 12px;
}
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 9999;
  pointer-events: none;
}
.copy-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toggle-pdf-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-pdf-icon.toggle-arrow--open {
  transform: rotate(90deg);
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  background: rgba(15, 140, 255, 0.08);
}

.sort-arrow {
  display: inline-block;
  width: 1.1em;
  text-align: center;
  margin-left: 2px;
}

.data-table {
  table-layout: fixed;
  width: 100%;
}

.invoice-list-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  border: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.invoice-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.invoice-list-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invoice-list-header h2 {
  margin: 0;
  font-size: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border-radius: 999px;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-hover), #1d4ed8);
}

.invoice-list {
  max-height: 68vh;
  overflow-y: auto;
}

.invoice-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.tab-row {
  display: inline-flex;
  width: fit-content;
  align-self: flex-start;
  gap: 2px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover:not(.tab-btn--active) {
  color: var(--text-color);
  background: rgba(148, 163, 184, 0.1);
}

.tab-btn--active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.filter-input {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--card-bg);
  color: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Password visibility toggle (eye button) */
.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.auth-card #loginStep .password-input-wrap:last-of-type,
.auth-card .change-password-step .password-input-wrap:last-of-type,
.auth-card .force-pw-fields .password-input-wrap:last-of-type {
  margin-bottom: 20px;
}

.force-pw-fields .password-input-wrap {
  margin-bottom: 12px;
}

.password-input-wrap .filter-input {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}

.pw-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s,
    background 0.2s;
}

.pw-toggle-btn:hover {
  color: #0f8cff;
  background: rgba(15, 140, 255, 0.08);
}

.pw-toggle-btn:focus-visible {
  outline: 2px solid #0f8cff;
  outline-offset: 2px;
}

.pw-toggle-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

body.theme-dark .pw-toggle-btn {
  color: #94a3b8;
}

body.theme-dark .pw-toggle-btn:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}

.filter-label {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.date-row > * {
  min-width: 0;
}

.date-row .filter-input,
.date-row .password-input-wrap .filter-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.date-row .password-input-wrap {
  min-width: 0;
  width: 100%;
}

/* Create user row - equal width inputs */
.create-user-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.create-user-row .create-user-field {
  min-width: 0;
}

.create-user-row .create-user-field .filter-input,
.create-user-row .create-user-field .password-input-wrap {
  width: 100%;
  box-sizing: border-box;
}

.create-user-row .create-user-field .password-input-wrap .filter-input {
  width: 100%;
}

.invoice-filters .date-row:has(.filter-label) {
  grid-template-columns: 1fr 1fr 1fr;
}

.edit-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 6px;
}

.edit-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 6px;
}

.edit-row-3 > div,
.edit-row-2 > div {
  min-width: 0;
}

.edit-row-3 .filter-input,
.edit-row-2 .filter-input,
.edit-row-3 select.filter-input,
.edit-row-2 select.filter-input {
  width: 100%;
  box-sizing: border-box;
}

.remarks-row {
  width: 100%;
}

.remarks-row .filter-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 150px;
  resize: vertical;
}

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

.invoice-item {
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  border: 1px solid transparent;
}

.invoice-item:hover {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.2);
  transform: translateX(4px);
}

.invoice-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-item-name {
  font-weight: 500;
  font-size: 0.875em;
}

.invoice-item-meta {
  font-size: 0.6875em;
  color: #6b7280;
}

.invoice-item-amount {
  font-weight: 600;
  font-size: 0.875em;
  text-align: right;
}

.invoice-item-days {
  font-weight: 700;
  font-size: 0.8125em;
  min-width: 32px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 6px;
}

.status-meta--danger {
  color: #991b1b;
}
.status-meta--success {
  color: #166534;
}
.status-meta--warning {
  color: #b45309;
}
.status-meta--neutral {
  color: #334155;
}

body.theme-dark .status-meta--danger { color: #f87171; }
body.theme-dark .status-meta--success { color: #4ade80; }
body.theme-dark .status-meta--warning { color: #fb923c; }
body.theme-dark .status-meta--neutral { color: #94a3b8; }

.invoice-detail-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  border: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

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

.invoice-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-dropdown {
  position: relative;
}

.export-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 180px;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  padding: 8px;
  z-index: 100;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

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

.export-dropdown.open .export-dropdown-menu {
  display: block;
}

.export-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: inherit;
  transition:
    background 0.2s,
    color 0.2s;
}

.export-dropdown-menu button:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
  opacity: 0.5;
}

/* Status indicators and badges */
.status-pill {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #e5e7eb;
  color: #374151;
  box-shadow: var(--shadow-sm);
}

.status-pill--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill--info {
  background: #e0f2fe;
  color: #0369a1;
}

.status-pill--success {
  background: #dcfce7;
  color: #15803d;
}

.status-pill--unpaid {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-pill--warning {
  background: #fecaca;
  color: #991b1b;
}

.status-pill--no-statement {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #991b1b;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.btn-outline {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-color);
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.invoice-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 13px;
}

.invoice-detail-section h3 {
  margin-top: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}

.invoice-detail-row-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.invoice-detail-row-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
}

.pdf-wrapper,
.statement-wrapper {
  margin: 10px -22px -20px;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  background: var(--card-bg);
  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.pdf-load-error {
  padding: 24px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin: 12px;
  font-weight: 500;
}

#pdfFrame,
#statementFrame,
#singlePdfFrame {
  width: 100%;
  height: 720px;
  border: none;
  background: transparent;
}

.stats {
  font-size: 13px;
  color: #4b5563;
}

.pdf-wrapper--open,
.statement-wrapper--open {
  max-height: 760px;
  opacity: 1;
  transform: translateY(0);
}

.toggle-arrow {
  display: inline-block;
  margin-right: 6px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  font-size: 11px;
}

.toggle-arrow--open {
  transform: rotate(90deg);
}

.upload-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 32px;
  min-width: 0;
  min-height: calc(100vh - 48px);
}

.upload-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 24px;
}

.main--dashboard .upload-section {
  flex: none;
  padding: 8px 24px 24px;
}

.upload-card--compact .upload-inner {
  padding: 20px;
}

.upload-card {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.upload-card-glow {
  display: none;
}

.upload-inner {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    0 0 40px rgba(59, 130, 246, 0.15),
    0 0 80px rgba(59, 130, 246, 0.08);
}

.upload-header {
  text-align: center;
  margin-bottom: 28px;
}

.upload-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  margin-bottom: 16px;
}

.upload-icon {
  width: 28px;
  height: 28px;
  color: #2563eb;
}

.upload-title {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.upload-subtitle {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.upload-dropzone {
  border-radius: 20px;
  border: 2px dashed #cbd5e1;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-dropzone:hover {
  border-color: #94a3b8;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.upload-dropzone.dragover {
  border-color: var(--primary, #2563eb);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.upload-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.upload-dropzone-icon svg {
  width: 48px;
  height: 48px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.upload-dropzone:hover .upload-dropzone-icon svg,
.upload-dropzone.dragover .upload-dropzone-icon svg {
  color: var(--primary, #2563eb);
}

.upload-dropzone-title {
  font-weight: 600;
  font-size: 16px;
  color: #334155;
  margin-bottom: 6px;
}

.upload-dropzone-text {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.upload-browse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-browse-divider {
  font-size: 13px;
  color: #94a3b8;
}

.upload-browse-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary, #2563eb);
  background: #ffffff;
  border: 1px solid var(--primary, #2563eb);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-browse-btn:hover {
  background: var(--primary, #2563eb);
  color: #ffffff;
}

.upload-list {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
}

.upload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.custom-country-search-wrap {
  padding: 8px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  z-index: 10;
}
.custom-country-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}
.custom-country-search:focus {
  border-color: var(--primary);
}

/* Bank List Drag and Drop styles */
.bank-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}
.bank-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}
.bank-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.bank-list-item:active {
  cursor: grabbing;
}
.item-dragging {
  opacity: 0.4;
  background: var(--primary-light) !important;
  transform: scale(0.98);
}
.item-drop-target-top {
  border-top: 2px solid var(--primary) !important;
}
.item-drop-target-bottom {
  border-bottom: 2px solid var(--primary) !important;
}
.bank-item-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.drag-handle {
  color: var(--text-muted);
  font-size: 1.4rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.bank-list-item:hover .drag-handle {
  opacity: 1;
  color: var(--primary);
}
.bank-name-text {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-main);
}
.bank-item-actions {
  display: flex;
  align-items: center;
  margin-left: 16px;
}
.btn-sm {
  padding: 4px 16px;
  font-size: 0.85rem;
  min-width: 90px;
  border-radius: 20px;
}

.upload-item:last-child {
  border-bottom: none;
}

.upload-item-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-item-icon {
  font-size: 18px;
}

.upload-item-status {
  font-size: 12px;
  color: #64748b;
  margin-left: 4px;
}

.upload-item-progress {
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
}

.upload-item--error {
  background: rgba(220, 38, 38, 0.08);
  border-left: 3px solid #dc2626;
}

.upload-item--error .upload-item-progress {
  color: #dc2626;
  font-weight: 600;
}

.upload-item--error .upload-item-name {
  color: #b91c1c;
}

.days-left--blue {
  color: #2563eb;
}
.days-left--green {
  color: #16a34a;
}
.days-left--yellow {
  color: #ca8a04;
}
.days-left--orange {
  color: #ea580c;
}
.days-left--red {
  color: #dc2626;
}

body.theme-dark .days-left--blue { color: #60a5fa; }
body.theme-dark .days-left--green { color: #4ade80; }
body.theme-dark .days-left--yellow { color: #facc15; }
body.theme-dark .days-left--orange { color: #fb923c; }
body.theme-dark .days-left--red { color: #f87171; }

.upload-global-progress {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.upload-section {
  margin-top: 32px;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.upload-progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 10px;
}

.upload-progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-progress-text {
  font-size: 13px;
  color: #64748b;
}

body.theme-dark .upload-inner {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.5);
  box-shadow:
    0 0 60px rgba(59, 130, 246, 0.25),
    0 0 120px rgba(59, 130, 246, 0.15);
}

body.theme-dark .upload-icon-wrap {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2) 0%,
    rgba(59, 130, 246, 0.1) 100%
  );
}

body.theme-dark .upload-icon {
  color: #60a5fa;
}

body.theme-dark .upload-title {
  color: #f1f5f9;
}

body.theme-dark .upload-subtitle {
  color: #94a3b8;
}

body.theme-dark .upload-dropzone {
  border-color: #475569;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

body.theme-dark .upload-dropzone:hover {
  border-color: #64748b;
  background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
}

body.theme-dark .upload-dropzone.dragover {
  border-color: #3b82f6;
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.2) 0%,
    rgba(59, 130, 246, 0.1) 100%
  );
}

body.theme-dark .upload-dropzone-icon svg {
  color: #64748b;
}

body.theme-dark .upload-dropzone:hover .upload-dropzone-icon svg,
body.theme-dark .upload-dropzone.dragover .upload-dropzone-icon svg {
  color: #60a5fa;
}

body.theme-dark .upload-dropzone-title {
  color: #e2e8f0;
}

body.theme-dark .upload-dropzone-text {
  color: #94a3b8;
}

body.theme-dark .upload-browse-divider {
  color: #64748b;
}

body.theme-dark .upload-browse-btn {
  color: #60a5fa;
  background: transparent;
  border-color: #3b82f6;
}

body.theme-dark .upload-browse-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

body.theme-dark .upload-list {
  border-top-color: #334155;
}

body.theme-dark .upload-item {
  border-bottom-color: #334155;
}

body.theme-dark .upload-item-status {
  color: #94a3b8;
}

body.theme-dark .upload-global-progress {
  border-top-color: #334155;
}

body.theme-dark .upload-progress-bar {
  background: #334155;
}

body.theme-dark .upload-progress-bar-fill {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

body.theme-dark .upload-progress-text {
  color: #94a3b8;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Premium scrollbar for tables */
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

.data-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.8125em; /* 13px relative to 16px baseline */
}

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

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em; /* relative to table's font size */
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.05);
}

.data-table tr {
  transition: background 0.2s ease;
}

.data-table tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #e5e7eb;
  color: #374151;
  box-shadow: var(--shadow-sm);
}

.status-badge--success {
  background: #dcfce7;
  color: #166534;
}

.status-badge--danger {
  background: #fecaca;
  color: #991b1b;
}

.status-badge--warning {
  background: #fecaca;
  color: #991b1b;
}

.status-badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge--neutral {
  background: #e2e8f0;
  color: #334155;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.22) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.18) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 15% 85%,
      rgba(147, 51, 234, 0.12) 0%,
      transparent 45%
    ),
    #f4f7fa;
  padding: 24px;
  font-family: "Inter", sans-serif;
}
body.theme-dark .auth-page {
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.05) 0%,
      transparent 50%
    ),
    #0f172a;
}

.auth-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.auth-logo {
  margin-bottom: 6px;
}

.auth-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-card-head .sidebar-logo {
  margin: 0;
}

.auth-card-head .auth-logo {
  margin-bottom: 0;
}

.auth-theme-btn {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.language-switch-theme-btn {
  padding: 4px 10px;
  font-size: 12px;
}

.auth-card h1 {
  margin: 0 0 8px 0;
  font-size: 26px;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.5px;
  text-align: center;
  color: var(--text-color);
}

.auth-subtitle {
  margin: 0 0 20px 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.auth-card #loginStep input,
.auth-card #twoFactorStep input.filter-input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.auth-card #loginStep input:focus,
.auth-card #twoFactorStep input.filter-input:focus {
  outline: none;
  border-color: #0f8cff;
  box-shadow: 0 0 0 4px rgba(15, 140, 255, 0.2);
}

.auth-card #loginStep input:last-of-type {
  margin-bottom: 20px;
}

.auth-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.auth-actions .btn-primary {
  flex: 1;
}

.auth-actions .btn-outline {
  flex-shrink: 0;
}

.profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: none;
  z-index: 30;
}

.profile-menu--open .profile-menu-dropdown {
  display: block;
}

.profile-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #1f2937;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.profile-menu-item:hover {
  background: #f1f5f9;
}

body.theme-dark {
  background: #0b1220;
  color: #d6deeb;
}

body.theme-dark .main-title span,
body.theme-dark .invoice-detail-row-label,
body.theme-dark .stats,
body.theme-dark .invoice-item-meta {
  color: #94a3b8;
}

body.theme-dark .main-title h1,
body.theme-dark .invoice-item-name,
body.theme-dark .invoice-detail-row-value {
  color: #e2e8f0;
}

body.theme-dark .invoice-list-card,
body.theme-dark .invoice-detail-card,
body.theme-dark .auth-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.theme-dark .auth-card h1 {
  color: #f1f5f9;
}

body.theme-dark .auth-subtitle {
  color: #94a3b8;
}

body.theme-dark .auth-page {
  background:
    linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)),
    radial-gradient(ellipse at top left, #1e293b 0%, #0f172a 50%, #020617 100%);
}

body.theme-dark .auth-card #loginStep input,
body.theme-dark .auth-card #twoFactorStep input.filter-input {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.6);
  color: #f1f5f9;
}

body.theme-dark .auth-card #loginStep input::placeholder,
body.theme-dark .auth-card #twoFactorStep input.filter-input::placeholder {
  color: #64748b;
}

body.theme-dark .btn-outline,
body.theme-dark .filter-input,
body.theme-dark .language-switch button {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.theme-dark .tab-row {
  background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
}

body.theme-dark .tab-btn:hover:not(.tab-btn--active) {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .tab-btn--active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.theme-dark .btn-outline:hover,
body.theme-dark .tab-btn:hover,
body.theme-dark .profile-menu-item:hover {
  background: #1e293b;
}

body.theme-dark .profile-menu-dropdown {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .profile-menu-item {
  color: #cbd5e1;
}

body.theme-dark .export-dropdown-menu {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .export-dropdown-menu button {
  color: #cbd5e1;
}

body.theme-dark .export-dropdown-menu button:hover {
  background: #1e293b;
}

body.theme-dark .data-table th {
  background: #0f172a;
  color: #cbd5e1;
}

body.theme-dark .data-table th,
body.theme-dark .data-table td {
  border-bottom-color: #1e293b;
}

body.theme-dark .data-table tr:hover td,
body.theme-dark .invoice-item:hover {
  background: #17253b;
}

body.theme-dark .status-badge {
  background: #334155;
  color: #e2e8f0;
}

body.theme-dark .status-badge--success {
  background: #064e3b;
  color: #6ee7b7;
}

/* Status pills: always use light appearance (user preference) */
body.theme-dark .status-badge--danger,
body.theme-dark .status-badge--warning {
  background: #fecaca;
  color: #991b1b;
}

body.theme-dark .status-badge--info {
  background: #1e3a8a;
  color: #93c5fd;
}

body.theme-dark .status-badge--neutral {
  background: #334155;
  color: #cbd5e1;
}

body.theme-dark .status-pill--success {
  background: #064e3b;
  color: #6ee7b7;
}

/* Status pills: always use light appearance (user preference) */
body.theme-dark .status-pill--danger,
body.theme-dark .status-pill--warning {
  background: #fecaca;
  color: #991b1b;
}

body.theme-dark .status-pill--info {
  background: #1e3a8a;
  color: #93c5fd;
}

.language-switch {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 200;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d1d5db;
  backdrop-filter: blur(4px);
}

.language-switch--inline {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  padding: 4px;
  backdrop-filter: none;
}

.profile-menu-dropdown .language-switch--profile {
  position: static;
  display: flex;
  gap: 6px;
  padding: 6px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
}

.profile-menu-dropdown .language-switch--profile button {
  flex: 1;
  padding: 6px 10px;
}

body.theme-dark .profile-menu-dropdown .language-switch--profile {
  border-bottom-color: #334155;
}

.language-switch button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.language-switch button.active {
  background: #0f8cff;
  color: #fff;
  border-color: #0f8cff;
  font-weight: 700;
}

body.theme-dark .language-switch {
  background: rgba(15, 23, 42, 0.85);
  border-color: #334155;
}

body.theme-dark .language-switch button {
  color: #94a3b8;
}

body.theme-dark .language-switch button.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0b1220;
}

button:hover,
button:focus-visible {
  box-shadow: none;
}

.user-pill:hover,
.user-pill:focus-visible {
  box-shadow: none;
}

.user-pill {
  box-shadow: none;
}

body.theme-dark .language-switch.language-switch--inline {
  background: rgba(15, 23, 42, 0.5);
}

.session-timer-badge {
  position: fixed;
  top: 64px;
  right: 14px;
  z-index: 199;
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  font-variant-numeric: tabular-nums;
  transition:
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  min-width: 0;
  flex-shrink: 1;
  text-align: center;
  white-space: nowrap;
}

.session-timer-badge--inline {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  margin-right: 25px;
}

.session-timer-badge:hover,
.session-timer-badge:focus-visible {
  box-shadow: none;
}

body.theme-dark .session-timer-badge {
  background: rgba(15, 23, 42, 0.96) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.session-timer-badge--glow-blue {
  box-shadow: none !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #0369a1 !important;
}

.session-timer-badge--glow-green {
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.7),
    0 0 18px rgba(74, 222, 128, 0.5) !important;
  border-color: rgba(74, 222, 128, 0.8) !important;
  color: #15803d !important;
}

.session-timer-badge--glow-orange {
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.7),
    0 0 18px rgba(251, 146, 60, 0.5) !important;
  border-color: rgba(251, 146, 60, 0.8) !important;
  color: #c2410c !important;
}

.session-timer-badge--glow-red {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.7),
    0 0 18px rgba(248, 113, 113, 0.5) !important;
  border-color: rgba(248, 113, 113, 0.8) !important;
  color: #b91c1c !important;
}

body.theme-dark .session-timer-badge--glow-blue {
  box-shadow: none !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #7dd3fc !important;
}

body.theme-dark .session-timer-badge--glow-green {
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.7),
    0 0 22px rgba(74, 222, 128, 0.55) !important;
  border-color: rgba(74, 222, 128, 0.85) !important;
  color: #86efac !important;
}

body.theme-dark .session-timer-badge--glow-orange {
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.7),
    0 0 22px rgba(251, 146, 60, 0.55) !important;
  border-color: rgba(251, 146, 60, 0.85) !important;
  color: #fdba74 !important;
}

body.theme-dark .session-timer-badge--glow-red {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.7),
    0 0 22px rgba(248, 113, 113, 0.55) !important;
  border-color: rgba(248, 113, 113, 0.85) !important;
  color: #fca5a5 !important;
}

/* Status pills: keep light appearance (see above) */
body.theme-dark .status-pill--warning,
body.theme-dark .status-badge--warning {
  background: #fecaca;
  color: #991b1b;
}

.fx-header-display {
  background: #ffffff;
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
  min-width: 0;
  flex-shrink: 1;
  text-align: center;
  white-space: nowrap;
}

.theme-dark .fx-header-display {
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.15);
}

.fx-header-display--neutral {
  box-shadow: none;
  border-color: rgba(56, 189, 248, 0.5);
}

.fx-header-display--up {
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.7),
    0 0 18px rgba(74, 222, 128, 0.5);
  border-color: rgba(74, 222, 128, 0.8);
}

.fx-header-display--down {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.7),
    0 0 18px rgba(248, 113, 113, 0.5);
  border-color: rgba(248, 113, 113, 0.8);
}

.theme-dark .fx-header-display--neutral {
  box-shadow: none;
  border-color: rgba(56, 189, 248, 0.5);
}

.theme-dark .fx-header-display--up {
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.7),
    0 0 22px rgba(74, 222, 128, 0.55);
  border-color: rgba(74, 222, 128, 0.85);
}

.theme-dark .fx-header-display--down {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.7),
    0 0 22px rgba(248, 113, 113, 0.55);
  border-color: rgba(248, 113, 113, 0.85);
}

.fx-header-display--neutral {
  color: #0369a1;
}

.fx-header-display--up {
  color: #15803d;
}

.fx-header-display--down {
  color: #b91c1c;
}

.theme-dark .fx-header-display--neutral {
  color: #7dd3fc;
}

.theme-dark .fx-header-display--up {
  color: #86efac;
}

.theme-dark .fx-header-display--down {
  color: #fca5a5;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 20px;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-content {
  flex: 1;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
}

/* Specific colors for stat cards */
.stat-card--total .stat-card-icon { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-card--review .stat-card-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-card--done .stat-card-icon { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.stat-card--overdue .stat-card-icon { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* Dashboard Recent Section */
.dashboard-recent {
  margin-top: -1px;
  width: 1000px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  background: var(--dashboard-panel-bg, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-top-color: var(--dashboard-panel-border-top, #cbd5e1);
  border-radius: 25px 25px 16px 16px;
  box-shadow: 0 15px 25px -5px var(--dashboard-panel-shadow, rgba(0, 0, 0, 0.08));
  position: relative;
  z-index: 5;
}

.dashboard-recent--visible {
  height: 500px;
  opacity: 1;
  overflow-y: auto;
}

.dashboard-recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 12px;
  position: sticky;
  top: 0;
  background: var(--dashboard-panel-bg, #f8fafc);
  z-index: 6;
  border-bottom: 2px solid var(--dashboard-panel-divider, #f1f5f9);
}

.recent-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  cursor: pointer;
}

.stat-card.is-active {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  background: var(--dashboard-panel-bg, #f8fafc);
  transform: translateY(-2px);
  z-index: 11;
  box-shadow: 0 -8px 20px -6px var(--dashboard-panel-shadow, rgba(0,0,0,0.05));
}

/* The 'connector' bridge */
.stat-card.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: -1px;
  right: -1px;
  height: 4px;
  background: var(--dashboard-panel-bg, #f8fafc);
  z-index: 12;
}

.btn-close-recent {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-close-recent:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-color);
}

body.theme-dark .btn-close-recent:hover {
  background: rgba(255,255,255,0.1);
}

.dashboard-recent-header h2 {
  font-size: 18px;
  margin: 0;
}

/* 2-Column Form Grid for Modals */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-section-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 12px 0 4px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.fx-rate-item--up .fx-rate-value {
  color: #15803d;
}
.fx-rate-item--down .fx-rate-value {
  color: #b91c1c;
}
body.theme-dark .fx-rate-item--up .fx-rate-value {
  color: #86efac;
}
body.theme-dark .fx-rate-item--down .fx-rate-value {
  color: #fca5a5;
}

.fx-rates-loading,
.fx-rates-error {
  color: var(--text-muted, #64748b);
  margin: 0;
  padding: 16px 0;
}

.reauth-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reauth-overlay--open {
  display: flex;
}

.reauth-modal {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reauth-modal h3 {
  margin: 0;
  font-size: 18px;
}

/* Empty State Styles */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: rgba(248, 250, 252, 0.5);
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: 16px;
  margin: 24px 0;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color, #1e293b);
  margin: 0 0 8px 0;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted, #64748b);
  max-width: 400px;
  margin: 0;
}

body.theme-dark .empty-state {
  background: rgba(15, 23, 42, 0.5);
  border-color: #334155;
}

body.theme-dark .empty-state-icon {
  color: #475569;
}

.reauth-modal p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

#reauthCountdownText,
#activityCheckCountdownText {
  font-weight: 600;
  color: #b45309;
}

.reauth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

body.theme-dark .reauth-modal {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .reauth-modal h3 {
  color: #e2e8f0;
}

body.theme-dark .reauth-modal p {
  color: #94a3b8;
}

body.theme-dark .auth-page {
  background:
    linear-gradient(rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.62)),
    url("../img/background.jpg"),
    radial-gradient(circle at top left, #0b1220 0%, #111827 45%, #0f172a 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.theme-dark #reauthCountdownText,
body.theme-dark #activityCheckCountdownText {
  color: #f59e0b;
}

.customers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  gap: 8px;
  padding: 24px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

.stat-card-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.pie-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 16px;
}

.status-pie {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: none;
  position: relative;
  overflow: visible;
  perspective: 800px;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.05));
}

.status-pie-svg {
  width: 100%;
  height: 100%;
}

.pie-segment {
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
  transform-box: fill-box;
  transform-origin: center;
  transform-style: preserve-3d;
}

.pie-segment--open {
  fill: var(--pie-open);
}

.pie-segment--paid {
  fill: var(--pie-paid);
}

.pie-segment--unpaid {
  fill: var(--pie-unpaid);
}

.pie-segment--active {
  transform: translateZ(-18px) scale(0.965);
  filter: brightness(0.82) saturate(0.9);
  opacity: 0.96;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.pie-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.pie-legend-item--active {
  font-weight: 700;
}

.pie-tooltip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -100%);
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 5;
}

.pie-tooltip--show {
  opacity: 1;
}

.dot-open {
  background: var(--pie-open);
}

.dot-paid {
  background: var(--pie-paid);
}

.dot-unpaid {
  background: var(--pie-unpaid);
}

body.theme-dark .stat-card-label,
body.theme-dark .stat-card-meta {
  color: #94a3b8;
}

body.theme-dark .status-pie {
  border-color: #334155;
}

body.theme-dark .pie-tooltip {
  background: rgba(2, 6, 23, 0.95);
  border-color: #334155;
  color: #e2e8f0;
}

@media (max-width: 1160px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .invoice-list {
    max-height: 42vh;
  }

  .invoice-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .customers-grid {
    grid-template-columns: 1fr;
  }

  .pie-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-pie {
    width: 170px;
    height: 170px;
  }
}

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

  .sidebar {
    padding: 10px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .sidebar-logo {
    width: 36px;
    height: 36px;
  }

  .sidebar-nav {
    margin-top: 0;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .sidebar-icon .sidebar-tooltip {
    display: none !important;
  }

  .main,
  .upload-main {
    padding: 16px;
  }

  .upload-inner {
    padding: 24px 20px;
  }

  .upload-dropzone {
    padding: 28px 16px;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }

  .main-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
  }

  .main-title h1 {
    font-size: 22px;
  }

  .invoice-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }

  .invoice-detail-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .invoice-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }

  .invoice-list-header > div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  .invoice-list-header > div > * {
    flex: 1 1 auto;
  }

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

  .upload-card {
    margin-left: 0;
    margin-right: 0;
    padding: 16px;
  }

  .upload-inner {
    padding: 18px;
  }

  .data-table {
    table-layout: fixed;
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    white-space: normal;
    word-break: break-word;
    padding: 8px;
  }

  .language-switch {
    top: 8px;
    right: 8px;
  }

  .session-timer-badge {
    top: 54px;
    right: 8px;
  }
}

@media (max-width: 520px) {
  .main,
  .upload-main {
    padding: 12px;
    gap: 16px;
  }

  .settings-content {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 18px 20px;
    border-radius: 14px;
  }

  .settings-card .form-row input.filter-input,
  .two-factor-setup .filter-input,
  .two-factor-disable .filter-input {
    max-width: 100%;
  }

  .invoice-list-card,
  .invoice-detail-card {
    padding: 14px;
    border-radius: 14px;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    text-align: center;
  }

  .actions-cell .btn-outline {
    width: auto;
  }

  .profile-menu-dropdown {
    right: auto;
    left: 0;
    min-width: 160px;
  }

  .upload-dropzone {
    padding: 22px 14px;
  }

  .status-pie {
    width: 150px;
    height: 150px;
  }

  #pdfFrame,
  #singlePdfFrame {
    height: 60vh;
    min-height: 320px;
  }
}

/* Companies grid */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.companies-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.dashboard-stats-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
  padding: 0 24px 4px;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px; /* Reduced gap to feel tighter */
  max-width: 1250px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 11;
}

@media (max-width: 900px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 600px;
  }
}

@media (max-width: 600px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 400px;
  }
}

@media (max-width: 900px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 480px;
  }
}

@media (max-width: 600px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 400px;
  }
}

.stat-card--dashboard {
  padding: 24px 20px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.stat-card--dashboard .stat-card-label {
  font-size: 0.8125em;
  margin-bottom: 4px;
}

.stat-card--dashboard .stat-card-value {
  font-size: 1.85em;
}

.stat-card--dashboard .stat-card-meta {
  font-size: 0.875em;
  margin-top: 6px;
}

.company-card {
  padding: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.company-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.company-card--selected {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.company-card-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
}

.company-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.company-card-stats {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
}

.company-card-stats span {
  color: var(--text-muted, #64748b);
}

.companies-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted, #64748b);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
}

/* Company modal – wider layout */
.company-modal {
  max-width: 720px;
  width: 95%;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.theme-dark .company-modal {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  border-color: var(--border-color, #334155);
}

.company-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: rgba(248, 250, 252, 0.8);
}

body.theme-dark .company-modal-header {
  background: rgba(15, 23, 42, 0.5);
  border-color: var(--border-color, #334155);
}

.company-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.company-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
}

.company-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f2933;
}

body.theme-dark .company-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.company-modal-form {
  padding: 28px 32px;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}

.company-modal-section {
  margin-bottom: 28px;
}

.company-modal-section:last-of-type {
  margin-bottom: 0;
}

.company-modal-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin: 0 0 12px;
}

.company-modal-row {
  margin-bottom: 12px;
}

.company-modal-form .form-row-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.company-modal-form .form-row-flex-2 {
  grid-column: span 2;
  min-width: 0;
}

@media (max-width: 640px) {
  .company-modal-form .form-row-flex-2 {
    grid-column: span 1;
  }
}

.company-modal-field-narrow {
  min-width: 0;
}

.company-modal-input {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9375rem;
}

.company-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  flex-wrap: wrap;
}

body.theme-dark .company-modal-actions {
  border-color: var(--border-color, #334155);
}

.company-modal-actions-left {
  margin-right: auto;
}

.company-modal-actions-right {
  display: flex;
  gap: 12px;
}

.btn-outline--danger {
  color: #dc2626;
  border-color: #dc2626;
}

.btn-outline--danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

/* Advanced toggle (invoice edit) */
.advanced-toggle-wrap {
  margin-top: 12px;
}

.advanced-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--primary, #2563eb);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.advanced-toggle-btn:hover {
  text-decoration: underline;
}

.advanced-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s;
}

.advanced-toggle-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.advanced-toggle-content--collapsed {
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
}

.advanced-toggle-content:not(.advanced-toggle-content--collapsed) {
  max-height: 800px;
}

body.theme-dark .advanced-toggle-btn {
  color: var(--primary, #3b82f6);
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.form-row-inline {
  display: flex;
  gap: 12px;
}

.form-row-inline > div {
  flex: 1;
}

.form-row-flex-2 {
  flex: 2;
  min-width: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

.company-detail-meta {
  margin-bottom: 12px;
}

.company-detail-meta-text {
  margin: 0;
  font-size: 0.9rem;
}

/* Settings & 2FA */
.settings-content {
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.settings-card {
  background: var(--card-bg, #fff);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.theme-dark .settings-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--border-color, #334155);
}

.settings-card h2 {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 600;
}

.settings-desc {
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.settings-card .form-row {
  margin-bottom: 16px;
}

.settings-card .form-row:last-of-type {
  margin-bottom: 0;
}

.settings-card .form-row label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

body.theme-dark .settings-card .form-row label {
  color: #cbd5e1;
}

.settings-card .form-row input.filter-input {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  border-radius: 10px;
  box-sizing: border-box;
}

.settings-card .settings-actions {
  margin-top: 20px;
  padding-top: 4px;
}

.two-factor-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.two-factor-setup .filter-input,
.two-factor-disable .filter-input {
  max-width: 280px;
  margin-top: 8px;
  display: block;
}

.two-factor-disable {
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  margin-top: 16px;
}

body.theme-dark .two-factor-disable {
  border-top-color: #334155;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.status-badge--success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success, #16a34a);
}

.status-badge--muted {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted, #666);
}

body.theme-dark .status-badge--muted {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.two-factor-setup h3,
.two-factor-disable p:first-of-type {
  margin-top: 0;
}

.qr-container {
  margin: 16px 0;
  padding: 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  display: inline-block;
}

body.theme-dark .qr-container {
  background: #0f172a;
  border-color: #334155;
}

.qr-container img {
  display: block;
  width: 200px;
  height: 200px;
}

.totp-secret {
  display: block;
  padding: 10px 14px;
  background: var(--input-bg, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  margin: 8px 0 16px;
  word-break: break-all;
}

body.theme-dark .totp-secret {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.settings-hint {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  margin: 12px 0 6px;
}

body.theme-dark .settings-hint,
body.theme-dark .settings-desc {
  color: #94a3b8;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.875rem;
}

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

.btn-outline--danger {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}

.btn-outline--danger:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--danger, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

body.theme-dark .btn-outline--danger:hover {
  background: rgba(220, 38, 38, 0.2);
}

.two-factor-step .auth-subtitle--2fa {
  margin-bottom: 16px;
}

/* Force password change (first-time setup) */
.force-password-change-step {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}

.force-pw-badge {
  display: inline-flex;
  align-self: center;
  padding: 6px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 500;
  color: #0f8cff;
  background: rgba(15, 140, 255, 0.1);
  border-radius: 20px;
  letter-spacing: 0.02em;
}

body.theme-dark .force-pw-badge {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}

.force-pw-hint {
  margin: 0 0 20px 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

body.theme-dark .force-pw-hint {
  color: #94a3b8;
}

.force-pw-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.force-pw-fields .filter-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.force-pw-fields .filter-input:focus {
  outline: none;
  border-color: #0f8cff;
}

body.theme-dark .force-pw-fields .filter-input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.theme-dark .force-pw-fields .filter-input::placeholder {
  color: #64748b;
}

.force-pw-submit {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
}

.two-factor-step .filter-input {
  margin-bottom: 12px;
}

.two-factor-step .remember-device-label {
  margin-bottom: 16px;
}

.remember-device-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.remember-device-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0f8cff;
}

body.theme-dark .remember-device-label {
  color: #94a3b8;
}

.backup-codes-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.backup-codes-content {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
}

.backup-codes-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.backup-code {
  padding: 8px;
  background: var(--input-bg, #f1f5f9);
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  text-align: center;
}

body.theme-dark .backup-code {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
}

body.theme-dark .backup-codes-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

/* Audit Log page */
.logs-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logs-filters .filter-input {
  min-width: 180px;
}

.logs-table-wrapper {
  max-height: 70vh;
  overflow-y: auto;
}

.logs-timestamp {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.logs-action-badge {
  display: inline-block;
  padding: 4px 8px;
  background: var(--primary-light, #e0e7ff);
  color: var(--primary, #4f46e5);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

body.theme-dark .logs-action-badge {
  background: rgba(79, 70, 229, 0.25);
  color: #a5b4fc;
}

.logs-details {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  max-width: 400px;
}

.logs-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted, #64748b);
}

/* Reauth / lock screen - change password */
.reauth-change-pw-link {
  margin-top: 12px;
  margin-bottom: 0;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: #0f8cff;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  padding: 0;
}

.btn-link:hover,
.btn-link:focus,
.btn-link:focus-visible,
.btn-link:active {
  color: #0369a1;
  text-decoration: none;
  outline: none;
  box-shadow: none;
  border: none;
}

.reauth-hint {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 12px;
}

.reauth-modal .filter-input {
  margin-bottom: 10px;
  width: 100%;
}

.reauth-modal .reauth-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.auth-links {
  margin-top: 14px;
  margin-bottom: 0;
  text-align: center;
}

.auth-link-sep {
  margin: 0 6px;
  color: var(--text-muted, #64748b);
}

.forgot-pw-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-option-btn {
  width: 100%;
}

.auth-success-msg {
  margin-top: 12px;
  color: var(--success, #22c55e);
  font-size: 0.9rem;
}

.auth-error-msg {
  margin-top: 12px;
  color: var(--danger, #ef4444);
  font-size: 0.9rem;
}

.change-password-step .filter-input {
  margin-bottom: 10px;
  width: 100%;
}

.change-password-step .auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.permissions-grid,
.permissions-grid-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
}

.permissions-grid-inline {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.role-permissions-block .permissions-grid-inline {
  grid-template-columns: 1fr;
}

.permission-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-check-item input[type="checkbox"],
.permission-check-item input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.permission-check-item label {
  cursor: pointer;
  font-size: 0.9rem;
  margin: 0;
}

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

.permission-label {
  min-width: 140px;
  font-weight: 500;
}

.permission-options {
  display: flex;
  gap: 16px;
}

.permission-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: normal;
}

.permission-option input {
  margin: 0;
}

.permission-check-item--disabled,
.role-permissions-block--readonly .permission-check-item {
  opacity: 0.6;
  pointer-events: none;
}

.permission-check-item--disabled input,
.permission-check-item--disabled label,
.role-permissions-block--readonly input,
.role-permissions-block--readonly label {
  cursor: not-allowed;
}

.role-permissions-block--readonly {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border-color);
}

.role-permissions-block--draggable {
  cursor: grab;
}

.role-permissions-block--draggable:active {
  cursor: grabbing;
}

.role-permissions-block--dragging {
  opacity: 0.5;
}

.role-permissions-block--drop-target {
  outline: 2px dashed var(--primary, #0f8cff);
  outline-offset: 4px;
}

.role-drag-handle {
  opacity: 0.5;
  margin-right: 6px;
  cursor: grab;
  user-select: none;
}

body.theme-dark .role-permissions-block--readonly {
  background: rgba(255, 255, 255, 0.04);
}

.role-permissions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.role-permissions-block {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

body.theme-dark .role-permissions-block {
  background: rgba(255, 255, 255, 0.03);
}

.role-permissions-block h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 12px 0;
}

.form-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Admin tab bar - modern segmented control */
.admin-tab-bar {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}

body.theme-dark .admin-tab-bar {
  background: rgba(255, 255, 255, 0.04);
}

.admin-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.admin-tab:hover:not(.admin-tab--active) {
  background: rgba(255, 255, 255, 0.6);
  color: #334155;
}

body.theme-dark .admin-tab {
  color: #94a3b8;
}

body.theme-dark .admin-tab:hover:not(.admin-tab--active) {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.admin-tab--active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-tab--active:hover {
  background: var(--primary);
  color: #ffffff;
}

body.theme-dark .admin-tab--active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.theme-dark .admin-tab--active:hover {
  background: var(--primary);
  color: #ffffff;
}

.admin-panels {
  min-height: 200px;
}

.admin-panel {
  display: block;
}

.admin-panel[hidden] {
  display: none !important;
}

/* Theme color options - Settings */
.theme-color-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.theme-color-option {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  width: 100%;
  min-width: 0;
}

.theme-color-option:hover {
  border-color: var(--primary, #0f8cff);
  background: rgba(15, 140, 255, 0.04);
}

.theme-color-option.theme-color-option--selected {
  border-color: var(--primary, #0f8cff);
  background: rgba(15, 140, 255, 0.08);
}

.theme-color-squares {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.theme-color-square {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

body.theme-dark .theme-color-square {
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-color-option-label {
  font-size: 1rem;
  font-weight: 500;
}

/* Theme palettes - override CSS variables (only on app pages, not login) */
body.theme-palette-2 {
  --primary: rgb(125, 57, 235);
}

body.theme-palette-2 .sidebar {
  background: rgb(24, 24, 24);
}

body.theme-palette-2 .sidebar-icon--active,
body.theme-palette-2 .sidebar-icon:hover {
  background: rgb(125, 57, 235);
  color: #fff;
}

body.theme-palette-2.theme-dark {
  background: rgb(24, 24, 24);
  color: rgb(255, 255, 255);
  --card-bg: rgb(24, 24, 24);
  --border-color: rgba(255, 255, 255, 0.2);
  --text-muted: rgb(198, 255, 51);
}

body.theme-palette-2.theme-dark .invoice-list-card,
body.theme-palette-2.theme-dark .invoice-detail-card,
body.theme-palette-2.theme-dark .settings-card,
body.theme-palette-2.theme-dark .company-card,
body.theme-palette-2.theme-dark .upload-inner {
  background: rgb(24, 24, 24);
  border-color: rgba(255, 255, 255, 0.2);
}

body.theme-palette-2.theme-dark .filter-input,
body.theme-palette-2.theme-dark .data-table th {
  background: rgb(24, 24, 24);
}

body.theme-palette-2:not(.theme-dark) {
  --primary: rgb(125, 57, 235);
}

body.theme-palette-2:not(.theme-dark) .invoice-list-card,
body.theme-palette-2:not(.theme-dark) .invoice-detail-card,
body.theme-palette-2:not(.theme-dark) .settings-card,
body.theme-palette-2:not(.theme-dark) .company-card,
body.theme-palette-2:not(.theme-dark) .upload-inner {
  border-color: rgba(125, 57, 235, 0.2);
}

body.theme-palette-3 {
  --primary: rgb(173, 125, 86);
}

body.theme-palette-3 .sidebar {
  background: rgb(17, 17, 17);
}

body.theme-palette-3 .sidebar-icon--active,
body.theme-palette-3 .sidebar-icon:hover {
  background: rgb(173, 125, 86);
  color: #fff;
}

body.theme-palette-3.theme-dark {
  background: rgb(17, 17, 17);
  color: rgb(245, 241, 236);
  --card-bg: rgb(17, 17, 17);
  --border-color: rgb(205, 180, 158);
  --text-muted: rgb(205, 180, 158);
}

body.theme-palette-3.theme-dark .invoice-list-card,
body.theme-palette-3.theme-dark .invoice-detail-card,
body.theme-palette-3.theme-dark .settings-card,
body.theme-palette-3.theme-dark .company-card,
body.theme-palette-3.theme-dark .upload-inner {
  background: rgb(17, 17, 17);
  border-color: rgb(205, 180, 158);
}

body.theme-palette-3.theme-dark .filter-input,
body.theme-palette-3.theme-dark .data-table th {
  background: rgb(17, 17, 17);
}

body.theme-palette-3:not(.theme-dark) {
  --primary: rgb(173, 125, 86);
  background: rgb(245, 241, 236);
}

body.theme-palette-3:not(.theme-dark) .invoice-list-card,
body.theme-palette-3:not(.theme-dark) .invoice-detail-card,
body.theme-palette-3:not(.theme-dark) .settings-card,
body.theme-palette-3:not(.theme-dark) .company-card,
body.theme-palette-3:not(.theme-dark) .upload-inner {
  background: rgb(205, 180, 158);
  border-color: rgb(173, 125, 86);
}

body.theme-palette-4 {
  --primary: rgb(109, 0, 26);
}

body.theme-palette-4 .sidebar {
  background: rgb(26, 26, 26);
}

body.theme-palette-4 .sidebar-icon--active,
body.theme-palette-4 .sidebar-icon:hover {
  background: rgb(109, 0, 26);
  color: #fff;
}

body.theme-palette-4.theme-dark {
  background: rgb(26, 26, 26);
  color: rgb(245, 241, 236);
  --card-bg: rgb(26, 26, 26);
  --border-color: rgb(181, 172, 138);
  --text-muted: rgb(181, 172, 138);
}

body.theme-palette-4.theme-dark .invoice-list-card,
body.theme-palette-4.theme-dark .invoice-detail-card,
body.theme-palette-4.theme-dark .settings-card,
body.theme-palette-4.theme-dark .company-card,
body.theme-palette-4.theme-dark .upload-inner {
  background: rgb(26, 26, 26);
  border-color: rgb(181, 172, 138);
}

body.theme-palette-4.theme-dark .filter-input,
body.theme-palette-4.theme-dark .data-table th {
  background: rgb(26, 26, 26);
}

body.theme-palette-4:not(.theme-dark) {
  --primary: rgb(109, 0, 26);
  background: rgb(245, 241, 236);
}

body.theme-palette-4:not(.theme-dark) .invoice-list-card,
body.theme-palette-4:not(.theme-dark) .invoice-detail-card,
body.theme-palette-4:not(.theme-dark) .settings-card,
body.theme-palette-4:not(.theme-dark) .company-card,
body.theme-palette-4:not(.theme-dark) .upload-inner {
  background: rgb(181, 172, 138);
  border-color: rgb(109, 0, 26);
}

body.theme-palette-5 {
  --primary: rgb(230, 30, 50);
}

body.theme-palette-5 .sidebar {
  background: rgb(24, 24, 24);
}

body.theme-palette-5 .sidebar-icon--active,
body.theme-palette-5 .sidebar-icon:hover {
  background: rgb(230, 30, 50);
  color: #fff;
}

body.theme-palette-5.theme-dark {
  background: rgb(24, 24, 24);
  color: rgb(255, 255, 255);
  --card-bg: rgb(24, 24, 24);
  --border-color: rgb(179, 179, 179);
  --text-muted: rgb(179, 179, 179);
}

body.theme-palette-5.theme-dark .invoice-list-card,
body.theme-palette-5.theme-dark .invoice-detail-card,
body.theme-palette-5.theme-dark .settings-card,
body.theme-palette-5.theme-dark .company-card,
body.theme-palette-5.theme-dark .upload-inner {
  background: rgb(24, 24, 24);
  border-color: rgb(179, 179, 179);
}

body.theme-palette-5.theme-dark .filter-input,
body.theme-palette-5.theme-dark .data-table th {
  background: rgb(24, 24, 24);
}

body.theme-palette-5:not(.theme-dark) {
  --primary: rgb(230, 30, 50);
}

body.theme-palette-5:not(.theme-dark) .invoice-list-card,
body.theme-palette-5:not(.theme-dark) .invoice-detail-card,
body.theme-palette-5:not(.theme-dark) .settings-card,
body.theme-palette-5:not(.theme-dark) .company-card,
body.theme-palette-5:not(.theme-dark) .upload-inner {
  border-color: rgba(230, 30, 50, 0.25);
}

/* Apply palette primary to buttons and accents */
body.theme-palette-2 .btn-primary,
body.theme-palette-3 .btn-primary,
body.theme-palette-4 .btn-primary,
body.theme-palette-5 .btn-primary {
  background: var(--primary);
}

body.theme-palette-2 .btn-outline,
body.theme-palette-3 .btn-outline,
body.theme-palette-4 .btn-outline,
body.theme-palette-5 .btn-outline {
  border-color: var(--primary);
  color: var(--primary);
}

body.theme-palette-2 .user-pill,
body.theme-palette-3 .user-pill,
body.theme-palette-4 .user-pill,
body.theme-palette-5 .user-pill {
  background: var(--primary);
}

/* Utility classes (CSP: no inline styles) */
.util-hidden {
  display: none !important;
}
.util-block {
  display: block !important;
}
.util-flex {
  display: flex !important;
}
.util-inline-flex {
  display: inline-flex !important;
}
.util-flex-gap-8 {
  display: flex;
  gap: 8px;
}
.util-flex-wrap {
  flex-wrap: wrap;
}
.util-align-center {
  align-items: center;
}
.util-align-end {
  align-items: flex-end;
}
.util-mt-0 {
  margin-top: 0;
}
.util-m-0 {
  margin: 0;
}
.util-mt-4 {
  margin-top: 4px;
}
.util-mt-8 {
  margin-top: 8px;
}
.util-mt-10 {
  margin-top: 10px;
}
.util-mt-12 {
  margin-top: 12px;
}
.util-mt-14 {
  margin-top: 14px;
}
.util-mt-16 {
  margin-top: 16px;
}
.util-mb-0 {
  margin-bottom: 0;
}
.util-mr-8 {
  margin-right: 8px;
}
.util-max-w-140 {
  max-width: 140px;
}
.util-text-center-muted {
  text-align: center;
  color: #6b7280;
  padding: 18px;
}
.util-pdf-open {
  max-height: none;
  opacity: 1;
  transform: none;
}
.util-pointer {
  cursor: pointer;
  pointer-events: auto;
}

/* Theme palette color squares (no inline style) */
.palette-default .theme-color-square:nth-child(1) {
  background: #f3f6fb;
}
.palette-default .theme-color-square:nth-child(2) {
  background: #2563eb;
}
.palette-default .theme-color-square:nth-child(3) {
  background: #ffffff;
}
.palette-default .theme-color-square:nth-child(4) {
  background: #64748b;
}
.palette-2 .theme-color-square:nth-child(1) {
  background: rgb(0, 0, 0);
}
.palette-2 .theme-color-square:nth-child(2) {
  background: rgb(125, 57, 235);
}
.palette-2 .theme-color-square:nth-child(3) {
  background: rgb(255, 255, 255);
}
.palette-2 .theme-color-square:nth-child(4) {
  background: rgb(198, 255, 51);
}
.palette-3 .theme-color-square:nth-child(1) {
  background: rgb(17, 17, 17);
}
.palette-3 .theme-color-square:nth-child(2) {
  background: rgb(173, 125, 86);
}
.palette-3 .theme-color-square:nth-child(3) {
  background: rgb(205, 180, 158);
}
.palette-3 .theme-color-square:nth-child(4) {
  background: rgb(245, 241, 236);
}
.palette-4 .theme-color-square:nth-child(1) {
  background: rgb(26, 26, 26);
}
.palette-4 .theme-color-square:nth-child(2) {
  background: rgb(109, 0, 26);
}
.palette-4 .theme-color-square:nth-child(3) {
  background: rgb(181, 172, 138);
}
.palette-4 .theme-color-square:nth-child(4) {
  background: rgb(245, 241, 236);
}
.palette-5 .theme-color-square:nth-child(1) {
  background: rgb(0, 0, 0);
}
.palette-5 .theme-color-square:nth-child(2) {
  background: rgb(230, 30, 50);
}
.palette-5 .theme-color-square:nth-child(3) {
  background: rgb(255, 255, 255);
}
.palette-5 .theme-color-square:nth-child(4) {
  background: rgb(179, 179, 179);
}

/* Progress bar width via data-percent (0-100) - CSP: no inline style */
.upload-progress-bar-fill[data-percent="0"] {
  width: 0%;
}
.upload-progress-bar-fill[data-percent="1"] {
  width: 1%;
}
.upload-progress-bar-fill[data-percent="2"] {
  width: 2%;
}
.upload-progress-bar-fill[data-percent="3"] {
  width: 3%;
}
.upload-progress-bar-fill[data-percent="4"] {
  width: 4%;
}
.upload-progress-bar-fill[data-percent="5"] {
  width: 5%;
}
.upload-progress-bar-fill[data-percent="6"] {
  width: 6%;
}
.upload-progress-bar-fill[data-percent="7"] {
  width: 7%;
}
.upload-progress-bar-fill[data-percent="8"] {
  width: 8%;
}
.upload-progress-bar-fill[data-percent="9"] {
  width: 9%;
}
.upload-progress-bar-fill[data-percent="10"] {
  width: 10%;
}
.upload-progress-bar-fill[data-percent="11"] {
  width: 11%;
}
.upload-progress-bar-fill[data-percent="12"] {
  width: 12%;
}
.upload-progress-bar-fill[data-percent="13"] {
  width: 13%;
}
.upload-progress-bar-fill[data-percent="14"] {
  width: 14%;
}
.upload-progress-bar-fill[data-percent="15"] {
  width: 15%;
}
.upload-progress-bar-fill[data-percent="16"] {
  width: 16%;
}
.upload-progress-bar-fill[data-percent="17"] {
  width: 17%;
}
.upload-progress-bar-fill[data-percent="18"] {
  width: 18%;
}
.upload-progress-bar-fill[data-percent="19"] {
  width: 19%;
}
.upload-progress-bar-fill[data-percent="20"] {
  width: 20%;
}
.upload-progress-bar-fill[data-percent="21"] {
  width: 21%;
}
.upload-progress-bar-fill[data-percent="22"] {
  width: 22%;
}
.upload-progress-bar-fill[data-percent="23"] {
  width: 23%;
}
.upload-progress-bar-fill[data-percent="24"] {
  width: 24%;
}
.upload-progress-bar-fill[data-percent="25"] {
  width: 25%;
}
.upload-progress-bar-fill[data-percent="26"] {
  width: 26%;
}
.upload-progress-bar-fill[data-percent="27"] {
  width: 27%;
}
.upload-progress-bar-fill[data-percent="28"] {
  width: 28%;
}
.upload-progress-bar-fill[data-percent="29"] {
  width: 29%;
}
.upload-progress-bar-fill[data-percent="30"] {
  width: 30%;
}
.upload-progress-bar-fill[data-percent="31"] {
  width: 31%;
}
.upload-progress-bar-fill[data-percent="32"] {
  width: 32%;
}
.upload-progress-bar-fill[data-percent="33"] {
  width: 33%;
}
.upload-progress-bar-fill[data-percent="34"] {
  width: 34%;
}
.upload-progress-bar-fill[data-percent="35"] {
  width: 35%;
}
.upload-progress-bar-fill[data-percent="36"] {
  width: 36%;
}
.upload-progress-bar-fill[data-percent="37"] {
  width: 37%;
}
.upload-progress-bar-fill[data-percent="38"] {
  width: 38%;
}
.upload-progress-bar-fill[data-percent="39"] {
  width: 39%;
}
.upload-progress-bar-fill[data-percent="40"] {
  width: 40%;
}
.upload-progress-bar-fill[data-percent="41"] {
  width: 41%;
}
.upload-progress-bar-fill[data-percent="42"] {
  width: 42%;
}
.upload-progress-bar-fill[data-percent="43"] {
  width: 43%;
}
.upload-progress-bar-fill[data-percent="44"] {
  width: 44%;
}
.upload-progress-bar-fill[data-percent="45"] {
  width: 45%;
}
.upload-progress-bar-fill[data-percent="46"] {
  width: 46%;
}
.upload-progress-bar-fill[data-percent="47"] {
  width: 47%;
}
.upload-progress-bar-fill[data-percent="48"] {
  width: 48%;
}
.upload-progress-bar-fill[data-percent="49"] {
  width: 49%;
}
.upload-progress-bar-fill[data-percent="50"] {
  width: 50%;
}
.upload-progress-bar-fill[data-percent="51"] {
  width: 51%;
}
.upload-progress-bar-fill[data-percent="52"] {
  width: 52%;
}
.upload-progress-bar-fill[data-percent="53"] {
  width: 53%;
}
.upload-progress-bar-fill[data-percent="54"] {
  width: 54%;
}
.upload-progress-bar-fill[data-percent="55"] {
  width: 55%;
}
.upload-progress-bar-fill[data-percent="56"] {
  width: 56%;
}
.upload-progress-bar-fill[data-percent="57"] {
  width: 57%;
}
.upload-progress-bar-fill[data-percent="58"] {
  width: 58%;
}
.upload-progress-bar-fill[data-percent="59"] {
  width: 59%;
}
.upload-progress-bar-fill[data-percent="60"] {
  width: 60%;
}
.upload-progress-bar-fill[data-percent="61"] {
  width: 61%;
}
.upload-progress-bar-fill[data-percent="62"] {
  width: 62%;
}
.upload-progress-bar-fill[data-percent="63"] {
  width: 63%;
}
.upload-progress-bar-fill[data-percent="64"] {
  width: 64%;
}
.upload-progress-bar-fill[data-percent="65"] {
  width: 65%;
}
.upload-progress-bar-fill[data-percent="66"] {
  width: 66%;
}
.upload-progress-bar-fill[data-percent="67"] {
  width: 67%;
}
.upload-progress-bar-fill[data-percent="68"] {
  width: 68%;
}
.upload-progress-bar-fill[data-percent="69"] {
  width: 69%;
}
.upload-progress-bar-fill[data-percent="70"] {
  width: 70%;
}
.upload-progress-bar-fill[data-percent="71"] {
  width: 71%;
}
.upload-progress-bar-fill[data-percent="72"] {
  width: 72%;
}
.upload-progress-bar-fill[data-percent="73"] {
  width: 73%;
}
.upload-progress-bar-fill[data-percent="74"] {
  width: 74%;
}
.upload-progress-bar-fill[data-percent="75"] {
  width: 75%;
}
.upload-progress-bar-fill[data-percent="76"] {
  width: 76%;
}
.upload-progress-bar-fill[data-percent="77"] {
  width: 77%;
}
.upload-progress-bar-fill[data-percent="78"] {
  width: 78%;
}
.upload-progress-bar-fill[data-percent="79"] {
  width: 79%;
}
.upload-progress-bar-fill[data-percent="80"] {
  width: 80%;
}
.upload-progress-bar-fill[data-percent="81"] {
  width: 81%;
}
.upload-progress-bar-fill[data-percent="82"] {
  width: 82%;
}
.upload-progress-bar-fill[data-percent="83"] {
  width: 83%;
}
.upload-progress-bar-fill[data-percent="84"] {
  width: 84%;
}
.upload-progress-bar-fill[data-percent="85"] {
  width: 85%;
}
.upload-progress-bar-fill[data-percent="86"] {
  width: 86%;
}
.upload-progress-bar-fill[data-percent="87"] {
  width: 87%;
}
.upload-progress-bar-fill[data-percent="88"] {
  width: 88%;
}
.upload-progress-bar-fill[data-percent="89"] {
  width: 89%;
}
.upload-progress-bar-fill[data-percent="90"] {
  width: 90%;
}
.upload-progress-bar-fill[data-percent="91"] {
  width: 91%;
}
.upload-progress-bar-fill[data-percent="92"] {
  width: 92%;
}
.upload-progress-bar-fill[data-percent="93"] {
  width: 93%;
}
.upload-progress-bar-fill[data-percent="94"] {
  width: 94%;
}
.upload-progress-bar-fill[data-percent="95"] {
  width: 95%;
}
.upload-progress-bar-fill[data-percent="96"] {
  width: 96%;
}
.upload-progress-bar-fill[data-percent="97"] {
  width: 97%;
}
.upload-progress-bar-fill[data-percent="98"] {
  width: 98%;
}
.upload-progress-bar-fill[data-percent="99"] {
  width: 99%;
}
.upload-progress-bar-fill[data-percent="100"] {
  width: 100%;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.toast.toast--visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.toast--success {
  background: #16a34a;
  color: #fff;
}
.toast.toast--error {
  background: #dc2626;
  color: #fff;
}
body.theme-dark .toast.toast--success {
  background: #15803d;
}
body.theme-dark .toast.toast--error {
  background: #b91c1c;
}

/* ===== Dashboard Dark Mode & Theme Compatibility ===== */

/* 1. Generic dark mode for dashboard */
body.theme-dark {
  --dashboard-panel-bg: #1e293b;
  --dashboard-panel-border-top: #334155;
  --dashboard-panel-shadow: rgba(0, 0, 0, 0.3);
  --dashboard-panel-divider: #334155;
  --text-primary: #f1f5f9;
}

body.theme-dark .stat-card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.theme-dark .stat-card .stat-card-label {
  color: #94a3b8;
}

body.theme-dark .stat-card .stat-card-value {
  color: #f1f5f9;
}

body.theme-dark .stat-card .stat-card-icon {
  color: #94a3b8;
}

body.theme-dark .dashboard-recent {
  background: var(--dashboard-panel-bg, #1e293b);
  border-color: #334155;
}

body.theme-dark .dashboard-recent-header {
  background: var(--dashboard-panel-bg, #1e293b);
  border-bottom-color: #334155;
}

body.theme-dark .dashboard-recent .invoice-item {
  border-bottom-color: #334155 !important;
}

body.theme-dark .dashboard-recent .invoice-item-name {
  color: #f1f5f9 !important;
}

body.theme-dark .dashboard-recent .invoice-item-meta {
  color: #94a3b8 !important;
}

body.theme-dark .dashboard-recent .invoice-item-amount {
  color: #f1f5f9 !important;
}

body.theme-dark .dashboard-recent .empty-state-title {
  color: #f1f5f9;
}

/* 2. Palette 2 (Purple) dark mode */
body.theme-palette-2.theme-dark .stat-card,
body.theme-palette-2.theme-dark .dashboard-recent {
  background: rgb(24, 24, 24);
  border-color: rgba(255, 255, 255, 0.2);
}
body.theme-palette-2.theme-dark .dashboard-recent-header {
  background: rgb(24, 24, 24);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
body.theme-palette-2.theme-dark {
  --dashboard-panel-bg: rgb(24, 24, 24);
  --dashboard-panel-divider: rgba(255, 255, 255, 0.1);
}
body.theme-palette-2:not(.theme-dark) .stat-card {
  border-color: rgba(125, 57, 235, 0.2);
}
body.theme-palette-2:not(.theme-dark) .dashboard-recent {
  border-color: rgba(125, 57, 235, 0.2);
}

/* 3. Palette 3 (Warm) dark mode */
body.theme-palette-3.theme-dark .stat-card,
body.theme-palette-3.theme-dark .dashboard-recent {
  background: rgb(17, 17, 17);
  border-color: rgb(205, 180, 158);
}
body.theme-palette-3.theme-dark .dashboard-recent-header {
  background: rgb(17, 17, 17);
  border-bottom-color: rgba(205, 180, 158, 0.3);
}
body.theme-palette-3.theme-dark {
  --dashboard-panel-bg: rgb(17, 17, 17);
  --dashboard-panel-divider: rgba(205, 180, 158, 0.3);
}
body.theme-palette-3:not(.theme-dark) .stat-card {
  border-color: rgb(173, 125, 86);
}
body.theme-palette-3:not(.theme-dark) .dashboard-recent {
  background: rgb(205, 180, 158);
  border-color: rgb(173, 125, 86);
}
body.theme-palette-3:not(.theme-dark) .dashboard-recent-header {
  background: rgb(205, 180, 158);
}
body.theme-palette-3:not(.theme-dark) {
  --dashboard-panel-bg: rgb(205, 180, 158);
}

/* 4. Palette 4 (Burgundy) dark mode */
body.theme-palette-4.theme-dark .stat-card,
body.theme-palette-4.theme-dark .dashboard-recent {
  background: rgb(26, 26, 26);
  border-color: rgb(181, 172, 138);
}
body.theme-palette-4.theme-dark .dashboard-recent-header {
  background: rgb(26, 26, 26);
  border-bottom-color: rgba(181, 172, 138, 0.3);
}
body.theme-palette-4.theme-dark {
  --dashboard-panel-bg: rgb(26, 26, 26);
  --dashboard-panel-divider: rgba(181, 172, 138, 0.3);
}
body.theme-palette-4:not(.theme-dark) .stat-card {
  border-color: rgb(109, 0, 26);
}
body.theme-palette-4:not(.theme-dark) .dashboard-recent {
  border-color: rgba(109, 0, 26, 0.2);
}

/* 5. Palette 5 (Red) dark mode */
body.theme-palette-5.theme-dark .stat-card,
body.theme-palette-5.theme-dark .dashboard-recent {
  background: rgb(0, 0, 0);
  border-color: rgba(230, 30, 50, 0.3);
}
body.theme-palette-5.theme-dark .dashboard-recent-header {
  background: rgb(0, 0, 0);
  border-bottom-color: rgba(230, 30, 50, 0.15);
}
body.theme-palette-5.theme-dark {
  --dashboard-panel-bg: rgb(0, 0, 0);
  --dashboard-panel-divider: rgba(230, 30, 50, 0.15);
}
body.theme-palette-5:not(.theme-dark) .stat-card {
  border-color: rgba(230, 30, 50, 0.2);
}
body.theme-palette-5:not(.theme-dark) .dashboard-recent {
  border-color: rgba(230, 30, 50, 0.2);
}

/* Dashboard CSP Fixes */
.dashboard-stats-wrapper-custom {
  margin-top: 32px !important;
}

.upload-section-custom {
  margin-top: 48px !important;
}

.loading-state-custom {
  padding: 20px;
}

.empty-state-custom {
  padding: 100px 24px;
  text-align: center;
}

.empty-state-icon-custom {
  width: 64px;
  height: 64px;
  opacity: 0.2;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.empty-state-title-custom {
  margin-bottom: 8px;
}

.invoice-list-padded {
  padding: 0 32px 32px;
}

.invoice-item-dashboard {
  cursor: pointer;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.invoice-item-dashboard-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.invoice-item-dashboard-meta {
  font-size: 0.95rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-item-dashboard-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.invoice-item-dashboard-amount {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Redundant styles removed - consolidated around line 823 */

/* Validation Effects */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}
.input-error-shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
.input-error-glow {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
  border-color: #ef4444 !important;
  transition: all 0.3s ease;
}

.modal-error-feedback {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5) !important;
  border: 1px solid rgba(239, 68, 68, 0.6) !important;
}

/* Days Left Colors */
.days-left--red { color: #dc2626; font-weight: 700; }
.days-left--orange { color: #d97706; font-weight: 700; }
.days-left--green { color: #16a34a; font-weight: 700; }

body.theme-dark .days-left--red {
  color: #ff5f5f;
  text-shadow: 0 0 8px rgba(255, 95, 95, 0.3);
}
body.theme-dark .days-left--orange {
  color: #ffb84d;
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.3);
}
body.theme-dark .days-left--green {
  color: #52ff8d;
  text-shadow: 0 0 8px rgba(82, 255, 141, 0.3);
}
/* Date Input Calendar Icon Filter */
input[type=date]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(240deg) brightness(0.9);
}
body.theme-palette-2 input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(200deg) brightness(0.9);
}
body.theme-palette-3 input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(100deg) brightness(0.9);
}
body.theme-palette-4 input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(300deg) brightness(0.9);
}
body.theme-palette-5 input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.4) sepia(1) saturate(5) hue-rotate(50deg) brightness(0.9);
}

/* Invoice Detail Layout Fixes */
.invoice-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.invoice-detail-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 0.5rem;
}

.invoice-detail-row-label {
  font-weight: 500;
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
}

.invoice-detail-row-value {
  font-weight: 600;
  text-align: left;
  font-size: 0.95rem;
}


/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 320px;
}
.toast--active {
  transform: translateY(0);
  opacity: 1;
}
.toast--error {
  border-left: 4px solid #ef4444;
}
.toast--success {
  border-left: 4px solid #10b981;
}
.toast-icon {
  font-size: 1.25rem;
}

/* Custom Country Select */
.custom-country-select {
  position: relative;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  user-select: none;
  min-height: 38px;
}
.custom-country-select-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  height: 100%;
}
.custom-country-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 4px;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s;
}
.custom-country-select.active .custom-country-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-country-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  transition: background 0.15s ease;
}
.custom-country-select-option:hover {
  background: rgba(59, 130, 246, 0.1);
}
.custom-country-select-option.selected {
  background: rgba(59, 130, 246, 0.2);
  font-weight: 500;
}
.country-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.custom-country-select .placeholder {
  color: var(--text-muted);
}
body.theme-dark .custom-country-select {
  background: #0f172a;
}
body.theme-dark .custom-country-select-dropdown {
  background: #1e293b;
}
body.theme-dark .custom-country-select-option:hover {
  background: rgba(59, 130, 246, 0.2);
}


/* Clear Search Button */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.search-input-wrap input {
  width: 100%;
  padding-right: 32px;
}
.clear-search-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: none; /* hidden by default, can be shown via js or css focus-within */
  padding: 0 4px;
}
.clear-search-btn:hover {
  color: var(--text-color);
}
.search-input-wrap input:not(:placeholder-shown) ~ .clear-search-btn {
  display: block;
}


/* COMPANY EDIT MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-error-feedback {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.01); box-shadow: 0 0 20px 10px rgba(239, 68, 68, 0.2); }
  100% { transform: scale(1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
}

.modal-content.modal-error-feedback {
  animation: modal-error-feedback 0.4s ease-in-out;
}

.modal-content.company-edit-modal {
  background: var(--bg-card, #ffffff);
  width: min(900px, 95%);
  max-height: 90vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-color);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  background: rgba(148, 163, 184, 0.02);
}

body.theme-dark .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

body.theme-dark .modal-content.company-modal {
  background: #1e293b;
}

/* Form Layouts */
.company-modal .modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-section-title {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin: 20px 0 4px;
}

.form-section-title:first-child {
  margin-top: 0;
}

.company-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.company-modal-actions-right {
  display: flex;
  gap: 12px;
}

/* STATEMENT TRANSITIONS */
.pdf-wrapper, .statement-wrapper {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              max-height 0.4s ease,
              margin 0.4s ease,
              padding 0.4s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  border: none;
  box-shadow: none;
}

.pdf-wrapper--open, .statement-wrapper--open {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 850px;
  padding: 30px;
  opacity: 1;
  max-height: 1500px;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.btn-icon.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-icon.active img {
  filter: brightness(0) invert(1);
}

.util-hidden {
  display: none !important;
}

.util-mt-8 { margin-top: 0.5rem; }
.util-mt-10 { margin-top: 0.625rem; }
.util-mt-12 { margin-top: 0.75rem; }
.util-mr-8 { margin-right: 0.5rem; }
.util-max-w-140 { max-width: 140px; }

/* REFINEMENTS */
.fx-preview-row {
  grid-column: 1 / -1;
  padding: 4px 0;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

body.theme-dark .fx-preview-row {
  color: var(--text-muted);
}

.pdf-wrapper, .statement-wrapper {
  background: #2b2b2b; /* Standard PDF viewer dark gray */
}

.pdf-wrapper iframe, .statement-wrapper iframe {
  background: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 100%;
  height: 800px;
  border: none;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.no-statement-indicator {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: no-statement-pulse 2s infinite;
}

@keyframes no-statement-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Custom Logo Select */
.custom-logo-select { position: relative; width: 100%; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); cursor: pointer; user-select: none; min-height: 38px; }
.custom-logo-select-current { display: flex; align-items: center; gap: 8px; padding: 8px 12px; height: 100%; }
.custom-logo-select-dropdown { position: absolute; top: 100%; left: 0; right: 0; max-height: 250px; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; margin-top: 4px; z-index: 1000; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(-5px); transition: all 0.2s; }
.custom-logo-select.active .custom-logo-select-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-logo-select-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; transition: background 0.15s ease; }
.custom-logo-select-option:hover { background: rgba(59, 130, 246, 0.1); }
.custom-logo-select-option.selected { background: rgba(59, 130, 246, 0.2); font-weight: 500; }
.custom-logo-select .placeholder { color: var(--text-muted); }
body.theme-dark .custom-logo-select { background: #0f172a; }
body.theme-dark .custom-logo-select-dropdown { background: #1e293b; }
body.theme-dark .custom-logo-select-option:hover { background: rgba(59, 130, 246, 0.2); }

/* Urgent Status Colors */
.status-meta--urgent, .status-pill--urgent, .status-badge--urgent { background: rgba(225, 29, 72, 0.15) !important; color: #e11d48 !important; border: 1px solid rgba(225, 29, 72, 0.3) !important; }
body.theme-dark .status-meta--urgent, body.theme-dark .status-pill--urgent, body.theme-dark .status-badge--urgent { background: rgba(225, 29, 72, 0.2) !important; color: #fda4af !important; border-color: rgba(225, 29, 72, 0.4) !important; }
.stat-card--urgent .stat-card-icon { background: rgba(225, 29, 72, 0.15) !important; color: #e11d48 !important; }
body.theme-dark .stat-card--urgent .stat-card-icon { background: rgba(225, 29, 72, 0.2) !important; color: #fda4af !important; }
.urgent-row td { background-color: rgba(225, 29, 72, 0.05) !important; }
body.theme-dark .urgent-row td { background-color: rgba(225, 29, 72, 0.15) !important; }
