﻿:root {
  --bg: #08133f;
  --bg-glow-a: rgba(255, 145, 58, 0.22);
  --bg-glow-b: rgba(216, 30, 91, 0.18);
  --panel: rgba(230, 233, 238, 0.94);
  --panel-strong: rgba(241, 243, 247, 0.98);
  --line: rgba(86, 97, 110, 0.16);
  --line-strong: rgba(255, 187, 92, 0.44);
  --text: #28343a;
  --soft: #6b7d83;
  --mint-100: #fff2dd;
  --mint-400: #ffc56a;
  --mint-600: #ff9d3d;
  --gray-100: #f8fafb;
  --gray-300: #d8dfe2;
  --accent-100: #fff1d8;
  --accent-300: #ffc86c;
  --accent-500: #ff9e38;
  --accent-700: #b46b14;
  --accent-glow: 0 0 0 1px rgba(255, 197, 106, 0.28), 0 0 18px rgba(255, 177, 76, 0.34);
  --shadow: 0 18px 44px rgba(9, 18, 60, 0.18);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
}

body {
  color: var(--text);
  font-family: "Segoe UI", "Aptos", sans-serif;
  font-size: 12px;
  zoom: 0.8;
  background:
    radial-gradient(circle at top left, var(--bg-glow-a), transparent 26%),
    radial-gradient(circle at bottom right, var(--bg-glow-b), transparent 32%),
    linear-gradient(180deg, #08133f 0%, #061137 100%);
}

button,
input,
select {
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.ambient {
  position: absolute;
  display: block;
  pointer-events: none;
}

.ambient-a,
.ambient-b {
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(38px);
}

.ambient-a {
  top: -7rem;
  left: -7rem;
  background: rgba(59, 130, 246, 0.24);
}

.ambient-b {
  right: -7rem;
  bottom: -7rem;
  background: rgba(213, 40, 104, 0.22);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 80%);
}

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
  width: 100%;
  min-height: 100vh;
  padding: 0.55rem;
}

.shell-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.submenu-shell {
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.96);
}

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

.eyebrow,
.section-title,
.hero-title,
.hero-copy,
.muted,
.message-box,
.status-chip,
.bar-value,
.bar-card span,
.profile-chip span,
.field span {
  font-size: 12px;
  line-height: 1.25;
}

.eyebrow,
.muted,
.profile-chip span {
  color: var(--soft);
}

.section-title,
.hero-title {
  margin: 0;
}

.login-shell,
.app-frame,
.view-root,
.stack-form,
.line-stack,
.stack-list {
  display: grid;
  gap: 0.55rem;
}

.login-shell {
  min-height: calc(100vh - 1.1rem);
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
   padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(255, 170, 91, 0.42), transparent 20%),
    radial-gradient(circle at bottom right, rgba(111, 35, 88, 0.38), transparent 24%),
    linear-gradient(135deg, #121c59 0%, #10194f 58%, #25144a 100%);
}

.hero-block,
.login-card,
.view-card,
.topbar,
.menu-strip,
.empty-state {
  padding: 0.55rem 0.65rem;
}

.card-control-strip {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.2rem;
  min-height: 1.2rem;
  cursor: grab;
  user-select: none;
}

.card-body-shell {
  display: grid;
  gap: 0.55rem;
}

.card-header-title {
  margin: 0;
}

.card-control-buttons {
  display: inline-flex;
  gap: 0.2rem;
  align-items: center;
}

.card-toggle-button {
  min-width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5c7074;
  box-shadow: none;
  font-size: 11px;
  line-height: 1;
  opacity: 0.85;
}

.card-toggle-button:hover {
  color: #17343a;
  transform: none;
}

.view-card.is-collapsed {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  resize: none;
  min-height: 0 !important;
  height: auto !important;
  max-height: 3rem !important;
  width: fit-content !important;
  max-width: min(100%, 22rem) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  align-self: start;
  flex: 0 0 auto !important;
}

.view-card.is-collapsed .card-control-strip {
  margin: 0;
}

.collapsed-cards-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.1rem 0 0.55rem;
}

.collapsed-cards-tray .view-card {
  width: auto;
  min-width: 12rem;
}

.view-card.is-collapsed .card-body-shell {
  display: none;
}

.message-box {
  display: none;
}

