.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 0 0 auto;
  width: 264px;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 30% -10%, rgba(19, 163, 145, 0.16), transparent 30%),
    var(--brand-950);
}

.brand {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 9px;
  border-radius: 12px;
  background: var(--accent-500);
  box-shadow: 0 8px 20px rgba(19, 163, 145, 0.22);
}

.brand-mark i {
  width: 4px;
  display: block;
  border-radius: 4px;
  background: #fff;
}

.brand-mark i:nth-child(1) { height: 10px; opacity: 0.76; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 14px; opacity: 0.88; }

.brand-copy {
  display: grid;
}

.brand-copy strong {
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
}

.brand-copy small {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.business-switcher {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  padding: 10px;
  color: inherit;
  text-align: right;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: background var(--motion-ui), border-color var(--motion-ui);
}

.business-switcher:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.business-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--brand-950);
  border-radius: 10px;
  background: var(--sand-200);
  font-weight: 700;
}

.business-switcher span:nth-child(2),
.profile-card span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.business-switcher strong,
.profile-card strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-switcher small,
.profile-card small {
  color: rgba(255, 255, 255, 0.49);
  font-size: 11px;
}

.business-switcher .icon {
  width: 16px;
  height: 16px;
}

.main-nav {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.nav-label {
  margin: 0 10px 8px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  font-weight: 600;
}

.nav-label-section {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-item {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.68);
  text-align: right;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  transition: background var(--motion-ui), color var(--motion-ui), transform var(--motion-fast);
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 12px 0 12px auto;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-500);
  opacity: 0;
  transform: scaleY(0.5);
  transition: opacity var(--motion-ui), transform var(--motion-ui);
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item:active { transform: scale(0.985); }

.nav-item.active {
  color: #fff;
  background: rgba(19, 163, 145, 0.13);
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-item .icon {
  width: 19px;
  height: 19px;
}

.nav-item span:nth-child(2) {
  flex: 1;
}

.nav-count {
  min-width: 23px;
  height: 22px;
  display: grid;
  place-items: center;
  padding-inline: 6px;
  color: var(--accent-100);
  border-radius: var(--radius-round);
  background: rgba(19, 163, 145, 0.18);
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2a64f;
  box-shadow: 0 0 0 3px rgba(226, 166, 79, 0.12);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  flex: 0 0 auto;
  padding-top: 10px;
}

.plan-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(234, 223, 201, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(234, 223, 201, 0.1), rgba(255, 255, 255, 0.03));
}

.plan-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #f0c77f;
  border-radius: 10px;
  background: rgba(240, 199, 127, 0.11);
}

.plan-icon .icon { width: 17px; height: 17px; }
.plan-card div { display: grid; }
.plan-card strong { color: #f6ead4; font-size: 12px; }
.plan-card small { color: rgba(255, 255, 255, 0.43); font-size: 10px; }

.profile-card {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: inherit;
  text-align: right;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

.profile-card:hover { background: rgba(255, 255, 255, 0.05); }

.profile-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
}

.profile-card .icon { width: 17px; }

.workspace {
  min-height: 100vh;
  margin-right: 264px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 0 32px;
  background: rgba(245, 246, 242, 0.88);
  border-bottom: 1px solid rgba(214, 220, 219, 0.72);
  backdrop-filter: blur(14px);
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 500;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

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

.search-trigger {
  width: 250px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--ink-500);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.search-trigger:hover {
  color: var(--ink-700);
  border-color: var(--ink-200);
  background: var(--surface);
}

.search-trigger span {
  flex: 1;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-trigger .icon { width: 18px; height: 18px; }

kbd {
  min-width: 33px;
  padding: 2px 6px;
  color: var(--ink-500);
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  background: var(--ink-50);
  font-family: inherit;
  font-size: 10px;
  direction: ltr;
}

.notification-button { position: relative; }
.notification-button i {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--red-700);
}

.mobile-menu { display: none; }

#appMain {
  width: min(100%, 1540px);
  margin-inline: auto;
  padding: 28px 32px 48px;
}

.view-enter {
  animation: view-enter var(--motion-enter) var(--ease-standard) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-strip,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.welcome-strip h2,
.page-heading h2 {
  margin: 0 0 5px;
  font-size: clamp(22px, 2.4vw, 29px);
  line-height: 1.35;
  letter-spacing: -0.4px;
}

.welcome-strip p,
.page-heading p {
  margin: 0;
  color: var(--ink-600);
}

.date-filter,
.filter-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink-700);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}

