@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --bg: #f4eee4;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffdfa;
  --ink: #13211e;
  --muted: #66726d;
  --line: #d8cebf;
  --line-soft: #ebe1d3;
  --accent: #123f39;
  --accent-dark: #0a2a26;
  --accent-soft: #dce9e4;
  --gold: #b78d4b;
  --gold-soft: #e6cfaa;
  --charcoal: #1c2523;
  --danger: #b04646;
  --surface: #fcf9f3;
  --surface-alt: #f7f0e6;
  --surface-strong: #ecdfce;
  --shadow: 0 20px 48px rgba(18, 28, 25, 0.07);
  --shadow-soft: 0 10px 24px rgba(18, 28, 25, 0.045);
}

/* Hybrid V10: compact finance workspace inspired by the approved prototype. */
@media screen {
  body {
    background: #f5f7f6;
  }

  body::before {
    display: none;
  }

  .page-shell {
    display: block;
    min-height: 100vh;
  }

  .brand-panel {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 0;
    padding: 0;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #dfe6e3;
    box-shadow: 0 5px 20px rgba(15, 45, 39, 0.05);
    backdrop-filter: blur(18px);
  }

  .brand-card {
    width: min(100%, 1480px);
    min-height: 0;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .brand-block {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 42px auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
  }

  .brand-mark {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
  }

  .brand-mark img {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    filter: none;
  }

  .brand-panel .eyebrow {
    grid-column: 2;
    margin: 0;
    color: var(--accent);
    font-size: 0.55rem;
    letter-spacing: 0.13em;
  }

  .brand-block h1 {
    grid-column: 2;
    margin: 0;
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
  }

  .brand-copy,
  .brand-highlight-panel,
  .sidebar-credit {
    display: none;
  }

  .sidebar-nav {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 10px;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #53625d;
    background: transparent;
    font-size: 0.73rem;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 8px;
    color: #60716b;
    background: #edf2f0;
  }

  .nav-icon svg {
    width: 13px;
    height: 13px;
  }

  .nav-btn:hover {
    color: var(--accent);
    background: #eef5f2;
    transform: none;
  }

  .nav-btn.active {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 7px 18px rgba(18, 63, 57, 0.18);
    transform: none;
  }

  .nav-btn.active .nav-icon {
    color: #fff;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
  }

  .app-panel {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 16px 20px 30px;
  }

  .card {
    border-color: #dfe5e2;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 22px rgba(19, 42, 36, 0.045);
    backdrop-filter: none;
  }

  .dashboard-top {
    padding: 13px 16px;
    border-radius: 15px;
    background: #fff;
  }

  .dashboard-top-copy h2 {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.28rem;
  }

  .dashboard-top-copy #welcomeText {
    margin-bottom: 0;
    font-size: 0.76rem;
  }

  .dashboard-top-meta {
    gap: 6px;
  }

  .meta-pill {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.56rem;
  }

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

  .period-switcher {
    display: grid;
    grid-template-columns: 30px minmax(118px, auto) 30px;
    align-items: center;
    min-height: 38px;
    padding: 3px;
    border: 1px solid #dfe5e2;
    border-radius: 12px;
    background: #f3f6f5;
  }

  .period-switcher button {
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
  }

  .period-switcher button:hover {
    color: var(--accent);
    background: #fff;
  }

  .period-switcher input {
    min-width: 0;
    padding: 4px;
    border: 0;
    color: var(--ink);
    background: transparent;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    outline: 0;
  }

  .dashboard-overview-strip {
    gap: 10px;
  }

  .overview-tile {
    min-height: 112px;
    padding: 15px;
  }

  .overview-tile strong {
    font-size: 1rem;
  }

  .dashboard-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    padding: 18px;
    color: var(--ink);
    border-color: #dce5e1;
    border-radius: 17px;
    background:
      radial-gradient(circle at 90% 10%, rgba(71, 147, 119, 0.12), transparent 28%),
      linear-gradient(135deg, #ffffff, #f1f7f4);
  }

  .dashboard-hero .eyebrow {
    color: #3e806e;
  }

  .dashboard-hero h3 {
    max-width: none;
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
  }

  .dashboard-lead {
    color: var(--muted);
    font-size: 0.8rem;
  }

  .hero-storyline span {
    color: #49615a;
    border-color: #d9e5e0;
    background: #edf4f1;
  }

  .hero-ai-launch {
    color: var(--ink);
    border-color: #cfded8;
    background: #fff;
    box-shadow: 0 6px 18px rgba(20, 68, 59, 0.06);
  }

  .hero-ai-copy small {
    color: var(--muted);
  }

  .hero-ai-arrow {
    color: var(--accent);
  }

  .hero-action-btn {
    color: var(--accent);
    border-color: #cfded8;
    background: #fff;
  }

  .hero-action-btn:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
  }

  .dashboard-pill {
    color: var(--ink);
    border-color: #d6e2dd;
    background: rgba(255, 255, 255, 0.78);
  }

  .dashboard-pill span {
    color: var(--muted);
  }

  .dashboard-pill-feature {
    border-color: #d8c49d;
    background: #fbf5e9;
  }

  .hero-orb {
    opacity: 0.35;
  }

  .analytics-panel {
    background: #fff;
  }

  input,
  select,
  textarea {
    border-color: #dce3e0;
    background: #f8faf9;
  }

  .expense-quick-fill {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
  }

  .expense-quick-fill > span {
    margin-right: 3px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .expense-quick-fill button {
    padding: 6px 9px;
    border: 1px solid #dce5e1;
    border-radius: 9px;
    color: #52635d;
    background: #f4f7f6;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
  }

  .expense-quick-fill button:hover {
    color: var(--accent);
    border-color: #bcd2ca;
    background: #eaf3ef;
  }
}