.app-modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-modal-root.is-hidden {
  display: none !important;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 11, 52, 0.36);
  backdrop-filter: blur(4px);
}

.app-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.98);
}

.app-modal-body {
  display: grid;
  gap: 0.7rem;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.modal-copy {
  margin: 0;
  line-height: 1.45;
}

.modal-stack {
  display: grid;
  gap: 0.7rem;
}

.login-card {
  display: grid;
  gap: 1rem;
  width: min(100%, 30rem);
  padding: 1.35rem 1.2rem 1.1rem;
  background: linear-gradient(180deg, rgba(73, 82, 125, 0.9), rgba(56, 64, 105, 0.88));
  border: 1px solid rgba(202, 214, 255, 0.34);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(9, 14, 49, 0.42), 0 0 0 1px rgba(255, 244, 220, 0.04) inset;
}

.hero-block {
  display: grid;
  gap: 0.8rem;
  width: min(100%, 58rem);
  padding: 0.6rem 1.2rem 1.2rem;
  color: #fff6e6;
  text-align: center;
}

.hero-copy {
  color: rgba(255, 245, 226, 0.84);
  max-width: 42ch;
  margin: 0 auto;
}

#login-panel .eyebrow,
#login-panel .section-title,
#login-panel .hero-title,
#login-panel .hero-copy,
#login-panel .field span {
  color: #fff6e6;
}

#login-panel .section-title,
#login-panel .hero-title {
  font-size: 14px;
}

#login-panel .login-stage {
  width: min(100%, 70rem);
  display: grid;
  justify-items: center;
  gap: 1.45rem;
}

#login-panel .login-hero {
  justify-items: center;
}

#login-panel .login-brand {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 241, 214, 0.78);
  letter-spacing: 0.04em;
}

#login-panel .login-heading {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.06;
  color: #ffc933;
  font-weight: 800;
}

#login-panel .login-lead {
  margin: 0;
  color: rgba(255, 248, 236, 0.96);
  font-style: italic;
  font-size: 0.95rem;
}

#login-panel .login-subcopy {
  margin: 0;
  max-width: 52rem;
  color: rgba(255, 246, 231, 0.95);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.55;
}

#login-panel .login-card-title {
  font-size: 1rem;
  color: #fff6e6;
}

#login-panel .login-field {
  gap: 0.45rem;
}

#login-panel .field input {
  min-height: 2.75rem;
  background: rgba(69, 78, 92, 0.9);
  border-color: rgba(255, 214, 137, 0.34);
  color: #fff9ef;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 209, 0.04);
}

#login-panel .field input::placeholder {
  color: rgba(255, 244, 220, 0.55);
}

#login-panel .field input:focus {
  border-color: rgba(255, 196, 90, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 187, 74, 0.14), 0 0 14px rgba(255, 182, 70, 0.24);
}

#login-panel .login-submit {
  min-height: 2.9rem;
  border-radius: 14px;
  border: 0;
  color: #4f3200;
  background: linear-gradient(90deg, #ffc768 0%, #ffb34d 55%, #ff9f39 100%);
  box-shadow: 0 10px 24px rgba(255, 175, 69, 0.22), 0 0 18px rgba(255, 185, 81, 0.18);
}

#login-panel .login-submit:hover {
  filter: brightness(1.02);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: center;
}

.brand-strip,
.topbar-actions,
.button-row,
.toolbar-line,
.filter-row,
.detail-strip,
.entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.menu-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  overflow: visible;
  transition: max-height 160ms ease, padding 160ms ease;
  max-height: 10rem;
  position: relative;
  z-index: 12;
}