.date-filter:hover,
.filter-button:hover { border-color: var(--ink-300); background: var(--ink-50); }
.date-filter .icon,
.filter-button .icon { width: 17px; height: 17px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-height: 145px;
  padding: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--motion-ui), box-shadow var(--motion-ui), border-color var(--motion-ui);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-200);
  box-shadow: var(--shadow-sm);
}

.metric-card.featured {
  color: #fff;
  border-color: var(--brand-900);
  background:
    radial-gradient(circle at 0 0, rgba(19, 163, 145, 0.22), transparent 36%),
    var(--brand-900);
}

.metric-card::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -18px;
  width: 90px;
  height: 90px;
  border: 18px solid rgba(19, 163, 145, 0.08);
  border-radius: 50%;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 500;
}

.featured .metric-label { color: rgba(255, 255, 255, 0.67); }

.metric-help {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  border-radius: 9px;
  background: var(--ink-50);
}

.featured .metric-help { color: var(--accent-100); background: rgba(255, 255, 255, 0.08); }
.metric-help .icon { width: 15px; height: 15px; }

.metric-value {
  margin: 18px 0 9px;
  font-size: clamp(23px, 2.3vw, 30px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.4px;
}

.metric-value small {
  margin-right: 3px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 500;
}

.featured .metric-value small { color: rgba(255, 255, 255, 0.55); }

.metric-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 11px;
}

.metric-change {
  color: var(--accent-700);
  font-weight: 700;
}

.metric-change.down { color: var(--red-700); }
.featured .metric-change { color: #7ee3d4; }
.featured .metric-foot { color: rgba(255, 255, 255, 0.53); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-card { min-height: 382px; }

.chart-card .card-header {
  border-bottom: 0;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--ink-50);
}

.segmented-button {
  min-width: 50px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink-500);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.segmented-button.active {
  color: var(--brand-900);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.chart-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 22px 0;
}

.chart-summary strong {
  font-size: 23px;
}

.chart-summary span {
  color: var(--accent-700);
  font-size: 12px;
  font-weight: 700;
}

.cash-chart {
  width: 100%;
  height: 225px;
  display: block;
  padding: 0 10px 10px;
  overflow: visible;
}

.chart-grid-line { stroke: var(--ink-100); stroke-width: 1; }
.chart-area { fill: url(#chartFill); }
.chart-line { fill: none; stroke: var(--accent-600); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--surface); stroke: var(--accent-600); stroke-width: 2.5; }
.chart-label { fill: var(--ink-500); font-family: var(--font-family); font-size: 10px; }
.chart-tooltip rect { fill: var(--brand-950); }
.chart-tooltip text { fill: #fff; font-family: var(--font-family); font-size: 10px; }

.side-stack {
  display: grid;
  gap: 18px;
}

.smart-card {
  position: relative;
  min-height: 202px;
  padding: 20px;
  overflow: hidden;
  color: var(--brand-950);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 5% 0, rgba(255, 255, 255, 0.9), transparent 34%),
    var(--surface-warm);
}

.smart-card::after {
  content: "";
  position: absolute;
  left: -28px;
  bottom: -46px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(168, 92, 11, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(168, 92, 11, 0.035), 0 0 0 38px rgba(168, 92, 11, 0.02);
}

.smart-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--amber-700);
  font-size: 12px;
  font-weight: 700;
}

.smart-label .icon { width: 16px; height: 16px; }
.smart-card h3 { max-width: 290px; margin: 0 0 8px; font-size: 18px; line-height: 1.6; }
.smart-card p { max-width: 310px; margin: 0 0 14px; color: var(--ink-600); font-size: 12px; }
.smart-card .button { position: relative; z-index: 1; }

.quick-actions-card { padding: 18px 20px; }
.quick-actions-card h3 { margin: 0 0 13px; font-size: 15px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-action {
  min-height: 70px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 8px;
  color: var(--ink-700);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: color var(--motion-ui), border-color var(--motion-ui), background var(--motion-ui), transform var(--motion-fast);
}

.quick-action:hover { color: var(--accent-700); border-color: var(--accent-100); background: var(--accent-50); }
.quick-action:active { transform: scale(0.97); }
.quick-action .icon { width: 20px; height: 20px; }

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 18px;
}

.attention-list {
  display: grid;
  padding: 4px 18px 12px;
}

.attention-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ink-100);
  border-top: 0;
  border-right: 0;
  border-left: 0;
  color: inherit;
  text-align: right;
  background: transparent;
  cursor: pointer;
  transition: padding var(--motion-ui), background var(--motion-ui);
}

