/* TASLEEM ERP — dashboard */
:root {
  --bg-page: #e8edf4;
  --bg-page-end: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-elevated: #ffffff;
  --brand: #8b0000;
  --brand-hover: #6d0000;
  --brand-deep: #5c1010;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --white: #fff;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-medium: #e2e8f0;
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.1);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.12);
  --radius-card: 16px;
  --radius-btn: 10px;
  --topbar-h: 56px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --sync-bg: #f5d547;
  --sync-text: #111;
  --accent-gemini-bg: #f3e8ff;
  --accent-gemini-border: #7c3aed;
  --accent-expense-bg: #fffbeb;
  --accent-expense-border: #ea580c;
  --accent-master-bg: #e6fffa;
  --accent-master-border: #059669;
  --accent-fund-bg: #f3e8ff;
  --accent-fund-border: #7c3aed;
  --accent-analytics-bg: #eff6ff;
  --accent-analytics-border: #2563eb;
  --icon-box: 68px;
  --icon-font: 1.85rem;
  --icon-box-featured: 84px;
  --icon-font-featured: 2.2rem;
  --section-gap: clamp(1.75rem, 4vw, 2.5rem);
  --table-head-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --table-head-text: #ffffff;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-page) 0%, var(--bg-page-end) 42%, #eef2f7 100%);
  background-attachment: fixed;
  line-height: 1.45;
  overflow-x: clip;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--white);
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid #f5d547;
  outline-offset: 2px;
}

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

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 48%, #a31616 100%);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(92, 16, 16, 0.28);
}

.topbar__inner {
  max-width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.topbar__back {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  white-space: nowrap;
}

.topbar__back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.topbar__back:focus-visible {
  outline: 3px solid #f5d547;
  outline-offset: 2px;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1rem;
  flex-shrink: 0;
}

.brand__text {
  font-weight: 700;
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-btn);
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid #f5d547;
  outline-offset: 2px;
}

.btn--sync {
  background: var(--sync-bg);
  color: var(--sync-text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.btn--sync:hover {
  filter: brightness(1.05);
}
.btn--sync[aria-busy="true"] i {
  animation: spin 0.75s linear infinite;
}

.btn--logout {
  background: var(--white);
  color: var(--text);
}
.btn--logout:hover {
  background: #f0f0f0;
}

.btn__label-short {
  display: none;
}

@media (max-width: 380px) {
  .btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
  }
  .btn__label-full {
    display: none;
  }
  .btn__label-short {
    display: inline;
  }
  .btn--sync span:not(.fa-solid) {
    display: none;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .btn--sync[aria-busy="true"] i {
    animation: none;
  }
  .tile,
  .btn {
    transition: none;
  }
  .tile:hover {
    transform: none;
  }
  .tile:active {
    transform: none;
  }
  .toast {
    transition: none;
  }
  .work-entry-row__delete,
  .btn-work-final-save,
  .work-entry-add-row {
    transition: none;
  }
}

/* Main shell */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(0.75rem, 2vw, 1.25rem)
    clamp(2rem, 5vw, 3rem);
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* Page intro */
.page-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: clamp(1.1rem, 2.5vw, 1.5rem) clamp(1rem, 2vw, 1.35rem);
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.page-intro__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-intro__sub {
  margin: 0;
  max-width: 36rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.page-intro__aside {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0;
}

.page-intro__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(139, 0, 0, 0.08);
  color: var(--brand);
  font-size: 1.15rem;
}

.page-intro__meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.page-intro__meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.page-intro__meta time {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Sections */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid rgba(139, 0, 0, 0.12);
}

.section-head__title {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-head__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.dash-section--featured .section-head {
  border-bottom-color: rgba(124, 58, 237, 0.2);
}

.dash-section--panel {
  flex: 1;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.25rem);
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dash-section--panel .section-head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.25rem;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: stretch;
}

@media (max-width: 720px) {
  .dash-split {
    grid-template-columns: 1fr;
  }
}

/* Featured row */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.15rem);
}

@media (max-width: 1100px) {
  .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

/* Module grids */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.1rem);
}

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

.module-grid--stack {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (max-width: 1024px) {
  .module-grid:not(.module-grid--stack) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .module-grid.module-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .module-grid:not(.module-grid--stack) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
}

@media (max-width: 360px) {
  .module-grid:not(.module-grid--stack) {
    grid-template-columns: 1fr;
  }
}

.dashboard-all-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.1rem);
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .dashboard-all-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-all-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
}

@media (max-width: 360px) {
  .dashboard-all-grid {
    grid-template-columns: 1fr;
  }
}

.dash-footer {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg, 12px);
  background: var(--surface-2, #f4f6f9);
  border: 1px solid var(--border, #e2e8f0);
}

.dash-footer__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.dash-footer__hint {
  margin: 0 0 1rem;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
}

.dash-footer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.assistant-preset {
  margin: 0.35rem 0.35rem 0 0;
}

.assistant-msg {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.assistant-msg--user {
  background: #eef2ff;
}

.assistant-msg--assistant {
  background: #f0fdf4;
}

#assistantLog {
  max-height: 320px;
  overflow-y: auto;
  margin: 1rem 0;
}

/* Tiles */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 148px;
  padding: 1.15rem 0.75rem;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
}

.dash-section--panel .tile {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  gap: 1rem;
  min-height: auto;
  padding: 1rem 1.1rem;
}

.dash-section--panel .tile__label {
  max-width: none;
  text-align: left;
}

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

.tile:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow);
}

.tile:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.tile--accent {
  border-bottom-width: 4px;
  border-bottom-style: solid;
}

.tile--accent-gemini {
  background: var(--accent-gemini-bg);
  border-bottom-color: var(--accent-gemini-border);
}

.tile--accent-expense {
  background: var(--accent-expense-bg);
  border-bottom-color: var(--accent-expense-border);
}

.tile--accent-master {
  background: var(--accent-master-bg);
  border-bottom-color: var(--accent-master-border);
}

.tile--accent-fund {
  background: var(--accent-fund-bg);
  border-bottom-color: var(--accent-fund-border);
}

.tile--accent-analytics {
  background: var(--accent-analytics-bg);
  border-bottom-color: var(--accent-analytics-border);
}

.tile--featured {
  min-height: 158px;
  padding: 1.25rem 0.85rem;
  gap: 0.85rem;
}

.tile__icon {
  display: grid;
  place-items: center;
  width: var(--icon-box);
  height: var(--icon-box);
  border-radius: 16px;
  font-size: var(--icon-font);
  background: rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.tile--featured .tile__icon {
  width: var(--icon-box-featured);
  height: var(--icon-box-featured);
  font-size: var(--icon-font-featured);
  border-radius: 18px;
}

.tile__icon--blue {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}
.tile__icon--purple {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}
.tile__icon--red {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}
.tile__icon--green {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
.tile__icon--green-dark {
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
}
.tile__icon--orange {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.1);
}
.tile__icon--grey {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}
.tile__icon--dark {
  color: #334155;
  background: rgba(51, 65, 85, 0.12);
}

.tile__label {
  font-size: clamp(0.8125rem, 1.9vw, 0.9375rem);
  font-weight: 600;
  line-height: 1.3;
  max-width: 12em;
}

.tile--featured .tile__label {
  font-size: clamp(0.8125rem, 2vw, 0.95rem);
  max-width: 10em;
}

@media (max-width: 640px) {
  :root {
    --icon-box: 58px;
    --icon-font: 1.55rem;
    --icon-box-featured: 68px;
    --icon-font-featured: 1.85rem;
  }

  .tile {
    min-height: 128px;
    padding: 1rem 0.55rem;
    gap: 0.6rem;
  }

  .tile--featured {
    min-height: 138px;
    padding: 1.05rem 0.55rem;
  }

  .dash-section--panel .tile {
    padding: 0.9rem 1rem;
    gap: 0.85rem;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(90vw, 360px);
  padding: 0.75rem 1.1rem;
  background: #111;
  color: #fafafa;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  transition: transform 0.28s ease;
  z-index: 100;
}
.toast[data-visible="true"] {
  transform: translateX(-50%) translateY(0);
}

/* --- Data entry (customers, works, payments, expenses) --- */
.data-shell {
  max-width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(0.75rem, 2vw, 1.25rem) 2.5rem;
  overflow-x: clip;
}

.data-page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.data-page-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  max-width: 42rem;
}

.data-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  border-radius: var(--radius-card);
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.data-card__head {
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(139, 0, 0, 0.12);
  font-size: 1.05rem;
  font-weight: 700;
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.banner a {
  color: var(--brand);
  font-weight: 600;
}

.banner--blocked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.banner--blocked i {
  margin-right: 0.35rem;
}

.banner--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

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

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: #fafafa;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.12);
}

/* Searchable combobox (customers & services) */
.search-combobox {
  position: relative;
  width: 100%;
}

.search-combobox__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.search-combobox__input {
  width: 100%;
  cursor: text;
}

.search-combobox__input.wer-select {
  background-image: none;
  padding-right: 0.75rem;
  cursor: text;
}

.search-combobox__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.search-combobox__option {
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.35;
}

.search-combobox__option:hover,
.search-combobox__option--active {
  background: #f1f5f9;
}

.search-combobox--wer .search-combobox__list {
  font-size: 0.9375rem;
}

.search-combobox--ledger .search-combobox__list {
  font-size: 0.875rem;
}

.field .search-combobox__input {
  padding: 0.55rem 0.7rem;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: #fafafa;
}

.field .search-combobox__input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.12);
}

.work-entry-row .search-combobox {
  min-width: 0;
}

.work-entry-row .search-combobox__list {
  min-width: 12rem;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
  align-items: center;
}

.btn--primary {
  background: var(--brand);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--brand-hover);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn--danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn--danger:hover {
  background: #fecaca;
}

.btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.table-wrap {
  overflow: hidden;
  max-width: 100%;
  margin-top: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

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

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.data-table thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-bottom-color: #334155;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  -webkit-text-fill-color: currentColor;
}

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

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

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.data-table th.num {
  white-space: nowrap;
}

.empty-row td {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1.25rem;
}

/* --- Professional work entry (new work page) --- */
.data-shell--work-entry {
  max-width: 1200px;
}

.work-entry-card {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 1.75rem;
}

.work-entry-card__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f2744;
}

.work-entry-card__lead {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
  max-width: 52rem;
}

.work-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.work-entry-field--full {
  width: 100%;
}

.wer-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.wer-label--opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

.wer-label--mob {
  display: none;
}

.wer-input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.wer-input-icon > i {
  position: absolute;
  left: 0.85rem;
  font-size: 1.1rem;
  color: #64748b;
  pointer-events: none;
  z-index: 1;
}

.wer-input-icon .wer-input,
.wer-input-icon .wer-select {
  padding-left: 2.65rem;
}

.wer-input-icon--search > i {
  font-size: 0.95rem;
  opacity: 0.85;
}

.wer-input,
.wer-select,
.wer-control,
.wer-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.wer-input:focus,
.wer-select:focus,
.wer-control:focus,
.wer-textarea:focus {
  outline: none;
  border-color: #94a3b8;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.08);
}

.wer-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.wer-textarea {
  resize: vertical;
  min-height: 4rem;
}

.work-entry-grid-head {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.85fr 0.7fr 0.75fr 0.55fr 0.8fr 2.75rem;
  gap: 0.5rem 0.45rem;
  padding: 0 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  max-width: 100%;
}