.menu-strip.is-collapsed {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

.menu-button,
.menu-group-button,
.menu-subitem,
.primary-button,
.ghost-button,
.link-button,
.doc-tab {
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.menu-button.is-active,
.menu-group-button.is-active,
.menu-subitem.is-active,
.primary-button,
.doc-tab.is-active {
  background: linear-gradient(135deg, var(--accent-300), var(--accent-500));
  color: #55330a;
  box-shadow: 0 10px 24px rgba(255, 161, 53, 0.26);
}

.menu-button:hover,
.menu-group-button:hover,
.menu-subitem:hover,
.primary-button:hover,
.ghost-button:hover,
.link-button:hover,
.doc-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.menu-button.is-locked,
.menu-subitem.is-locked {
  border-color: rgba(255, 177, 73, 0.38);
  background: rgba(255, 243, 227, 0.88);
  color: #8b5c11;
}

.menu-button.is-locked.is-active,
.menu-subitem.is-locked.is-active {
  color: #8b5c11;
}

.menu-lock-note {
  margin-left: 0.45rem;
  font-size: 0.72rem;
  opacity: 0.82;
}

.menu-group-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.sri-detail-card,
.sri-detail-panel {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.7rem;
}

.sri-detail-grid {
  align-items: start;
}

.sri-message-list {
  display: grid;
  gap: 0.5rem;
}

.sri-message-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
}

.sri-message-card p,
.sri-detail-panel p {
  margin: 0;
}

.sri-raw-shell {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

.sri-raw-shell summary {
  cursor: pointer;
  color: #11373a;
  font-weight: 600;
}

.code-block {
  margin: 0.6rem 0 0;
  padding: 0.75rem;
  max-height: 18rem;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(4, 11, 52, 0.92);
  color: #edf9f7;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.menu-dropdown {
  position: relative;
  z-index: 14;
}

.menu-caret {
  width: 0.5rem;
  height: 0.5rem;
  display: inline-block;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.8;
}

.menu-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 14rem;
  z-index: 15;
  padding: 0.45rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(39, 53, 58, 0.12);
  z-index: 20;
}

.menu-submenu.is-open {
  display: grid;
}

.menu-subitem {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  box-shadow: none;
}

.menu-subitem.is-active {
  box-shadow: none;
}

.profile-chip,
.company-switcher {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.profile-avatar {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd086, #ffae4b);
  font-weight: 700;
}

.view-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 10rem;
}

.view-card:not(.is-collapsed) {
  resize: both;
  overflow: auto;
}

.view-card.is-dragging-card {
  opacity: 0.7;
}

.two-column,
.three-column,
.form-grid {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
}

.two-column {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  align-items: start;
}

.three-column {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}

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

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field-span-2 {
  grid-column: span 2;
}

.helper-text {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.field-grow {
  flex: 1 1 16rem;
}

.module-config-shell {
  display: grid;
  gap: 0.55rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.65rem;
}

.module-toggle-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
}

.module-toggle-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
  accent-color: var(--accent-500);
}

.module-toggle-card strong,
.module-toggle-card p {
  margin: 0;
}

.module-toggle-card p {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--soft);
}

.module-toggle-card.is-locked {
  background: rgba(247, 249, 252, 0.84);
}

.toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.toggle-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent-500);
}

.variable-card,
.preview-card,
.crm-preview-shell,
.crm-customer-summary {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
}

.crm-customer-summary p,
.crm-preview-shell p {
  margin: 0;
}

.variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.soft-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--soft);
}

.html-preview,
.text-preview {
  min-height: 8rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  overflow: auto;
}

.html-preview > *:first-child {
  margin-top: 0;
}

.html-preview > *:last-child {
  margin-bottom: 0;
}

.crm-recipient-shell {
  max-height: 28rem;
}

.crm-followup-grid {
  align-items: start;
}

.compact-field {
  min-width: 10rem;
}

.toggle-line {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.toggle-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.toggle-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toggle-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-pill span {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.toggle-pill input:checked + span {
  background: linear-gradient(135deg, var(--accent-300), var(--accent-500));
  color: #55330a;
  box-shadow: var(--accent-glow);
  border-color: transparent;
}

.field input,
.field select,
.line-item input,
.line-item select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.toggle-line input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 1rem;
  padding: 0;
  margin: 0;
  border-radius: 0.2rem;
  accent-color: #1c78bf;
}

.field select[multiple] {
  min-height: 9rem;
}

.field input:focus,
.field select:focus,
.line-item input:focus,
.line-item select:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: var(--accent-glow);
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 100%;
}

.tall-table {
  max-height: 28rem;
}

.compact-shell {
  margin-top: 0.75rem;
}

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

.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(99, 111, 116, 0.08);
  text-align: left;
  vertical-align: top;
}