.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { padding-inline: 7px; background: var(--surface-soft); }
.attention-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; }
.attention-icon .icon { width: 18px; height: 18px; }
.attention-icon.warning { color: var(--amber-700); background: var(--amber-50); }
.attention-icon.danger { color: var(--red-700); background: var(--red-50); }
.attention-icon.info { color: var(--blue-700); background: var(--blue-50); }
.attention-copy { display: grid; }
.attention-copy strong { font-size: 13px; }
.attention-copy small { color: var(--ink-500); font-size: 11px; }
.attention-item > .icon { width: 16px; height: 16px; color: var(--ink-300); }

.page-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.inline-search {
  position: relative;
  min-width: 240px;
}

.inline-search .icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 17px;
  height: 17px;
  color: var(--ink-500);
}

.inline-search input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.inline-search input:focus { border-color: var(--accent-600); outline: 3px solid rgba(10, 145, 131, 0.1); }

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 84px;
  padding: 14px 16px;
}

.summary-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--brand-700);
  border-radius: 12px;
  background: var(--brand-50);
}

.summary-icon.warning { color: var(--amber-700); background: var(--amber-50); }
.summary-icon.success { color: var(--accent-700); background: var(--accent-50); }
.summary-icon.danger { color: var(--red-700); background: var(--red-50); }
.summary-item div { display: grid; }
.summary-item span { color: var(--ink-600); font-size: 12px; }
.summary-item strong { margin-top: 2px; font-size: 19px; }

.table-card .card-header { min-height: 76px; }
.table-card-title { display: flex; align-items: center; gap: 9px; }
.table-card-title .count { color: var(--ink-500); font-size: 12px; font-weight: 500; }

.customer-cell,
.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-avatar,
.product-thumb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-800);
  border-radius: 10px;
  background: var(--brand-50);
  font-size: 11px;
  font-weight: 700;
}

.product-thumb { border-radius: 9px; }
.customer-cell div,
.product-cell div { display: grid; }
.customer-cell small,
.product-cell small { color: var(--ink-500); font-size: 11px; font-weight: 400; }

.row-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.row-action:hover { color: var(--brand-900); background: var(--ink-50); }
.row-action .icon { width: 17px; height: 17px; }

.progress-bar {
  width: 100px;
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ink-100);
}

.progress-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent-500); }
.progress-bar.warning i { background: #d28b2e; }
.progress-bar.danger i { background: var(--red-700); }

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

.report-card {
  min-height: 220px;
  padding: 21px;
  transition: transform var(--motion-ui), box-shadow var(--motion-ui), border-color var(--motion-ui);
}

.report-card:hover { transform: translateY(-2px); border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.report-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent-700); border-radius: 13px; background: var(--accent-50); }
.report-card h3 { margin: 18px 0 6px; font-size: 17px; }
.report-card p { margin: 0; color: var(--ink-600); font-size: 13px; }
.report-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--ink-100); }
.report-meta strong { font-size: 18px; }
.report-meta span { color: var(--ink-500); font-size: 11px; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.account-card {
  min-height: 190px;
  padding: 18px;
  transition: transform var(--motion-ui), border-color var(--motion-ui), box-shadow var(--motion-ui);
}

.account-card:hover { transform: translateY(-2px); border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-card p { margin: 18px 0 2px; color: var(--ink-600); font-size: 13px; }
.account-card > strong { display: block; font-size: 26px; letter-spacing: -0.02em; }
.account-card > strong small { color: var(--ink-500); font-size: 12px; }
.account-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 13px; color: var(--ink-500); border-top: 1px solid var(--ink-100); font-size: 10px; }
.movement-success { color: var(--accent-700) !important; }
.movement-danger { color: var(--red-700) !important; }
.status-note { color: var(--ink-500); font-size: 11px; }

.operational-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.ledger-panel,
.settings-card {
  padding: 20px;
}

.ledger-panel > header,
.settings-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-100);
}