.work-entry-grid-head__qty {
  text-align: center;
}

.wer-cell.num .wer-control {
  text-align: right;
}

.work-entry-grid-head .num {
  text-align: right;
}

.work-entry-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-entry-row {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.85fr 0.7fr 0.75fr 0.55fr 0.8fr 2.75rem;
  gap: 0.5rem 0.45rem;
  align-items: end;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid #f1f5f9;
  max-width: 100%;
}

/* Quantity multiplier (×1 … ×5 + custom) */
.wer-cell--qty {
  min-width: 0;
}

/* Quantity entry */
.wer-cell--qty .qty-picker__input {
  width: 100%;
  text-align: center;
  font-weight: 700;
  padding: 0.55rem 0.4rem !important;
  font-size: 0.9375rem !important;
}

.work-entry-row:last-of-type {
  border-bottom: none;
}

.wer-cell--profit .service-line__profit {
  min-height: 2.65rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  color: #065f46;
}

.wer-cell--act {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.15rem;
}

.work-entry-row__delete {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  transition: background 0.15s ease, transform 0.12s ease;
}

.work-entry-row__delete:hover {
  background: #fee2e2;
}

.work-entry-row__delete:active {
  transform: scale(0.96);
}

.work-entry-row__delete:focus-visible {
  outline: 3px solid #fca5a5;
  outline-offset: 2px;
}

.work-entry-add-row {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border: 2px dashed #38bdf8;
  border-radius: 12px;
  background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%);
  color: #0369a1;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.work-entry-add-row:hover {
  background: #bae6fd;
  border-color: #0ea5e9;
}

.work-entry-add-row i {
  font-size: 1.1rem;
}

.work-entry-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.work-entry-totals__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.work-entry-totals__value {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.work-entry-totals__item--profit .work-entry-totals__value {
  color: #047857;
}

.work-entry-totals__item--discount .work-entry-totals__value--discount {
  color: #b45309;
}

.entry-discount-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #b45309;
}

.work-entry-field--discount {
  margin-top: 1rem;
}

.wer-input-icon--pct {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 8.5rem;
}

.wer-input-icon--pct .wer-input {
  flex: 1;
  min-width: 0;
}

.wer-input-suffix {
  font-weight: 700;
  color: #64748b;
}

.field-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.work-entry-field--notes {
  margin-top: 1.15rem;
}

.work-entry-warn {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
}

.btn-work-final-save {
  width: 100%;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.35);
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-work-final-save:hover {
  filter: brightness(1.08);
}

.btn-work-final-save:active {
  transform: scale(0.99);
}

.btn-work-final-save:focus-visible {
  outline: 3px solid #f5d547;
  outline-offset: 3px;
}

.btn-work-final-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.work-entry-cancel {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
}

.work-entry-history {
  margin-top: 0.5rem;
}

/* --- Entry module pages (work / payments / expenses) --- */
.entry-module-page {
  background: linear-gradient(165deg, var(--bg-page) 0%, var(--bg-page-end) 48%, #eef2f7 100%);
}

.data-shell--entry-module {
  max-width: 1200px;
}

.entry-form-card {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 1.85rem);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.work-entry-card.entry-form-card--work {
  padding-top: clamp(1.35rem, 3vw, 2rem);
}

.entry-form-card::before,
.work-entry-card.entry-form-card--work::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #0f2744);
  opacity: 0.9;
}

.entry-form-card--payments::before {
  background: linear-gradient(90deg, #15803d, #065f46);
}

.entry-form-card--work::before,
.work-entry-card.entry-form-card--work::before {
  background: linear-gradient(90deg, #2563eb, #0f2744);
}

.entry-form-card__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.entry-form-card__head--inline {
  margin-bottom: 1.25rem;
}

.entry-form-card__head--work {
  margin-bottom: 1.5rem;
}

.entry-form-card__head--work .work-entry-card__title,
.entry-form-card__head--work .work-entry-card__lead {
  margin-bottom: 0;
}

.entry-form-card__head--work .work-entry-card__title {
  margin-bottom: 0.35rem;
}

.entry-form-card__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.14), rgba(15, 39, 68, 0.08));
  color: #15803d;
  font-size: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.entry-form-card__icon--work {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 39, 68, 0.08));
  color: #2563eb;
}

.entry-form-card__icon--expense {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.14), rgba(15, 39, 68, 0.08));
  color: #ea580c;
}

.entry-form-card__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f2744;
}

.entry-form-card__lead {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
  max-width: 42rem;
}

.entry-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

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

.entry-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid #e2e8f0;
}

.entry-log-card {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.09), 0 1px 0 rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.07);
  min-width: 0;
  max-width: 100%;
}

.entry-log-card--work {
  border-top: 3px solid rgba(37, 99, 235, 0.35);
}

.entry-log-card--payments {
  border-top: 3px solid rgba(21, 128, 61, 0.4);
}

.entry-log-card--expenses {
  border-top: 3px solid rgba(234, 88, 12, 0.4);
}

.entry-log-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.entry-log-card__title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.entry-log-card__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.entry-log-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.entry-log-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  min-width: min(100%, 14rem);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.entry-log-search:focus-within {
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
  background: #fff;
}

.entry-log-search i {
  color: #94a3b8;
  font-size: 0.85rem;
}

.entry-log-search input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  width: 100%;
  min-width: 8rem;
  outline: none;
  color: #0f172a;
}

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

.entry-log-pagesize {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.entry-log-pagesize select {
  padding: 0.38rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8125rem;
  background: #fff;
  cursor: pointer;
}

.entry-log-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.entry-log-kpi {
  flex: 1 1 8rem;
  min-width: 7rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.entry-log-kpi--in {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: #a7f3d0;
}

.entry-log-kpi--out {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  border-color: #fed7aa;
}

.entry-log-kpi--opening {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border-color: #bfdbfe;
}

.entry-log-kpi__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.entry-log-kpi__value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.entry-log-kpi--in .entry-log-kpi__value {
  color: #15803d;
}

.entry-log-kpi--out .entry-log-kpi__value {
  color: #c2410c;
}

.entry-log-table-wrap {
  border-radius: 12px;
  overflow: visible;
  max-width: 100%;
  border: 1px solid var(--border-medium);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.entry-log-table-wrap .data-table--entry-list {
  width: 100%;
  table-layout: fixed;
  min-width: 0;
}

.entry-log-table-wrap .data-table--entry-list th,
.entry-log-table-wrap .data-table--entry-list td {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.entry-log-table-wrap .data-table--entry-list thead th {
  white-space: normal;
  hyphens: auto;
  position: static;
}

.entry-log-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.entry-log-pager__count {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

.entry-log-pager__nav {
  display: flex;
  gap: 0.5rem;
}

.btn--pager {
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
}

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

@media (max-width: 767px) {
  .entry-log-card__head {
    flex-direction: column;
  }

  .entry-log-card__toolbar {
    width: 100%;
  }

  .entry-log-search {
    flex: 1 1 100%;
  }

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

@media (max-width: 768px) {
  .work-entry-grid-head {
    display: none;
  }

  .work-entry-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 0.75rem;
    background: #fafbfc;
    align-items: stretch;
  }

  .wer-label--mob {
    display: block;
  }

  .wer-cell--profit .service-line__profit {
    justify-content: flex-start;
  }

  .wer-cell--act {
    justify-content: flex-start;
    padding-bottom: 0;
  }

  .work-entry-totals {
    grid-template-columns: 1fr;
  }
}

/* --- Login (local demo + GAS role) --- */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
}

.login-shell {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.login-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--brand, #b71c1c);
}

.login-card__lead {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
}

.login-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.login-form .wer-input {
  width: 100%;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.login-hint {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 1rem 0 0;
}

.login-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
}

.login-footer a {
  color: #0284c7;
}

/* ============================================================
   PREMIUM DASHBOARD (index.html)
   ============================================================ */

.dashboard-premium {
  --dash-font-display: "Plus Jakarta Sans", var(--font);
  --dash-bg-deep: #0c1222;
  --dash-glass: rgba(255, 255, 255, 0.72);
  --dash-glass-border: rgba(255, 255, 255, 0.55);
  --dash-glow-brand: rgba(139, 0, 0, 0.35);
  background: #eef2f8;
  position: relative;
  overflow-x: hidden;
}

/* Animated background */
.dash-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.dash-bg__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(139, 0, 0, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(37, 99, 235, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(124, 58, 237, 0.07), transparent 55%),
    linear-gradient(180deg, #f0f4fa 0%, #e8edf6 45%, #eef2f8 100%);
}

.dash-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 0%, transparent 85%);
}

.dash-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  transition: transform 0.4s ease-out;
  will-change: transform;
}

.dash-bg__orb--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.25), transparent 70%);
  animation: orbFloat1 18s ease-in-out infinite;
}

.dash-bg__orb--2 {
  width: 360px;
  height: 360px;
  bottom: 10%;
  left: -100px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 70%);
  animation: orbFloat2 22s ease-in-out infinite;
}

.dash-bg__orb--3 {
  width: 280px;
  height: 280px;
  top: 40%;
  right: 15%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 70%);
  animation: orbFloat3 16s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, -30px); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 25px); }
}

.dashboard-premium .topbar,
.dashboard-premium .shell {
  position: relative;
  z-index: 1;
}

.topbar--glass {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.97) 0%, rgba(100, 0, 0, 0.95) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.brand__mark--pulse {
  animation: brandPulse 3s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.btn--ghost-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s, transform 0.15s;
}

.btn--ghost-top:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.topbar__role {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.dashboard-page--premium {
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

/* Hero */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: stretch;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 24px;
  background: var(--dash-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--dash-glass-border);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 20px 50px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.dash-hero__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.dash-hero__title {
  margin: 0 0 0.65rem;
  font-family: var(--dash-font-display);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #0f172a 0%, #334155 50%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-hero__sub {
  margin: 0 0 1.25rem;
  max-width: 28rem;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.55;
}

.dash-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.dash-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.dash-hero__chip--live {
  color: #047857;
  background: rgba(209, 250, 229, 0.7);
  border-color: rgba(16, 185, 129, 0.25);
}

.dash-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Stat cards */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: statIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.18s; }
.stat-card:nth-child(3) { animation-delay: 0.26s; }
.stat-card:nth-child(4) { animation-delay: 0.34s; }
.stat-card:nth-child(5) { animation-delay: 0.42s; }

.dash-stats--staff {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 28rem;
}

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

.stat-card--liquid .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.12), transparent 60%);
}

.stat-card--netcash .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(15, 39, 68, 0.12), transparent 60%);
}

.stat-card--liquid .stat-card__icon {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9;
}

.stat-card--netcash .stat-card__icon {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #1e3a8a;
}

.stat-card--liquid .stat-card__value,
.stat-card--netcash .stat-card__value {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
}

@keyframes statIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.stat-card__glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.stat-card:hover .stat-card__glow {
  opacity: 1;
}

.stat-card--revenue .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.12), transparent 60%);
}

.stat-card--collect .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(22, 163, 74, 0.12), transparent 60%);
}

.stat-card--due .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(220, 38, 38, 0.1), transparent 60%);
}

.stat-card--expense .stat-card__glow {
  background: radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.1), transparent 60%);
}

.stat-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
}

.stat-card--revenue .stat-card__icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
}

