:root {
  --bg: #f4f9f9;
  --bg-subtle: #eaf5f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #072144;
  --text-secondary: #0d2a4d;
  --muted: #3b6b8a;
  --border: #b8d0e0;
  --border-light: #e3eef3;
  --accent: #01aba8;
  --accent-hover: #00705f;
  --accent-light: #e6f7f6;
  --accent-gradient: linear-gradient(135deg, #01aba8 0%, #00705f 100%);
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(7, 33, 68, 0.04);
  --shadow: 0 4px 16px rgba(7, 33, 68, 0.06);
  --shadow-lg: 0 12px 32px rgba(7, 33, 68, 0.1);
  --shadow-glow: 0 0 0 3px rgba(1, 171, 168, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-display: 'Fraunces', serif;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at top left, rgba(99,102,241,0.07), transparent 35%),
    radial-gradient(circle at bottom right, rgba(139,92,246,0.05), transparent 35%),
    var(--bg);
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.taskbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding: 6px 14px 6px 0;
  margin-right: 6px;
  border-right: 1px solid rgba(226, 232, 240, 0.7);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.taskbar-brand:hover {
  transform: translateY(-1px);
}

.taskbar-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  margin-right: 6px;
  vertical-align: middle;
}

.taskbar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.taskbar-nav-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.taskbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  background: transparent;
  border: 1px solid transparent;
}

.taskbar-link:hover {
  color: var(--text);
  background: var(--border-light);
  transform: translateY(-1px);
}

.taskbar-link-active {
  color: #fff;
  background: var(--accent-gradient);
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

.taskbar-link-active:hover {
  color: #fff;
  background: var(--accent-gradient);
  filter: brightness(1.05);
}

.taskbar-link-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  background: transparent;
  border: 1px solid transparent;
}

.taskbar-link-group:hover {
  color: var(--text);
  background: var(--border-light);
}

.taskbar-link-group-active {
  color: #fff;
  background: var(--accent-gradient);
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

.taskbar-link-group-active:hover {
  color: #fff;
  background: var(--accent-gradient);
  filter: brightness(1.05);
}

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

.taskbar-caret {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-left: 2px;
}

.taskbar-spacer {
  display: none;
}

.taskbar-utility {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.taskbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.taskbar-user-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(226, 232, 240, 1);
}

.taskbar-fy-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 2px;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: var(--text);
}

.taskbar-fy-trigger:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  border-color: rgba(226, 232, 240, 1);
}

.taskbar-fy-label {
  color: var(--muted);
  font-weight: 600;
  padding: 5px 10px 5px 12px;
  letter-spacing: 0.02em;
  user-select: none;
}

.taskbar-fy-value {
  padding: 5px 28px 5px 10px;
  font-weight: 500;
}

.taskbar-dropdown-wrap {
  position: relative;
}

.taskbar-dropdown-trigger {
  display: inline-flex;
  align-items: center;
}

.taskbar-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  max-width: 260px;
  z-index: 200;
  padding: 6px;
  animation: dropIn 180ms ease-out;
}

.taskbar-dropdown-right {
  right: 0;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.taskbar-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-xs);
  text-decoration: none;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.taskbar-dropdown-item:hover,
.taskbar-dropdown-item-active {
  background: var(--accent-light);
  color: var(--accent);
}

.taskbar-dropdown-item-active {
  font-weight: 600;
}

.taskbar-global-search {
  flex: 1 1 auto;
  padding: 0 12px;
  min-width: 220px;
  max-width: 420px;
}

.global-search {
  width: 100%;
  position: relative;
}

.global-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.global-search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 171, 168, 0.12);
}

.global-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

.global-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  outline: none;
}

.global-search-input::placeholder {
  color: #94a3b8;
}

.global-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.global-search-clear:hover {
  color: var(--text);
  background: var(--border-light);
}

.global-search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font: 500 0.75rem/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 420px;
  overflow-y: auto;
  animation: dropIn 180ms ease-out;
}

.global-search-group {
  padding: 6px;
}

.global-search-group-label {
  padding: 8px 12px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.global-search-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease, color 0.15s ease;
}

.global-search-item:hover,
.global-search-item-active {
  background: var(--accent-light);
  color: var(--accent);
}

.global-search-item-title {
  font-weight: 600;
  color: var(--text);
}

.global-search-item-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.global-search-item-description {
  font-size: 0.8rem;
  color: var(--muted);
}

.global-search-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
}