@media screen and (max-width: 900px) {
  body.app-authenticated .brand-panel,
  body.app-authenticated.mobile-nav-open .brand-panel {
    display: block;
    position: sticky;
    inset: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
  }

  .brand-card,
  body.app-authenticated.mobile-nav-open .brand-card {
    min-height: 0;
    padding: 8px 12px 0;
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .brand-block {
    width: 100%;
  }

  .sidebar-nav {
    order: 3;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 2px 12px 8px;
    justify-content: flex-start;
  }

  .nav-btn {
    min-height: 36px;
    padding: 6px 10px;
  }

  .nav-label {
    display: block;
    font-size: 0.7rem;
  }

  .app-panel {
    padding: 12px;
  }

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

  .dashboard-top,
  .dashboard-hero,
  .section-head,
  .records-head,
  .print-head,
  .report-header,
  .utility-card,
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-top {
    gap: 10px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .period-switcher {
    grid-column: 1 / -1;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 520px) {
  .brand-panel .eyebrow {
    font-size: 0.5rem;
  }

  .brand-block h1 {
    font-size: 0.9rem;
  }

  .brand-mark,
  .brand-mark img {
    width: 36px;
    height: 36px;
  }

  .brand-block {
    grid-template-columns: 36px auto;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .dashboard-overview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .overview-tile {
    min-height: 105px;
    padding: 12px;
  }

  .dashboard-hero {
    padding: 15px;
  }

  .top-actions .primary-btn,
  .top-actions .ghost-btn {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.72rem;
  }

  .expense-quick-fill > span {
    flex-basis: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 135, 70, 0.16), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(18, 61, 54, 0.12), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.52), transparent 22%),
    linear-gradient(180deg, #fbf6ef 0%, #efe7da 42%, #f5efe6 100%);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 56%);
  opacity: 0.3;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.nav-btn,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(183, 141, 75, 0.42);
  outline-offset: 3px;
}

.page-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
  width: 100%;
}

.brand-panel {
  padding: 16px;
  background:
    radial-gradient(circle at top, rgba(230, 198, 137, 0.18), transparent 28%),
    linear-gradient(180deg, #163c35 0%, #102c27 52%, #0d2420 100%);
  color: #f6f4ef;
  position: relative;
  min-height: 100vh;
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  padding: 16px 14px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at top right, rgba(255, 224, 168, 0.08), transparent 22%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 36px rgba(0, 0, 0, 0.08);
}

.brand-block {
  display: grid;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  max-width: 100%;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--gold);
}

.brand-panel .eyebrow {
  color: #ffe0a8;
}

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

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.04em;
  font-weight: 700;
}

h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.54rem;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h3 {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  margin-bottom: 0;
  letter-spacing: -0.015em;
  font-weight: 800;
}

.brand-copy {
  color: rgba(246, 244, 239, 0.78);
  line-height: 1.68;
  font-size: 0.82rem;
  max-width: 190px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.brand-highlight-panel {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.brand-highlight-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.brand-highlight-item span,
.brand-highlight-item strong {
  display: block;
}

.brand-highlight-item span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 244, 219, 0.66);
  margin-bottom: 6px;
}

.brand-highlight-item strong {
  color: #fff9ef;
  font-size: 0.92rem;
}

.sidebar-credit {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(246, 244, 239, 0.72);
}

.sidebar-credit span,
.sidebar-credit strong {
  display: block;
}

.sidebar-credit span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.sidebar-credit strong {
  font-size: 0.98rem;
  color: #fff4dc;
}

.nav-btn {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(246, 244, 239, 0.84);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.05));
  color: #f7e5bf;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  flex: 1 1 auto;
  line-height: 1.2;
}

.nav-btn.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(255, 224, 168, 0.08), transparent 70%);
  color: #fffaf1;
  border-color: rgba(242, 215, 161, 0.34);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  transform: translateX(2px);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.075);
  color: #fffaf1;
  transform: translateX(1px);
}

.nav-btn.active .nav-icon {
  background: linear-gradient(180deg, rgba(255, 238, 205, 0.22), rgba(255, 255, 255, 0.08));
  color: #fff0ca;
  border-color: rgba(255, 255, 255, 0.12);
}

.brand-highlights {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.brand-highlights div {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-highlights strong,
.brand-highlights span {
  display: block;
}

.brand-highlights span {
  margin-top: 4px;
  color: rgba(246, 245, 241, 0.75);
}

.app-panel {
  padding: 22px 24px 28px;
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(220, 211, 198, 0.82);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 18px;
}

.auth-card {
  max-width: 548px;
  margin: 28px auto;
  padding: 26px 28px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(248, 241, 231, 0.92)),
    radial-gradient(circle at top, rgba(183, 141, 75, 0.09), transparent 26%);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-brand img {
  width: 188px;
  max-width: 72%;
  height: auto;
  object-fit: contain;
}

.card-head p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.dashboard-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px 20px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.88), rgba(250, 245, 236, 0.8)),
    radial-gradient(circle at top right, rgba(180, 135, 70, 0.08), transparent 24%);
  border-radius: 20px;
  box-shadow: none;
  border: 1px solid rgba(226, 214, 196, 0.9);
  position: relative;
  overflow: hidden;
}

.dashboard-top-copy {
  display: grid;
  gap: 4px;
  max-width: 62ch;
}

.dashboard-top-copy h2 {
  margin-bottom: 2px;
  font-size: 1.56rem;
  letter-spacing: -0.04em;
}

.dashboard-top-copy #welcomeText {
  max-width: 720px;
  font-size: 0.9rem;
  line-height: 1.56;
}

.dashboard-top::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 135, 70, 0.35), transparent);
}

.dashboard-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(220, 210, 194, 0.92);
  color: #35514b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-pill.accent {
  background: linear-gradient(180deg, rgba(18, 61, 54, 0.1), rgba(180, 135, 70, 0.08));
  color: #173f38;
}

.dashboard-top p:last-child,
.section-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.top-actions .primary-btn,
.top-actions .ghost-btn {
  min-height: 42px;
  padding-inline: 16px;
}

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