.data-table thead {
  background: var(--gray-100);
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.line-item {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.doc-detail-row {
  grid-template-columns: minmax(110px, 0.9fr) minmax(150px, 1.2fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(220px, 1.8fr) repeat(4, minmax(95px, 0.9fr)) auto;
}

.retention-detail-row {
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
}

.row-labels {
  display: grid;
  margin-bottom: 0.15rem;
  padding: 0 0.25rem;
  color: var(--soft);
  font-weight: 700;
}

.row-labels span {
  display: block;
}

.entry-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border: 1px solid rgba(99, 111, 116, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(235, 238, 243, 0.84);
}

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

.entry-head div {
  display: grid;
  gap: 0.2rem;
}

.detail-strip {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--accent-100);
  border: 1px solid rgba(255, 171, 68, 0.24);
}

.status-chip {
  display: inline-flex;
  margin-right: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #f0f4f5;
  color: var(--soft);
}

.status-chip.is-success {
  background: #e7faf5;
  color: #27786c;
}

.status-chip.is-warning {
  background: rgba(255, 198, 109, 0.26);
  color: #8a5c16;
}

.status-chip.is-danger {
  background: rgba(217, 123, 123, 0.18);
  color: #8c4747;
}

.status-chip.is-muted {
  background: #f0f2f3;
}

.petty-cash-stats-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.petty-cash-stat-card {
  min-height: 5.8rem;
  align-content: center;
}

.petty-cash-stat-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.modal-textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  resize: vertical;
}

.message-box {
  min-height: 1.2rem;
}

.message-box.is-visible {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(98, 203, 183, 0.24);
  background: rgba(98, 203, 183, 0.14);
}

.message-box.is-error {
  background: rgba(217, 123, 123, 0.12);
  border-color: rgba(217, 123, 123, 0.22);
  color: #924f4f;
}

.chart-shell {
  display: flex;
  gap: 0.55rem;
  align-items: end;
  min-height: 15rem;
}

.line-chart {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 249, 247, 0.6));
  border: 1px solid rgba(99, 111, 116, 0.08);
}

.chart-axis {
  stroke: rgba(99, 111, 116, 0.2);
  stroke-width: 1;
}

.chart-label {
  fill: var(--soft);
  font-size: 10px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.chart-grid {
  stroke: rgba(99, 111, 116, 0.14);
  stroke-dasharray: 4 4;
}

.report-chart-card {
  overflow: hidden;
}

.report-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.report-line-chart {
  min-height: 280px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 255, 0.72));
}

.report-chart-point {
  stroke: #ffffff;
  stroke-width: 2;
  transition: transform 150ms ease;
}

.report-chart-hit-area,
.report-chart-point {
  pointer-events: all;
  cursor: pointer;
}

.report-chart-point:hover {
  transform: scale(1.15);
}

.searchable-select-shell {
  width: 100%;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--soft);
}

.legend-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
}

.bar-card {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
  text-align: center;
}

.bar-column {
  height: 180px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(237, 249, 247, 0.9), rgba(242, 246, 247, 0.4));
  border: 1px solid rgba(98, 203, 183, 0.18);
  padding: 0.75rem;
}

.bar-fill {
  width: 100%;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #7be1cf, #46b9a6);
}

.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.config-card {
  padding: 0.9rem;
  border: 1px solid rgba(99, 111, 116, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(235, 238, 243, 0.84);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.inline-form input {
  min-width: 18rem;
}

.upload-inline-form input {
  min-width: 14rem;
}

.file-field {
  position: relative;
}

.native-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input-shell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.45rem 0.6rem;
  border: 1px dashed rgba(255, 166, 55, 0.45);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 242, 222, 0.96), rgba(255, 255, 255, 0.98));
}

.file-input-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-300), var(--accent-500));
  color: #55330a;
  font-weight: 700;
  white-space: nowrap;
}

.file-input-name {
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-file-field {
  min-width: min(26rem, 100%);
}

.inline-file-field .file-input-shell {
  min-width: 16rem;
}

.danger-link {
  color: #b53b51;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
}

.access-matrix {
  display: grid;
  gap: 0.8rem;
}

.is-selected-row {
  background: rgba(143, 225, 211, 0.18);
}

.submenu-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submenu-strip .menu-subitem {
  width: auto;
}

.tax-shell {
  margin-top: 0.75rem;
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 111, 116, 0.08);
  background: rgba(235, 238, 243, 0.84);
}

.xml-box summary {
  cursor: pointer;
  font-weight: 700;
}

.api-key-box {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(98, 203, 183, 0.24);
  background: #f6fbfa;
}