.ledger-panel h2,
.settings-card h2 { margin: 0; font-size: 17px; }
.ledger-panel header p,
.settings-card header p { margin: 3px 0 0; color: var(--ink-600); font-size: 12px; }
.ledger-list { display: grid; margin: 4px 0 16px; }
.ledger-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--ink-100); }
.ledger-list span { color: var(--ink-600); font-size: 11px; }
.ledger-list strong { font-size: 12px; white-space: nowrap; }
.ledger-panel > .button { width: 100%; }

.tax-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px;
  color: #fff;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, var(--brand-950), var(--brand-800));
  box-shadow: var(--shadow-sm);
}

.tax-readiness .smart-label { color: var(--accent-100); }
.tax-readiness h2 { margin: 12px 0 5px; font-size: 23px; }
.tax-readiness p { margin: 0; color: rgba(255, 255, 255, 0.68); font-size: 13px; }
.tax-progress { display: grid; gap: 7px; }
.tax-progress strong { font-size: 30px; }
.tax-progress > span { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
.tax-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent-500); }
.tax-progress small { color: rgba(255, 255, 255, 0.62); font-size: 10px; }
.tax-checklist { display: grid; margin-block: 4px 16px; }
.tax-checklist label { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.tax-checklist input { width: 16px; height: 16px; accent-color: var(--accent-600); }
.tax-checklist span { font-size: 11px; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.settings-card form { padding-top: 18px; }
.settings-actions { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--ink-100); }
.settings-side { display: grid; gap: 18px; }
.role-list,
.audit-list { display: grid; padding-top: 4px; }
.role-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--ink-100); }
.role-row-button { width: 100%; color: inherit; text-align: right; border: 0; background: transparent; cursor: pointer; }
.role-row-button:hover { background: var(--ink-50); }
.role-row:last-child,
.audit-item:last-child { border-bottom: 0; }
.role-row > div { display: grid; }
.role-row strong { font-size: 12px; }
.role-row small { color: var(--ink-500); font-size: 10px; }
.audit-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: start; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--ink-100); }
.audit-mark { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent-500); box-shadow: 0 0 0 4px var(--accent-50); }
.audit-item strong { font-size: 12px; }
.audit-item p { margin: 2px 0 0; color: var(--ink-600); font-size: 10px; }
.audit-item > small { color: var(--ink-500); font-size: 9px; white-space: nowrap; }

.modal-layer {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: visibility var(--motion-ui), opacity var(--motion-ui);
}

.modal-layer.open { visibility: visible; opacity: 1; }
.modal-scrim { position: absolute; inset: 0; border: 0; background: rgba(10, 24, 28, 0.56); backdrop-filter: blur(3px); }
.modal {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateY(12px) scale(0.985);
  transition: transform var(--motion-enter) var(--ease-standard);
}
.modal-layer.open .modal { transform: translateY(0) scale(1); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--ink-100); background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 1px 0 3px; font-size: 20px; }
.modal-header p { margin: 0; color: var(--ink-600); font-size: 12px; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.invoice-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px; gap: 10px; align-items: end; margin-top: 18px; padding: 16px; border: 1px solid var(--ink-100); border-radius: var(--radius-md); background: var(--surface-soft); }
.invoice-total { display: grid; gap: 9px; margin-top: 16px; padding: 15px 0 0; border-top: 1px solid var(--ink-100); }
.invoice-total div { display: flex; align-items: center; justify-content: space-between; color: var(--ink-600); font-size: 13px; }
.invoice-total div:last-child { color: var(--ink-950); font-size: 16px; font-weight: 700; }
.modal-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--ink-100); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); }
.modal-footer-wrap { flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.purchase-bills-card { margin-top: 18px; }
.field-hint { color: var(--ink-500); font-size: 11px; }
.provider-note { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--accent-100); border-radius: var(--radius-md); background: var(--accent-50); }
.provider-note strong { font-size: 13px; }
.provider-note p { margin: 4px 0 0; color: var(--ink-600); font-size: 11px; }
.option-list { display: grid; gap: 7px; }
.option-row { width: 100%; min-height: 64px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 13px; color: inherit; text-align: right; border: 1px solid var(--ink-100); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.option-row:hover,
.option-row.selected { border-color: var(--accent-400); background: var(--accent-50); }
.option-row > span { display: grid; }
.option-row strong { font-size: 13px; }
.option-row small { color: var(--ink-500); font-size: 10px; }
.option-row > .icon { width: 16px; color: var(--ink-400); }
.record-summary,
.report-detail { display: grid; border: 1px solid var(--ink-100); border-radius: var(--radius-lg); overflow: hidden; }
.record-summary > div,
.report-detail > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border-bottom: 1px solid var(--ink-100); }
.record-summary > div:last-child,
.report-detail > div:last-child { border-bottom: 0; }
.record-summary span,
.report-detail span { color: var(--ink-600); font-size: 12px; }
.record-summary span small { display: block; margin-top: 2px; color: var(--ink-400); }
.record-summary strong,
.report-detail strong { text-align: left; font-size: 13px; }
.report-detail strong.negative { color: var(--red-700); }
.review-groups { display: grid; gap: 22px; }
.review-groups h3 { margin: 0 0 9px; font-size: 14px; }
.review-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--ink-100); }
.review-row > span { display: grid; }
.review-row strong { font-size: 12px; }
.review-row small { color: var(--ink-500); font-size: 10px; }
.success-message { margin: 0; padding: 12px; color: var(--accent-700); border-radius: var(--radius-md); background: var(--accent-50); font-size: 12px; }