.app-view {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.section-caption {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.smart-entry-tools {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(180, 135, 70, 0.25);
  border-radius: 17px;
  background:
    radial-gradient(circle at right, rgba(180, 135, 70, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(238, 247, 243, 0.92), rgba(252, 247, 238, 0.96));
}

.smart-entry-copy {
  display: grid;
  gap: 3px;
}

.smart-entry-copy span,
.smart-briefing-head span {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.smart-entry-copy strong,
.smart-briefing-head strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.smart-entry-copy small,
.field-intelligence {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.smart-entry-actions,
.inline-command-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.smart-upload-btn {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.smart-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.receipt-preview-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(180, 135, 70, 0.18);
}

.receipt-preview-wrap img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.receipt-preview-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.listening {
  border-color: #b44747 !important;
  color: #9e3030 !important;
  animation: pulse-listening 1.2s ease-in-out infinite;
}

@keyframes pulse-listening {
  50% { box-shadow: 0 0 0 6px rgba(180, 71, 71, 0.1); }
}

.inline-command-control input {
  flex: 1 1 280px;
}

.inline-command-control button {
  flex: 0 0 auto;
}

.smart-briefing {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(19, 70, 61, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(22, 68, 60, 0.06), rgba(180, 135, 70, 0.08));
}

.smart-briefing-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.smart-briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.smart-briefing-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(25, 68, 60, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.68);
}

.smart-briefing-grid article.risk {
  border-color: rgba(162, 67, 55, 0.25);
  background: rgba(255, 242, 237, 0.76);
}

.smart-briefing-grid article > span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.smart-briefing-grid article strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.8rem;
}

.smart-briefing-grid article small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.smart-report-briefing {
  padding: 14px;
  border-radius: 12px;
  background: #f3f7f4;
}

.smart-report-briefing > p {
  margin: 0;
  color: #3f514c;
  line-height: 1.55;
}

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

.overview-tile {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(180, 135, 70, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 241, 232, 0.94));
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
  padding: 16px 16px 14px;
}

.overview-tile::after {
  content: "";
  position: absolute;
  inset: auto 20px 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(180, 135, 70, 0.74), rgba(21, 68, 59, 0.92));
  opacity: 0.52;
}

.overview-tile span,
.overview-tile strong,
.overview-tile small {
  display: block;
}

.overview-tile span {
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.overview-tile strong {
  font-size: 1.04rem;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  line-height: 1.18;
}

.overview-tile small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

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

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

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.dashboard-intelligence-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
}

.dashboard-alert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) 250px;
  gap: 18px;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(228, 190, 119, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(135deg, rgba(20, 66, 58, 0.98), rgba(12, 40, 35, 0.96));
  color: #f7f5ef;
  border: 1px solid rgba(24, 76, 65, 0.18);
  overflow: hidden;
  padding: 20px 22px 18px;
  border-radius: 22px;
  isolation: isolate;
}

.dashboard-hero .eyebrow {
  color: #ffe0a8;
}

.dashboard-hero h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.68rem, 2.6vw, 2.35rem);
  margin-bottom: 10px;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 11ch;
}

.dashboard-lead {
  margin: 0;
  max-width: 620px;
  color: rgba(247, 245, 239, 0.84);
  line-height: 1.62;
  font-size: 0.9rem;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(2px);
}

.hero-orb-one {
  width: 240px;
  height: 240px;
  top: -70px;
  right: -30px;
  background: radial-gradient(circle, rgba(228, 190, 119, 0.24), rgba(228, 190, 119, 0));
}

.hero-orb-two {
  width: 180px;
  height: 180px;
  bottom: -80px;
  left: 30%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
}

.hero-storyline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.hero-storyline span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(247, 245, 239, 0.82);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

.hero-ai-launch {
  width: min(100%, 510px);
  margin-top: 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 224, 168, 0.28);
  border-radius: 15px;
  color: #fffaf0;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.12), rgba(228, 190, 119, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hero-ai-launch:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 224, 168, 0.52);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.16), rgba(228, 190, 119, 0.13));
}

.hero-ai-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #163f37;
  background: linear-gradient(145deg, #ffe1a7, #c99a4c);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hero-ai-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hero-ai-copy strong {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.hero-ai-copy small {
  overflow: hidden;
  color: rgba(247, 245, 239, 0.68);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-ai-arrow {
  color: #ffe0a8;
  font-size: 1.1rem;
  text-align: right;
}

.analytics-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(226, 216, 202, 0.92);
  background:
    radial-gradient(circle at top right, rgba(180, 135, 70, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(247, 241, 232, 0.95));
  box-shadow: var(--shadow-soft);
}

.chart-bars {
  display: block;
  min-height: 196px;
}

.trend-chart-shell {
  display: grid;
  gap: 12px;
  padding: 2px 0 0;
}

.chart-intelligence {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 135, 70, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(circle at right, rgba(180, 135, 70, 0.11), transparent 35%),
    linear-gradient(135deg, rgba(238, 247, 243, 0.96), rgba(251, 246, 237, 0.96));
}

.chart-intelligence-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 32px;
  padding: 0 9px;
  border-radius: 10px;
  color: #fff8e8;
  background: linear-gradient(135deg, #1a5a4f, #b48746);
  box-shadow: 0 8px 18px rgba(21, 68, 59, 0.18);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.chart-intelligence p {
  margin: 0;
  color: #35534d;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

.trend-chart-svg {
  filter: drop-shadow(0 6px 12px rgba(20, 68, 59, 0.06));
}

.trend-chart-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  padding: 12px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 232, 0.92));
  border: 1px solid rgba(226, 216, 202, 0.94);
}

.mini-stat span,
.mini-stat strong,
.mini-stat small {
  display: block;
}