.api-key-box code,
code {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.xml-box pre {
  margin: 0.8rem 0 0;
  max-height: 22rem;
  overflow: auto;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #f7faf9;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  color: var(--soft);
}

#login-panel.shell-card {
  border-color: rgba(255, 240, 213, 0.22);
  background: transparent;
  box-shadow: none;
}

.app-frame,
.view-root {
  width: 100%;
  min-width: 0;
  align-content: start;
}

.view-root > * {
  width: 100%;
  min-width: 0;
}

.topbar,
.menu-strip,
.submenu-shell,
.view-card,
.shell-card,
.table-shell,
.collapsed-cards-tray,
.row-labels,
.line-item,
.line-stack,
.stack-form {
  min-width: 0;
}

.topbar,
.menu-strip,
.submenu-shell,
.collapsed-cards-tray,
.view-card {
  width: 100%;
}

.collapsed-cards-tray {
  align-items: flex-start;
}

.collapsed-cards-tray .view-card,
.collapsed-cards-tray .view-card.is-collapsed {
  width: fit-content !important;
  max-width: min(100%, 22rem) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 3rem !important;
  flex: 0 0 auto !important;
  resize: none !important;
  overflow: hidden !important;
}

.collapsed-cards-tray .view-card.is-collapsed .card-control-strip {
  display: inline-flex;
  width: auto;
  gap: 0.45rem;
  align-items: center;
  white-space: nowrap;
}

.collapsed-cards-tray .view-card.is-collapsed .card-header-title {
  white-space: nowrap;
}

.collapsed-cards-tray .view-card.is-collapsed .card-toggle-button {
  font-size: 10px;
}

.inline-form,
.filter-row,
.toolbar-line,
.button-row {
  width: 100%;
}

.inline-form > *,
.filter-row > *,
.toolbar-line > *,
.button-row > * {
  min-width: 0;
}

.inline-form input,
.filter-row input,
.filter-row select {
  flex: 1 1 14rem;
}

@media (max-width: 1180px) {
  .login-shell,
  .two-column,
  .three-column,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .topbar,
  .toolbar-line,
  .filter-row,
  .entry-head,
  .line-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 520px;
  }
}

/* Libro Cloud light SaaS theme overrides */
:root {
  --bg: #f4f6f9;
  --bg-glow-a: rgba(37, 99, 235, 0.12);
  --bg-glow-b: rgba(96, 165, 250, 0.1);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e5e7eb;
  --line-strong: rgba(37, 99, 235, 0.34);
  --text: #111827;
  --soft: #6b7280;
  --mint-100: #dbeafe;
  --mint-400: #60a5fa;
  --mint-600: #2563eb;
  --gray-100: #f9fafb;
  --gray-300: #d1d5db;
  --accent-100: #dbeafe;
  --accent-300: #60a5fa;
  --accent-500: #2563eb;
  --accent-700: #1d4ed8;
  --accent-glow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
  --radius-xl: 16px;
  --radius-lg: 16px;
  --radius-md: 10px;
}

body {
  background: #f4f6f9;
  color: #111827;
  font-family: Inter, Poppins, "Segoe UI", Arial, Helvetica, sans-serif;
}

.app-shell {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 18%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #f4f6f9 100%);
}

.ambient-grid {
  display: none;
}

.ambient-a,
.ambient-b {
  filter: blur(52px);
}

.ambient-a {
  background: rgba(37, 99, 235, 0.14);
}

.ambient-b {
  background: rgba(96, 165, 250, 0.08);
}

.workspace {
  gap: 1rem;
  padding: 1rem;
}