.search-dialog { padding-top: 18px; }
.search-results { display: grid; gap: 4px; margin-top: 18px; }
.search-section-label { margin: 0 4px 7px; color: var(--ink-500); font-size: 11px; font-weight: 600; }
.search-result { width: 100%; min-height: 66px; display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 11px; padding: 8px 10px; color: var(--ink-800); text-align: right; border: 0; border-radius: var(--radius-md); background: transparent; cursor: pointer; transition: background var(--motion-ui), transform var(--motion-fast); }
.search-result:hover { background: var(--ink-50); }
.search-result:active { transform: scale(0.99); }
.search-result-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--brand-700); border-radius: 11px; background: var(--brand-50); }
.search-result > span:nth-child(2) { display: grid; }
.search-result strong { font-size: 13px; }
.search-result small { color: var(--ink-500); font-size: 11px; }
.search-result > .icon { width: 16px; height: 16px; color: var(--ink-300); }

.notification-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: min(390px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateX(-105%);
  transition: transform var(--motion-enter) var(--ease-standard);
}
.notification-panel.open { transform: translateX(0); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--ink-100); }
.panel-header h2 { margin: 0; font-size: 22px; }
.notification-list { display: grid; }
.notification { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 11px; padding: 18px 4px; border-bottom: 1px solid var(--ink-100); }
.notification-button-row { width: 100%; color: inherit; text-align: right; border-top: 0; border-right: 0; border-left: 0; background: transparent; cursor: pointer; }
.notification-button-row:hover { background: var(--ink-50); }
.notification.unread { background: linear-gradient(90deg, transparent, rgba(237, 249, 246, 0.58)); }
.notification-mark { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--ink-300); }
.notification-mark.warning { background: #d28b2e; }
.notification-mark.danger { background: var(--red-700); }
.notification-mark.success { background: var(--accent-600); }
.notification strong { font-size: 13px; }
.notification p { margin: 3px 0; color: var(--ink-600); font-size: 12px; }
.notification small { color: var(--ink-500); font-size: 10px; }
.panel-action { margin-top: auto; width: 100%; }

.toast-region { position: fixed; z-index: 100; bottom: 24px; left: 24px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 300px; max-width: min(400px, calc(100vw - 32px)); display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--ink-100); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); animation: toast-in var(--motion-enter) var(--ease-standard) both; }
.toast-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent-700); border-radius: 10px; background: var(--accent-50); }
.toast strong { display: block; font-size: 13px; }
.toast small { display: block; margin-top: 2px; color: var(--ink-600); font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.offline-banner { position: fixed; z-index: 110; top: 12px; left: 50%; display: none; align-items: center; gap: 8px; padding: 9px 14px; color: #fff; border-radius: var(--radius-round); background: var(--brand-950); box-shadow: var(--shadow-md); font-size: 12px; transform: translateX(-50%); }
.offline-banner.show { display: flex; }
.offline-banner .icon { width: 16px; height: 16px; }

.mobile-nav,
.sidebar-scrim { display: none; }

.loading-view { display: grid; gap: 18px; }
.loading-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skeleton-metric { height: 145px; }
.loading-panels { display: grid; grid-template-columns: 1.65fr .75fr; gap: 18px; }
.skeleton-panel { height: 370px; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .lower-grid { grid-template-columns: minmax(0, 1fr); }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .search-trigger { width: 210px; }
  .operational-grid,
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    width: 280px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
    transition: transform var(--motion-enter) var(--ease-standard), opacity var(--motion-ui), visibility var(--motion-ui);
  }
  .sidebar.open { visibility: visible; opacity: 1; pointer-events: auto; transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 29; inset: 0; width: 100%; border: 0; background: rgba(10, 24, 28, 0.45); backdrop-filter: blur(2px); }
  .sidebar-scrim.show { display: block; }
  .workspace { margin-right: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar .search-trigger span,
  .topbar .search-trigger kbd { display: none; }
  .topbar .search-trigger { width: 44px; justify-content: center; padding: 0; }
  .reports-layout { grid-template-columns: minmax(0, 1fr); }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .tax-readiness { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .topbar { height: 70px; padding: 0 16px; }
  .topbar h1 { font-size: 17px; }
  .topbar .eyebrow { font-size: 10px; }
  .top-action { display: none; }
  .topbar-actions { gap: 7px; }
  #appMain { padding: 20px 16px 104px; }
  .welcome-strip,
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  .welcome-strip h2,
  .page-heading h2 { font-size: 22px; }
  .welcome-strip > button { flex: 0 0 auto; }
  .date-filter span { display: none; }
  .date-filter { width: 42px; padding: 0; justify-content: center; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 128px; padding: 14px; }
  .metric-value { margin-top: 15px; font-size: 21px; }
  .metric-foot { align-items: flex-start; flex-direction: column; gap: 1px; }
  .metric-help { width: 27px; height: 27px; }
  .side-stack { grid-template-columns: minmax(0, 1fr); }
  .chart-card { min-height: 340px; }
  .card-header { padding-inline: 16px; }
  .chart-summary { padding-inline: 18px; }
  .cash-chart { height: 205px; padding-inline: 0; }
  .lower-grid { gap: 14px; }
  .quick-actions-card { padding: 16px; }
  .summary-row { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .summary-item { min-height: 74px; }
  .page-heading { display: grid; }
  .page-tools { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  .inline-search { min-width: 0; }
  .table-card .card-header { align-items: flex-start; }
  .table-card .card-header > .page-tools { display: none; }
  .reports-layout { gap: 12px; }
  .operational-grid,
  .settings-grid { gap: 12px; }
  .settings-card,
  .ledger-panel { padding: 16px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-actions .button { width: 100%; }
  .tax-readiness { padding: 20px 18px; }
  .tax-readiness h2 { font-size: 20px; }
  .report-card { min-height: 200px; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 12px;
    bottom: 10px;
    left: 12px;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 6px;
    border: 1px solid rgba(214, 220, 219, 0.8);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 40px rgba(14, 34, 39, 0.18);
    backdrop-filter: blur(14px);
  }
  .mobile-nav-item { min-height: 56px; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--ink-500); border: 0; border-radius: 14px; background: transparent; font-size: 9px; font-weight: 600; }
  .mobile-nav-item.active { color: var(--accent-700); background: var(--accent-50); }
  .mobile-nav-item .icon { width: 20px; height: 20px; }
  .mobile-create { width: 48px; height: 48px; place-self: center; display: grid; place-items: center; color: #fff; border: 0; border-radius: 16px; background: var(--brand-900); box-shadow: 0 8px 18px rgba(18, 54, 61, 0.25); }
  .mobile-create:active { transform: scale(0.95); }
  .mobile-create .icon { width: 22px; height: 22px; }
  .modal-layer { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-body { padding: 18px 16px; }
  .modal-header,
  .modal-footer { padding-inline: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .invoice-line { grid-template-columns: minmax(0, 1fr) 72px; }
  .invoice-line .price-field { grid-column: 1 / -1; }
  .toast-region { right: 16px; bottom: 94px; left: 16px; }
  .toast { min-width: 0; width: 100%; }
  .loading-metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .loading-panels { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card { min-height: 120px; }
  .metric-foot { flex-direction: row; }
  .topbar .search-trigger { display: none; }
}