.stat-card--collect .stat-card__icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}

.stat-card--due .stat-card__icon {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #b91c1c;
}

.stat-card--expense .stat-card__icon {
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  color: #c2410c;
}

.stat-card__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.stat-card__value {
  font-family: var(--dash-font-display);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Zones */
.dash-zone {
  animation: zoneIn 0.5s ease both;
}

.dash-zone:nth-of-type(2) { animation-delay: 0.15s; }
.dash-zone:nth-of-type(3) { animation-delay: 0.25s; }
.dash-zone:nth-of-type(4) { animation-delay: 0.35s; }

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

.dash-zone__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  margin-bottom: 1rem;
}

.dash-zone__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--dash-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.dash-zone__bar {
  display: inline-block;
  width: 4px;
  height: 1.15em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), #dc2626);
  box-shadow: 0 0 12px var(--dash-glow-brand);
}

.dash-zone__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* Premium tiles */
.dashboard-all-grid--premium {
  margin-bottom: 0;
}

.tile--premium {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 1.15rem 1rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);
  opacity: 0;
  transform: translateY(20px);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
  animation: tileEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--tile-i, 0) * 0.05s + 0.2s);
}

.tile--premium.tile--visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes tileEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tile--premium .tile__shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 45%,
    transparent 90%
  );
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.tile--premium:hover .tile__shine {
  left: 140%;
}

.tile--premium:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 4px 8px rgba(15, 23, 42, 0.06),
    0 20px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(139, 0, 0, 0.08);
  border-color: rgba(139, 0, 0, 0.15);
}

.tile--premium:active {
  transform: translateY(-2px) scale(1);
}

.tile--premium .tile__arrow {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.65rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.04);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.25s, background 0.25s, color 0.25s;
}

.tile--premium:hover .tile__arrow {
  opacity: 1;
  transform: translateX(0);
  background: var(--brand);
  color: #fff;
}

.tile--premium .tile__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.tile--premium.tile--accent {
  border-bottom-width: 3px;
  border-bottom-style: solid;
}

.tile--premium.tile--accent-gemini {
  background: linear-gradient(145deg, rgba(243, 232, 255, 0.95), rgba(255, 255, 255, 0.9));
}

.tile--premium.tile--accent-expense {
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.9));
}

.tile--premium.tile--accent-master {
  background: linear-gradient(145deg, rgba(230, 255, 250, 0.95), rgba(255, 255, 255, 0.9));
}

.tile--premium.tile--accent-fund {
  background: linear-gradient(145deg, rgba(243, 232, 255, 0.9), rgba(255, 255, 255, 0.9));
}

.tile--premium.tile--accent-analytics {
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.9));
}

.tile--premium .tile__icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile--premium:hover .tile__icon {
  transform: scale(1.08) rotate(-3deg);
}

.tile--premium .tile__label {
  font-family: var(--dash-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Premium footer */
.dash-footer--premium {
  margin-top: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
}

.dash-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.35rem, 3vw, 2rem);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.dash-footer--premium .dash-footer__title {
  color: #f8fafc;
  font-family: var(--dash-font-display);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-footer--premium .dash-footer__title i {
  color: #f5d547;
}

.dash-footer--premium .dash-footer__hint {
  color: #94a3b8;
  margin-bottom: 0;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn--excel {
  background: #107c41;
  color: #fff;
  border: none;
}

.btn--excel:hover {
  background: #0e6b38;
  filter: brightness(1.05);
}

.btn--pdf {
  background: #b91c1c;
  color: #fff;
  border: none;
}

.btn--pdf:hover {
  background: #991b1b;
  filter: brightness(1.05);
}

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

.ledger-export-actions .btn {
  flex: 1;
  min-width: 5.5rem;
  justify-content: center;
}

.ledger-filters__export .ledger-export-actions {
  min-height: 2.5rem;
  align-items: stretch;
}

.data-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(139, 0, 0, 0.12);
}

.data-card__toolbar .data-card__head {
  margin: 0;
  padding: 0;
  border: none;
}

.data-card__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.data-shell .btn--secondary {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.data-shell .btn--secondary:hover {
  background: #cbd5e1;
}

.row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}

.btn--action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.44rem 0.78rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn--action i {
  font-size: 0.78rem;
  flex-shrink: 0;
}

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

.btn--action-edit {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.btn--action-edit:hover:not(:disabled) {
  background: #e0f2fe;
  border-color: #7dd3fc;
  box-shadow: 0 1px 3px rgba(3, 105, 161, 0.12);
}

.btn--action-del {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn--action-del:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.12);
}

.data-table th.col-actions,
.data-table td.col-actions {
  width: 6.25rem;
  min-width: 0;
  max-width: 6.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.data-table td.col-actions .row-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.data-table td.col-actions .btn--action {
  width: 100%;
  justify-content: center;
  padding: 0.36rem 0.45rem;
  font-size: 0.72rem;
}

.data-table td.col-actions .btn--action span {
  display: none;
}

.data-table td.col-actions .btn--action i {
  font-size: 0.85rem;
  margin: 0;
}

@media (min-width: 1100px) {
  .data-table th.col-actions,
  .data-table td.col-actions {
    width: 11rem;
    max-width: 11rem;
  }

  .data-table td.col-actions .row-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .data-table td.col-actions .btn--action {
    width: auto;
    padding: 0.44rem 0.78rem;
    font-size: 0.8125rem;
  }

  .data-table td.col-actions .btn--action span {
    display: inline;
  }
}

/* Entry logs — work, payments, expenses */
.data-card--entry-list {
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);
}

.data-card--entry-list .data-card__toolbar {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.data-card--entry-list .data-card__head {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.entry-list-wrap {
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-medium);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.data-table--entry-list {
  font-size: 0.8125rem;
  table-layout: fixed;
}

.data-table--entry-list th,
.data-table--entry-list td {
  padding: 0.72rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f6;
}

.data-table--entry-list th.num,
.data-table--entry-list td.num {
  padding-left: 0.5rem;
  padding-right: 0.75rem;
  text-align: right;
}

.data-table--entry-list thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-color: #334155;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
  text-align: left;
}

.data-table--entry-list thead th.num,
.data-table--entry-list thead th.col-amount,
.data-table--entry-list thead th.col-gov,
.data-table--entry-list thead th.col-profit {
  text-align: right;
}

.data-table--entry-list thead th.col-actions {
  text-align: center;
}

.data-table--entry-list tbody tr {
  transition: background 0.12s ease;
}

.data-table--entry-list tbody tr:nth-child(even) {
  background: #fafbfc;
}

.data-table--entry-list tbody tr:hover {
  background: #f1f5f9;
}

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

.data-table--entry-list .col-date {
  width: 6.75rem;
  min-width: 6.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  word-break: normal;
}

.data-table--entry-list tbody td.col-date {
  color: #334155;
  font-weight: 500;
}

.data-table--entry-list .col-customer {
  width: 11%;
  min-width: 0;
  max-width: none;
  white-space: normal;
  word-break: break-word;
}

.data-table--entry-list tbody td.col-customer {
  font-weight: 600;
  color: #0f172a;
}

.data-table--entry-list .col-services {
  width: auto;
  min-width: 0;
  max-width: none;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.data-table--entry-list tbody td.col-services {
  color: #334155;
}

.entry-services {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entry-services__line {
  display: block;
}

.entry-services__name {
  font-weight: 600;
  color: #0f172a;
}

.entry-services__meta {
  display: inline;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.data-table--entry-list .col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0f172a;
  width: 5.75rem;
  min-width: 5.75rem;
  max-width: 5.75rem;
}

.data-table--entry-list .col-gov,
.data-table--entry-list .col-profit {
  width: 5.25rem;
  min-width: 5.25rem;
  max-width: 5.25rem;
  font-weight: 600;
  color: #334155;
}

.data-table--entry-list .col-profit {
  font-weight: 700;
  color: #15803d;
}

.data-table--entry-list .col-amount--credit {
  color: #15803d;
}

.data-table--entry-list .col-method,
.data-table--entry-list .col-category,
.data-table--entry-list .col-payee {
  min-width: 5.5rem;
  width: 10%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.data-table--entry-list .col-reference {
  font-variant-numeric: tabular-nums;
  color: #475569;
  min-width: 0;
  max-width: none;
  white-space: normal;
}

.data-table--entry-list .col-notes,
.data-table--entry-list .col-desc {
  min-width: 7rem;
  width: 18%;
  max-width: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.data-table--entry-list tbody td.col-notes,
.data-table--entry-list tbody td.col-desc {
  color: #475569;
  font-size: 0.8125rem;
}

.data-table--expenses tbody td.col-date {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.data-table--expenses tbody td.col-amount {
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}

.data-table--expenses .entry-badge {
  max-width: 100%;
}

#tableExpenses {
  width: 100%;
  table-layout: fixed;
}

#tableExpenses col.col-date {
  width: 9%;
}

#tableExpenses col.col-category {
  width: 14%;
}

#tableExpenses col.col-amount {
  width: 9%;
}

#tableExpenses col.col-payee {
  width: 18%;
}

#tableExpenses col.col-desc {
  width: 42%;
}

#tableExpenses col.col-actions {
  width: 8%;
}

#tableExpenses .col-date,
#tableExpenses .col-category,
#tableExpenses .col-amount,
#tableExpenses .col-payee,
#tableExpenses .col-desc,
#tableExpenses .col-actions {
  width: auto;
  min-width: 0;
  max-width: none;
}

#tableExpenses tbody td.col-category {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

#tableExpenses .col-payee {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.35;
}

#tableExpenses tbody td.col-desc {
  color: #475569;
  font-size: 0.8125rem;
  line-height: 1.4;
}

#tablePayments {
  width: 100%;
  table-layout: fixed;
}

#tablePayments col.col-date { width: 9%; }
#tablePayments col.col-customer { width: 16%; }
#tablePayments col.col-amount { width: 9%; }
#tablePayments col.col-method { width: 11%; }
#tablePayments col.col-reference { width: 13%; }
#tablePayments col.col-actions { width: 8%; }
#tablePayments col.col-notes { width: 34%; }

#tableWorks {
  width: 100%;
  table-layout: fixed;
}

#tableWorks col.col-date { width: 8%; }
#tableWorks col.col-customer { width: 12%; }
#tableWorks col.col-services { width: 28%; }
#tableWorks col.col-amount { width: 8%; }
#tableWorks col.col-gov { width: 7%; }
#tableWorks col.col-profit { width: 8%; }
#tableWorks col.col-notes { width: 21%; }
#tableWorks col.col-actions { width: 8%; }