.mini-stat span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.mini-stat strong {
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.mini-stat small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.trend-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.trend-area {
  fill: url(#expenseAreaGradient);
  opacity: 0.78;
}

.trend-grid-line {
  stroke: rgba(78, 96, 89, 0.13);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

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

.trend-line-expense {
  stroke: #16483f;
}

.cash-bar {
  fill: url(#cashBarGradient);
  opacity: 0.46;
  filter: drop-shadow(0 3px 5px rgba(156, 116, 56, 0.1));
  transition: opacity 160ms ease;
}

.cash-bar:hover {
  opacity: 0.78;
}

.trend-dot {
  stroke: #fffaf1;
  stroke-width: 2;
}

.trend-dot-expense {
  fill: #16483f;
}

.trend-dot-current {
  stroke: #d6b06b;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 7px rgba(180, 135, 70, 0.68));
}

.trend-axis-label {
  fill: #73807a;
  font-size: 13px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

.trend-value-label {
  fill: #8a938f;
  font-size: 10px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-weight: 700;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch.expense {
  background: #16483f;
}

.legend-swatch.cash {
  border-radius: 4px;
  background: linear-gradient(180deg, #d2a85e, #9c7438);
}

.legend-swatch.current {
  background: rgba(180, 135, 70, 0.12);
  border: 1px solid rgba(180, 135, 70, 0.42);
}

.category-chart {
  display: grid;
  gap: 14px;
}

.category-row {
  display: grid;
  gap: 8px;
}

.category-card {
  padding: 12px 13px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 241, 232, 0.92));
  border: 1px solid rgba(226, 216, 202, 0.9);
  box-shadow: var(--shadow-soft);
}

.category-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.category-row-head strong {
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-row-head span {
  color: var(--muted);
  font-size: 0.76rem;
}

.category-row-track {
  height: 10px;
  border-radius: 999px;
  background: #ede5d8;
  overflow: hidden;
}

.category-row-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b48746, #15443b);
}

.category-card small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b48746, #15443b);
  display: inline-block;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.insight-chip {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(225, 216, 204, 0.92);
  background: linear-gradient(180deg, #fffefb, #f7f0e5);
  box-shadow: var(--shadow-soft);
}

.insight-chip span,
.insight-chip strong,
.insight-chip small {
  display: block;
}

.insight-chip span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.insight-chip strong {
  font-size: 0.92rem;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.insight-chip small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(229, 220, 208, 0.94);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f2e8d8, #e6d8c1);
  color: #173c35;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.activity-copy,
.activity-meta {
  display: grid;
  gap: 4px;
}

.activity-copy strong,
.activity-meta strong {
  font-size: 0.82rem;
  line-height: 1.3;
}

.activity-copy span,
.activity-meta span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

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

.empty-chart {
  padding: 18px;
  border-radius: 16px;
  background: #f7f1e8;
  color: var(--muted);
}

.dashboard-pill-grid {
  display: grid;
  gap: 12px;
  align-content: start;
}

.dashboard-pill {
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dashboard-pill-feature {
  background:
    radial-gradient(circle at top right, rgba(228, 190, 119, 0.18), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
}

.dashboard-pill span,
.dashboard-pill strong {
  display: block;
}

.dashboard-pill span {
  color: rgba(247, 245, 239, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  margin-bottom: 7px;
}

.dashboard-pill strong {
  font-size: 0.94rem;
  color: #fffaf0;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.dashboard-pill-feature strong {
  color: #fffdf8;
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

body[data-active-view="aiView"] .period-switcher,
body[data-active-view="operationsView"] .period-switcher,
body[data-active-view="settingsView"] .period-switcher {
  display: none;
}

.hero-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fffaf0;
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 700;
  letter-spacing: 0;
  font-size: 0.78rem;
  box-shadow: none;
}

.alert-card {
  border-color: #efc9c9;
  background: linear-gradient(180deg, #fffaf8 0%, #fff3f0 100%);
}

.payroll-reminder-card {
  border-color: #ecd39c;
  background: linear-gradient(180deg, #fffbf2 0%, #fef2dc 100%);
}

.payroll-reminder-card .form-actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

.payroll-reminder-card h3,
.dashboard-panel h3,
.financial-panel h3,
.vehicle-panel h3 {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.alert-summary {
  margin-bottom: 14px;
  font-weight: 700;
  color: #8d1d1d;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #f0c9c9;
  background: #fff;
}

.alert-item-head,
.dashboard-task-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.alert-item strong,
.alert-item span {
  display: block;
}

.alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mobile-alert-toggle {
  display: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(180, 135, 70, 0.34);
  border-radius: 12px;
  color: #36564f;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.table-btn.quiet {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.table-btn.complete {
  color: #155247;
  border-color: #b9d7ce;
  background: #edf7f3;
}

.compact-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.compact-filter select {
  min-width: 145px;
  padding: 9px 34px 9px 11px;
}

.alert-item span {
  margin-top: 4px;
  color: #6d3f3f;
}

.alert-item.overdue {
  border-color: #e4aaaa;
  background: #fff1f1;
}

.alert-item.due-soon {
  border-color: #ecd39c;
  background: #fff9ec;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 243, 236, 0.96));
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(225, 216, 204, 0.95);
  box-shadow: none;
}

.stat-card strong {
  font-size: 0.96rem;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.dashboard-panel {
  min-height: 100%;
  border: 1px solid rgba(225, 216, 204, 0.95);
  box-shadow: var(--shadow-soft);
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(247, 241, 232, 0.95));
}

.dashboard-action-grid .dashboard-panel,
.dashboard-action-grid .payroll-reminder-card,
.dashboard-action-grid .alert-card {
  align-self: start;
}

.financial-panel,
.vehicle-panel {
  display: grid;
  align-content: start;
  gap: 2px;
}

.financial-panel {
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(248, 242, 233, 0.96));
}

.vehicle-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(245, 239, 229, 0.96));
}

.finance-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finance-stats-grid .stat-card {
  padding: 15px 14px 14px;
  border-radius: 16px;
  min-height: 88px;
}

.finance-stats-grid .stat-card span {
  margin-bottom: 7px;
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1.35;
  font-weight: 800;
}

.finance-stats-grid .stat-card strong {
  font-size: 0.98rem;
  line-height: 1.38;
  letter-spacing: -0.015em;
  font-weight: 800;
  word-break: normal;
  overflow-wrap: anywhere;
}

.dashboard-panel-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.54;
}

.dashboard-task-list {
  display: grid;
  gap: 12px;
}

.dashboard-task {
  padding: 12px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(230, 221, 210, 0.95);
}

.dashboard-task strong,
.dashboard-task span {
  display: block;
}

.dashboard-task span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.dashboard-task.overdue {
  border-color: #e1b0b0;
  background: #fff4f4;
}

.dashboard-task.due-soon {
  border-color: #ecd39c;
  background: #fffaf0;
}

.dashboard-task.empty {
  background: #fbf8f1;
}

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

.dashboard-insight-grid .insight-card:last-child {
  grid-column: 1 / -1;
}

.insight-card {
  padding: 15px 15px;
  border-radius: 16px;
  border: 1px solid rgba(228, 218, 206, 0.95);
  background: linear-gradient(180deg, #fffefb, #f8f2e8);
  box-shadow: none;
}

.insight-card span,
.insight-card strong {
  display: block;
}

.insight-card span {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.insight-card strong {
  font-size: 0.92rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.salary-overview-card {
  background:
    radial-gradient(circle at right top, rgba(180, 135, 70, 0.09), transparent 26%),
    linear-gradient(180deg, rgba(255, 254, 249, 0.98), rgba(246, 240, 229, 0.96));
}

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

.salary-kpi-card {
  padding: 16px 15px;
  border-radius: 16px;
  border: 1px solid #e6dac8;
  background: linear-gradient(180deg, #fffefa, #fbf5eb);
}

.salary-kpi-card span,
.salary-kpi-card strong {
  display: block;
}

.salary-kpi-card span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.salary-kpi-card strong {
  font-size: 1rem;
  line-height: 1.34;
  letter-spacing: -0.02em;
}

.content-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.single-main {
  grid-template-columns: 1fr;
}

.section-head,
.records-head,
.print-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  min-width: 0;
}

label span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5d6660;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(14, 107, 97, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(18, 61, 54, 0.06);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.table-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.84rem;
  letter-spacing: -0.01em;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
}

.secondary-btn {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
}

.table-btn {
  padding: 8px 12px;
  margin-right: 6px;
  border-radius: 12px;
  background: #f4eee4;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.table-btn.delete {
  color: var(--danger);
}

.table-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(18, 61, 54, 0.08);
}

.hint-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f5f0e6;
  color: var(--muted);
}

.hint-box strong {
  color: var(--ink);
  margin-left: 8px;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-weight: 600;
}

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

.filters input,
.filters select {
  min-width: 200px;
}

.full-width {
  grid-column: 1 / -1;
}

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

.checkbox-label {
  align-content: end;
}

.checkbox-label input {
  width: 20px;
  height: 20px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.settings-check span {
  margin: 0;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.notification-schedule-note {
  padding: 16px 18px;
  border: 1px solid rgba(31, 79, 70, 0.16);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(240, 227, 197, 0.38), rgba(235, 244, 239, 0.72));
  color: var(--muted);
}

.notification-schedule-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.notification-schedule-note p {
  margin: 0;
  line-height: 1.55;
}

.notification-schedule-note code {
  color: var(--accent);
  font-weight: 700;
}

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

.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid rgba(230, 221, 210, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(18, 63, 57, 0.5) rgba(216, 206, 191, 0.38);
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(216, 206, 191, 0.38);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(18, 63, 57, 0.5);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pagination-actions strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.pagination-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

th,
td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid #eee6d8;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 800;
  background: rgba(247, 241, 232, 0.8);
  backdrop-filter: blur(12px);
}

td.amount-cell {
  font-weight: 800;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(250, 246, 239, 0.92);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-chip.neutral {
  color: #4f5b66;
  background: #f4efe7;
  border-color: #e3d7c6;
}

.status-chip.processed {
  color: #11453d;
  background: #edf7f3;
  border-color: #cfe5dc;
}

.status-chip.pending {
  color: #7a5410;
  background: #fff7e6;
  border-color: #ead19b;
}

.status-chip.overdue {
  color: #8c2e2e;
  background: #fff0f0;
  border-color: #e4b7b7;
}

.status-chip.inactive {
  color: #6b5c54;
  background: #f5f0eb;
  border-color: #ded2c5;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--muted);
  padding: 18px;
  border: 1px dashed #decfb8;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(251, 247, 239, 0.98), rgba(246, 238, 226, 0.95));
}

.empty-state-title,
.empty-state-copy {
  display: block;
}

.empty-state-title {
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 6px;
}

.empty-state-copy {
  font-size: 0.88rem;
  line-height: 1.55;
}

.report-form {
  align-items: end;
}

.report-form .form-actions {
  flex-wrap: wrap;
}

.utility-actions {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.utility-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

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

.utility-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.utility-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.danger-card {
  border-color: #e7c8c8;
  background: #fff8f8;
}

.danger-btn {
  color: var(--danger);
  border-color: #e1b8b8;
}

.odometer-text,
.subtle-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.report-sheet {
  background: #fffef9;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid #eadfce;
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 20px 40px rgba(12, 31, 27, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, #123d36, #1a5a4f);
}

.toast.error {
  background: linear-gradient(135deg, #8f3838, #ba5147);
}

.toast strong,
.toast span {
  display: block;
}

.app-loading {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 55, 48, 0.94);
  box-shadow: 0 18px 44px rgba(10, 34, 29, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-loading.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-loading strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #f2cb83;
  border-radius: 50%;
  animation: loading-spin 700ms linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.toast strong {
  margin-bottom: 4px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast span {
  font-size: 0.9rem;
  line-height: 1.45;
}

.payroll-sheet {
  display: grid;
  gap: 22px;
  margin-top: 18px;
  background: #fffef9;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid #eadfce;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8dfd2;
}

.report-header-main h3 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  letter-spacing: -0.04em;
}

.report-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

.report-badge {
  min-width: 140px;
  border-radius: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #0e6b61, #0a4f48);
  color: #fff;
  text-align: right;
}

.report-badge-logo {
  width: 60px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 0 10px auto;
  filter: drop-shadow(0 10px 16px rgba(7, 31, 28, 0.22));
}

.report-badge span,
.report-badge strong {
  display: block;
}

.report-badge span {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.report-badge strong {
  font-size: 1.25rem;
  margin-top: 4px;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 6px;
}

.meta-item {
  border: 1px solid #e8dfd2;
  border-radius: 18px;
  padding: 18px 18px;
  background: #fff;
}

.meta-item span,
.meta-item strong {
  display: block;
}

.meta-item span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.meta-item strong {
  font-size: 1rem;
  line-height: 1.45;
}

.print-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  color: var(--muted);
}

.report-summary {
  display: grid;
  gap: 22px;
}

.report-insight-banner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-insight-item {
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: linear-gradient(180deg, #fffefb, #f7f0e5);
  box-shadow: var(--shadow-soft);
}

.overview-tile:hover,
.analytics-panel:hover,
.dashboard-panel:hover,
.insight-chip:hover,
.activity-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(18, 28, 25, 0.08);
}

.report-insight-item span,
.report-insight-item strong,
.report-insight-item small {
  display: block;
}

.report-insight-item span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.report-insight-item strong {
  font-size: 1.1rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.report-insight-item small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

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

.summary-box {
  padding: 20px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcf8ef 0%, #f4ecde 100%);
  border: 1px solid #eadfce;
}

.summary-box span,
.summary-box strong {
  display: block;
}

.summary-box span {
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.summary-box strong {
  font-size: 1.35rem;
  line-height: 1.32;
}

.report-section {
  display: grid;
  gap: 12px;
}

.report-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.report-section-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.report-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.report-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fff;
  break-inside: avoid;
}

.report-category-row > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.report-category-row i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--category-color, #64748b);
}

.report-category-row > strong {
  text-align: right;
  white-space: nowrap;
}

.report-category-row > strong small {
  margin-left: 5px;
  color: var(--muted);
  font-weight: 600;
}

.report-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.report-table-wrap {
  border: 1px solid #eadfce;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.report-sheet table {
  font-size: 0.95rem;
}

.report-sheet td {
  vertical-align: top;
  line-height: 1.5;
}

.report-sheet thead {
  background: #f4eee2;
}

.report-sheet th {
  color: #4f5b66;
  font-size: 0.78rem;
}

.report-sheet tbody tr:nth-child(even) {
  background: #fcfaf5;
}

.amount-strong {
  font-weight: 800;
  white-space: nowrap;
}

.report-footer {
  display: block;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid #e8dfd2;
}

.report-footer-note {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

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

.signature-line {
  min-height: 88px;
  border: 1px solid #e8dfd2;
  border-radius: 22px;
  padding: 18px 20px;
  background: #fff;
  display: flex;
  align-items: end;
}

.signature-line span {
  display: block;
  width: 100%;
  padding-top: 30px;
  border-top: 1px solid #cfc2ad;
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

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

.ai-workspace {
  display: grid;
  gap: 14px;
}

.ai-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    radial-gradient(circle at 90% 20%, rgba(230, 198, 137, 0.24), transparent 28%),
    linear-gradient(135deg, #153f37, #0d2925);
  color: #fffaf1;
  border-color: rgba(18, 63, 57, 0.2);
}

.ai-setup-notice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(180, 135, 70, 0.3);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(252, 246, 233, 0.98), rgba(239, 246, 242, 0.96));
  color: var(--ink);
}

.ai-setup-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #173f38;
  background: linear-gradient(145deg, #f6d99e, #c59649);
  font-size: 0.72rem;
  font-weight: 900;
}

.ai-setup-notice strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.84rem;
}

.ai-setup-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.ai-question-form :disabled,
.ai-suggestions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.ai-hero-card .eyebrow {
  color: #ffe0a8;
}

.ai-hero-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 8px;
}

.ai-hero-card .section-caption {
  max-width: 720px;
  color: rgba(255, 250, 241, 0.74);
}

.ai-chat-card {
  display: grid;
  gap: 14px;
}

.ai-conversation {
  display: grid;
  gap: 10px;
  max-height: 520px;
  min-height: 190px;
  padding: 6px;
  overflow-y: auto;
}

.ai-message {
  width: min(760px, 88%);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fffefb, #f7f0e5);
}

.ai-message.user {
  justify-self: end;
  background: linear-gradient(135deg, #17483f, #0f332d);
  color: #fffaf1;
  border-color: transparent;
}

.ai-message span {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ai-message p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.65;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggestions button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 750;
}

.ai-question-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ai-question-form textarea {
  min-height: 86px;
  resize: vertical;
}

.ai-question-form button {
  min-height: 48px;
}

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

.ai-capability span,
.ai-capability strong {
  display: block;
}

.ai-capability span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ai-capability strong {
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .page-shell,
  .stats-grid,
  .dashboard-overview-strip,
  .dashboard-analytics-grid,
  .dashboard-intelligence-grid,
  .dashboard-summary-grid,
  .dashboard-action-grid,
  .dashboard-alert-grid,
  .dashboard-insight-grid,
  .salary-kpi-grid,
  .report-meta-grid,
  .summary-bar,
  .report-footer,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    position: relative;
    top: auto;
    height: auto;
    padding: 18px 18px 0;
  }

  .app-panel {
    padding: 18px;
  }

  .brand-card {
    min-height: 0;
  }

  .settings-utility-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero,
  .dashboard-pill-grid,
  .finance-stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    gap: 18px;
    padding: 24px 22px;
  }

  .dashboard-hero h3 {
    max-width: none;
  }

  .dashboard-pill {
    min-height: 0;
  }

  .dashboard-top,
  .dashboard-hero,
  .section-head,
  .records-head,
  .print-head,
  .report-header,
  .utility-card,
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions,
  .dashboard-quick-actions,
  .form-actions {
    flex-wrap: wrap;
  }

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

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at top, rgba(180, 135, 70, 0.1), transparent 24%),
      linear-gradient(180deg, #f7f2ea 0%, #f0e9de 52%, #f7f2ea 100%);
  }

  .page-shell {
    display: block;
  }

  body.app-authenticated .brand-panel {
    display: none;
  }

  body.app-authenticated.mobile-nav-open .brand-panel {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow-y: auto;
    min-height: 100vh;
    padding: 14px;
  }

  .brand-panel {
    padding: 14px 14px 0;
    background:
      radial-gradient(circle at top, rgba(230, 198, 137, 0.16), transparent 24%),
      linear-gradient(180deg, #183f38 0%, #112f2a 100%);
  }

  .brand-card {
    gap: 12px;
    padding: 13px;
    border-radius: 24px;
  }

  .brand-highlight-panel {
    grid-template-columns: 1fr 1fr;
  }

  body.app-authenticated.mobile-nav-open .brand-card {
    min-height: calc(100vh - 28px);
  }

  h1 {
    font-size: 2.18rem;
    line-height: 0.95;
    margin-bottom: 8px;
  }

  .brand-copy {
    max-width: none;
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .sidebar-nav {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-btn {
    padding: 11px 12px;
    font-size: 0.83rem;
    min-height: 54px;
  }

  .nav-label {
    display: block;
    font-size: 0.8rem;
  }

  .sidebar-credit {
    margin-top: 4px;
    padding-top: 12px;
  }

  .app-panel {
    padding: 14px;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

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

  .card,
  .auth-card,
  .dashboard-top,
  .report-sheet,
  .payroll-sheet {
    padding: 16px;
    border-radius: 18px;
  }

  .auth-card {
    margin: 12px auto 22px;
  }

  .auth-brand img {
    width: 170px;
    max-width: 70%;
  }

  .dashboard-top {
    margin-bottom: 14px;
    gap: 11px;
  }

  body.app-authenticated .dashboard-top {
    position: static;
  }

  .dashboard-top h2 {
    font-size: 1.34rem;
  }

  .dashboard-top-copy {
    gap: 2px;
  }

  .dashboard-top-copy #welcomeText {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .dashboard-top-meta {
    gap: 8px;
  }

  .meta-pill {
    font-size: 0.66rem;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .primary-btn,
  .top-actions .ghost-btn,
  .top-actions .mobile-menu-btn {
    width: 100%;
    min-height: 39px;
    padding: 8px 9px;
    font-size: 0.76rem;
  }

  #headerQuickAddButton {
    padding-inline: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .dashboard-hero {
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    grid-template-columns: 1fr;
  }

  .smart-entry-tools,
  .smart-briefing-grid {
    grid-template-columns: 1fr;
  }

  .smart-entry-actions,
  .inline-command-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .smart-upload-btn,
  .smart-entry-actions button,
  .inline-command-control input,
  .inline-command-control button {
    width: 100%;
  }

  .inline-command-control input {
    grid-column: 1 / -1;
  }

  .smart-briefing-head {
    display: grid;
  }

  .dashboard-hero h3 {
    font-size: 1.74rem;
    line-height: 1;
  }

  .dashboard-lead {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .hero-storyline {
    gap: 8px;
  }

  .hero-ai-launch {
    margin-top: 12px;
    padding: 9px 10px;
  }

  .dashboard-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-pill-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dashboard-pill-feature {
    grid-column: 1 / -1;
  }

  .dashboard-overview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-panel {
    gap: 10px;
  }

  .chart-intelligence {
    padding: 9px 10px;
  }

  .chart-intelligence p {
    font-size: 0.73rem;
  }

  .analytics-panel > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 8px;
  }

  .analytics-panel > .section-head .section-caption {
    max-width: 150px;
    text-align: right;
  }

  .dashboard-intelligence-grid .analytics-panel,
  .dashboard-analytics-grid .analytics-panel {
    padding: 14px;
  }

  .category-chart {
    gap: 8px;
  }

  .category-card:nth-child(n + 4),
  .activity-item:nth-child(n + 5) {
    display: none;
  }

  .alert-list {
    max-height: 560px;
    overflow-y: auto;
    padding-right: 3px;
  }

  .alert-list:not(.expanded) .mobile-alert-extra {
    display: none;
  }

  .mobile-alert-toggle {
    display: block;
  }

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

  .alert-actions .table-btn {
    width: 100%;
    padding: 8px 5px;
    font-size: 0.67rem;
  }

  .trend-chart-meta,
  .insight-strip,
  .report-insight-banner {
    grid-template-columns: 1fr;
  }

  .hero-action-btn {
    width: 100%;
    text-align: center;
  }

  .section-head,
  .records-head,
  .print-head {
    margin-bottom: 16px;
  }

  .content-grid,
  .single-main,
  .card,
  .dashboard-top,
  .dashboard-overview-strip,
  .dashboard-analytics-grid,
  .dashboard-summary-grid,
  .dashboard-action-grid,
  .dashboard-alert-grid,
  .form-grid,
  .salary-kpi-grid,
  .dashboard-insight-grid,
  .filters,
  label {
    min-width: 0;
    width: 100%;
  }

  .section-head h3,
  .payroll-reminder-card h3,
  .dashboard-panel h3,
  .financial-panel h3,
  .vehicle-panel h3 {
    font-size: 0.96rem;
  }

  .finance-stats-grid .stat-card,
  .salary-kpi-card,
  .insight-card,
  .dashboard-task,
  .alert-item,
  .summary-box,
  .meta-item {
    padding: 13px 12px;
  }

  .alert-item-head,
  .dashboard-task-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .finance-stats-grid .stat-card strong,
  .insight-card strong,
  .salary-kpi-card strong {
    font-size: 0.98rem;
  }

  .report-header-main h3 {
    font-size: 1.48rem;
  }

  .report-badge {
    min-width: 0;
    text-align: left;
  }

  .report-badge-logo {
    width: 52px;
    margin: 0 0 10px 0;
  }

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

  th,
  td {
    padding: 10px 9px;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .ai-hero-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-question-form,
  .ai-capability-grid {
    grid-template-columns: 1fr;
  }

  .ai-message {
    width: 96%;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.76rem;
  }

  h2 {
    font-size: 1.24rem;
  }

  .eyebrow {
    letter-spacing: 0.16em;
    font-size: 0.62rem;
  }

  .dashboard-hero h3 {
    max-width: none;
    margin-bottom: 7px;
    font-size: 1.24rem;
    line-height: 1.08;
  }

  .dashboard-hero {
    gap: 10px;
    padding: 14px;
  }

  .dashboard-hero .eyebrow {
    margin-bottom: 7px;
    font-size: 0.55rem;
  }

  .dashboard-lead {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hero-storyline {
    display: none;
  }

  .dashboard-quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
  }

  .brand-highlight-panel {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    min-height: 0;
  }

  .brand-mark {
    width: 110px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .nav-btn {
    justify-content: flex-start;
    min-height: 50px;
  }

  .trend-legend {
    flex-direction: row;
    gap: 7px 12px;
  }

  .trend-legend span {
    font-size: 0.68rem;
  }

  .activity-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .dashboard-overview-strip {
    gap: 8px;
  }

  .insight-strip,
  .finance-stats-grid,
  .dashboard-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .insight-chip {
    min-height: 108px;
    padding: 11px;
  }

  .insight-chip span {
    margin-bottom: 5px;
    font-size: 0.56rem;
  }

  .insight-chip strong {
    font-size: 0.8rem;
  }

  .insight-chip small {
    font-size: 0.67rem;
    line-height: 1.35;
  }

  .finance-stats-grid .stat-card,
  .dashboard-insight-grid .insight-card {
    min-height: 78px;
    padding: 10px;
  }

  .dashboard-insight-grid .insight-card:last-child {
    grid-column: 1 / -1;
  }

  .overview-tile {
    padding: 11px 11px 10px;
  }

  .overview-tile strong {
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .overview-tile span {
    margin-bottom: 5px;
    font-size: 0.57rem;
  }

  .overview-tile small {
    font-size: 0.69rem;
  }

  .dashboard-pill {
    padding: 9px 10px;
    border-radius: 13px;
  }

  .dashboard-pill-feature {
    grid-column: auto;
  }

  .dashboard-pill span {
    margin-bottom: 4px;
    font-size: 0.52rem;
  }

  .dashboard-pill strong,
  .dashboard-pill-feature strong {
    font-size: 0.75rem;
    line-height: 1.25;
  }

  .hero-action-btn {
    min-height: 36px;
    padding: 7px 6px;
    font-size: 0.69rem;
  }

  .hero-orb-one {
    width: 150px;
    height: 150px;
  }

  .hero-orb-two {
    display: none;
  }

  .activity-meta {
    grid-column: 2;
    text-align: left;
  }

  .auth-brand img {
    width: 150px;
    max-width: 76%;
  }

  .filters input,
  .filters select {
    min-width: 0;
  }

  .table-btn,
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .ai-setup-notice {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 11px;
  }

  .ai-setup-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .trend-chart-meta {
    grid-template-columns: 1fr 1fr;
  }

  .trend-chart-meta .mini-stat:last-child {
    grid-column: 1 / -1;
  }

  .analytics-panel > .section-head {
    grid-template-columns: 1fr;
  }

  .analytics-panel > .section-head .section-caption {
    max-width: none;
    text-align: left;
  }

  .compact-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-filter select {
    width: 100%;
  }

  .status-chip {
    font-size: 0.7rem;
    min-height: 26px;
  }

  .toast-stack {
    left: 14px;
    right: 14px;
    top: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .brand-copy {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  @page {
    size: A4;
    margin: 12mm;
  }

  .no-print,
  .brand-panel,
  #dashboardView,
  #expensesView,
  #cashView,
  #carsView,
  #salaryView,
  #settingsView {
    display: none !important;
  }

  body.salary-print-mode #salaryView {
    display: block !important;
  }

  body.salary-print-mode #salaryView .no-print,
  body.salary-print-mode #salaryView form,
  body.salary-print-mode #salaryView .records-card,
  body.salary-print-mode #salaryView .message,
  body.salary-print-mode #salaryView .section-head,
  body.salary-print-mode #salaryView .content-grid > section.card:not(:last-child),
  body.salary-print-mode #salaryView #employeeForm,
  body.salary-print-mode #salaryView #attendanceForm,
  body.salary-print-mode #salaryView #salaryReportForm,
  body.salary-print-mode #salaryView #employeeMessage,
  body.salary-print-mode #salaryView #attendanceMessage,
  body.salary-print-mode #salaryView #salaryReportMessage,
  body.salary-print-mode #salaryView #employeesTableBody,
  body.salary-print-mode #salaryView #attendanceTableBody,
  body.salary-print-mode #salaryView #employeesEmptyState,
  body.salary-print-mode #salaryView #attendanceEmptyState {
    display: none !important;
  }

  body.salary-print-mode #reportsView {
    display: none !important;
  }

  .page-shell,
  .app-panel,
  #appView,
  #reportsView,
  .report-sheet,
  body.salary-print-mode #salaryView,
  body.salary-print-mode .payroll-sheet {
    display: block !important;
    padding: 0;
    margin: 0;
    background: #fff;
    box-shadow: none;
    border: 0;
  }

  .report-sheet {
    padding: 0;
    border-radius: 0;
  }

  body.salary-print-mode .payroll-sheet {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .report-header {
    padding: 0 0 10px;
    border-bottom: 1px solid #b8b8b8;
    gap: 14px;
    align-items: flex-start;
  }

  .report-meta-grid,
  .summary-bar,
  .report-signatures {
    gap: 8px;
  }

  .report-header-main h3 {
    font-size: 19pt;
    margin-bottom: 4px;
  }

  .report-subtitle {
    font-size: 9.5pt;
    color: #444;
    max-width: none;
  }

  .eyebrow {
    color: #666;
  }

  .report-badge {
    background: none;
    color: #111;
    border: 1px solid #b8b8b8;
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 110px;
  }

  .report-badge span {
    opacity: 1;
  }

  .report-badge-logo {
    width: 46px;
    filter: none;
  }

  .report-meta-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 12px 0 0;
  }

  .meta-item,
  .summary-box,
  .signature-line {
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    box-shadow: none;
    padding: 9px 10px;
  }

  .meta-item,
  .summary-box,
  .signature-line {
    break-inside: avoid;
  }

  .report-table-wrap {
    break-inside: auto;
    border: 1px solid #c8c8c8;
    border-radius: 0;
    overflow: visible;
  }

  .report-sheet table {
    page-break-inside: auto;
    font-size: 9.5pt;
  }

  .report-sheet tr,
  .report-sheet td,
  .report-sheet th {
    page-break-inside: avoid;
    word-break: break-word;
  }

  .report-sheet thead {
    display: table-header-group;
    background: #efefef;
  }

  .report-sheet th,
  .report-sheet td {
    padding: 7px 8px;
    border-bottom: 1px solid #d6d6d6;
    color: #111;
  }

  .report-sheet th {
    font-size: 8.5pt;
    letter-spacing: 0.04em;
  }

  .report-sheet tbody tr:nth-child(even) {
    background: #fafafa;
  }

  .summary-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 6px;
  }

  .summary-box span,
  .meta-item span {
    font-size: 7.5pt;
    margin-bottom: 5px;
    color: #555;
  }

  .summary-box strong,
  .meta-item strong {
    font-size: 10.5pt;
    line-height: 1.25;
  }

  .report-section {
    gap: 6px;
  }

  .report-section-head h4 {
    font-size: 11pt;
  }

  .report-section-head p,
  .signature-line span {
    font-size: 8.8pt;
  }

  .report-category-grid {
    gap: 6px;
  }

  .report-category-row {
    padding: 7px 8px;
    border-color: #c8c8c8;
    border-radius: 5px;
    font-size: 8.5pt;
  }

  .report-category-row i {
    width: 7px;
    height: 7px;
  }

  .report-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #b8b8b8;
  }

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

  .signature-line {
    min-height: 58px;
    display: block;
  }

  .signature-line span {
    padding-top: 18px;
    border-top: 1px solid #b8b8b8;
  }

  .report-signatures {
    gap: 10px;
  }
}