.shell-card,
.view-card,
.topbar,
.menu-strip,
.submenu-shell,
.empty-state,
.config-card,
.tax-shell,
.entry-card,
.module-toggle-card,
.variable-card,
.preview-card,
.crm-preview-shell,
.crm-customer-summary,
.table-shell {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

.hero-block,
.login-card,
.view-card,
.topbar,
.menu-strip,
.empty-state,
.submenu-shell {
  padding: 20px;
}

.topbar {
  align-items: center;
  gap: 1rem;
}

.brand-strip {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-logo {
  height: 46px;
  width: auto;
  flex: 0 0 auto;
}

.brand-copy {
  display: grid;
  gap: 0.12rem;
}

.brand-name,
.brand-subtitle {
  margin: 0;
}

.brand-name {
  color: #1f2f6d;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.15;
}

.brand-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-view {
  display: grid;
  gap: 0.1rem;
}

.eyebrow,
.muted,
.profile-chip span,
.field span,
.helper-text,
.hero-copy,
.hero-copy strong {
  color: #6b7280;
}

.section-title,
.hero-title,
.card-header-title,
strong,
h1,
h2,
h3,
h4 {
  color: #111827;
}

.login-shell {
  min-height: calc(100vh - 2rem);
  padding: 2.5rem 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, #eef4fb 100%);
}

#login-panel.shell-card {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.login-stage {
  width: min(100%, 76rem);
  gap: 1.6rem;
}

.login-brand-lockup {
  justify-self: center;
  margin-bottom: 0.25rem;
}

.login-brand-lockup .brand-logo {
  height: 58px;
}

.login-brand-lockup .brand-name {
  font-size: clamp(2.1rem, 4vw, 3rem);
}

#login-panel .hero-block {
  padding: 0;
  text-align: center;
  color: #111827;
}

#login-panel .login-brand {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#login-panel .login-heading {
  margin: 0;
  color: #111827;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.06;
  font-weight: 800;
}

#login-panel .login-lead {
  margin: 0;
  color: #374151;
  font-style: italic;
  font-size: 1rem;
}

#login-panel .login-subcopy {
  margin: 0 auto;
  max-width: 56rem;
  color: #4b5563;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
}

.login-card {
  width: min(100%, 30rem);
  padding: 1.5rem;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

#login-panel .section-title,
#login-panel .login-card-title,
#login-panel .field span {
  color: #111827;
}

.field input,
.field select,
.line-item input,
.line-item select,
.modal-textarea {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.field input::placeholder,
.modal-textarea::placeholder {
  color: #9ca3af;
}

#login-panel .field input {
  min-height: 2.8rem;
  border-radius: 12px;
}

.field input:focus,
.field select:focus,
.line-item input:focus,
.line-item select:focus,
.modal-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.menu-button,
.menu-group-button,
.menu-subitem,
.ghost-button,
.link-button,
.doc-tab {
  min-height: 2.75rem;
  padding: 0.62rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  box-shadow: none;
}

.primary-button,
.menu-button.is-active,
.menu-group-button.is-active,
.menu-subitem.is-active,
.doc-tab.is-active,
.file-input-button {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.primary-button {
  min-height: 2.8rem;
  border-radius: 10px;
}

.primary-button:hover,
.menu-button:hover,
.menu-group-button:hover,
.menu-subitem:hover,
.ghost-button:hover,
.link-button:hover,
.doc-tab:hover,
.file-input-button:hover {
  filter: brightness(1.02);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.menu-button.is-locked,
.menu-subitem.is-locked {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.menu-strip,
.submenu-shell {
  background: #ffffff;
}

.menu-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.menu-submenu {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.profile-chip,
.company-switcher {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.profile-avatar {
  background: linear-gradient(135deg, #93c5fd, #2563eb);
  color: #ffffff;
}

.toggle-pill span,
.soft-chip,
.toggle-card,
.sri-message-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.toggle-pill input:checked + span {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.detail-strip,
.api-key-box,
.message-box.is-visible {
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.16);
}

.status-chip {
  background: #f3f4f6;
  color: #6b7280;
}

.status-chip.is-success {
  background: #ecfdf5;
  color: #047857;
}

.status-chip.is-warning {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-chip.is-danger {
  background: #fef2f2;
  color: #b91c1c;
}

.table-shell {
  background: #ffffff;
}

.data-table thead {
  background: #f9fafb;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.entry-card,
.config-card,
.tax-shell,
.module-toggle-card,
.petty-cash-stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.petty-cash-stat-card strong {
  color: #111827;
}

.bar-column {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.bar-fill {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.line-chart {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.file-input-shell {
  background: #eff6ff;
  border: 1px dashed rgba(37, 99, 235, 0.35);
}

.file-input-name {
  color: #6b7280;
}

.code-block {
  background: #111827;
  color: #f9fafb;
}

.xml-box pre,
.html-preview,
.text-preview {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.message-box.is-error {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.view-root .two-column,
.view-root .three-column {
  gap: 1rem;
}

@media (max-width: 760px) {
  .brand-strip,
  .topbar-actions,
  .brand-meta {
    width: 100%;
  }

  .brand-strip {
    flex-direction: column;
    align-items: stretch;
  }

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

  .brand-name {
    font-size: 1.5rem;
  }

  .brand-subtitle {
    font-size: 0.9rem;
  }
}

/* Exact login refinement */
.login-shell {
  background: #ffffff;
}

#login-panel .login-stage {
  width: min(100%, 31rem);
  gap: 2rem;
  justify-items: center;
}

#login-panel .hero-block {
  width: auto;
  justify-items: center;
  gap: 0.35rem;
}

#login-panel .login-brand-lockup {
  gap: 0.6rem;
}

#login-panel .login-logo {
  height: 72px;
}

#login-panel .login-brand-lockup .brand-name {
  color: #111111;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
}

#login-panel .login-brand-lockup .brand-subtitle {
  color: #111111;
  font-size: 0.95rem;
  opacity: 0.9;
}

#login-panel .login-brand,
#login-panel .login-heading,
#login-panel .login-lead,
#login-panel .login-subcopy {
  display: none;
}

#login-panel .login-card {
  width: min(100%, 28.5rem);
  padding: 1.7rem 2.2rem 1.5rem;
  gap: 0.95rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

#login-panel .login-card-title {
  margin: 0 0 0.6rem;
  text-align: center;
  font-size: 0.98rem;
}

#login-panel .field.login-field {
  gap: 0.4rem;
}

#login-panel .field span {
  color: #111111;
  font-size: 0.92rem;
}

#login-panel .field input {
  min-height: 2.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: #f5f5f5;
  border: 1px solid #c4c4c4;
  box-shadow: none;
  color: #111111 !important;
  -webkit-text-fill-color: #111111;
  caret-color: #111111;
  font-size: 16px;
}

#login-panel .field input[type="password"] {
  letter-spacing: 0.08em;
}

#login-panel .field input::placeholder {
  color: #6b7280;
  -webkit-text-fill-color: #6b7280;
}