.entry-payee {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Entry log tables — icon-only actions, centered */
.entry-log-table-wrap .data-table--entry-list th.col-actions,
.entry-log-table-wrap .data-table--entry-list td.col-actions {
  width: 8%;
  min-width: 0;
  max-width: none;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.entry-log-table-wrap .data-table--entry-list td.col-actions .row-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0 auto;
}

.entry-log-table-wrap .data-table--entry-list td.col-actions .btn--action {
  width: auto;
  flex: 0 0 auto;
  padding: 0.42rem 0.48rem;
  font-size: 0.72rem;
  justify-content: center;
}

.entry-log-table-wrap .data-table--entry-list td.col-actions .btn--action span {
  display: none;
}

.entry-log-table-wrap .data-table--entry-list td.col-actions .btn--action i {
  font-size: 0.8rem;
  margin: 0;
}

.data-table--entry-list td.col-actions {
  text-align: center;
}

.entry-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.entry-badge--cash {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.entry-badge--card {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.entry-badge--transfer {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.entry-badge--category {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.entry-badge--office {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.entry-badge--active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.entry-badge--blocked {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.credit-row__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
}

/* Credit controller */
.data-shell--credit {
  max-width: 980px;
}

.data-card--credit-form,
.data-card--credit-list {
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.data-card--credit-form .data-card__head,
.data-card--credit-list .data-card__head {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.data-card__sub {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.data-card--credit-form .data-card__sub {
  margin-bottom: 1.15rem;
}

.data-card--credit-list .data-card__toolbar {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.credit-form {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.credit-status-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.credit-status-preview--active {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.credit-status-preview--blocked {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.credit-status-preview__text {
  flex: 1;
  min-width: 12rem;
  font-weight: 500;
}

.credit-table-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

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

.data-table--credit th,
.data-table--credit td {
  padding: 1rem 1.15rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f6;
}

.data-table--credit thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-color: #334155;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.data-table--credit thead th.num {
  text-align: right;
}

.data-table--credit .col-customer {
  width: 38%;
  min-width: 10rem;
  text-align: left;
}

.data-table--credit .col-limit {
  width: 14%;
  min-width: 6.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #334155;
}

.data-table--credit .col-status {
  width: 16%;
  min-width: 6.5rem;
  text-align: center;
}

.data-table--credit .col-balance {
  width: 16%;
  min-width: 6.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.data-table--credit .col-balance--due {
  color: #b45309;
}

.data-table--credit .col-balance--advance {
  color: #15803d;
}

.data-table--credit .col-balance--zero {
  color: #64748b;
  font-weight: 600;
}

.data-table--credit .col-actions {
  width: 10%;
  min-width: 4.5rem;
  text-align: right;
}

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

.data-table--credit tbody tr:nth-child(even) {
  background: #fafbfc;
}

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

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

.credit-cell-customer {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.credit-cell-customer__name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.credit-cell-customer__phone {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.data-table--credit .col-status .entry-badge {
  min-width: 5.5rem;
  justify-content: center;
}

.data-table--credit td.col-actions .btn--action {
  margin-left: auto;
}

.data-table--credit .empty-row td {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: #64748b;
  font-size: 0.875rem;
  background: #fafbfc;
}

@media (max-width: 767px) {
  .credit-table-wrap .data-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }

  .credit-table-wrap .data-table tbody tr:nth-child(even) {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  }

  .credit-table-wrap .data-table tbody tr:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  }

  .credit-table-wrap .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: none;
    text-align: right;
    width: 100%;
  }

  .credit-table-wrap .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    flex: 0 0 38%;
  }

  .credit-table-wrap .data-table tbody td.col-customer {
    display: block;
    text-align: left;
    padding-bottom: 0.65rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px dashed var(--border-medium);
  }

  .credit-table-wrap .data-table tbody td.col-customer::before {
    display: none;
  }

  .credit-table-wrap .data-table tbody td.col-status {
    justify-content: space-between;
    align-items: center;
  }

  .credit-table-wrap .data-table tbody td.col-actions {
    display: block;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px dashed var(--border-medium);
    text-align: left;
  }

  .credit-table-wrap .data-table tbody td.col-actions::before {
    display: none;
  }
}

.data-table--entry-list .empty-row td {
  text-align: center;
  padding: 2.25rem 1rem;
  color: #64748b;
  font-size: 0.875rem;
  background: #fafbfc;
}

@media (max-width: 900px) {
  .data-table--entry-list .col-customer,
  .data-table--entry-list .col-services,
  .data-table--entry-list .col-notes,
  .data-table--entry-list .col-desc {
    max-width: none;
  }
}

.btn--edit {
  background: #e0f2fe;
  color: #0369a1;
  border: none;
}

.btn--edit:hover {
  background: #bae6fd;
}

/* Office expense / card transfer — professional panel */
.data-shell--expenses {
  max-width: 1200px;
}

.office-expense-panel {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 1.75rem;
}

.office-expense-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.office-expense-panel__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.12), rgba(15, 39, 68, 0.08));
  color: var(--brand);
  font-size: 1.15rem;
}

.office-expense-panel__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f2744;
}

.office-expense-panel__lead {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
  max-width: 36rem;
}

.office-expense-panel__hint {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1.35rem;
  border-radius: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.office-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.35rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.office-type-tabs__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.office-type-tabs__btn i {
  font-size: 0.9rem;
  opacity: 0.85;
}

.office-type-tabs__btn:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.55);
}

.office-type-tabs__btn.is-active {
  background: var(--white);
  color: #0f2744;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.office-type-tabs__btn.is-active[data-tab="transfer"] {
  color: #065f46;
}

.office-tab-panel__hint {
  margin: 0 0 1.1rem;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
}

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

.btn-work-final-save--transfer {
  background: #0f766e;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
}

.btn-work-final-save--transfer:hover {
  filter: brightness(1.08);
}

.office-expense-panel__hint i {
  margin-top: 0.1rem;
  color: #0284c7;
  flex-shrink: 0;
}

.office-expense-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.office-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem 1rem;
  align-items: end;
}

.office-flow__field {
  min-width: 0;
}

.office-flow__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.55rem;
}

.office-flow__arrow-inner {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
}

.office-expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.office-expense-grid__field--full {
  grid-column: 1 / -1;
}

.office-expense-mode {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 0.8125rem;
  color: #475569;
}

.office-expense-mode.is-transfer {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.office-expense-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.office-expense-actions .btn-work-final-save {
  margin-top: 0;
}

.office-expense-cancel {
  width: 100%;
  justify-content: center;
}

/* Ledger / reports — shared toolbar & KPIs */
.data-shell--statement {
  max-width: 1140px;
}

.data-card--ledger {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-subtle);
}

.ledger-toolbar,
.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.35rem;
  max-width: 100%;
}

.ledger-toolbar__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1rem;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.ledger-toolbar__grid--dates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 100%;
}

.ledger-toolbar__field {
  min-width: 0;
}

.ledger-toolbar__field:has(.ledger-control--date) {
  min-width: 0;
  flex-shrink: 1;
}

.ledger-toolbar__field--wide {
  grid-column: 1 / -1;
}

.ledger-toolbar__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.ledger-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ledger-input-wrap > i {
  position: absolute;
  left: 0.8rem;
  font-size: 0.9rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.ledger-control {
  width: 100%;
  padding: 0.62rem 0.75rem 0.62rem 2.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ledger-control:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.08);
}

.ledger-control--date {
  min-width: 0;
  padding-right: 0.5rem;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}

.ledger-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.ledger-toolbar__sep {
  width: 1px;
  height: 2rem;
  background: #cbd5e1;
  flex-shrink: 0;
}

.ledger-toolbar__export {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.btn--ledger-run {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(139, 0, 0, 0.28);
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn--ledger-run:hover {
  filter: brightness(1.06);
}

.btn--ledger-run:active {
  transform: scale(0.99);
}

.btn--export-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #0f766e;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn--export-outline i {
  font-size: 0.95rem;
}

.btn--export-outline:hover {
  background: #ecfdf5;
}

.btn--export-outline--pdf {
  color: #b91c1c;
}

.btn--export-outline--pdf:hover {
  background: #fef2f2;
}

.statement-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.kpi-card {
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  border-left-width: 4px;
  border-left-style: solid;
}

.kpi-card__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.kpi-card__value {
  display: block;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f2744;
  font-variant-numeric: tabular-nums;
}

.kpi-card--opening {
  border-left-color: #64748b;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.kpi-card--out {
  border-left-color: #dc2626;
  background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.kpi-card--out .kpi-card__value {
  color: #b91c1c;
}

.kpi-card--in {
  border-left-color: #16a34a;
  background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.kpi-card--in .kpi-card__value {
  color: #15803d;
}

.kpi-card--bal {
  border-left-color: #0f2744;
  background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
}

.kpi-card--bal .kpi-card__value {
  color: #0f172a;
}

.statement-table-wrap {
  margin-top: 0.15rem;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.data-table--statement thead th,
#tblLedger thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.data-table--statement thead th {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
  word-break: break-word;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.data-table--statement thead th.num,
.data-table--statement thead th.col-dr,
.data-table--statement thead th.col-cr,
.data-table--statement thead th.col-bal,
.data-table--statement thead th.col-out,
.data-table--statement thead th.col-in,
.data-table--statement thead th.col-govt,
.data-table--statement thead th.col-profit {
  white-space: nowrap;
}

.data-table--statement .num,
.data-table--statement .col-dr,
.data-table--statement .col-cr,
.data-table--statement .col-bal,
.data-table--statement .col-out,
.data-table--statement .col-in {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.data-table--statement .col-date {
  width: 8%;
  white-space: nowrap;
}

.data-table--statement .col-type {
  width: 8%;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.data-table--statement .col-employee {
  width: 10%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  vertical-align: top;
}

.data-table--statement tbody td.col-employee {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.data-table--statement .col-desc {
  width: 22%;
  min-width: 7.5rem;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  vertical-align: top;
}

.data-table--statement tbody td.col-desc {
  color: #475569;
  font-size: 0.8125rem;
}

.data-table--statement:has(.col-category):has(.col-desc) .col-category {
  width: 13%;
  min-width: 5.25rem;
}

.data-table--statement:has(.col-category):has(.col-desc) .col-desc {
  width: 26%;
  min-width: 8rem;
}

#tblExp {
  min-width: 760px;
}

#tblExp .col-date {
  width: 8%;
  min-width: 5.5rem;
}

#tblExp .col-payee {
  width: 12%;
  min-width: 6.5rem;
}

#tblExp .col-category {
  width: 13%;
  min-width: 5.5rem;
}

#tblExp .col-desc {
  width: 40%;
  min-width: 9rem;
}

#tblExp thead th.num,
#tblExp td.num {
  width: 11%;
  min-width: 6.25rem;
}

.data-table--statement .col-dr,
.data-table--statement .col-cr {
  width: 10%;
}

.data-table--statement .col-bal {
  width: 10%;
  font-weight: 700;
}

.data-table--statement .col-out,
.data-table--statement .col-in {
  width: 13%;
}

#tblLedger .col-actions {
  width: 6.5rem;
  max-width: 6.5rem;
}

.data-table--statement .col-customer {
  width: 13%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  vertical-align: top;
}

.data-table--statement tbody td.col-customer {
  font-weight: 600;
  color: #0f172a;
}

.data-table--statement .col-note,
.data-table--statement .col-category,
.data-table--statement .col-service {
  width: 14%;
  min-width: 5.5rem;
  max-width: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  vertical-align: top;
}

.data-table--statement tbody td.col-note,
.data-table--statement tbody td.col-category,
.data-table--statement tbody td.col-service {
  color: #475569;
}

.data-table--statement .col-payee {
  width: 12%;
  min-width: 6rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  vertical-align: top;
}

.data-table--statement tbody td.col-payee {
  font-weight: 600;
  color: #334155;
}

.data-table--statement tbody td.col-desc,
.data-table--statement tbody td.col-customer,
.data-table--statement tbody td.col-employee,
.data-table--statement tbody td.col-note,
.data-table--statement tbody td.col-category,
.data-table--statement tbody td.col-service {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.data-table--statement .col-govt,
.data-table--statement .col-profit,
.data-table--statement .col-cr {
  width: 9%;
}

#tblG .col-desc {
  width: 22%;
  min-width: 8rem;
}

#tblG {
  min-width: 880px;
}

#tblG .col-customer {
  width: 12%;
}