.global-search-view-all {
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.global-search-view-all:hover {
  background: var(--accent-light);
}

.global-search-status {
  padding: 16px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.global-search-error {
  padding: 16px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 0.875rem;
  text-align: center;
}

.global-search-empty-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.global-search-empty-tips {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: left;
}

.app-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.welcome-banner-wrap {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.welcome-banner-wrap > * {
  animation: slideDown 240ms ease-out;
}

.welcome-banner-gradient {
  position: relative;
  height: 132px;
  margin: 16px 0 0;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  box-shadow: 0 24px 40px -26px rgba(5, 11, 30, .6), 0 6px 16px -8px rgba(0, 0, 0, .25);
}

.welcome-banner-content-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  margin: 0;
  text-shadow: 0 1px 14px rgba(0, 20, 25, .35);
}

.welcome-banner-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .03em;
  color: #fff;
  text-shadow: none;
  background: rgba(255, 255, 255, .16);
  border: 1.5px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.welcome-banner-content { display: flex; flex-direction: column; min-width: 0; }

.welcome-banner-greeting {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  opacity: .92;
  color: #fff;
}

.welcome-banner-name {
  margin: 3px 0 2px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.welcome-banner-org {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 14px;
  opacity: .9;
  color: #fff;
}

.welcome-banner-date {
  position: absolute;
  right: 28px;
  bottom: 16px;
  font-size: 12px;
  opacity: .88;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .welcome-banner-gradient { height: auto; min-height: 124px; }
  .welcome-banner-content-wrap { position: relative; inset: auto; min-height: 124px; padding: 14px 18px; gap: 14px; }
  .welcome-banner-avatar { width: 56px; height: 56px; }
  .welcome-banner-name { font-size: 21px; max-width: 150px; }
  .welcome-banner-date { display: none; }
  .welcome-banner-role { right: 16px; }
}

.welcome-banner-role {
  position: absolute;
  top: 0;
  right: 28px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 14px 19px;
  background: #ffd166;
  color: #14221c;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.4s;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 8px), 0 100%);
}
.welcome-banner-role[data-role='owner']      { background: #ffd166; }
.welcome-banner-role[data-role='accountant'] { background: #5eead4; }
.welcome-banner-role[data-role='staff']      { background: #7dd3fc; }
.welcome-banner-role[data-role='viewer']     { background: #c4b5fd; }

@media (max-width: 600px) {
  .welcome-banner-role { right: 16px; }
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 300ms ease-out;
}

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

.page-centered {
  max-width: 520px;
  margin: 40px auto;
  width: 100%;
}

.login-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 16px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-family: var(--font-display);
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.page-subtitle a {
  color: var(--accent);
  font-weight: 500;
}

.auth-switch {
  margin: 20px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.terms-agree input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.terms-agree a {
  color: var(--accent);
  font-weight: 500;
}

.terms-agree a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.policy-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.policy-content h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text);
}

.policy-content p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.policy-meta {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.policy-table th,
.policy-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.policy-table th {
  font-weight: 600;
  background: var(--bg-subtle);
}

.policy-content ul,
.policy-content ol {
  margin: 0 0 12px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.policy-content li {
  margin: 4px 0;
}

.password-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.password-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
  line-height: 0;
}

.password-toggle:hover {
  color: var(--text);
}

.field-optional {
  font-weight: 400;
  color: var(--muted);
}

.dev-code-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-actions .btn {
  flex: 0 0 auto;
  justify-content: center;
}

.daily-actions-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
}

.daily-date-picker {
  min-width: 280px;
}

.page-breadcrumb-sep {
  color: var(--border);
  user-select: none;
}

.page-breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
}

.page-breadcrumb-link:hover {
  color: var(--accent);
}

.page-breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
}

.banner-error,
.banner-success {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  animation: slideDown 240ms ease-out;
}

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

.banner-error {
  color: #991b1b;
  background: var(--danger-bg);
  border: 1px solid #fecaca;
}

.banner-info {
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.temp-password {
  background: #1e3a8a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
}

.banner-success {
  color: #065f46;
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
}

.loading,
.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 48px 20px;
  font-size: 0.9rem;
}

.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 100%;
}

.search-field--full {
  grid-column: 1 / -1;
}

.search-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.search-field input,
.search-field select,
.search-field textarea {
  width: 100%;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field input:focus,
.search-field select:focus,
.search-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #94a3b8;
}

.form-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.fy-selector {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.fy-selector:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.fy-selector-label {
  color: var(--muted);
  font-weight: 600;
  padding: 5px 10px 5px 12px;
  letter-spacing: 0.02em;
  user-select: none;
}

.fy-selector select {
  padding: 5px 28px 5px 10px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: color 0.2s ease;
}

.fy-selector select:hover {
  color: var(--text);
}

.fy-selector select:focus {
  outline: none;
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 200ms ease-out;
}

.modal {
  width: 100%;
  max-width: 520px;
}

.modal .panel,
.modal .section-card {
  backdrop-filter: none;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.entry-card-popup {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-card-popup > * {
  min-width: 0;
}

.entry-card-popup-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.entry-card-popup-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.entry-card-popup-body {
  display: grid;
  gap: 10px;
}

.entry-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted, #f8fafc);
}

.entry-card-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.entry-card-value {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 520px;
}

.modal-card-wide {
  max-width: 720px;
}

.modal-card-wide .page {
  gap: 14px;
}

.modal-card-wide .page-header {
  margin-bottom: 6px;
}

.modal-card-wide .page-title {
  font-size: 1.25rem;
}

.modal-card-wide .page-subtitle {
  font-size: 0.85rem;
  margin-top: 2px;
}

.modal-card-wide .invoice-new-grid {
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.modal-card-wide .section-card {
  padding: 20px;
}

.modal-card-wide .summary-actions {
  gap: 8px;
  margin-top: 14px;
}

.modal-card-wide .summary-actions .btn {
  padding: 10px 16px;
}

.card-popup-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  color: var(--text);
}

.card-popup-body {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
}

.card-popup-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.select-company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
}

.login-card .login-logo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 14px;
}

.login-card .form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card .form-field-wide {
  grid-column: auto;
}

.login-card .auth-switch {
  text-align: center;
}

.signup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
}

.signup-card .auth-switch {
  text-align: center;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-span {
  grid-column: 1 / -1;
}

.select-company-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.select-company-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.select-company-option:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(7, 33, 68, 0.1);
}

.select-company-option:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.select-company-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.panel-narrow {
  max-width: 640px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:hover {
  color: var(--accent-hover);
}

.dialog-text {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.dialog-text--compact {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.modal-card-title {
  margin-top: 0;
  margin-bottom: 12px;
}

.table-wrap--mt {
  margin-top: 8px;
}

.btn-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}

.btn-warning:hover:not(:disabled) {
  background: #fcd34d;
  color: #78350f;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success-bg);
  color: #065f46;
}

.btn-success:hover:not(:disabled) {
  background: var(--success);
  color: white;
  border-color: var(--success);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.space-x-2 > * + * {
  margin-left: 0.5rem;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

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

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

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

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.uppercase {
  text-transform: uppercase;
}

.leading-none {
  line-height: 1;
}

.leading-relaxed {
  line-height: 1.625;
}

.list-disc {
  list-style-type: disc;
}

.list-inside {
  list-style-position: inside;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.break-words {
  overflow-wrap: break-word;
  word-break: break-word;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mr-1 {
  margin-right: 0.25rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-1 {
  margin-left: 0.25rem;
}

.ml-auto {
  margin-left: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.inline-flex {
  display: inline-flex;
}

.flex {
  display: flex;
}

.inline-block {
  display: inline-block;
}

.block {
  display: block;
}

.hidden {
  display: none;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.min-w-0 {
  min-width: 0;
}

.min-w-full {
  min-width: 100%;
}

.w-7 {
  width: 1.75rem;
}

.w-8 {
  width: 2rem;
}

.w-full {
  width: 100%;
}

.h-7 {
  height: 1.75rem;
}

.h-8 {
  height: 2rem;
}

.h-32 {
  height: 8rem;
}

.h-full {
  height: 100%;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-5xl {
  max-width: 64rem;
}

.max-w-full {
  max-width: 100%;
}

.max-h-\[90vh\] {
  max-height: 90vh;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

.relative {
  position: relative;
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-50 {
  z-index: 50;
}

.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

.select-none {
  user-select: none;
}

.border {
  border: 1px solid var(--border);
}

.border-0 {
  border: 0;
}

.border-b {
  border-bottom: 1px solid var(--border);
}

.border-t {
  border-top: 1px solid var(--border);
}

.border-r {
  border-right: 1px solid var(--border);
}

.border-l {
  border-left: 1px solid var(--border);
}

.border-x {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.border-y {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.border-0 {
  border-width: 0;
}

.border-2 {
  border-width: 2px;
}

.border-t-0 {
  border-top-width: 0;
}

.border-b-0 {
  border-bottom-width: 0;
}

.rounded {
  border-radius: var(--radius-xs);
}

.rounded-lg {
  border-radius: var(--radius);
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-none {
  border-radius: 0;
}

.bg-white {
  background: var(--surface);
}

.bg-transparent {
  background: transparent;
}

.bg-black {
  background: #000;
}

.bg-opacity-50 {
  --tw-bg-opacity: 0.5;
}

.bg-opacity-75 {
  --tw-bg-opacity: 0.75;
}

.bg-red-50 {
  background: #fef2f2;
}

.bg-yellow-50 {
  background: #fffbeb;
}

.bg-green-50 {
  background: #ecfdf5;
}

.bg-blue-50 {
  background: #eff6ff;
}

.bg-gray-50 {
  background: #f9fafb;
}

.bg-gray-100 {
  background: #f3f4f6;
}

.text-white {
  color: #fff;
}

.text-black {
  color: #000;
}

.text-gray-500 {
  color: #6b7280;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-700 {
  color: #374151;
}

.text-gray-800 {
  color: #1f2937;
}

.text-gray-900 {
  color: #111827;
}

.text-red-700 {
  color: #991b1b;
}

.text-red-600 {
  color: #dc2626;
}

.text-red-500 {
  color: #ef4444;
}

.text-yellow-700 {
  color: #92400e;
}

.text-yellow-600 {
  color: #d97706;
}

.text-green-700 {
  color: #065f46;
}

.text-green-600 {
  color: #059669;
}

.text-blue-700 {
  color: #1d4ed8;
}

.text-blue-600 {
  color: #2563eb;
}

.text-blue-800 {
  color: #1e40af;
}

.text-green-800 {
  color: #064e3b;
}

.shadow {
  box-shadow: var(--shadow);
}

.shadow-xl {
  box-shadow: var(--shadow-lg);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.border-red-200 {
  border-color: #fecaca;
}

.border-yellow-200 {
  border-color: #fde68a;
}

.border-green-200 {
  border-color: #a7f3d0;
}

.border-blue-200 {
  border-color: #bfdbfe;
}

.border-gray-200 {
  border-color: #e5e7eb;
}

.border-gray-300 {
  border-color: #d1d5db;
}

.border-green-100 {
  border-color: #d1fae5;
}

.border-yellow-100 {
  border-color: #fef3c7;
}

.border-red-100 {
  border-color: #fee2e2;
}

.divide-y {
  --tw-divide-y-reverse: 0;
  border-top-width: 0;
  border-bottom-width: 0;
}

.divide-y > :not([hidden]) ~ :not([hidden]) {
  --tw-divide-x-reverse: 0;
  border-right-width: 0;
  border-left-width: 0;
  border-top-width: 1px;
  border-top-color: var(--border);
}

.divide-gray-200 {
  --tw-divide-opacity: 1;
  border-color: rgb(229 231 235 / var(--tw-divide-opacity));
}

.divide-y-0 {
  --tw-divide-y-reverse: 0;
  border-top-width: 0;
  border-bottom-width: 0;
}

.divide-x-0 {
  --tw-divide-x-reverse: 0;
  border-right-width: 0;
  border-left-width: 0;
}

.hover\:bg-blue-700:hover {
  background: #1d4ed8;
}

.hover\:bg-red-700:hover {
  background: #991b1b;
}

.hover\:bg-green-700:hover {
  background: #065f46;
}

.hover\:text-blue-800:hover {
  color: #1e40af;
}

.hover\:text-red-800:hover {
  color: #991b1b;
}

.hover\:text-yellow-800:hover {
  color: #92400e;
}

.hover\:text-green-800:hover {
  color: #064e3b;
}

.hover\:bg-gray-50:hover {
  background: #f9fafb;
}

.hover\:bg-gray-100:hover {
  background: #f3f4f6;
}

.hover\:bg-subtle:hover {
  background: var(--bg-subtle);
}

.hover\:text-white:hover {
  color: #fff;
}

.focus\:outline-none:focus {
  outline: none;
}

.focus\:border-accent:focus {
  border-color: var(--accent);
}

.focus\:shadow-glow:focus {
  box-shadow: var(--shadow-glow);
}

.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.col-span-1 {
  grid-column: span 1 / span 1;
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

.col-span-3 {
  grid-column: span 3 / span 3;
}

.col-span-full {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .md\:col-span-1 {
    grid-column: span 1 / span 1;
  }
  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
  .md\:col-span-3 {
    grid-column: span 3 / span 3;
  }
  .md\:col-span-full {
    grid-column: 1 / -1;
  }
  .md\:flex {
    display: flex;
  }
  .md\:hidden {
    display: none;
  }
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .md\:w-auto {
    width: auto;
  }
  .md\:w-1\/2 {
    width: 50%;
  }
  .md\:w-1\/3 {
    width: 33.333333%;
  }
  .md\:w-2\/3 {
    width: 66.666667%;
  }
  .md\:w-full {
    width: 100%;
  }
  .md\:max-w-3xl {
    max-width: 48rem;
  }
  .md\:max-w-5xl {
    max-width: 64rem;
  }
  .md\:flex-row {
    flex-direction: row;
  }
  .md\:flex-col {
    flex-direction: column;
  }
  .md\:items-center {
    align-items: center;
  }
  .md\:justify-between {
    justify-content: space-between;
  }
  .md\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .lg\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sm\:hidden {
    display: none;
  }
  .sm\:block {
    display: block;
  }
  .sm\:flex {
    display: flex;
  }
  .sm\:grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .sm\:p-4 {
    padding: 1rem;
  }
  .sm\:px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .sm\:text-sm {
    font-size: 0.875rem;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-fade-in {
  animation: fadeIn 200ms ease-out;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.entry-panel {
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.summary-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  backdrop-filter: blur(10px) saturate(180%);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.summary-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
  word-break: break-word;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  min-width: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 640px;
}

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

.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-subtle);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: var(--bg-subtle);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table .btn {
  margin-right: 6px;
}

.table .btn:last-child {
  margin-right: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 48px 20px;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.summary-cards-stacked {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

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

.summary-card-row--single {
  grid-template-columns: 1fr;
}

.summary-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px) saturate(180%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.summary-card-primary {
  background: linear-gradient(135deg, rgba(238,242,255,0.9) 0%, rgba(232,240,255,0.9) 100%);
  border-color: #c7d2fe;
}

.summary-card-primary:hover {
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 18px 20px;
  border-radius: var(--radius);
  border-width: 1px;
  border-style: solid;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  backdrop-filter: blur(10px) saturate(180%);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.panel:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.payables-card {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(254, 243, 199, 0.9) 100%);
}

.payables-card:hover {
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.12);
}

.payables-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.85rem;
}

.payables-overdue {
  color: var(--danger);
  font-weight: 500;
}

.payables-due-today {
  color: var(--warning);
  font-weight: 500;
}

.aging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tax-card {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.tax-card:hover {
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.1);
}

.tax-paid-card {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.tax-paid-card:hover {
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.1);
}

.tax-outstanding-card {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.tax-outstanding-card:hover {
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.1);
}

.vat-card {
  background: linear-gradient(135deg, rgba(230, 247, 246, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.vat-card:hover {
  box-shadow: 0 10px 28px rgba(1, 171, 168, 0.1);
}

.tds-card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.tds-card:hover {
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.1);
}

.tax-card-details,
.vat-card-details,
.tds-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.due-today-card {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.due-today-card:hover {
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.1);
}

.due-7-card {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.due-7-card:hover {
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.1);
}

.due-30-card {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.due-30-card:hover {
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.1);
}

.overdue-card {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.overdue-card:hover {
  box-shadow: 0 10px 28px rgba(185, 28, 28, 0.1);
}

.aging-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.aging-row:hover {
  background: var(--border-light);
  border-color: var(--border);
}

.aging-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aging-amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

.aging-percentage {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.due-soon-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.due-soon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.due-soon-row:hover {
  background: var(--border-light);
  border-color: var(--border);
}

.due-soon-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.due-soon-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

.breakdown-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

.breakdown-overdue {
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 500;
  white-space: nowrap;
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-sublabel {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

.amount-high {
  color: var(--success);
  font-weight: 700;
}

.amount-low {
  color: var(--danger);
  font-weight: 700;
}

.amount-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-cell--zero {
  color: var(--muted);
  font-weight: 400;
}

.amount-cell--positive {
  color: var(--success);
}

.amount-cell--negative {
  color: var(--danger);
}

.banner-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.banner-status--success {
  color: #065f46;
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
}

.banner-status--warning {
  color: #92400e;
  background: var(--warning-bg);
  border: 1px solid #fde68a;
}

.banner-warning {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.5;
}

.banner-warning strong {
  color: #78350f;
}

.banner-warning .duplicate-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.banner-warning .duplicate-list li {
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  min-width: 0;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 600px;
}

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

.transaction-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--border-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}



.transaction-table tbody tr:hover {
  background: var(--border-light);
}

.transaction-table tbody tr:last-child td {
  border-bottom: none;
}

.aging-buckets h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}

.aging-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aging-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: box-shadow 0.15s ease;
}

.aging-card:hover {
  box-shadow: var(--shadow-sm);
}

.aging-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.aging-card-org {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.aging-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.aging-card-right {
  text-align: right;
  white-space: nowrap;
}

.aging-card-outstanding {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.aging-card-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.aging-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.aging-card-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aging-card-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aging-card-value {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.aging-card-btn {
  width: 100%;
  text-align: center;
}

.table-total-row td {
  background: #f4f9f9;
  border-top: 2px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.actions-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  justify-content: center;
  border-bottom: none !important;
}

.actions-cell .btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

.actions-cell .btn-small {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.form-error {
  margin: 0 0 16px;
  color: var(--danger);
  font-size: 0.875rem;
}

.duplicate-list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 0.875rem;
}

.empty-state,
.loading {
  color: var(--muted);
  text-align: center;
  padding: 48px 20px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-page {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.organization-totals {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.organization-filters {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.organization-filters .search-field {
  min-width: 220px;
}

.col-actions {
  min-width: 220px;
  width: 220px;
  white-space: nowrap;
}

.org-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.org-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.section-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  backdrop-filter: blur(10px) saturate(180%);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: visible;
}

.section-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Bank Reconciliation */
.rec-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rec-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.rec-detail-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rec-detail-header-info h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rec-detail-header-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.rec-detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.rec-status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
}

.rec-status-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-status-banner-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.rec-reopen-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.rec-reopen-form .form-field {
  max-width: 400px;
  flex: 1 1 240px;
}

.rec-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.rec-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.rec-difference-card {
  border: 2px solid var(--color-success, var(--success));
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rec-difference-card--danger {
  border-color: var(--color-danger, var(--danger));
}

.rec-difference-card .section-card-header {
  background: var(--bg-subtle);
  margin-bottom: 0;
  padding: 12px 16px;
}

.rec-difference-card .section-card-body {
  padding: 16px;
}

.rec-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.rec-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.rec-breakdown-row--total {
  font-size: 1.1rem;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.rec-breakdown-row--remaining {
  font-size: 1.05rem;
  font-weight: 600;
}

.rec-breakdown-label {
  color: var(--text-secondary);
}

.rec-breakdown-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rec-breakdown-message {
  margin-top: 8px;
  font-weight: 600;
  color: var(--success);
}

.rec-breakdown-message--danger {
  color: var(--danger);
}

.rec-import-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rec-import-preview h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.rec-import-errors {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.875rem;
}

.rec-import-errors strong {
  display: block;
  margin-bottom: 8px;
}

.rec-suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-suggestions h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}

.rec-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.rec-suggestion-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

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

.rec-suggestion-header strong {
  color: var(--text);
}

.rec-suggestion-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rec-suggestion-date {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.rec-suggestion-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.rec-suggestion-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.rec-table-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.rec-table-actions .form-select {
  min-width: 180px;
}

.rec-modal-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.rec-modal-details p {
  margin: 0;
  color: var(--text-secondary);
}

.rec-modal-details strong {
  color: var(--text);
}

.rec-modal-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.rec-create-form {
  margin-bottom: 24px;
}

.rec-section-header {
  justify-content: space-between;
}

.rec-journal-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.rec-journal-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.table tbody tr.is-selected {
  background: var(--accent-light);
}

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

.help-search-wrap {
  margin-bottom: 16px;
  position: relative;
}

.help-search-logo {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.6;
}

.help-search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.help-search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.help-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.help-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.help-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-article-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
}

.help-article-list li:hover {
  color: var(--accent);
}

.help-article-list li:last-child {
  border-bottom: none;
}

.support-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.support-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.support-tab:hover {
  color: var(--text);
}

.support-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ticket-messages {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-message {
  padding: 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
}

.ticket-message--original {
  border-left: 3px solid var(--accent);
}

.ticket-message--staff {
  border-left: 3px solid var(--success);
  background: var(--success-bg);
}

.ticket-message--customer {
  border-left: 3px solid var(--muted);
}

.ticket-message-author {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.ticket-message-text {
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ticket-message-time {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.priority-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.priority-critical {
  background: var(--danger-bg);
  color: var(--danger);
}

.priority-high {
  background: var(--warning-bg);
  color: var(--warning);
}

.priority-normal {
  background: var(--bg-subtle);
  color: var(--muted);
}

.priority-feature {
  background: var(--accent-light);
  color: var(--accent-hover);
}

.app-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
}

.app-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.app-footer-links a,
.app-footer-links nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.app-footer-links a:hover,
.app-footer-links nav a:hover {
  color: var(--accent);
}

.app-footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.section-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-card-body > * {
  min-width: 0;
}

.profit-card {
  background: linear-gradient(135deg, rgba(1, 171, 168, 0.08) 0%, rgba(16, 185, 129, 0.06) 100%);
}

.profit-card:hover {
  box-shadow: 0 10px 28px rgba(1, 171, 168, 0.1);
}

.profit-margin {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.margin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.margin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.margin-row span {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.margin-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.form-field select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-subtle);
}

.autocomplete {
  position: relative;
  width: 100%;
}

.autocomplete-list {
  position: absolute;
  z-index: 20;
  top: calc(100% - 4px);
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item-active {
  background: var(--accent-light);
}

.autocomplete-name {
  font-weight: 600;
}

.autocomplete-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.input-auto {
  background: var(--border-light);
}

.nepali-date-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nepali-date-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.day-stepper {
  display: flex;
  gap: 8px;
}

.day-btn {
  flex: 1;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.day-btn:hover {
  background: var(--border-light);
}

.day-btn:active {
  background: var(--border);
}

.date-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.daily-date-picker {
  min-width: 280px;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.daily-grid > * {
  min-width: 0;
}

.daily-section h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.daily-section-form {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.daily-section-form .transaction-form h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.daily-section-form .form-note {
  margin-bottom: 12px;
}

.landing-home-link {
  text-decoration: none;
  color: inherit;
}

.landing-home-link:hover h1 {
  color: var(--accent);
}

.landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-brand h1 {
  margin: 0 0 4px;
  font-size: 2.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, #00705f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.landing-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.landing-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.landing-cta {
  font-size: 1rem;
  padding: 12px 24px;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  text-decoration: none;
}

.landing-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.landing-cta.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.landing-cta.btn-secondary:hover {
  background: var(--border-light);
}

.landing-hero {
  text-align: center;
  margin-bottom: 56px;
  padding: 48px 28px 36px;
  background: linear-gradient(135deg, var(--accent-light) 0%, #f4f9f9 100%);
  border-radius: var(--radius);
  border: 1px solid #c7d2fe;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 40%),
              radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.08), transparent 40%);
  pointer-events: none;
}

.landing-hero > * {
  position: relative;
}

.landing-hero-badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #c7d2fe;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.landing-hero h2 {
  margin: 0 0 12px;
  font-size: 2.4rem;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.landing-hero p {
  margin: 0 auto 24px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.landing-hero-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-hero-visual {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.landing-hero-preview {
  width: 100%;
  max-width: 860px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.landing-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f4f9f9 0%, #e3eef3 100%);
  border-bottom: 1px solid var(--border);
}

.landing-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.landing-preview-dot-red {
  background: #fca5a5;
}

.landing-preview-dot-yellow {
  background: #fcd34d;
}

.landing-preview-dot-green {
  background: #86efac;
}

.landing-preview-title {
  margin-left: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.landing-preview-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 18px;
}

.landing-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-preview-line {
  height: 10px;
  border-radius: 999px;
  background: #b8d0e0;
}

.landing-preview-line-short {
  width: 65%;
}

.landing-preview-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-preview-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.landing-preview-card {
  height: 56px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-light) 0%, #e6f7f6 100%);
  border: 1px solid #c7d2fe;
}

.landing-preview-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-preview-row {
  height: 12px;
  border-radius: 999px;
  background: #e3eef3;
}

.landing-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.landing-highlight {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.landing-highlight h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.landing-highlight p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #c7d2fe;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.landing-hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.landing-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  animation: float-orb 8s ease-in-out infinite alternate;
}

.landing-hero-orb--one {
  width: 260px;
  height: 260px;
  background: #01aba8;
  top: -60px;
  left: -40px;
  animation-delay: 0s;
}

.landing-hero-orb--two {
  width: 220px;
  height: 220px;
  background: #00705f;
  bottom: -40px;
  right: -20px;
  animation-delay: 1.5s;
}

.landing-hero-orb--three {
  width: 180px;
  height: 180px;
  background: #a78bfa;
  top: 40%;
  left: 55%;
  animation-delay: 3s;
}

@keyframes float-orb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(20px, -24px) scale(1.08);
  }
}

.landing-hero-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18), transparent 60%);
  transform: translate(calc(var(--mouse-x, 0) - 170px), calc(var(--mouse-y, 0) - 170px));
  pointer-events: none;
  transition: transform 120ms ease-out;
}

.landing-hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.landing-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
}

.landing-hero-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.landing-hero-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.landing-highlight {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.landing-highlight:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.landing-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--accent-light);
  border: 1px solid #c7d2fe;
  margin-bottom: 10px;
}

.landing-highlight-icon-inner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.landing-highlight {
  animation: fade-up 420ms ease-out both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-hero,
.landing-highlights,
.landing-footer {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
  will-change: opacity, transform;
}

.landing-hero.is-visible,
.landing-highlights.is-visible,
.landing-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-preview-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-light) 0%, #e6f7f6 100%);
  border: 1px solid #c7d2fe;
}

.landing-preview-card-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(99, 102, 241, 0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 500ms ease;
}

.landing-preview-card--active .landing-preview-card-glow {
  transform: translateX(100%);
}

.landing-preview-card-line {
  position: absolute;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.25);
  transition: transform 300ms ease, opacity 300ms ease;
  opacity: 0.7;
}

.landing-preview-card-line--title {
  width: 55%;
  height: 10px;
  top: 18px;
  left: 12px;
}

.landing-preview-card-line--amount {
  width: 38%;
  height: 10px;
  top: 34px;
  left: 12px;
}

.landing-preview-card-line--muted {
  width: 28%;
  height: 10px;
  top: 50px;
  left: 12px;
}

.landing-preview-card--active .landing-preview-card-line {
  transform: translateX(4px);
  opacity: 1;
}

.landing-highlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(120deg, transparent 30%, rgba(99, 102, 241, 0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 500ms ease;
  pointer-events: none;
}

.landing-highlight:hover::before {
  transform: translateX(100%);
}

@media (max-width: 640px) {
  .landing {
    padding: 32px 16px 56px;
  }

  .landing-hero {
    padding: 28px 18px 24px;
  }

  .landing-hero h2 {
    font-size: 1.7rem;
  }

  .landing-preview-body {
    grid-template-columns: 1fr;
  }

  .landing-preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-highlights {
    grid-template-columns: 1fr;
  }

  .landing-hero-orb--one {
    width: 160px;
    height: 160px;
    top: -40px;
    left: -30px;
  }

  .landing-hero-orb--two {
    width: 140px;
    height: 140px;
    bottom: -30px;
    right: -20px;
  }

  .landing-hero-orb--three {
    width: 120px;
    height: 120px;
  }

  .landing-hero-glow {
    width: 220px;
    height: 220px;
    transform: translate(calc(var(--mouse-x, 0) - 110px), calc(var(--mouse-y, 0) - 110px));
  }

  .landing-hero-stats {
    gap: 20px;
    margin-top: 22px;
  }

  .landing-hero-stat-value {
    font-size: 1.15rem;
  }

  .landing-hero-stat-label {
    font-size: 0.7rem;
  }
}

.report-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.report-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.report-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.report-tab-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.report-tab-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.ledger-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.ledger-accounts,
.ledger-detail {
  min-width: 0;
}

.ledger-accounts h3,
.ledger-detail h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
}

.ledger-account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.ledger-account-btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ledger-account-btn span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ledger-account-btn span:last-child {
  flex-shrink: 0;
}

.ledger-account-btn:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
}

.ledger-account-btn-active {
  background: var(--accent-light);
  border-color: #c7d2fe;
}

.ledger-account-btn-active:hover {
  background: #e0e7ff;
  border-color: #c7d2fe;
}

.ledger-entry-row-clickable {
  cursor: pointer;
}

.report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.report-columns > * {
  min-width: 0;
}

.report-columns--stacked {
  grid-template-columns: 1fr;
}

.report-columns .report-summary-panel {
  grid-column: 1 / -1;
}

.report-summary-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.report-net-result {
  margin: 0;
  font-size: 1.1rem;
}

.ledger-filters {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ledger-filters .form-field {
  min-width: 160px;
}

.ledger-filters .form-field input[type="date"] {
  min-width: 160px;
}

.date-filter-clear {
  margin-bottom: 10px;
}

.entry-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.entry-type-income {
  background: var(--success-bg);
  color: #065f46;
}

.entry-type-expense {
  background: var(--danger-bg);
  color: #991b1b;
}

.coa-setup-panel {
  margin-bottom: 20px;
  border: 1px solid #c7d2fe;
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.coa-setup-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.coa-setup-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

.coa-system-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #c7d2fe;
  color: #3730a3;
}

.coa-row-inactive {
  opacity: 0.6;
}

.coa-active-field .coa-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.account-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.account-type-asset {
  background: var(--accent-light);
  color: var(--accent);
}

.account-type-liability {
  background: var(--warning-bg);
  color: #b45309;
}

.account-type-equity {
  background: var(--accent-light);
  color: var(--accent);
}

.account-type-income {
  background: var(--success-bg);
  color: #065f46;
}

.account-type-expense {
  background: var(--danger-bg);
  color: #b91c1c;
}

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

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

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--muted);
}

.badge-info {
  background: var(--accent-light);
  color: var(--accent-hover);
}

.badge-secondary {
  background: var(--border-light);
  color: var(--muted);
}

.badge-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-role-owner {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-role-accountant {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-role-staff {
  background: var(--success-bg);
  color: #065f46;
}

.badge-role-viewer {
  background: #fef3c7;
  color: #92400e;
}

.badge-role-developer {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-status-draft {
  background: #e3eef3;
  color: #475569;
  border: 1px solid #b8d0e0;
}

.badge-status-filed {
  background: var(--warning-bg);
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-status-paid {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge--paid {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge--partial {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge--void {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

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

.data-table th {
  background: var(--border-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.sortable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.sortable:hover {
  background: var(--bg);
}

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

.data-table tbody tr:hover {
  background: rgba(238,242,255,0.6);
}

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



  .not-found {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    min-height: 60vh;
  }

  .not-found-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 48px;
    align-items: center;
    max-width: 960px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 48px;
  }

  .not-found-visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .not-found-receipt {
    position: relative;
    width: 320px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f9f9 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    overflow: hidden;
    font-size: 0.9rem;
    padding-bottom: 36px;
    clip-path: polygon(
      0% 0%, 100% 0%, 100% calc(100% - 16px),
      95% 100%, 90% calc(100% - 16px), 85% 100%,
      80% calc(100% - 16px), 75% 100%, 70% calc(100% - 16px),
      65% 100%, 60% calc(100% - 16px), 55% 100%,
      50% calc(100% - 16px), 45% 100%, 40% calc(100% - 16px),
      35% 100%, 30% calc(100% - 16px), 25% 100%,
      20% calc(100% - 16px), 15% 100%, 10% calc(100% - 16px),
      5% 100%, 0% 100%
    );
    animation: receipt-print 420ms ease-out;
    transform-origin: top center;
  }

  @keyframes receipt-print {
    from { transform: scaleY(0.4) translateY(-12px); opacity: 0; }
    to { transform: scaleY(1) translateY(0); opacity: 1; }
  }

  .not-found-receipt-stamp {
    position: absolute;
    top: 38%;
    right: 8%;
    font-family: monospace;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.15em;
    color: #c0392b;
    border: 3px solid #c0392b;
    border-radius: 6px;
    padding: 4px 14px;
    transform: rotate(-14deg) scale(1.4);
    opacity: 0;
    mix-blend-mode: multiply;
    animation: stamp-down 180ms ease-out 480ms forwards;
  }

  @keyframes stamp-down {
    0%   { opacity: 0; transform: rotate(-14deg) scale(2.2); }
    70%  { opacity: 0.85; transform: rotate(-14deg) scale(1.3); }
    100% { opacity: 0.85; transform: rotate(-14deg) scale(1.45); }
  }

  .not-found-receipt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #f4f9f9 0%, #e3eef3 100%);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
  }

  .not-found-receipt-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .not-found-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
  }

  .not-found-receipt-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .not-found-row {
    display: grid;
    grid-template-columns: 2fr 0.6fr 1fr;
    gap: 10px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
  }

  .not-found-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-weight: 500;
  }

  .not-found-row-muted {
    color: var(--muted);
    animation: row-fade 260ms ease-out both;
    animation-delay: var(--row-delay, 0ms);
  }

  @keyframes row-fade {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
  }

  .not-found-row-highlight {
    color: var(--text);
    font-weight: 600;
  }

  .not-found-row-total {
    color: var(--text);
    font-weight: 700;
    font-size: 0.85rem;
  }

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

  .not-found-receipt-footer {
    padding: 10px 18px 16px;
    border-top: 1px dashed var(--border);
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .not-found-recalculate {
    margin-top: 8px;
    border: 1px dashed currentColor;
    background: none;
    font: inherit;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 150ms ease, opacity 150ms ease;
  }

  .not-found-recalculate:hover {
    opacity: 1;
    transform: rotate(-2deg);
  }

  .not-found-text {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .not-found-text h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
  }

  .not-found-text p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 420px;
  }

  .not-found-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
  }

  .not-found-row-ticking span:last-child {
    font-variant-numeric: tabular-nums;
    animation: tick-pulse 1s ease-in-out infinite;
  }

  @keyframes tick-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
  }

  .not-found-receipt-barcode {
    height: 24px;
    margin: 10px 0 4px;
    background: repeating-linear-gradient(
      90deg,
      currentColor 0px, currentColor 2px,
      transparent 2px, transparent 4px,
      currentColor 4px, currentColor 5px,
      transparent 5px, transparent 9px
    );
    opacity: 0.55;
  }

  .not-found-scrap {
    position: absolute;
    bottom: 40px;
    left: 50%;
    width: 6px;
    height: 10px;
    background: currentColor;
    opacity: 0.6;
    border-radius: 1px;
    animation: scrap-fly 650ms ease-out forwards;
  }

  @keyframes scrap-fly {
    from {
      transform: translate(0, 0) rotate(0deg);
      opacity: 0.6;
    }
    to {
      transform: translate(var(--x), -34px) rotate(var(--rot));
      opacity: 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
   .not-found-receipt,
   .not-found-row-muted,
   .not-found-receipt-stamp,
   .not-found-row-ticking span:last-child,
   .not-found-scrap {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
  }

  @media (max-width: 860px) {
   .not-found-card {
      grid-template-columns: 1fr;
      justify-items: center;
      text-align: center;
      padding: 28px 20px;
    }

   .not-found-text p {
      max-width: 100%;
    }

   .not-found-actions {
      justify-content: center;
    }
  }

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

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

  .report-columns {
    grid-template-columns: 1fr;
  }

  .daily-grid {
    grid-template-columns: 1fr;
  }

  .account-type-badge {
    padding: 2px 6px;
    font-size: 0.7rem;
  }
}

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

.hide-mobile {
  display: none;
}

.chart-container {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-panel {
  min-width: 0;
}

.chart-panel-narrow {
  grid-column: span 1;
}

.chart-screen-notice {
  grid-column: 1 / -1;
  color: #dc2626;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
  display: none;
}

.chart-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.chart-tooltip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-tooltip-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-tooltip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-tooltip-name {
  flex: 1;
  color: var(--muted);
}

.chart-tooltip-value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.chart-tooltip-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.chart-legend {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  color: var(--muted);
  transition: opacity 0.2s ease;
}

.chart-legend-item:hover {
  opacity: 0.7;
}

.chart-legend-item-inactive {
  opacity: 0.35;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-legend-name {
  white-space: nowrap;
}

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

.chart-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chart-panel-action {
  flex-shrink: 0;
}

.chart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--muted);
}

.chart-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.chart-loading-text {
  font-size: 0.85rem;
}

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

.chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}

.chart-empty-icon {
  opacity: 0.4;
  color: var(--muted);
}

.chart-empty-text {
  margin: 0;
  font-size: 0.9rem;
}

.chart-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--danger);
  text-align: center;
}

.chart-error-icon {
  opacity: 0.6;
}

.chart-error-text {
  margin: 0;
  font-size: 0.9rem;
}

.chart-error-retry {
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.chart-error-retry:hover {
  background: #fecaca;
}

.chart-panel-wrapper {
  min-width: 0;
}

.chart-panel-wrapper--span-2 {
  grid-column: span 2;
}

.chart-panel-wrapper--span-3 {
  grid-column: span 3;
}

.chart-panel-wrapper--span-4 {
  grid-column: span 4;
}

.metric-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px) saturate(180%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card-clickable {
  cursor: pointer;
}

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

.metric-card-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.metric-card-value-error {
  color: var(--danger);
}

.metric-card-change {
  font-size: 0.8rem;
  font-weight: 500;
}

.metric-change-up {
  color: var(--success);
}

.metric-change-down {
  color: var(--danger);
}

.metric-change-neutral {
  color: var(--muted);
}

.metric-card-error {
  font-size: 0.75rem;
  color: var(--danger);
}

.trend-widget-chart {
  width: 100%;
  height: 120px;
}

.trend-sparkline {
  width: 100%;
  height: 100%;
  display: block;
}

.breakdown-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.breakdown-row-clickable {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.breakdown-row-clickable:hover {
  background: var(--bg-subtle);
}

.breakdown-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.breakdown-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  min-width: 40px;
}

.breakdown-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.breakdown-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}

.breakdown-percentage {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.ranking-widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-widget-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding: 4px 0;
}

.ranking-widget-item-clickable {
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.ranking-widget-item-clickable:hover {
  background: var(--bg-subtle);
}

.ranking-widget-rank {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.ranking-widget-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ranking-widget-primary {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}

.ranking-widget-secondary {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.summary-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-widget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.summary-widget-row:last-child {
  border-bottom: none;
}

.summary-widget-label {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.summary-widget-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

.summary-widget-change {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.summary-widget-change-up {
  color: var(--success);
}

.summary-widget-change-down {
  color: var(--danger);
}

.summary-widget-change-neutral {
  color: var(--muted);
}

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

.bi-dashboard-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.bi-dashboard-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.bi-dashboard-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .bi-dashboard-grid--3,
  .bi-dashboard-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bi-dashboard-grid--2,
  .bi-dashboard-grid--3,
  .bi-dashboard-grid--4 {
    grid-template-columns: 1fr;
  }
}

.kpi-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kpi-section {
  position: relative;
}

.kpi-section--primary .section-card {
  border-color: rgba(1, 171, 168, 0.18);
  box-shadow: 0 4px 24px rgba(1, 171, 168, 0.06);
}

.kpi-section-grid {
  display: grid;
  gap: 20px;
}

.kpi-section-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
  .kpi-section-grid--2 {
    grid-template-columns: 1fr;
  }
}

.kpi-grid {
  grid-template-columns: repeat(4, 1fr);
}

.kpi-grid .summary-card-row {
  grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

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

.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.kpi-change-up {
  color: var(--success);
  background: var(--success-bg);
}

.kpi-change-down {
  color: var(--danger);
  background: var(--danger-bg);
}

.metric-error {
  display: block;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 500;
}

.revenue-card {
  background: linear-gradient(135deg, rgba(230, 247, 246, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.expense-card {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.inventory-value-card {
  background: linear-gradient(135deg, rgba(230, 247, 246, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.inventory-quantity-card {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.low-stock-card {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.7) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.out-of-stock-card {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.6) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.inventory-trend {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.trend-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.trend-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.trend-mode-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.trend-mode-toggle button.active {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-height: 220px;
  overflow-x: auto;
}

.trend-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 28px;
}

.trend-bar-container {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar {
  width: 100%;
  max-width: 48px;
  background: var(--accent-gradient);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-height: 6px;
}

.trend-bar:hover {
  opacity: 0.85;
  transform: scaleX(1.04);
}

.trend-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.trend-bar:hover .trend-tooltip {
  opacity: 1;
}

.trend-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  word-break: keep-all;
  white-space: nowrap;
}

.warehouse-inventory h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.product-inventory-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: auto;
}

.table-controls {
  display: flex;
  justify-content: flex-end;
}

.rec-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.rec-filters-left {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  flex: 1;
  min-width: 220px;
}

.rec-filters-right {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
}

.rec-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.rec-filter-field input,
.rec-filter-field select {
  width: 100%;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rec-filter-field input:focus,
.rec-filter-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 171, 168, 0.12);
}

.table-search {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 0.875rem;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.table-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 171, 168, 0.12);
}

.table-search::placeholder {
  color: #94a3b8;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.table-pagination button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.table-pagination button:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
}

.table-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.status-warning {
  color: #92400e;
  background: #fffbeb;
}

.status-ok {
  color: #065f46;
  background: #ecfdf5;
}

.chart-loading,
.chart-error,
.chart-empty,
.table-loading,
.table-error,
.table-empty {
  color: var(--muted);
  text-align: center;
  padding: 32px 20px;
  font-size: 0.9rem;
}

.chart-error,
.table-error {
  color: var(--danger);
}

.revenue-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.expense-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.revenue-change-neutral {
  color: var(--muted);
  background: var(--bg-subtle);
}

.revenue-change-up {
  color: var(--success);
  background: var(--success-bg);
}

.revenue-change-down {
  color: var(--danger);
  background: var(--danger-bg);
}

.expense-change-neutral {
  color: var(--muted);
  background: var(--bg-subtle);
}

.expense-change-up {
  color: var(--danger);
  background: var(--danger-bg);
}

.expense-change-down {
  color: var(--success);
  background: var(--success-bg);
}

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

.comparison-current,
.comparison-previous,
.comparison-change {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  text-align: center;
}

.comparison-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.comparison-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  word-break: break-word;
}

.comparison-up {
  color: var(--success);
}

.comparison-down {
  color: var(--danger);
}

.comparison-neutral {
  color: var(--muted);
}

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

.bi-section-gap {
  margin-top: 24px;
}

.receivables-card {
  background: rgba(255, 248, 247, 0.9);
}

.receivables-value {
  font-size: 1.5rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.receivables-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.receivables-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.receivables-badge-overdue {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.receivables-badge-due-today {
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.overdue-summary {
  border: none;
  background: rgba(255, 248, 247, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.overdue-summary-title,
.aging-summary-title,
.customer-balances-title,
.receivables-trend-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.overdue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overdue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.overdue-row:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--border);
}

.overdue-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.overdue-amount {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--text);
}

.overdue-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.overdue-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.overdue-total-amount {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: #b91c1c;
}

.receivables-aging {
  border: none;
  background: rgba(255, 248, 247, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.aging-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aging-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px;
  align-items: center;
  gap: 12px;
}

.aging-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.aging-amount {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--text);
}

.aging-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.aging-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(248, 113, 113, 0.8));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.aging-percentage {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.customer-balances {
  border: none;
}

.customer-balances-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.customer-balances-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customer-balances-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.customer-balances-row:hover {
  background: var(--bg-subtle);
}

.customer-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.customer-amount {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
}

.customer-overdue {
  font-size: 0.8rem;
  font-weight: 500;
  color: #b91c1c;
  white-space: nowrap;
}

.receivables-trend {
  border: none;
}

.receivables-trend-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.overdue-current {
  border-left: 2px solid transparent;
}

.overdue-1-30 {
  border-left: 2px solid rgba(245, 158, 11, 0.35);
}

.overdue-31-60 {
  border-left: 2px solid rgba(251, 146, 60, 0.4);
}

.overdue-61-90 {
  border-left: 2px solid rgba(239, 68, 68, 0.5);
}

.overdue-90-plus {
  border-left: 2px solid rgba(220, 38, 38, 0.6);
}

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

  .bi-bottom-grid {
    grid-template-columns: 1fr;
  }

  .aging-row {
    grid-template-columns: 80px 1fr 60px;
    gap: 8px;
  }

  .customer-balances-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .receivables-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.kpi-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.kpi-card-link:hover {
  text-decoration: none;
}

.kpi-card-link:hover .summary-value {
  color: var(--accent);
}

.kpi-empty {
  text-align: center;
  padding: 48px 24px;
}

.kpi-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ledger-search-field {
  min-width: 100%;
}

.taskbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.taskbar-mobile-toggle svg {
  display: block;
}

.taskbar-nav-open {
  display: flex !important;
}

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

  .daily-grid {
    grid-template-columns: 1fr;
  }

  .landing-preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .ledger-account-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .account-type-badge {
    padding: 2px 8px;
    font-size: 0.7rem;
  }

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

  .modal-backdrop {
    padding: 20px;
  }

  .modal-card {
    padding: 24px 20px;
  }

  .login-card,
  .signup-card {
    padding: 24px 20px;
    max-width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    width: 100%;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .chart-screen-notice {
    display: block;
  }

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

  .ledger-accounts {
    max-height: 40vh;
  }

  .ledger-account-list {
    max-height: calc(40vh - 50px);
  }

  .ledger-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-preview-body {
    grid-template-columns: 1fr;
  }

  .landing-preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-preview-sidebar {
    display: none;
  }

  .nepali-date-fields {
    grid-template-columns: repeat(3, 1fr);
  }

  .day-stepper {
    flex-wrap: wrap;
  }

  .search-field input,
  .search-field select,
  .search-field textarea {
    min-width: 100%;
  }

  .organization-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions {
    flex-direction: column;
  }

  .policy-header {
    flex-wrap: wrap;
  }

  .aging-table-desktop {
    display: none;
  }

  .aging-cards-mobile {
    display: block;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 16px;
  }

  .page-title {
    font-size: 1.25rem;
  }

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

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

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td,
  .transaction-table th,
  .transaction-table td {
    padding: 8px 10px;
  }

  .hide-mobile {
    display: none;
  }

  .aging-card {
    padding: 12px;
    gap: 8px;
  }

  .aging-card-org {
    font-size: 0.85rem;
  }

  .aging-card-outstanding {
    font-size: 0.85rem;
  }

  .aging-card-meta {
    font-size: 0.75rem;
    gap: 12px;
  }

  .aging-card-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .aging-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .aging-card-label {
    font-size: 0.7rem;
  }

  .aging-card-value {
    font-size: 0.8rem;
  }

  .taskbar-nav {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 200;
  }

  .taskbar-nav-open {
    display: flex !important;
  }

  .taskbar-nav-row {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .taskbar-link,
  .taskbar-link-group {
    width: 100%;
    border-radius: var(--radius-xs);
    padding: 10px 12px;
  }

  .taskbar-link-icon {
    display: inline-flex;
  }

  .taskbar-mobile-toggle {
    display: inline-flex;
  }

  .taskbar-fy-trigger {
    display: none;
  }

  .page-actions {
    width: 100%;
    gap: 8px;
  }

  .page-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .daily-actions-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
  }

  .daily-date-picker {
    min-width: 100%;
  }

  .section-card {
    padding: 16px;
  }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

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

.card + .card {
  margin-top: 16px;
}

.panel {
    padding: 18px;
  }

  .panel-narrow {
    max-width: 100%;
  }

  .page-centered {
    margin: 16px auto;
    padding: 0 16px;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-value {
    font-size: 1rem;
  }

  .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pagination-controls {
    justify-content: center;
  }

  .not-found-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 16px;
  }

  .not-found-visual {
    display: none;
  }

  .landing {
    padding: 24px 16px 48px;
  }

  .landing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
  }

  .landing-hero {
    padding: 24px 16px;
  }

  .landing-hero h2 {
    font-size: 1.5rem;
  }

  .landing-hero p {
    font-size: 0.95rem;
  }

  .landing-brand h1 {
    font-size: 1.75rem;
  }

  .landing-preview-body {
    grid-template-columns: 1fr;
  }

  .landing-preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .select-company-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .modal-card {
    padding: 20px 16px;
  }

  .login-card,
  .signup-card {
    padding: 20px 16px;
    max-width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    width: 100%;
  }

  .daily-actions-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .report-columns {
    grid-template-columns: 1fr;
  }

  .ledger-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-preview-body {
    grid-template-columns: 1fr;
  }

  .landing-preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-preview-sidebar {
    display: none;
  }

  .nepali-date-fields {
    grid-template-columns: repeat(3, 1fr);
  }

  .day-stepper {
    flex-wrap: wrap;
  }

  .search-field input,
  .search-field select,
  .search-field textarea {
    min-width: 100%;
  }

  .organization-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions {
    flex-direction: column;
  }

  .policy-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .landing-preview-cards {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

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

  .not-found-card {
    padding: 16px 12px;
  }

  .landing-brand h1 {
    font-size: 1.5rem;
  }

  .landing-hero h2 {
    font-size: 1.3rem;
  }

  .ledger-account-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .ledger-accounts {
    max-height: 35vh;
  }

  .ledger-account-list {
    max-height: calc(35vh - 40px);
  }

  .account-type-badge {
    padding: 1px 6px;
    font-size: 0.65rem;
  }
}

@media (max-width: 375px) {
  .page-title {
    font-size: 1.1rem;
  }

  .landing-hero h2 {
    font-size: 1.3rem;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 6px 8px;
  }

  .aging-card {
    padding: 10px;
    gap: 6px;
  }

  .aging-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .aging-card-right {
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .aging-card-outstanding {
    font-size: 0.8rem;
  }

  .aging-card-badge {
    margin-top: 0;
  }

  .aging-card-org {
    font-size: 0.8rem;
  }

  .aging-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .aging-card-label {
    font-size: 0.65rem;
  }

  .aging-card-value {
    font-size: 0.75rem;
  }

  .aging-card-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-bar .input {
  min-width: 160px;
  flex: 1 1 auto;
}

.import-history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-select {
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-select:hover:not(:focus) {
  border-color: #cbd5e1;
}

.input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input::placeholder {
  color: #94a3b8;
}

.audit-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.audit-search-row {
  position: relative;
}

.audit-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.audit-filters .input-full {
  width: 100%;
  padding-left: 40px;
  font-size: 0.95rem;
}

.audit-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}

.audit-filter-actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  text-align: right;
  word-break: break-word;
  flex: 1 1 auto;
}

.table-cell-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.code-old {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.code-new {
  background: var(--success-bg);
  color: var(--success);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.json-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 4px 0 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--bg-subtle);
}

.audit-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.audit-search-row {
  width: 100%;
}

.audit-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.audit-filter-actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.audit-table {
  table-layout: auto;
}

.audit-table th {
  white-space: nowrap;
}

.audit-cell-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.audit-cell-event {
  font-size: 0.8rem;
  color: var(--muted);
}

.audit-cell-changes {
  white-space: nowrap;
}

.audit-no-changes {
  color: var(--muted);
  font-style: italic;
}

.audit-record {
  font-weight: 500;
  color: var(--text);
}

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

.audit-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.audit-badge-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.audit-badge-warning {
  background: var(--warning-bg);
  color: #b45309;
  border: 1px solid #fde68a;
}

.audit-badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.audit-badge-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.audit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.audit-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.audit-modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.audit-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.audit-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.audit-detail-item-wide {
  grid-column: 1 / -1;
}

.audit-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.audit-detail-value {
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

.audit-changes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-section-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.audit-changes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.audit-change-field {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.audit-change-values {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-change-arrow {
  color: var(--muted);
  font-size: 0.85rem;
}

.audit-code-old {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border: 1px solid #fecaca;
}

.audit-code-new {
  background: var(--success-bg);
  color: #065f46;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border: 1px solid #a7f3d0;
}

.audit-json-details {
  margin-top: 4px;
}

.audit-json-summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  user-select: none;
}

.audit-json-summary:hover {
  color: var(--accent-hover);
}

.audit-json-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.audit-json-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 12px;
  overflow-x: auto;
}

.audit-json-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.audit-json-block pre {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-card-audit {
  max-width: 680px;
}

.import-upload {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  background: var(--bg-subtle);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.import-dropzone:hover,
.import-dropzone-active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.import-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  color: var(--accent);
}

.import-dropzone-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.import-dropzone-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.import-file-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--accent-light);
  border: 1px solid #c7d2fe;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}

.import-file-remove {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  line-height: 0;
  transition: color 0.15s;
}

.import-file-remove:hover {
  color: var(--danger);
}

.column-mapping {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mapping-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mapping-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--border-light);
  border-bottom: 1px solid var(--border);
}

.mapping-header > div {
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.mapping-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
}

.mapping-row:last-child {
  border-bottom: none;
}

.mapping-source {
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: center;
}

.mapping-source input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.mapping-row select {
  border: none;
  border-radius: 0;
  background: transparent;
}

.mapping-row select:focus {
  box-shadow: none;
  border-radius: 0;
}

.mapping-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mapping-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mapping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--border-light);
  color: var(--muted);
  border: 1px solid var(--border);
}

.mapping-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.import-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.stat-valid {
  color: var(--success);
}

.stat-warning {
  color: #b45309;
}

.stat-error {
  color: var(--danger);
}

.preview-errors {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview-errors summary {
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-subtle);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.preview-errors summary::-webkit-details-marker {
  display: none;
}

.preview-errors summary:hover {
  background: var(--border-light);
}

.preview-errors summary::after {
  content: '▾';
  font-size: 0.75rem;
  margin-left: auto;
  transition: transform 0.2s;
}

.preview-errors[open] summary::after {
  transform: rotate(180deg);
}

.error-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-item {
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  font-size: 0.875rem;
}

.error-item strong {
  color: #991b1b;
  font-weight: 600;
}

.error-item ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.error-item li {
  margin-bottom: 3px;
  color: #991b1b;
}

.error-item li.warning {
  color: #b45309;
}

.import-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 300ms ease-out;
}

.progress-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.import-result-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius);
  animation: importResultIn 380ms ease-out;
  border: 1px solid transparent;
}

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

.import-success {
  background: var(--success-bg);
  border-color: #a7f3d0;
}

.import-error {
  background: var(--danger-bg);
  border-color: #fecaca;
}

.import-result-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.import-result-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-success {
  background: #d1fae5;
  color: #065f46;
}

.icon-error {
  background: #fee2e2;
  color: #991b1b;
}

.import-result-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.import-success .import-result-header h3 {
  color: #065f46;
}

.import-error .import-result-header h3 {
  color: #991b1b;
}

.import-result-subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.import-result-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.import-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

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

.import-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.import-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-valid {
  color: #059669;
}

.stat-imported {
  color: var(--accent);
}

.stat-error {
  color: #dc2626;
}

.import-result-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.5;
}

.import-result-notice p {
  margin: 0;
}

.import-result-errors {
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.import-result-errors summary {
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #991b1b;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 160ms ease;
}

.import-result-errors summary::-webkit-details-marker {
  display: none;
}

.import-result-errors summary::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 200ms ease;
  margin-bottom: 3px;
}

.import-result-errors[open] summary::before {
  transform: rotate(45deg);
}

.import-result-errors .error-list {
  border-top: 1px solid var(--border-light);
  padding: 10px 14px;
  max-height: 260px;
  overflow-y: auto;
}

.import-result-errors .error-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.import-result-errors .error-item:last-child {
  border-bottom: none;
}

.import-result-errors .error-item ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.import-result-errors .error-item li {
  margin-bottom: 2px;
}

.import-result-errors .error-item li.warning {
  color: #b45309;
}

.import-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

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

@media (max-width: 480px) {
  .import-result-stats {
    grid-template-columns: 1fr;
  }

  .import-result-header {
    flex-direction: column;
    text-align: center;
  }
}

.import-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.import-help strong {
  color: var(--text);
}

.import-help ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.import-help li {
  margin-bottom: 3px;
}

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

  .import-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-header,
  .mapping-row {
    grid-template-columns: 1fr;
  }

  .mapping-source {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .mapping-row select {
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .preview-stats {
    grid-template-columns: 1fr;
  }

  .import-result-stats {
    grid-template-columns: 1fr;
  }
}

.invoice-new-page {
  max-width: 1400px;
}

.invoice-new-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.invoice-new-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-new-summary {
  position: sticky;
  top: 20px;
}

.customer-search {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.customer-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-width: 400px;
}

.customer-clear {
  flex-shrink: 0;
}

.customer-results {
  margin-top: 8px;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
}

.customer-result-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.customer-result-item:hover,
.customer-result-item-active {
  background: var(--accent-light);
}

.customer-result-name {
  font-weight: 600;
}

.customer-result-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.customer-result-create {
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
  padding-top: 8px;
}

.customer-details {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--border-light);
}

.customer-details-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
}

.customer-details-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.customer-details-meta span {
  font-weight: 500;
  color: var(--muted);
  margin-right: 4px;
}

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

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

.invoice-items-table .input-number {
  width: 80px;
  text-align: right;
}

.invoice-items-table td {
  vertical-align: top;
}

.discount-field {
  display: flex;
  gap: 4px;
  align-items: center;
}

.discount-field input {
  width: 80px;
  text-align: right;
}

.discount-type-select {
  width: 60px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.line-calculations {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.line-calculation {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--border-light);
  min-width: 160px;
  flex: 1;
}

.line-calculation-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-calculation-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.line-calculation-row--total {
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 2px;
}

.invoice-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.invoice-totals-row--divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.invoice-totals-row--gross {
  font-weight: 500;
  color: var(--text);
}

.invoice-totals-row--total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  border-top: 2px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.tds-preview {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tds-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.tds-preview-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: var(--muted);
}

.tds-preview-value {
  font-weight: 600;
  font-size: 0.875rem;
}

.tds-preview-value--applicable {
  color: var(--success);
}

.tds-preview-value--not-applicable {
  color: var(--muted);
}

.tds-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.tds-preview-row--total {
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 4px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.search-field-input--muted {
  background: var(--border-light);
  color: var(--muted);
  cursor: not-allowed;
}

.search-field-input--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.autocomplete-list--inline {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .invoice-new-grid {
    grid-template-columns: 1fr;
  }

  .invoice-new-summary {
    position: static;
  }

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

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

@media (max-width: 640px) {
  .invoice-items-table {
    min-width: 800px;
  }

  .line-calculations {
    flex-direction: column;
  }

  .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .search-field input,
  .search-field select,
  .search-field textarea {
    min-width: 100%;
  }
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-filter-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2px;
}

.report-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(220, 38, 38, 0.15);
  transform: none;
  filter: none;
}

.btn-ghost:active:not(:disabled) {
  transform: none;
}

@media (max-width: 1024px) {
  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.summary-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.workflow-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.approval-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.approval-history-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.approval-history-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--muted);
}

.approval-history-dot--approved {
  background: var(--success);
}

.approval-history-dot--rejected {
  background: var(--danger);
}

.approval-history-dot--submitted {
  background: var(--accent);
}

.approval-history-dot--resubmitted {
  background: var(--accent);
}

.approval-history-dot--cancelled {
  background: var(--muted);
}

.approval-history-content {
  flex: 1;
  min-width: 0;
}

.approval-history-action {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 2px;
}

.approval-history-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.approval-history-comment {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
  font-style: italic;
}

.taskbar-notification-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.taskbar-notification-btn:hover {
  background: var(--bg-subtle);
}

.taskbar-notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.taskbar-notification-dropdown {
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
}

.taskbar-notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.taskbar-notification-header strong {
  font-size: 0.95rem;
}

.taskbar-notification-mark-all {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.taskbar-notification-mark-all:hover {
  text-decoration: underline;
}

.taskbar-notification-list {
  max-height: 360px;
  overflow-y: auto;
}

.taskbar-notification-empty {
  padding: 16px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.taskbar-notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-light);
}

.taskbar-notification-item:hover {
  background: var(--bg-subtle);
}

.taskbar-notification-item-unread {
  background: var(--accent-light);
}

.taskbar-notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-top: 6px;
  flex-shrink: 0;
}

.taskbar-notification-item-unread .taskbar-notification-dot {
  background: var(--accent);
}

.taskbar-notification-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.taskbar-notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.taskbar-notification-message {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.taskbar-notification-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.taskbar-notification-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.taskbar-notification-footer a {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.taskbar-notification-footer a:hover {
  text-decoration: underline;
}

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

.notifications-filters {
  display: flex;
  gap: 8px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: box-shadow 0.15s ease;
}

.notification-item:hover {
  box-shadow: var(--shadow-sm);
}

.notification-item-unread {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
}

.notification-item-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 6px;
  flex-shrink: 0;
}

.notification-dot-active {
  background: var(--accent);
}

.notification-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notification-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.notification-item-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notification-item-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.notification-item-type {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.notification-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.preferences-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preference-category-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.preference-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.preference-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.preference-toggles {
  display: flex;
  gap: 16px;
  align-items: center;
}

.preference-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.preference-toggle input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.preference-toggle-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preference-toggle-disabled input[type='checkbox'] {
  cursor: not-allowed;
}

.loading-text {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.banner-success {
  background: var(--success-bg);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.activity-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-timeline-content {
  flex: 1;
  min-width: 0;
}

.activity-timeline-title {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.activity-timeline-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 2px;
}

.activity-timeline-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.activity-timeline-actor {
  font-weight: 500;
}

.activity-timeline-separator {
  opacity: 0.5;
}

.activity-timeline-time {
  opacity: 0.8;
}

.activity-timeline-details {
  margin-top: 8px;
}

.activity-timeline-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.activity-timeline-metadata {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 8px;
  margin-top: 6px;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-timeline-load-more {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.style-settings-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .style-settings-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrap input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.color-input-wrap input[type="text"] {
  flex: 1;
}

.style-preview {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--preview-font, inherit);
}

.style-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.style-preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--preview-radius, var(--radius-sm));
  background: var(--preview-brand, var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.style-preview-name {
  font-weight: 600;
  color: var(--text);
}

.style-preview-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.style-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.style-preview-btn {
  border: none;
  border-radius: var(--preview-radius, var(--radius-sm));
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}

.style-preview-btn-primary {
  background: var(--preview-brand, var(--accent));
  color: #fff;
}

.style-preview-btn-secondary {
  background: var(--preview-secondary, var(--accent-hover));
  color: #fff;
}

.style-preview-btn-ghost {
  background: transparent;
  color: var(--preview-brand, var(--accent));
  border: 1px solid var(--border);
}

.style-preview-card {
  border: 1px solid var(--border-light);
  border-radius: var(--preview-radius, var(--radius-sm));
  padding: 16px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.style-preview-card-title {
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.style-preview-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.style-preview-card-row strong {
  color: var(--text);
}

.style-preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
}

.style-preview-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.style-preview-inputs input,
.style-preview-inputs select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--preview-radius, var(--radius-sm));
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 1024px) {
  .settings-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border: 1px solid transparent;
}

.settings-nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.settings-nav-link-active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(1, 171, 168, 0.25);
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-content .section-card {
  max-width: 900px;
}

.bg-blue-600 {
  background: #2563eb;
}

.bg-blue-700 {
  background: #1d4ed8;
}

.hover\:bg-blue-700:hover {
  background: #1d4ed8;
}

.overflow-hidden {
  overflow: hidden;
}

.hover\:text-blue-800:hover {
  color: #1e40af;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

.hover\:text-yellow-800:hover {
  color: #92400e;
}

.hover\:text-red-800:hover {
  color: #991b1b;
}

.hover\:text-green-800:hover {
  color: #064e3b;
}

/* BI Dashboard filter bar and layout */
.global-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-bar-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-bar-row + .filter-bar-row {
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.filter-preset-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 140px;
}

.filter-preset-menu .form-field {
  min-width: 140px;
}

.filter-preset-menu .form-field select {
  width: 100%;
}

.date-range-selector {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: end;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(1, 171, 168, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip-clear {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.filter-chip-clear:hover {
  opacity: 1;
}

.bi-section-title {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 4px 0 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.bi-placeholder-card {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.bi-dashboard-grid {
  gap: 20px;
}

/* Sales BI page specific styles */
.sales-bi-hero {
  background: linear-gradient(135deg, rgba(1, 171, 168, 0.06) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid rgba(1, 171, 168, 0.15);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 24px rgba(1, 171, 168, 0.06);
}

.sales-bi-hero .summary-card {
  box-shadow: none;
  border: none;
  background: transparent;
  backdrop-filter: none;
}

.sales-bi-hero .summary-card:hover {
  box-shadow: none;
  transform: none;
}

.sales-bi-hero .summary-label {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.sales-bi-hero .summary-value {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.sales-bi-hero .sales-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sales-bi-hero .sales-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.sales-bi-section {
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 12px rgba(7, 33, 68, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sales-bi-section:hover {
  box-shadow: 0 6px 20px rgba(7, 33, 68, 0.08);
  transform: translateY(-1px);
}

.sales-bi-section .section-card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
}

.sales-bi-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.sales-bi-grid-2 > * {
  min-width: 0;
}

@media (max-width: 1024px) {
  .sales-bi-grid-2 {
    grid-template-columns: 1fr;
  }
}

.sales-bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.sales-bi-table th,
.sales-bi-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.sales-bi-table th {
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sales-bi-table tbody tr {
  transition: background 0.15s ease;
}

.sales-bi-table tbody tr:hover {
  background: var(--bg-subtle);
}

.sales-bi-table tbody tr:last-child td {
  border-bottom: none;
}

.sales-bi-table .amount-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.sales-bi-table .qty-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

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

.sales-comparison-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sales-comparison-card:hover {
  background: var(--border-light);
  border-color: var(--border);
}

.sales-comparison-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sales-comparison-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  word-break: break-word;
}

.sales-comparison-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.sales-comparison-change-up {
  color: var(--success);
  background: var(--success-bg);
}

.sales-comparison-change-down {
  color: var(--danger);
  background: var(--danger-bg);
}

.sales-comparison-change-neutral {
  color: var(--muted);
  background: var(--bg-subtle);
}

@media (max-width: 768px) {
  .sales-comparison-grid {
    grid-template-columns: 1fr;
  }

  .sales-bi-hero .summary-value {
    font-size: 1.5rem;
  }

  .sales-bi-hero {
    padding: 16px;
  }
}

.sales-mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sales-mini-card:hover {
  background: var(--border-light);
  border-color: var(--border);
}

.sales-mini-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sales-mini-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  word-break: break-word;
}

.sales-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .sales-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sales-bi-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}

.customer-receipt-page {
  max-width: 1400px;
}

.customer-receipt-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.customer-receipt-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customer-receipt-summary {
  position: sticky;
  top: 20px;
}

.receipt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.receipt-totals-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.receipt-totals-row--divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.receipt-totals-value--remaining {
  color: var(--accent);
}

.allocation-input {
  width: 160px;
  text-align: right;
}

.outstanding-invoices-table .allocation-input {
  width: 160px;
  text-align: right;
}

@media (max-width: 1024px) {
  .customer-receipt-grid {
    grid-template-columns: 1fr;
  }

  .customer-receipt-summary {
    position: static;
  }
}

/* Invoice Status Dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--draft {
  background: #94a3b8;
}

.status-dot--confirmed {
  background: var(--accent);
}

.status-dot--posted {
  background: #3b82f6;
}

.status-dot--partially_paid {
  background: var(--warning);
}

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

.status-dot--cancelled,
.status-dot--void {
  background: var(--danger);
}

.status-dot--unpaid {
  background: #94a3b8;
}

.status-dot--overdue {
  background: var(--danger);
}

.status-dot--none {
  background: #e2e8f0;
}

/* Invoice Status Indicator */
.invoice-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Invoice Status Grid */
.invoice-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Invoice Detail Header */
.invoice-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-header-number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Invoice Customer */
.invoice-customer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.invoice-customer-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.invoice-customer-address {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.invoice-customer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.invoice-customer-meta span {
  font-weight: 500;
  color: var(--muted);
}

/* Invoice Meta Grid */
.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.invoice-meta-grid--single {
  grid-template-columns: 1fr;
}

.invoice-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-meta-item span:first-child {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invoice-meta-item span:last-child {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.invoice-meta-item--wide {
  grid-column: 1 / -1;
}

/* Invoice Totals */
.invoice-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
}

.invoice-totals-row--divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
  padding-top: 10px;
}

.invoice-totals-row--gross {
  font-weight: 600;
  font-size: 1rem;
}

.invoice-totals-row--total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.invoice-totals-row--balance {
  font-weight: 600;
  color: var(--accent);
}

/* Invoice Detail Grid */
.invoice-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* Action Button Group */
.action-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.action-group--primary {
  gap: 10px;
}

.action-group--secondary {
  gap: 8px;
}

.action-group--danger {
  margin-left: auto;
}

/* Invoice Filters */
.invoice-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.invoice-filters .search-field {
  flex: 1;
  min-width: 160px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.summary-cards--half {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.summary-card-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-card-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.amount-high {
  color: var(--danger);
}

.amount-low {
  color: var(--success);
}

/* Invoice Table Enhancements */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.invoice-table th,
.invoice-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.invoice-table th {
  background: var(--border-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invoice-table tbody tr {
  transition: background 0.15s ease;
}

.invoice-table tbody tr:hover {
  background: var(--border-light);
}

.invoice-table .table-cell-strong {
  font-weight: 600;
  color: var(--text);
}

/* Responsive */
@media (max-width: 1024px) {
  .invoice-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .invoice-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .invoice-new-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .invoice-meta-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .invoice-filters {
    flex-direction: column;
  }

  .invoice-filters .search-field {
    width: 100%;
    min-width: auto;
  }
}

/* Invoice Form Enhancements */
.invoice-form-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.invoice-form-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.invoice-form-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-items-table .input-number {
  width: 90px;
  text-align: right;
}

.invoice-items-table .input-select {
  width: 120px;
}

.invoice-items-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.invoice-items-table .item-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Empty state for tables */
.empty-state {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 24px;
}

/* Loading state */
.loading {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-size: 0.95rem;
}

/* Button Enhancements */
.btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-group--primary {
  gap: 10px;
}

.btn-group--secondary {
  gap: 8px;
}

/* Action bar in detail pages */
.invoice-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.invoice-action-bar .action-group {
  margin-left: auto;
}

/* Payment Progress */
.payment-progress {
  margin-top: 16px;
}

.payment-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.payment-progress-bar {
  background: var(--border-color, var(--border));
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.payment-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.payment-progress-fill--partial {
  background: var(--warning);
}

.payment-progress-fill--overdue {
  background: var(--danger);
}

.payment-progress-footer {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dev-portal {
  display: flex;
  min-height: 100vh;
  background: #f4f7f9;
}

.dev-portal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: #072144;
}

.dev-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #01aba8 0%, #00705f 55%, #003c32 100%);
  color: #fff;
  z-index: 100;
}

.dev-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.dev-sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}

.dev-sidebar-title {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.dev-sidebar-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.dev-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.dev-nav-section {
  margin-bottom: 18px;
}

.dev-nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  padding: 0 8px 6px;
}

.dev-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.dev-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dev-nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

.dev-nav-icon {
  display: flex;
  width: 18px;
  height: 18px;
  flex: none;
}

.dev-nav-icon svg {
  width: 18px;
  height: 18px;
}

.dev-sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.dev-user-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.dev-user-name {
  font-size: 13px;
  font-weight: 600;
}

.dev-user-phone {
  font-size: 11.5px;
  opacity: 0.7;
}

.dev-logout-btn {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dev-logout-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dev-main {
  flex: 1;
  margin-left: 250px;
  padding: 24px 28px 40px;
  min-width: 0;
}

@media (max-width: 860px) {
  .dev-sidebar {
    width: 200px;
  }
  .dev-main {
    margin-left: 200px;
    padding: 16px;
  }
}