#login-panel .field input:-webkit-autofill,
#login-panel .field input:-webkit-autofill:hover,
#login-panel .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #111111;
  caret-color: #111111;
  -webkit-box-shadow: 0 0 0 1000px #f5f5f5 inset;
  transition: background-color 5000s ease-in-out 0s;
}

#login-panel .field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

#login-panel .login-submit {
  min-height: 2.85rem;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

#login-panel .login-submit:hover {
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
  #login-panel .login-stage {
    width: min(100%, 24rem);
  }

  #login-panel .login-card {
    width: 100%;
    padding: 1.4rem;
  }

  #login-panel .login-logo {
    height: 60px;
  }

  #login-panel .login-brand-lockup .brand-name {
    font-size: 1.75rem;
  }
}

/* Topbar exact refinement */
.topbar {
  min-height: 96px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.topbar .brand-strip {
  width: auto;
  flex: 1 1 auto;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
}

.topbar .brand-lockup {
  gap: 0.95rem;
}

.topbar-logo {
  height: 54px;
}

.topbar .brand-name {
  color: #111111;
  font-size: 1.35rem;
  font-weight: 800;
}

.topbar .brand-subtitle {
  color: #111111;
  font-size: 0.92rem;
  opacity: 0.9;
}

.topbar .brand-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar .brand-view {
  display: none;
}

.topbar-actions {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.topbar .ghost-button,
.topbar .company-switcher,
.topbar .profile-chip {
  min-height: 44px;
}

.topbar #menu-toggle {
  min-width: 66px;
  padding: 0.55rem 0.95rem;
  border-radius: 14px;
}

.topbar .company-switcher {
  min-width: 192px;
  padding: 0.45rem 0.85rem;
}

.topbar .company-switcher span {
  font-size: 0.8rem;
  color: #4b5563;
}

.topbar .company-switcher select {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.85rem;
  color: #111827;
}

.topbar .profile-chip {
  min-width: 256px;
  padding: 0.4rem 0.85rem;
  gap: 0.7rem;
}

.topbar .profile-chip strong {
  font-size: 0.92rem;
  color: #111827;
  font-weight: 700;
}

.topbar .profile-chip span {
  font-size: 0.82rem;
  color: #6b7280;
}

.topbar .profile-avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.9rem;
}

.topbar #logout-button {
  padding: 0.55rem 1rem;
  border-radius: 14px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar .brand-strip {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
  }
}




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

.metric-card {
  display: grid;
  gap: 6px;
}