#tblG .col-employee {
  width: 9%;
}

.data-table--statement:not(#tblLedger):not(#tblExp) .col-date {
  width: 10%;
}

.data-table--statement:not(#tblLedger):not(#tblExp) .col-employee {
  width: 9%;
}

.data-table--statement:not(#tblLedger):not(#tblExp) .col-desc {
  width: 24%;
}

@media (min-width: 1100px) {
  #tblLedger .col-actions {
    width: 11rem;
    max-width: 11rem;
  }

  .data-table--statement:not(#tblExp) .col-desc {
    width: 26%;
  }

  #tblG .col-desc {
    width: 24%;
  }

  #tblExp .col-desc {
    width: 42%;
  }
}

.data-table--statement thead th:first-child,
.data-table--statement tbody td:first-child {
  min-width: 0;
}

.data-table--statement tbody td:first-child {
  white-space: nowrap;
}

/* Force legible headers — column body colors must not apply to thead */
.data-table thead th,
.data-table thead th[class*="col-"],
.data-table thead th.num {
  background: var(--table-head-bg);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  opacity: 1;
  border-bottom-color: #334155;
}

.statement-out {
  color: #dc2626;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.statement-in {
  color: #16a34a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.statement-bal {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.report-toolbar--actions-only .ledger-toolbar__grid {
  display: none;
}

.report-toolbar--actions-only {
  justify-content: flex-end;
}

.report-form-panel {
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
}

.statement-kpis.admin-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

@media (min-width: 900px) {
  .ledger-toolbar__field--wide {
    grid-column: auto;
  }

  .ledger-toolbar__grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }

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

@media (max-width: 720px) {
  .statement-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .ledger-toolbar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .btn--ledger-run {
    flex: 1;
    justify-content: center;
  }

  .ledger-toolbar__export {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .office-flow {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .office-flow__arrow {
    padding-bottom: 0;
    order: 2;
  }

  .office-flow__arrow-inner {
    transform: rotate(90deg);
  }

  .office-flow__field:first-child {
    order: 1;
  }

  .office-flow__field:last-child {
    order: 3;
  }

  .office-expense-grid {
    grid-template-columns: 1fr;
  }
}

.form-actions .btn--ghost-form {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.form-actions .btn--ghost-form:hover {
  background: #e2e8f0;
}

.btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--glow {
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.45);
}

.btn--glow:hover {
  box-shadow: 0 6px 28px rgba(139, 0, 0, 0.55);
}

@media (max-width: 960px) {
  .dash-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }

  .dash-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-footer__actions {
    width: 100%;
  }

  .dash-footer__actions .btn,
  .dash-footer__actions .btn--outline {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
}

/* ============================================================
   NO HORIZONTAL SCROLL — mobile card rows for all tables
   ============================================================ */

main,
.data-card,
.office-expense-panel,
.work-entry-card,
.entry-log-card,
.entry-form-card {
  max-width: 100%;
  overflow-x: clip;
}

.table-wrap .data-table,
.entry-list-wrap .data-table {
  table-layout: auto;
}

.entry-log-table-wrap .data-table--entry-list {
  table-layout: fixed;
  width: 100%;
}

.statement-table-wrap .data-table--statement {
  table-layout: fixed;
}

@media (max-width: 767px) {
  .table-wrap .data-table thead,
  .entry-list-wrap .data-table thead,
  .entry-log-table-wrap .data-table thead,
  .statement-table-wrap .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-wrap .data-table tbody,
  .entry-list-wrap .data-table tbody,
  .entry-log-table-wrap .data-table tbody,
  .statement-table-wrap .data-table tbody {
    display: block;
  }

  .table-wrap .data-table tbody tr,
  .entry-list-wrap .data-table tbody tr,
  .entry-log-table-wrap .data-table tbody tr,
  .statement-table-wrap .data-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }

  .table-wrap .data-table tbody tr.empty-row,
  .entry-list-wrap .data-table tbody tr.empty-row,
  .entry-log-table-wrap .data-table tbody tr.empty-row,
  .statement-table-wrap .data-table tbody tr.empty-row {
    padding: 1.75rem 1rem;
    text-align: center;
    background: var(--surface-muted);
  }

  .table-wrap .data-table tbody tr.empty-row td,
  .entry-list-wrap .data-table tbody tr.empty-row td,
  .entry-log-table-wrap .data-table tbody tr.empty-row td,
  .statement-table-wrap .data-table tbody tr.empty-row td {
    display: block;
    padding: 0;
    border: none;
  }

  .table-wrap .data-table tbody tr.empty-row td::before,
  .entry-list-wrap .data-table tbody tr.empty-row td::before,
  .entry-log-table-wrap .data-table tbody tr.empty-row td::before,
  .statement-table-wrap .data-table tbody tr.empty-row td::before {
    display: none;
  }

  .table-wrap .data-table tbody td,
  .entry-list-wrap .data-table tbody td,
  .entry-log-table-wrap .data-table tbody td,
  .statement-table-wrap .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.42rem 0;
    border: none;
    text-align: right;
    width: 100%;
    max-width: 100%;
  }

  .table-wrap .data-table tbody td::before,
  .entry-list-wrap .data-table tbody td::before,
  .entry-log-table-wrap .data-table tbody td::before,
  .statement-table-wrap .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    flex: 0 0 38%;
    padding-right: 0.35rem;
  }

  .table-wrap .data-table tbody td.col-actions,
  .entry-list-wrap .data-table tbody td.col-actions,
  .entry-log-table-wrap .data-table tbody td.col-actions,
  .statement-table-wrap .data-table tbody td.col-actions {
    display: block;
    width: 100%;
    max-width: 100%;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px dashed var(--border-medium);
    text-align: left;
  }

  .table-wrap .data-table tbody td.col-actions::before,
  .entry-list-wrap .data-table tbody td.col-actions::before,
  .entry-log-table-wrap .data-table tbody td.col-actions::before,
  .statement-table-wrap .data-table tbody td.col-actions::before {
    display: none;
  }

  .table-wrap .data-table tbody td.col-actions .row-actions,
  .entry-list-wrap .data-table tbody td.col-actions .row-actions,
  .entry-log-table-wrap .data-table tbody td.col-actions .row-actions,
  .statement-table-wrap .data-table tbody td.col-actions .row-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .table-wrap .data-table tbody td.col-actions .btn--action,
  .entry-list-wrap .data-table tbody td.col-actions .btn--action,
  .entry-log-table-wrap .data-table tbody td.col-actions .btn--action,
  .statement-table-wrap .data-table tbody td.col-actions .btn--action {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .table-wrap .data-table tbody td.col-actions .btn--action span,
  .entry-list-wrap .data-table tbody td.col-actions .btn--action span,
  .entry-log-table-wrap .data-table tbody td.col-actions .btn--action span,
  .statement-table-wrap .data-table tbody td.col-actions .btn--action span {
    display: inline;
  }

  .ledger-toolbar__grid,
  .ledger-toolbar__grid--dates {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .ledger-toolbar__actions {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  .dash-bg__orb,
  .brand__mark--pulse,
  .dash-hero__dot,
  .tile--premium,
  .stat-card,
  .dash-zone,
  .dash-hero {
    animation: none !important;
  }

  .tile--premium {
    opacity: 1;
    transform: none;
  }

  .dash-bg__orb {
    transition: none;
  }

  .tile--premium:hover .tile__shine {
    left: -100%;
  }
}

/* Monthly Intelligence report */
.monthly-report-page {
  background: linear-gradient(165deg, #eef2f7 0%, #e8edf4 48%, #f1f5f9 100%);
}

.data-shell--monthly-intel {
  max-width: 1180px;
}

.mr-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #eff6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: 0 12px 40px rgba(15, 39, 68, 0.08);
  position: relative;
  overflow: hidden;
}

.mr-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #0f2744);
}

.mr-hero__intro {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1 1 20rem;
}

.mr-hero__icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 39, 68, 0.08));
  color: #2563eb;
  font-size: 1.35rem;
}

.mr-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 39, 68, 0.08);
  color: #475569;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mr-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.mr-hero__sub {
  margin: 0;
  max-width: 36rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.55;
}

.mr-hero__period {
  align-self: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  box-shadow: var(--shadow-sm);
}

.mr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.15rem;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.mr-toolbar__filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mr-toolbar__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.mr-toolbar__select {
  min-width: 12rem;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 0.75rem center;
  appearance: none;
}

.mr-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.mr-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.mr-kpi {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.mr-kpi__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.mr-kpi__value {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.mr-kpi--profit .mr-kpi__value { color: #2563eb; }
.mr-kpi--in .mr-kpi__value { color: #059669; }
.mr-kpi--net .mr-kpi__value { color: #047857; }
.mr-kpi--adj .mr-kpi__value { color: #7c3aed; }
.mr-kpi--gov .mr-kpi__value { color: #475569; }
.mr-kpi--neg .mr-kpi__value { color: #b91c1c; }

.mr-charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mr-chart-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.mr-chart-card__head {
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.mr-chart-card__head h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mr-chart-card__head h2 i {
  color: #2563eb;
  font-size: 0.9rem;
}

.mr-chart-card__head p {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.mr-chart-card__body {
  position: relative;
  height: 240px;
  padding: 0.75rem 0.85rem 1rem;
}

.mr-chart-card__body--doughnut {
  height: 260px;
}

.mr-month-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mr-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748b;
  background: var(--white);
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
}

.mr-month-block {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: clamp(1.1rem, 2.5vw, 1.45rem);
  box-shadow: var(--shadow-md);
}

.mr-month-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.mr-month-block__title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.mr-month-block__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.mr-month-block__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.mr-month-block__hl {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  min-width: 8.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.mr-month-block__hl span {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.mr-month-block__hl-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mr-month-block__hl-val--pos { color: #059669; }
.mr-month-block__hl-val--neg { color: #b91c1c; }

.mr-month-block__hl--net {
  border-color: rgba(5, 150, 105, 0.25);
  background: linear-gradient(180deg, #fff, #ecfdf5);
}

.mr-month-block__hl--adj {
  border-color: rgba(124, 58, 237, 0.22);
  background: linear-gradient(180deg, #fff, #f5f3ff);
}

.mr-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.mr-card {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  background: #fff;
}

.mr-card__head {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
  background: #fafbfc;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mr-card--rev .mr-card__head { color: #1e40af; }
.mr-card--rev .mr-card__head i { color: #2563eb; }
.mr-card--cash .mr-card__head { color: #047857; }
.mr-card--cash .mr-card__head i { color: #059669; }
.mr-card--out .mr-card__head { color: #b91c1c; }
.mr-card--out .mr-card__head i { color: #dc2626; }

.mr-card__body {
  padding: 0.25rem 0;
}

.mr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.mr-row:last-child {
  border-bottom: none;
}

.mr-row__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
}

.mr-row__value {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  text-align: right;
}

.mr-row__value--pct {
  color: #2563eb;
}

.mr-row--profit .mr-row__value { color: #2563eb; }
.mr-row--in .mr-row__value { color: #059669; }
.mr-row--gov .mr-row__value { color: #64748b; }
.mr-row--loss .mr-row__value { color: #b91c1c; }
.mr-row--warn .mr-row__value { color: #d97706; }
.mr-row--muted .mr-row__value { font-weight: 600; color: #334155; }

@media (max-width: 1100px) {
  .mr-charts {
    grid-template-columns: 1fr 1fr;
  }

  .mr-chart-card:first-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 900px) {
  .mr-month-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .mr-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mr-toolbar__filter {
    flex-direction: column;
    align-items: stretch;
  }

  .mr-toolbar__select {
    width: 100%;
  }

  .mr-toolbar__actions {
    width: 100%;
  }

  .mr-charts {
    grid-template-columns: 1fr;
  }

  .mr-kpi-strip {
    grid-template-columns: 1fr;
  }

  .mr-month-block__head {
    flex-direction: column;
  }
}

/* Staff salary report */
.data-shell--salary-report {
  max-width: 1120px;
}

.data-shell--salary-stmt {
  max-width: 980px;
}

.salary-report-head {
  margin-bottom: 1.35rem;
}

.salary-report-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.salary-report-head__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 3.2vw, 1.85rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.salary-report-head__sub {
  margin: 0;
  max-width: 52rem;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.55;
}

.salary-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.salary-report-toolbar__field {
  flex: 1 1 220px;
}

.salary-report-toolbar__field--wide {
  flex: 2 1 320px;
}

.salary-report-toolbar__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.salary-report-toolbar__actions--start {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.salary-report-toolbar__hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.btn--salary-new {
  min-height: 2.65rem;
  white-space: nowrap;
}

.field-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

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

.salary-report-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 55%, #2563eb 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 39, 68, 0.28);
}

.salary-report-hero__glow {
  position: absolute;
  inset: -30% auto auto 55%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.salary-report-hero__main {
  position: relative;
  z-index: 1;
}

.salary-report-hero__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.35rem;
}

.salary-report-hero__value {
  display: block;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.salary-report-hero__value--due {
  color: #fecaca;
}

.salary-report-hero__value--clear {
  color: #bbf7d0;
}

.salary-report-hero__currency {
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  margin-left: 0.35rem;
}

.salary-report-hero__hint {
  margin: 0.55rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.salary-report-hero__side {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  align-content: center;
}

.salary-report-stat {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.salary-report-stat__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 0.25rem;
}

.salary-report-stat__value {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.salary-report-kpis {
  margin-bottom: 1.15rem;
}

.salary-report-panels {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.salary-report-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.salary-report-panel--bonus {
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
  border-color: #fed7aa;
}

.salary-report-panel__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.salary-report-panel__head p {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.salary-report-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  align-items: end;
}

.salary-report-form-grid--bonus {
  grid-template-columns: 1fr;
}

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

.salary-report-form-grid .field--actions {
  grid-column: 1 / -1;
}

.salary-report-ledger {
  margin-bottom: 1.15rem;
}

.salary-report-ledger__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0;
}

.salary-report-ledger__title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.salary-report-ledger__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.salary-report-table .col-date {
  white-space: nowrap;
  width: 6.5rem;
}

.salary-report-table .col-type {
  width: 6.5rem;
}

.salary-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.salary-type-badge--due {
  background: #fee2e2;
  color: #b91c1c;
}

.salary-type-badge--bonus {
  background: #ffedd5;
  color: #c2410c;
}

.salary-type-badge--paid {
  background: #dcfce7;
  color: #15803d;
}

.salary-type-badge--default {
  background: #f1f5f9;
  color: #475569;
}

.salary-row--due td {
  background: rgba(254, 226, 226, 0.18);
}

.salary-row--bonus td {
  background: rgba(255, 237, 213, 0.22);
}

.salary-row--payment td {
  background: rgba(220, 252, 231, 0.2);
}

.salary-pending-cell {
  font-weight: 800;
  color: #b91c1c !important;
}

.salary-report-overview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.salary-report-overview__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.salary-report-overview__head p {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.salary-overview-row {
  cursor: pointer;
}

.salary-overview-row:hover td {
  background: #f8fafc;
}

.salary-overview-row:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

@media (max-width: 960px) {
  .salary-report-hero {
    grid-template-columns: 1fr;
  }

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

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

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

.salary-stmt-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.salary-stmt-hero__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.salary-stmt-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  color: #0f172a;
}

.salary-stmt-hero__sub {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.salary-stmt-panel {
  background: var(--white);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.salary-stmt-config {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
  gap: 0.85rem 1rem;
  align-items: end;
}

.salary-stmt-history {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  line-height: 1.45;
}

.salary-stmt-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.salary-stmt-config__actions,
.salary-stmt-bonus__actions {
  display: flex;
  align-items: flex-end;
}

.btn--salary-save {
  min-height: 2.65rem;
  padding: 0 1.25rem;
  white-space: nowrap;
}

.salary-stmt-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.35rem 1rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
}

.salary-stmt-kpi__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.4rem;
}

.salary-stmt-kpi__value {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.salary-stmt-bonus {
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.salary-stmt-bonus__form {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 0.85rem 1rem;
  align-items: end;
}

.btn--bonus-add {
  background: #ea580c;
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  min-height: 2.65rem;
  white-space: nowrap;
}

.btn--bonus-add:hover {
  background: #c2410c;
}

.salary-stmt-ledger__toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0.85rem 0;
}

#tblSalary {
  min-width: 720px;
}

@media (max-width: 900px) {
  .salary-stmt-config,
  .salary-stmt-bonus__form {
    grid-template-columns: 1fr;
  }

  .salary-stmt-config__actions,
  .salary-stmt-bonus__actions {
    width: 100%;
  }

  .btn--salary-save,
  .btn--bonus-add {
    width: 100%;
    justify-content: center;
  }
}

/* Master audit report */
body.audit-page {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.08), transparent 50%),
    linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  min-height: 100vh;
}

.data-shell--audit {
  max-width: 1240px;
  padding-bottom: 2.5rem;
}

.audit-report-head {
  margin-bottom: 1.5rem;
  animation: auditFadeUp 0.5s ease both;
}

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

.audit-report-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), rgba(239, 68, 68, 0.06));
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-report-head__title h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0f172a 0%, #334155 60%, #dc2626 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.audit-report-head__sub {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 42rem;
}

.audit-report-head__period {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.audit-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  animation: auditFadeUp 0.55s ease 0.05s both;
}

.audit-report-toolbar__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.audit-report-toolbar__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 11rem;
}

.audit-report-toolbar__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.audit-input {
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
  background: #fff !important;
}

.audit-report-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn--audit-view {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--audit-view:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn--audit-pdf {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}

.btn--audit-pdf:hover {
  filter: brightness(1.08);
}

.btn--audit-excel {
  background: #fff;
  color: #059669;
  border: 1.5px solid #a7f3d0;
  font-weight: 700;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
}

.btn--audit-excel:hover {
  background: #ecfdf5;
}

.audit-report-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2rem 2rem 2.25rem;
  margin-bottom: 1.35rem;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: auditFadeUp 0.6s ease 0.1s both;
}

.audit-report-hero__glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.audit-report-hero__main {
  position: relative;
  z-index: 1;
}

.audit-report-hero__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.audit-report-hero__value {
  display: inline-block;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(34, 197, 94, 0.35));
}

.audit-report-hero__currency {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #64748b;
  vertical-align: super;
}

.audit-report-hero__side {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.audit-hero-stat {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.audit-hero-stat__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.audit-hero-stat__value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.audit-hero-stat__value--cyan { color: #67e8f9; }
.audit-hero-stat__value--green { color: #86efac; }
.audit-hero-stat__value--gold { color: #fcd34d; }

.audit-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.35rem;
  animation: auditFadeUp 0.65s ease 0.15s both;
}

.audit-summary-chip {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-left-width: 4px;
}

.audit-summary-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.audit-summary-chip--blue { border-left-color: #3b82f6; }
.audit-summary-chip--indigo { border-left-color: #6366f1; }
.audit-summary-chip--cyan { border-left-color: #06b6d4; }
.audit-summary-chip--slate { border-left-color: #64748b; }
.audit-summary-chip--orange { border-left-color: #f97316; }
.audit-summary-chip--purple { border-left-color: #a855f7; }
.audit-summary-chip--green { border-left-color: #22c55e; }
.audit-summary-chip--red { border-left-color: #ef4444; }

.audit-summary-chip__icon {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 0.15rem;
}

.audit-summary-chip--blue .audit-summary-chip__icon { color: #3b82f6; }
.audit-summary-chip--indigo .audit-summary-chip__icon { color: #6366f1; }
.audit-summary-chip--cyan .audit-summary-chip__icon { color: #06b6d4; }
.audit-summary-chip--slate .audit-summary-chip__icon { color: #64748b; }
.audit-summary-chip--orange .audit-summary-chip__icon { color: #f97316; }
.audit-summary-chip--purple .audit-summary-chip__icon { color: #a855f7; }
.audit-summary-chip--green .audit-summary-chip__icon { color: #22c55e; }
.audit-summary-chip--red .audit-summary-chip__icon { color: #ef4444; }

.audit-summary-chip__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.audit-summary-chip__value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.audit-charts-section {
  margin-bottom: 1.35rem;
  animation: auditFadeUp 0.7s ease 0.2s both;
}

.audit-charts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.audit-charts-row--main {
  grid-template-columns: 1.6fr 1fr;
}

.audit-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease;
}

.audit-chart-card:hover {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.09);
}

.audit-chart-card__head {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.audit-chart-card__head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
}

.audit-chart-card__head i {
  color: #dc2626;
  font-size: 0.9rem;
}

.audit-chart-card__body {
  position: relative;
  height: 260px;
  padding: 0.75rem 0.85rem 1rem;
}

.audit-chart-card__body--doughnut {
  height: 300px;
}

.audit-chart-card__body--bar {
  height: 240px;
}

.audit-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.audit-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  animation: auditFadeUp 0.75s ease both;
}

.audit-panel--rank:nth-child(1) { animation-delay: 0.25s; }
.audit-panel--rank:nth-child(2) { animation-delay: 0.3s; }

.audit-panel__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
}

.audit-panel__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.audit-panel__icon--gold { background: #fef3c7; color: #d97706; }
.audit-panel__icon--blue { background: #dbeafe; color: #2563eb; }
.audit-panel__icon--purple { background: #ede9fe; color: #7c3aed; }
.audit-panel__icon--orange { background: #ffedd5; color: #ea580c; }
.audit-panel__icon--red { background: #fee2e2; color: #dc2626; }

.audit-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.audit-rank-list__item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.audit-rank-list__item:hover {
  background: #f8fafc;
}

.audit-rank-list__rank {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.audit-rank-list__rank--gold {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #78350f;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.audit-rank-list__rank--silver {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #334155;
}

.audit-rank-list__rank--bronze {
  background: linear-gradient(135deg, #fed7aa, #fdba74);
  color: #9a3412;
}

.audit-rank-list__body {
  min-width: 0;
}

.audit-rank-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.audit-rank-list__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-rank-list__meta {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.audit-rank-list__amount {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  flex-shrink: 0;
}

.audit-rank-list__bar {
  display: block;
  height: 4px;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.audit-rank-list__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.audit-rank-list__empty {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
  padding: 0.5rem 0.25rem;
}

.audit-log-card {
  margin-top: 0.75rem;
  border-radius: 18px;
  overflow: hidden;
  animation: auditFadeUp 0.8s ease 0.35s both;
}

.audit-log-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0;
}

.audit-log-card__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.audit-log-card__title i {
  color: #dc2626;
}

.audit-log-card__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  padding: 0.35rem 0.65rem;
  background: #f1f5f9;
  border-radius: 999px;
}

.audit-log-card__table {
  padding: 0.75rem 1rem 1rem;
}

@media (max-width: 1024px) {
  .audit-charts-row,
  .audit-charts-row--main {
    grid-template-columns: 1fr;
  }

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

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

.commission-history-note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #6366f1;
  line-height: 1.45;
}

.form-grid--commission .field--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.commission-report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.commission-pay-kpis {
  margin-top: 0.75rem;
}

.commission-kpi {
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.commission-kpi--total {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: #0f172a;
}

.commission-kpi--total .commission-kpi__label {
  color: #94a3b8;
}

.commission-kpi--total .commission-kpi__value {
  color: #4ade80;
  font-size: 1.35rem;
}

.commission-kpi__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.commission-kpi__value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.commission-pro-panels {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.commission-pro-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.commission-pro-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  cursor: pointer;
  user-select: none;
}

.commission-pro-panel--open .commission-pro-panel__head {
  border-bottom: 1px solid #e2e8f0;
}

.commission-pro-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.commission-pro-panel__title i {
  color: #6366f1;
}

.commission-pro-panel__badge {
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 800;
}

.commission-pro-panel__meta {
  display: flex;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}

.commission-pro-panel__body {
  display: none;
  padding: 0.75rem 1rem 1rem;
}

.commission-pro-panel--open .commission-pro-panel__body {
  display: block;
}

.commission-pro-panel__subhead {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.commission-pro-panel__subhead:first-child {
  margin-top: 0;
}

.commission-pro-panel__subhead i {
  color: #dc2626;
  font-size: 0.85rem;
}

.commission-panel__empty {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}

.commission-subtable {
  font-size: 0.88rem;
}

.commission-total-row th,
.commission-total-row td {
  font-weight: 800;
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
}

.btn--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .audit-report-grid,
  .audit-report-grid--triple {
    grid-template-columns: 1fr;
  }

  .audit-report-toolbar__actions {
    width: 100%;
  }

  .btn--audit-view,
  .btn--audit-pdf,
  .btn--audit-excel {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.closing-entry-card,
.closing-history-card {
  margin-bottom: 1.25rem;
}

.closing-form__grid {
  margin-bottom: 1rem;
}

.closing-note-field textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
  white-space: pre-wrap;
}

.closing-note-col {
  min-width: 280px;
}

.closing-note-cell {
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  max-width: 640px;
}

.closing-history-table .col-date {
  width: 7.5rem;
  white-space: nowrap;
  vertical-align: top;
}

.closing-history-table .col-actions {
  width: 8.5rem;
  vertical-align: top;
}

.closing-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.closing-history-card .data-card__head--toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.closing-history-row {
  cursor: pointer;
}

.closing-history-row:hover td {
  background: #f8fafc;
}

.closing-history-row:focus {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}

.closing-ref-card {
  margin-bottom: 2rem;
}

.closing-ref-card__summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.closing-ref-card__summary::-webkit-details-marker {
  display: none;
}

.closing-ref-card__hint {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.closing-empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.field__hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

/* Admin financial intelligence */
.data-shell--admin-intel {
  max-width: 1180px;
}

.admin-intel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-intel-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
  color: #be185d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.admin-intel-head__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.admin-intel-head__sub {
  margin: 0;
  max-width: 40rem;
  color: #64748b;
  line-height: 1.55;
}

.admin-intel-head__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.admin-intel-sync {
  font-size: 0.78rem;
  color: #94a3b8;
}

.admin-intel-health-strip {
  display: grid;
  grid-template-columns: 1.1fr 0.75fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.admin-health-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.admin-health-card--monthly {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.admin-health-card--daily {
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.admin-health-card__ring {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.admin-health-card__ring--sm {
  width: 72px;
  height: 72px;
}

.admin-health-card__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.admin-health-ring__track {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.admin-health-ring__bar {
  fill: none;
  stroke: #64748b;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.admin-health-card__ring[data-status="good"] .admin-health-ring__bar {
  stroke: #16a34a;
}

.admin-health-card__ring[data-status="warn"] .admin-health-ring__bar {
  stroke: #ea580c;
}

.admin-health-card__ring[data-status="critical"] .admin-health-ring__bar {
  stroke: #dc2626;
}

.admin-health-card__ring[data-status="neutral"] .admin-health-ring__bar {
  stroke: #94a3b8;
}

.admin-health-card__score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.admin-health-card__body h2 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.admin-health-card__body p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.admin-health-mini {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.65rem;
}

.admin-health-mini__item {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #64748b;
}

.admin-health-mini__item strong {
  font-weight: 800;
  color: #334155;
}

.admin-health-mini__item--good strong {
  color: #15803d;
}

.admin-health-mini__item--warn strong {
  color: #c2410c;
}

.admin-health-mini__item--critical strong {
  color: #b91c1c;
}

.admin-intel-targets-card {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 39, 68, 0.22);
}

.admin-intel-targets-card h2 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-intel-targets-card__month {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.68);
}

.admin-intel-targets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.65rem;
}

.admin-intel-target-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-intel-target-field span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.admin-intel-target-field input {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
}

.admin-intel-hero-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.admin-intel-highlight {
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid transparent;
}

.admin-intel-highlight--cash {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
}

.admin-intel-highlight--liquid {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}

.admin-intel-highlight__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 0.35rem;
}

.admin-intel-highlight__value {
  display: block;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.admin-intel-highlight--cash .admin-intel-highlight__value {
  color: #047857;
}

.admin-intel-highlight--liquid .admin-intel-highlight__value {
  color: #1d4ed8;
}

.admin-intel-highlight__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
}

.admin-intel-pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.admin-intel-pillar {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.admin-intel-pillar__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-intel-pillar--ops .admin-intel-pillar__head {
  background: #fef2f2;
  color: #b91c1c;
}

.admin-intel-pillar--cash .admin-intel-pillar__head {
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-intel-pillar--out .admin-intel-pillar__head {
  background: #fff7ed;
  color: #c2410c;
}

.admin-intel-pillar__list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.85rem 0.85rem;
}

.admin-intel-pillar__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #e2e8f0;
}

.admin-intel-pillar__list li:last-child {
  border-bottom: none;
}

.admin-intel-pillar__label {
  font-size: 0.8125rem;
  color: #64748b;
}

.admin-intel-pillar__val {
  font-size: 0.9375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.admin-intel-pillar__val--profit {
  color: #2563eb;
}

.admin-intel-pillar__val--warn {
  color: #ea580c;
}

.admin-intel-pillar__val--due {
  color: #dc2626;
}

.admin-intel-charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.admin-intel-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.85rem 1rem 1rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.admin-intel-chart-card--wide {
  grid-column: span 1;
}

.admin-intel-charts .admin-intel-chart-card--wide:first-child {
  grid-column: 1 / -1;
}

.admin-intel-chart-card header h2 {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-intel-chart-body {
  position: relative;
  height: 260px;
}

.admin-intel-chart-body--doughnut {
  height: 240px;
}

.admin-intel-positions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-intel-position-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.admin-intel-position-card--assets {
  border-top: 3px solid #10b981;
}

.admin-intel-position-card--liab {
  border-top: 3px solid #ef4444;
}

.admin-intel-position-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.admin-intel-position-card__head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-intel-position-card__tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.admin-intel-position-card__total {
  font-size: 1.05rem;
  font-weight: 800;
  color: #047857;
  font-variant-numeric: tabular-nums;
}

.admin-intel-position-card__total--neg {
  color: #dc2626;
}

.admin-intel-table .num {
  font-variant-numeric: tabular-nums;
}

.admin-intel-bal--pos {
  color: #047857;
  font-weight: 700;
}

.admin-intel-bal--neg {
  color: #dc2626;
  font-weight: 700;
}

.admin-intel-export {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.admin-intel-pillar__hint {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.admin-intel-pillar__val--security {
  color: #ca8a04;
}

.admin-security-fund {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 45%, #fff 100%);
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.12);
}

.admin-security-fund__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-security-fund__head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.admin-security-fund__head p {
  margin: 0;
  max-width: 36rem;
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
}

.admin-security-fund__head em {
  font-style: normal;
  font-weight: 700;
  color: #b45309;
}

.admin-security-fund__balance {
  text-align: right;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #fde68a;
  min-width: 180px;
}

.admin-security-fund__balance-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #92400e;
}

.admin-security-fund__balance-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  color: #a16207;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.admin-security-fund__balance-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: #b45309;
}

.admin-security-fund__forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-security-form {
  background: #fff;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
}

.admin-security-form--deposit {
  border-top: 3px solid #16a34a;
}

.admin-security-form--withdraw {
  border-top: 3px solid #dc2626;
}

.admin-security-form h3 {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-security-form p {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-security-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.65rem;
  align-items: end;
}

.admin-security-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.admin-security-field--action {
  grid-column: 1 / -1;
}

.admin-security-field span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.admin-security-field input {
  padding: 0.45rem 0.55rem;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8125rem;
}

.admin-security-badge {
  display: inline-flex;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-security-badge--deposit {
  background: #dcfce7;
  color: #15803d;
}

.admin-security-badge--withdraw {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-security-amt--in {
  color: #15803d;
  font-weight: 700;
}

.admin-security-amt--out {
  color: #b91c1c;
  font-weight: 700;
}

.admin-security-row--deposit td {
  background: rgba(220, 252, 231, 0.15);
}

.admin-security-row--withdraw td {
  background: rgba(254, 226, 226, 0.15);
}

.data-shell--security-fund {
  max-width: 1080px;
}

.security-fund-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.security-fund-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  color: #a16207;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.security-fund-head__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  font-weight: 800;
  color: #78350f;
}

.security-fund-head__sub {
  margin: 0;
  max-width: 40rem;
  color: #92400e;
  line-height: 1.55;
  font-size: 0.9rem;
}

.security-fund-head__balance {
  align-self: flex-start;
}

.security-fund-kpis {
  margin-bottom: 1rem;
}

.security-fund-forms {
  margin-bottom: 1rem;
}

.security-fund-ledger {
  margin-bottom: 0.75rem;
}

.security-fund-ledger__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0;
}

.security-fund-ledger__title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.security-fund-ledger__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.security-fund-footnote {
  margin: 0 0 2rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.security-fund-footnote a {
  color: #2563eb;
  font-weight: 600;
}

.btn--admin-link {
  white-space: nowrap;
  text-decoration: none;
}

.admin-intel-link-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 55%, #fff 100%);
  border: 1px solid #fcd34d;
}

.admin-intel-link-card__body h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.admin-intel-link-card__body p {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  color: #92400e;
}

.admin-intel-link-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.8125rem;
  color: #b45309;
}

.admin-intel-link-card__stats strong {
  color: #78350f;
  font-weight: 800;
}

.admin-intel-link-card__btn {
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.admin-intel-pillar__link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-intel-pillar__link:hover {
  text-decoration: underline;
}

.admin-intel-pillar__val--security .admin-intel-pillar__link {
  color: #ca8a04;
}

@media (max-width: 1024px) {
  .admin-security-fund__forms {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .admin-intel-health-strip,
  .admin-intel-pillar-grid,
  .admin-intel-positions,
  .admin-intel-hero-duo {
    grid-template-columns: 1fr;
  }

  .admin-intel-charts {
    grid-template-columns: 1fr;
  }

  .admin-intel-head__meta {
    align-items: flex-start;
  }
}

/* Payment losses — professional admin ledger */
.payment-losses-page {
  background: linear-gradient(165deg, #f1f5f9 0%, #e8edf4 48%, #eef2f7 100%);
}

.data-shell--payment-losses {
  max-width: 1140px;
}

.pl-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fff8f8 55%, #fef2f2 100%);
  border: 1px solid rgba(220, 38, 38, 0.12);
  box-shadow: 0 12px 40px rgba(127, 29, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.pl-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc2626, #991b1b, #0f2744);
}

.pl-hero__intro {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1 1 20rem;
  min-width: 0;
}

.pl-hero__icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(15, 39, 68, 0.08));
  color: #dc2626;
  font-size: 1.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.pl-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 39, 68, 0.08);
  color: #475569;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pl-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #7f1d1d;
}

.pl-hero__sub {
  margin: 0;
  max-width: 36rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.55;
}

.pl-hero__sub strong {
  color: #991b1b;
  font-weight: 700;
}

.pl-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(7rem, 1fr));
  gap: 0.65rem;
  flex: 0 1 auto;
  min-width: min(100%, 22rem);
}

.pl-stat {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.pl-stat__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.pl-stat__value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pl-stat__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #94a3b8;
}

.pl-stat--net {
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
}

.pl-stat--net .pl-stat__value {
  color: #b91c1c;
}

.pl-stat--loss .pl-stat__value {
  color: #0f172a;
}

.pl-stat--rec {
  border-color: rgba(21, 128, 61, 0.2);
  background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

.pl-stat--rec .pl-stat__value {
  color: #15803d;
}

.pl-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.pl-callout i {
  margin-top: 0.15rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.pl-callout p {
  margin: 0;
}

.pl-callout a {
  color: #1d4ed8;
  font-weight: 600;
}

.pl-entry-panel {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.pl-entry-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.pl-entry-panel__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 39, 68, 0.1), rgba(220, 38, 38, 0.08));
  color: #0f2744;
  font-size: 1.1rem;
}

.pl-entry-panel__title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pl-entry-panel__lead {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.pl-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.35rem;
  margin-bottom: 1.15rem;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.pl-type-tabs__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pl-type-tabs__btn:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.55);
}

.pl-type-tabs__btn.is-active {
  background: var(--white);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pl-type-tabs__btn.is-active[data-tab="loss"] {
  color: #b91c1c;
}

.pl-type-tabs__btn.is-active[data-tab="recovery"] {
  color: #15803d;
}

.pl-tab-panel__hint {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.1rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.pl-tab-panel__hint--rec {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.pl-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

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

.pl-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e2e8f0;
}

.btn-work-final-save--loss {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: #991b1b;
}

.btn-work-final-save--loss:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.btn-work-final-save--rec {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #065f46;
}

.btn-work-final-save--rec:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.entry-log-card--losses {
  border-top: 3px solid rgba(220, 38, 38, 0.35);
}

.pl-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pl-type-badge--loss {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.pl-type-badge--rec {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.pl-reason-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  line-height: 1.3;
  word-break: break-word;
}

.pl-reason-badge--rec {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.pl-row--loss td {
  background: rgba(254, 242, 242, 0.35);
}

.pl-row--rec td {
  background: rgba(236, 253, 245, 0.35);
}

.pl-row:hover td {
  background: #f8fafc;
}

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

#tblPaymentLosses col.col-date { width: 9%; }
#tblPaymentLosses col.col-type { width: 9%; }
#tblPaymentLosses col.col-amount { width: 9%; }
#tblPaymentLosses col.col-customer { width: 14%; }
#tblPaymentLosses col.col-reason { width: 13%; }
#tblPaymentLosses col.col-desc { width: 28%; }
#tblPaymentLosses col.col-net { width: 10%; }
#tblPaymentLosses col.col-actions { width: 8%; }

.data-table--pl-ledger .col-amount--loss {
  color: #b91c1c;
  font-weight: 700;
}

.data-table--pl-ledger .col-net {
  font-weight: 700;
  color: #7f1d1d;
}

.data-table--pl-ledger tbody td.col-desc {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.entry-log-card--losses .entry-log-table-wrap .data-table--entry-list td.col-actions .btn--action span {
  display: none;
}

.admin-intel-link-card--losses {
  border-color: rgba(220, 38, 38, 0.18);
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.admin-intel-link-card--losses h2 {
  color: #991b1b;
}

.admin-intel-pillar__val--due {
  color: #b91c1c;
}

@media (max-width: 767px) {
  .pl-hero__stats {
    grid-template-columns: 1fr;
    width: 100%;
  }

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

@media (max-width: 480px) {
  .pl-type-tabs {
    grid-template-columns: 1fr;
  }
}

/* Fund rolling audit — professional admin ledger */
.fund-rolling-page {
  background: linear-gradient(165deg, #f5f3ff 0%, #ede9fe 42%, #eef2f7 100%);
}

.data-shell--fund-rolling {
  max-width: 1140px;
}

.fr-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 55%, #f5f3ff 100%);
  border: 1px solid rgba(124, 58, 237, 0.14);
  box-shadow: 0 12px 40px rgba(76, 29, 149, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.fr-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed, #2563eb, #0f2744);
}

.fr-hero__intro {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1 1 20rem;
  min-width: 0;
}

.fr-hero__icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(37, 99, 235, 0.1));
  color: #7c3aed;
  font-size: 1.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.fr-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 39, 68, 0.08);
  color: #475569;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fr-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #4c1d95;
}

.fr-hero__sub {
  margin: 0;
  max-width: 36rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.55;
}

.fr-hero__sub strong {
  color: #6d28d9;
  font-weight: 700;
}

.fr-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(7rem, 1fr));
  gap: 0.65rem;
  flex: 0 1 auto;
  min-width: min(100%, 22rem);
}

.fr-stat {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.fr-stat__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.fr-stat__value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fr-stat__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.35;
}

.fr-stat--open {
  border-color: rgba(234, 88, 12, 0.25);
  background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}

.fr-stat--open .fr-stat__value {
  color: #c2410c;
}

.fr-stat--cleared {
  border-color: rgba(21, 128, 61, 0.2);
  background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

.fr-stat--cleared .fr-stat__value {
  color: #15803d;
}

.fr-stat--volume .fr-stat__value {
  color: #5b21b6;
}

.fr-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.fr-callout i {
  margin-top: 0.15rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.fr-callout p {
  margin: 0;
}

.fr-callout a {
  color: #1d4ed8;
  font-weight: 600;
}

.fr-entry-panel {
  background: var(--white);
  border-radius: 18px;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(76, 29, 149, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.fr-entry-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.fr-entry-panel__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(37, 99, 235, 0.08));
  color: #6d28d9;
  font-size: 1.1rem;
}

.fr-entry-panel__title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.fr-entry-panel__lead {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.fr-form-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.1rem;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 0.8125rem;
  line-height: 1.45;
}

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

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

.fr-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e2e8f0;
}

.btn-work-final-save--fund {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border-color: #5b21b6;
}

.btn-work-final-save--fund:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

.fr-ledger-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.fr-ledger-tabs__btn {
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fr-ledger-tabs__btn:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.55);
}

.fr-ledger-tabs__btn.is-active {
  background: #fff;
  color: #6d28d9;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.entry-log-card--fund-rolling {
  border-top: 3px solid rgba(124, 58, 237, 0.35);
}

.fr-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.fr-status-badge--open {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fed7aa;
}

.fr-status-badge--cleared {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.fr-card-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  line-height: 1.3;
  word-break: break-word;
}

.fr-days {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.fr-days--ok {
  background: #ecfdf5;
  color: #047857;
}

.fr-days--mid {
  background: #fef3c7;
  color: #b45309;
}

.fr-days--warn {
  background: #fee2e2;
  color: #b91c1c;
}

.fr-row--open td {
  background: rgba(255, 247, 237, 0.35);
}

.fr-row--cleared td {
  background: rgba(236, 253, 245, 0.25);
}

.fr-row--open:hover td,
.fr-row--cleared:hover td {
  background: #f8fafc;
}

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

#tblRoll col.col-date { width: 9%; }
#tblRoll col.col-status { width: 9%; }
#tblRoll col.col-source { width: 13%; }
#tblRoll col.col-target { width: 13%; }
#tblRoll col.col-amount { width: 10%; }
#tblRoll col.col-days { width: 8%; }
#tblRoll col.col-note { width: 30%; }
#tblRoll col.col-actions { width: 8%; }

.data-table--fr-ledger .col-amount {
  font-weight: 700;
  color: #5b21b6;
}

.data-table--fr-ledger tbody td.col-note {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.btn--action-return {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.btn--action-return:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.entry-log-card--fund-rolling .entry-log-table-wrap .data-table--entry-list td.col-actions .btn--action span {
  display: none;
}

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

  .entry-log-card--fund-rolling .entry-log-card__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fr-ledger-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .fr-ledger-tabs__btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .fr-hero__stats {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Import & export page */
.import-export-page {
  background: linear-gradient(165deg, #eef2f7 0%, #e8edf4 48%, #f1f5f9 100%);
}

.data-shell--import-export {
  max-width: 820px;
}

.ie-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.15rem, 2.5vw, 1.5rem);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #f0fdf4 55%, #ecfdf5 100%);
  border: 1px solid rgba(21, 128, 61, 0.14);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.07);
}

.ie-hero__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.14), rgba(15, 39, 68, 0.08));
  color: #15803d;
  font-size: 1.25rem;
}

.ie-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 800;
  color: #0f172a;
}

.ie-hero__sub {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ie-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: clamp(1.1rem, 2.5vw, 1.35rem);
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.ie-card--excel {
  border-top: 3px solid rgba(21, 128, 61, 0.45);
}

.ie-card--danger {
  border-color: rgba(220, 38, 38, 0.15);
  background: linear-gradient(180deg, #fff, #fff5f5);
}

.ie-card__head {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.ie-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1.1rem;
}

.ie-card__icon--excel {
  background: #dcfce7;
  color: #15803d;
}

.ie-card__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.ie-card__title--plain {
  margin-bottom: 0.35rem;
}

.ie-card__lead {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.ie-card__head .ie-card__lead {
  margin-bottom: 0;
}

.ie-callout {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.ie-callout p {
  margin: 0;
}

.ie-callout--demo {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.ie-callout--demo .ie-callout__link {
  color: #1d4ed8;
  font-weight: 700;
  margin-left: 0.35rem;
}

.ie-callout--info {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.ie-sheet-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.ie-sheet-list__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-right: 0.25rem;
}

.ie-sheet-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
}

.ie-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn--excel-lg {
  padding: 0.75rem 1.15rem;
  font-weight: 700;
}

.ie-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ie-preview__file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 0.35rem;
}

.ie-preview__summary {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.45;
}

html[data-tasleem-sync="pulling"]::before,
html[data-tasleem-sync="pushing"]::before {
  content: attr(data-tasleem-sync-msg);
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