.metric-card span {
  font-size: 13px;
  color: #6b7280;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1.1;
  color: #111827;
}

.metric-card small {
  font-size: 12px;
  color: #7b8794;
}

.report-filter-card {
  margin-bottom: 0.8rem;
  overflow: visible;
  z-index: 6;
}

.report-filter-card.view-card:not(.is-collapsed) {
  resize: none;
  overflow: visible;
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.report-toolbar .primary-button,
.bulk-import-panel .primary-button,
.bulk-import-panel .ghost-button {
  min-height: 2.55rem;
  padding: 0.62rem 0.95rem;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, max-content));
  gap: 0.75rem;
  align-items: start;
  justify-content: start;
}

.report-field {
  justify-self: start;
  width: 100%;
}

.report-field-date {
  max-width: 13.8rem;
}

.report-field-dropdown {
  max-width: 19rem;
}

.report-field-switch {
  width: auto;
  min-width: 8.5rem;
  max-width: 9.5rem;
}

.report-filter-actions {
  justify-self: start;
  width: auto;
  flex-wrap: wrap;
}

.report-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: auto;
  padding: 0.15rem 0;
  border-radius: 0;
  border: none;
  background: transparent;
  width: fit-content;
}

.report-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 2.8rem;
  height: 1.18rem;
  min-height: 1.18rem;
  padding: 0;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.55), rgba(203, 213, 225, 0.92));
  position: relative;
  transition: background 160ms ease, border-color 160ms ease;
  cursor: pointer;
}

.report-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 0.07rem;
  left: 0.08rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 160ms ease;
}

.report-switch input[type="checkbox"]:checked {
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.report-switch input[type="checkbox"]:checked::before {
  transform: translateX(1.58rem);
}

.report-switch label {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text);
}

.report-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.report-metrics-grid {
  margin-top: 0.65rem;
  margin-bottom: 1rem;
  padding-inline: 0;
  box-sizing: border-box;
}

.report-chart-grid-spaced {
  padding-inline: 0;
  padding-bottom: 0.15rem;
  box-sizing: border-box;
}

.report-metric-card {
  justify-items: center;
  text-align: center;
  gap: 0.3rem;
  padding: 0.8rem 0.85rem;
}

.report-metric-card strong {
  font-size: clamp(1.25rem, 2.2vw, 1.95rem);
  line-height: 1.02;
  word-break: break-word;
}

.report-metric-card span,
.report-metric-card small {
  width: 100%;
  text-align: center;
}

.report-multiselect {
  position: relative;
  width: 100%;
}

.report-multiselect summary {
  list-style: none;
}

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

.report-multiselect-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.report-multiselect-summary::after {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid #8b98a8;
  border-bottom: 2px solid #8b98a8;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.report-multiselect[open] .report-multiselect-summary {
  border-color: rgba(47, 128, 237, 0.34);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.report-multiselect[open] .report-multiselect-summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.report-multiselect-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(47, 128, 237, 0.16);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  width: min(100%, 19rem);
  min-width: 16rem;
}

.report-multiselect-search input {
  min-height: 2.35rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  padding: 0.58rem 0.8rem;
  background: #fff;
}

.report-multiselect-options {
  display: grid;
  gap: 0.2rem;
  max-height: 8.2rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.report-multiselect-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.15rem;
  padding: 0.42rem 0.35rem;
  border-radius: 0.7rem;
}

.report-multiselect-row:hover {
  background: rgba(37, 99, 235, 0.05);
}

.report-multiselect-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}

.report-multiselect-all {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding-block: 0.45rem;
  margin-bottom: 0.15rem;
}

.report-multiselect-option.is-hidden {
  display: none;
}

.bulk-import-panel {
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.bulk-import-actions {
  align-items: center;
  flex-wrap: wrap;
}

.bulk-import-actions .inline-file-field {
  max-width: min(100%, 24rem);
}

.icon-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #2563eb;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-action-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.icon-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.icon-action-button[data-receivable-delete] {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.16);
}

@media (max-width: 980px) {
  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-field,
  .report-field-date,
  .report-field-dropdown,
  .report-field-switch {
    width: 100%;
    max-width: 100%;
  }
}

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

  .report-filter-actions {
    width: 100%;
  }

  .report-switch,
  .report-multiselect-panel {
    width: 100%;
    min-width: 0;
  }
}
