/* ========== GLOBAL RESET & BODY ========== */
* {
  box-sizing: border-box;
}

html {
  background-color: var(--app-page-background-color, #f8fafc);
  background-image: var(--app-page-background, radial-gradient(circle at top left, #fff1f2 0%, #f8fafc 55%, #ffffff 100%));
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  min-height: 100%;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
}

body {
  margin: 0;
  position: relative;
  isolation: isolate;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: transparent;
  background-color: transparent;
  color: #1f2937;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overscroll-behavior-y: auto;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
}

body::after {
  content: "";
  position: fixed;
  inset: -20vh 0 -20vh 0;
  background-color: var(--app-page-background-color, #f8fafc);
  background-image: var(--app-page-background, radial-gradient(circle at top left, #fff1f2 0%, #f8fafc 55%, #ffffff 100%));
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  z-index: -2;
  pointer-events: none;
  transform: translateZ(0);
}

@media (pointer: coarse) {
  html,
  body {
    height: auto;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }

  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

:root {
  --accent-red: #e22228;
  --accent-red-soft: rgba(226, 34, 40, 0.18);
  --panel-border: rgba(226, 34, 40, 0.16);
  --panel-shadow: 0 16px 34px rgba(226, 34, 40, 0.1);
  --page-content-gutter: 20px;
  --page-content-gutter-half: 10px;
  --app-page-background:
    radial-gradient(circle at top left, #fff1f2 0%, #f8fafc 55%, #ffffff 100%);
  --app-page-background-color: #f8fafc;
}

:root {
  --status-bar-bg: #0a0a0a;
  --header-offset: 0px;
}

@supports (padding: env(safe-area-inset-top)) {
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: var(--status-bar-bg);
    z-index: 2001;
    pointer-events: none;
  }
}

body.modal-open {
  overflow: hidden;
}

html.modal-open,
body.modal-open {
  height: 100%;
  overflow: hidden;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: calc(20px + var(--header-offset)) var(--page-content-gutter) 40px;
}

/* ========== PAGE SKELETON ========== */
.page-skeleton {
  --page-skeleton-backdrop: rgba(248, 250, 252, 0.84);
  --page-skeleton-surface: rgba(255, 255, 255, 0.76);
  --page-skeleton-surface-strong: rgba(255, 255, 255, 0.9);
  --page-skeleton-border: rgba(15, 23, 42, 0.08);
  --page-skeleton-highlight: rgba(255, 255, 255, 0.28);
  --page-skeleton-shadow: 0 20px 42px rgba(15, 23, 42, 0.06);
  --page-skeleton-bone-base: rgba(203, 213, 225, 0.72);
  --page-skeleton-bone-mid: rgba(255, 255, 255, 0.98);
  position: fixed;
  top: var(--header-offset);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1990;
  overflow-y: auto;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top left, rgba(226, 34, 40, 0.08), transparent 26%),
    linear-gradient(180deg, var(--page-skeleton-backdrop), rgba(248, 250, 252, 0.94));
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

html.page-skeleton-active .page-skeleton {
  opacity: 1;
  visibility: visible;
}

html.page-skeleton-active body {
  cursor: progress;
}

.page-skeleton[data-theme="workspace"] {
  --page-skeleton-backdrop: rgba(250, 242, 244, 0.88);
  --page-skeleton-surface: rgba(255, 255, 255, 0.78);
  --page-skeleton-surface-strong: rgba(255, 255, 255, 0.92);
  --page-skeleton-border: rgba(226, 34, 40, 0.12);
  --page-skeleton-highlight: rgba(255, 255, 255, 0.32);
  --page-skeleton-shadow: 0 22px 46px rgba(84, 18, 26, 0.08);
  --page-skeleton-bone-base: rgba(248, 187, 192, 0.52);
  --page-skeleton-bone-mid: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at top right, rgba(255, 175, 175, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(226, 34, 40, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 249, 249, 0.94), rgba(248, 250, 252, 0.96));
}

.page-skeleton[data-theme="workflow"] {
  --page-skeleton-backdrop: rgba(248, 248, 244, 0.9);
  --page-skeleton-surface: rgba(255, 255, 255, 0.8);
  --page-skeleton-surface-strong: rgba(255, 255, 255, 0.92);
  --page-skeleton-border: rgba(180, 83, 9, 0.12);
  --page-skeleton-highlight: rgba(255, 255, 255, 0.3);
  --page-skeleton-shadow: 0 22px 44px rgba(120, 53, 15, 0.08);
  --page-skeleton-bone-base: rgba(245, 208, 144, 0.5);
  --page-skeleton-bone-mid: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.12), transparent 22%),
    radial-gradient(circle at bottom left, rgba(234, 88, 12, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.95), rgba(248, 250, 252, 0.96));
}

.page-skeleton[data-theme="dark"] {
  --page-skeleton-backdrop: rgba(9, 13, 20, 0.9);
  --page-skeleton-surface: rgba(22, 28, 39, 0.84);
  --page-skeleton-surface-strong: rgba(19, 25, 36, 0.94);
  --page-skeleton-border: rgba(148, 163, 184, 0.14);
  --page-skeleton-highlight: rgba(255, 255, 255, 0.06);
  --page-skeleton-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
  --page-skeleton-bone-base: rgba(71, 85, 105, 0.54);
  --page-skeleton-bone-mid: rgba(148, 163, 184, 0.26);
  background:
    radial-gradient(circle at top right, rgba(226, 34, 40, 0.14), transparent 20%),
    radial-gradient(circle at bottom left, rgba(30, 41, 59, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(8, 11, 17, 0.94), rgba(17, 24, 39, 0.96));
}

.page-skeleton[data-theme="meta"] {
  --page-skeleton-backdrop: rgba(242, 247, 255, 0.9);
  --page-skeleton-surface: rgba(255, 255, 255, 0.8);
  --page-skeleton-surface-strong: rgba(255, 255, 255, 0.94);
  --page-skeleton-border: rgba(37, 99, 235, 0.12);
  --page-skeleton-highlight: rgba(255, 255, 255, 0.28);
  --page-skeleton-shadow: 0 22px 46px rgba(30, 64, 175, 0.08);
  --page-skeleton-bone-base: rgba(147, 197, 253, 0.46);
  --page-skeleton-bone-mid: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 20%),
    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(245, 249, 255, 0.95), rgba(248, 250, 252, 0.97));
}

.page-skeleton-stage {
  --page-skeleton-stage-width: 1120px;
  width: min(var(--page-skeleton-stage-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: calc(100% - 8px);
}

.page-skeleton-stage--analytics,
.page-skeleton-stage--workspace-profile,
.page-skeleton-stage--workspace-report-builder,
.page-skeleton-stage--workspace-tasks,
.page-skeleton-stage--workspace-reports,
.page-skeleton-stage--workflow,
.page-skeleton-stage--workflow-detail,
.page-skeleton-stage--integration {
  --page-skeleton-stage-width: 1180px;
}

.page-skeleton-stage--document {
  --page-skeleton-stage-width: 1240px;
}

.page-skeleton-stage--chat {
  --page-skeleton-stage-width: 560px;
}

.page-skeleton-hero,
.page-skeleton-card,
.page-skeleton-panel,
.page-skeleton-chart,
.page-skeleton-board-column,
.page-skeleton-section {
  background: var(--page-skeleton-surface-strong);
  border: 1px solid var(--page-skeleton-border);
  box-shadow:
    var(--page-skeleton-shadow),
    inset 0 1px 0 var(--page-skeleton-highlight);
}

.page-skeleton-hero {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 28px;
}

.page-skeleton-hero--compact {
  padding: 20px 22px;
}

.page-skeleton-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

.page-skeleton-card {
  display: grid;
  gap: 12px;
  min-height: 118px;
  padding: 18px;
  border-radius: 24px;
}

.page-skeleton-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
}

.page-skeleton-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
}

.page-skeleton-chart {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
}

.page-skeleton-stat-grid {
  display: grid;
  gap: 18px;
}

.page-skeleton-stat-grid--1 {
  grid-template-columns: minmax(0, 1fr);
}

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

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

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

.page-skeleton-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.page-skeleton-layout--wide-sidebar {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.95fr);
}

.page-skeleton-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

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

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

.page-skeleton-field,
.page-skeleton-search {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: var(--page-skeleton-surface);
  border: 1px solid var(--page-skeleton-border);
  box-shadow: inset 0 1px 0 var(--page-skeleton-highlight);
}

.page-skeleton-field--wide {
  grid-column: span 2;
}

.page-skeleton-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.page-skeleton-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.page-skeleton-stack-lg {
  gap: 12px;
}

.page-skeleton-link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.page-skeleton-table-block {
  display: grid;
  gap: 14px;
}

.page-skeleton-table-head,
.page-skeleton-table-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.page-skeleton-table-head {
  padding-bottom: 4px;
}

.page-skeleton-table-row {
  padding: 12px 0;
  border-top: 1px solid var(--page-skeleton-border);
}

.page-skeleton-table-head--4,
.page-skeleton-table-row--4 {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 0.85fr);
}

.page-skeleton-table-head--5,
.page-skeleton-table-row--5 {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.75fr);
}

.page-skeleton-table-head--6,
.page-skeleton-table-row--6 {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.95fr) minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.8fr);
}

.page-skeleton-table-head--7,
.page-skeleton-table-row--7 {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
}

.page-skeleton-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.7fr) minmax(90px, 0.42fr);
  gap: 12px;
  align-items: center;
}

.page-skeleton-feed {
  display: grid;
  gap: 0;
}

.page-skeleton-feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--page-skeleton-border);
}

.page-skeleton-feed-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.page-skeleton-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.page-skeleton-board-column {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 18px;
  border-radius: 24px;
}

.page-skeleton-board-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--page-skeleton-surface);
  border: 1px solid var(--page-skeleton-border);
  box-shadow: inset 0 1px 0 var(--page-skeleton-highlight);
}

.page-skeleton-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 18px;
}

.page-skeleton-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 170px;
}

.page-skeleton-chart-bar {
  flex: 1 1 0;
  min-height: 32px;
  border-radius: 18px 18px 8px 8px;
}

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

.page-skeleton-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.page-skeleton-avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.page-skeleton-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 20px;
}

.page-skeleton-bone {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--page-skeleton-bone-base) 0%,
    var(--page-skeleton-bone-mid) 48%,
    var(--page-skeleton-bone-base) 100%
  );
  background-size: 200% 100%;
  animation: dixelSkeletonWave 1.1s linear infinite;
}

.page-skeleton-line {
  height: 12px;
}

.page-skeleton-line-xs {
  width: 34%;
}

.page-skeleton-line-sm {
  width: 22%;
}

.page-skeleton-line-md {
  width: 58%;
}

.page-skeleton-line-lg {
  width: 76%;
}

.page-skeleton-line-xl {
  width: min(520px, 100%);
  height: 20px;
  border-radius: 14px;
}

.page-skeleton-chip {
  width: 84px;
  height: 30px;
}

.page-skeleton-chip-md {
  width: 110px;
}

@keyframes dixelSkeletonWave {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 960px) {
  .page-skeleton-grid,
  .page-skeleton-board,
  .page-skeleton-chart-grid,
  .page-skeleton-document,
  .page-skeleton-layout,
  .page-skeleton-layout--wide-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-skeleton-stat-grid--4,
  .page-skeleton-stat-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .page-skeleton {
    padding-inline: 14px;
  }

  .page-skeleton-hero,
  .page-skeleton-card,
  .page-skeleton-panel,
  .page-skeleton-chart,
  .page-skeleton-board-column,
  .page-skeleton-section {
    border-radius: 22px;
  }

  .page-skeleton-hero {
    padding: 20px;
  }

  .page-skeleton-card,
  .page-skeleton-panel,
  .page-skeleton-chart,
  .page-skeleton-board-column,
  .page-skeleton-section {
    padding: 16px;
  }

  .page-skeleton-grid,
  .page-skeleton-grid--2,
  .page-skeleton-stat-grid--4,
  .page-skeleton-stat-grid--3,
  .page-skeleton-stat-grid--2,
  .page-skeleton-form-grid,
  .page-skeleton-form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-skeleton-field--wide {
    grid-column: span 1;
  }

  .page-skeleton-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-skeleton-toolbar-actions {
    justify-content: flex-start;
  }

  .page-skeleton-table-head,
  .page-skeleton-table-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .page-skeleton-row,
  .page-skeleton-feed-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-skeleton-line-sm {
    width: 34%;
  }

  .page-skeleton-line-md {
    width: 72%;
  }

  .page-skeleton-line-lg,
  .page-skeleton-line-xl {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-skeleton {
    transition: none;
  }

  .page-skeleton-bone {
    animation: none;
  }
}

@media print {
  .page-skeleton {
    display: none !important;
  }
}

/* ========== FLASH MESSAGES ========== */
.flash-container {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.flash-toast-stack {
  position: fixed;
  top: calc(var(--header-offset) + 12px + env(safe-area-inset-top));
  right: 14px;
  left: auto;
  width: min(360px, calc(100% - 24px));
  margin: 0;
  z-index: 2104;
  pointer-events: none;
}

.flash {
  --flash-accent: #4f46e5;
  --flash-soft: rgba(79, 70, 229, 0.18);
  --flash-panel: linear-gradient(145deg, rgba(19, 24, 39, 0.96), rgba(34, 40, 61, 0.94));
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px 14px;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 0;
  font-size: 0.88rem;
  pointer-events: auto;
  color: #f8fafc;
  background: var(--flash-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  animation: flash-toast-in 0.34s cubic-bezier(.2,.8,.2,1);
}

.flash::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--flash-accent));
}

.flash::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -26px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--flash-soft) 0%, transparent 70%);
  pointer-events: none;
}

.flash.is-closing {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.flash-icon-shell {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), var(--flash-soft));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 12px 24px rgba(15, 23, 42, 0.16);
}

.flash-icon {
  width: 19px;
  height: 19px;
  color: var(--flash-accent);
}

.flash-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.flash-copy {
  min-width: 0;
}

.flash-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.flash-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.flash-close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.flash-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: scale(1.03);
}

.flash-close svg {
  width: 14px;
  height: 14px;
}

.flash-message {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flash-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.flash-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), var(--flash-accent));
  animation: flash-progress linear forwards;
}

.flash-success {
  --flash-accent: #22c55e;
  --flash-soft: rgba(34, 197, 94, 0.18);
  --flash-panel: linear-gradient(145deg, rgba(8, 46, 30, 0.96), rgba(15, 79, 49, 0.92));
}

.flash-info {
  --flash-accent: #4f46e5;
  --flash-soft: rgba(79, 70, 229, 0.18);
  --flash-panel: linear-gradient(145deg, rgba(23, 28, 58, 0.96), rgba(48, 35, 96, 0.92));
}

.flash-warning {
  --flash-accent: #f59e0b;
  --flash-soft: rgba(245, 158, 11, 0.2);
  --flash-panel: linear-gradient(145deg, rgba(68, 36, 5, 0.96), rgba(112, 60, 10, 0.92));
}

.flash-danger {
  --flash-accent: #ef4444;
  --flash-soft: rgba(239, 68, 68, 0.18);
  --flash-panel: linear-gradient(145deg, rgba(70, 16, 20, 0.96), rgba(102, 20, 28, 0.92));
}

@keyframes flash-toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes flash-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 640px) {
  .flash-toast-stack {
    top: calc(var(--header-offset) + 12px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    width: auto;
  }

  .flash {
    gap: 10px;
    padding: 11px 12px 13px;
    border-radius: 16px;
    font-size: 0.84rem;
  }

  .flash-icon-shell {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .flash-title {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .flash-close {
    width: 24px;
    height: 24px;
  }
}

/* Push permission banner */
.push-permission-banner {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: auto;
  width: min(460px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 18, 18, 0.96);
  color: #f7f7f7;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 2002;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    visibility 0.24s ease;
}

.push-permission-banner.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.push-permission-text {
  font-size: 0.92rem;
  line-height: 1.45;
}

.push-permission-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .push-permission-banner {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    padding: 12px;
    border-radius: 16px;
    align-items: flex-start;
  }

  .push-permission-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ========== ADD DAY (SCOPED) ========== */
.add-day-page {
  max-width: 100%;
  overflow-x: visible;
  overflow-y: visible;
}

.add-day-page .addday-card {
  max-width: 100%;
  width: 100%;
}

.add-day-page .table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  display: block;
  overscroll-behavior-x: contain;
  touch-action: auto;
}

@media (max-width: 768px) {
  .add-day-page .table-scroll {
    max-width: 100%;
  }

  .add-day-page .table-scroll table {
    min-width: 520px;
  }

  .add-day-page .table-scroll .invoice-table {
    min-width: 100%;
  }

  .add-day-page .table-scroll .expense-table {
    min-width: 100%;
  }
}

.add-day-page .table-scroll table {
  width: 100%;
  min-width: 520px;
}

.add-day-page .invoice-totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.add-day-page .invoice-total-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 6px;
  min-width: 200px;
}

.add-day-page .invoice-total-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-day-page .btn-save-day {
  background: #2e7d32;
}

.add-day-page .btn-save-day:hover {
  background: #256628;
}

.add-day-page .new-client-box {
  background: #e7f6e9;
  border-color: #bfe7c9;
}

.add-day-page .report-table input[type="text"],
.add-day-page .report-table input[type="number"],
.add-day-page .report-table select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.add-day-page .report-table input[type="text"]:focus,
.add-day-page .report-table input[type="number"]:focus,
.add-day-page .report-table select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.add-day-page input[type="file"] {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #ffffff;
  width: 100%;
  font-size: 0.9rem;
}

.add-day-page input[type="file"]::file-selector-button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: #000000;
  color: #ffffff;
  margin-right: 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.add-day-page input[type="file"]::file-selector-button:hover {
  background: #333333;
}

@media (max-width: 768px) {
  .add-day-page {
    padding: 0 6px;
  }

  .add-day-page .addday-card {
    padding: 18px;
    overflow-x: visible;
  }

  .add-day-page .add-day-toggles {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    flex-wrap: nowrap;
  }

  .add-day-page .addday-full {
    flex: 1 1 100%;
  }

  .add-day-page .user-form input,
  .add-day-page .user-form select,
  .add-day-page .user-form textarea {
    width: 100%;
  }

  .add-day-page .addday-input-wrap input,
  .add-day-page .addday-input-wrap select,
  .add-day-page .addday-input-wrap textarea {
    width: 100%;
  }

  .add-day-page .addday-label {
    width: 100%;
  }

  .add-day-page .invoice-totals {
    flex-direction: column;
    align-items: flex-start;
  }

  .add-day-page .invoice-total-block {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  .add-day-page .table-scroll {
    max-width: 100%;
  }

  .add-day-page .invoice-table thead {
    display: none;
  }

  .add-day-page .invoice-table,
  .add-day-page .invoice-table tbody,
  .add-day-page .invoice-table tr,
  .add-day-page .invoice-table td {
    display: block;
    width: 100%;
  }

  .add-day-page .invoice-table tr {
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 12px;
    background: transparent;
    box-shadow: none;
  }

  .add-day-page .invoice-table td {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
    box-sizing: border-box;
  }

  .add-day-page .invoice-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
  }

  .add-day-page .invoice-table td input,
  .add-day-page .invoice-table td select {
    width: 100%;
  }

  .add-day-page .expense-table thead {
    display: none;
  }

  .add-day-page .expense-table,
  .add-day-page .expense-table tbody,
  .add-day-page .expense-table tr,
  .add-day-page .expense-table td {
    display: block;
    width: 100%;
  }

  .add-day-page .expense-table tr {
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 12px;
    background: transparent;
    box-shadow: none;
  }

  .add-day-page .expense-table td {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
    box-sizing: border-box;
  }

  .add-day-page .expense-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
  }

  .add-day-page .expense-table td input,
  .add-day-page .expense-table td select {
    width: 100%;
  }

  .add-day-page .table-scroll {
    overflow-x: hidden;
  }

  .add-day-page .table-scroll table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed;
  }

  .add-day-page .addday-card {
    overflow-x: hidden;
  }

  .add-day-page .invoice-table,
  .add-day-page .expense-table {
    width: 100% !important;
  }
}

/* ========== HEADER (DESKTOP) ========== */
.main-header {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2000;
}

.header-overlay {
  background: linear-gradient(120deg, rgba(18, 6, 10, 0.9), rgba(110, 16, 24, 0.72) 45%, rgba(15, 15, 35, 0.45));
  padding: calc(14px + env(safe-area-inset-top)) 40px 14px;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-left-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.header-left-link:focus-visible {
  outline: 2px solid #ffffff;
  border-radius: 999px;
}


.header-logo-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e22228 0%, #ff7b7f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 24px rgba(226, 34, 40, 0.35);
}

.header-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-app-name {
  font-size: 1.3rem;
  font-weight: 700;
}

/* centered nav (desktop baseline) */
.header-center-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  font-size: 16px;
  align-items: center;
}

/* Nav pills (desktop + mobile base) */
.header-center-nav .nav-pill {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.header-center-nav .nav-pill[data-nav-clone="1"] {
  display: none;
}

.header-center-nav .nav-pill .nav-pill-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-center-nav .nav-pill .nav-pill-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  display: block;
}

.header-center-nav .nav-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

/* active nav pill */
.header-center-nav .nav-pill.active {
  background: #ffffff;
  color: #000000;
  border-radius: 999px;
  padding: 6px 14px;
}

/* Active page pill */
.header-center-nav .nav-pill.nav-pill-active {
  background: linear-gradient(120deg, #ffffff, #ffe1e3);
  color: #111111;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(226, 34, 40, 0.25);
}

/* Notification badge (desktop + mobile) */
.notif-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #ff4d4f;
  color: #ffffff;
  font-weight: 600;
}

.invoice-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #25d366;
  color: #ffffff;
  font-weight: 600;
}

.invoice-partial-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.2;
  background: #ffb347;
  color: #1a1a1a;
  font-weight: 700;
}


.settings-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #ffcc00;
  color: #1a1a1a;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge-green {
  background: #e9f9ef;
  color: #1f7a3a;
  border: 1px solid #c5f0d3;
}

.status-badge-gray {
  background: #eef1f5;
  color: #6b7280;
  border: 1px solid #d7dde6;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-online {
  background: #21c45a;
  box-shadow: 0 0 6px rgba(33, 196, 90, 0.6);
}

.ack-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.ack-modal-backdrop.show {
  display: flex;
}

.ack-modal-card {
  width: min(520px, 94vw);
  background: #fff;
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.ack-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.ack-modal-meta {
  font-size: 0.92rem;
  color: #333;
  margin-bottom: 10px;
}

.ack-modal-message {
  background: #f5f7ff;
  border-left: 3px solid #e22228;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  color: #1f2937;
}

.ack-modal-actions {
  display: flex;
  justify-content: flex-end;
}


/* right side (desktop) */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.owner-name {
  color: white;
  margin-right: 10px;
  font-weight: 500;
}

/* notification count in nav */
.nav-separator {
  color: rgba(255,255,255,0.6);
}

.notif-count {
  color: #ffdf47;
  font-weight: 600;
}

/* Profile button + menu */
.header-profile {
  position: relative;
}

.profile-btn {
  border: none;
  background: #ffffff;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-btn img {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-btn-ring {
  background: transparent;
}

.nav-avatar-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.nav-avatar-stroke {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff2d2d, #ff9b3d, #ff2d2d);
  animation: navAvatarSpin 6s linear infinite;
}

.nav-avatar-orbit {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: navAvatarOrbit 5s linear infinite;
  pointer-events: none;
  z-index: 3;
}

.nav-avatar-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff2d2d;
  box-shadow: 0 0 10px rgba(255, 45, 45, 0.9);
  transform: translate(-50%, -50%) translateX(22px);
}

.nav-avatar-ring img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  z-index: 2;
}

@keyframes navAvatarSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes navAvatarOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile-menu-overlay {
  display: none;
}

.profile-screen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 2500;
  pointer-events: none;
}

.profile-screen-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.profile-menu {
  position: fixed;
  top: env(safe-area-inset-top);
  right: 0;
  height: calc(100vh - env(safe-area-inset-top));
  width: 320px;
  max-width: 86vw;
  background: linear-gradient(160deg, #16070b 0%, #2a0b10 45%, #12070a 100%);
  border-left: 1px solid rgba(226, 34, 40, 0.22);
  box-shadow: none;
  padding: 0 0 calc(18px + env(safe-area-inset-bottom));
  transform: translateX(125%);
  transition: transform 0.25s ease;
  z-index: 3000;
  display: block;
  isolation: isolate;
  filter: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}

.profile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(226, 34, 40, 0.18), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(255, 191, 0, 0.14), transparent 50%);
  opacity: 0.8;
  pointer-events: none;
}

.profile-menu.open {
  transform: translateX(0);
}

html.profile-menu-open,
body.profile-menu-open {
  overflow: hidden;
}

body.profile-menu-open::after {
  content: none;
}

.profile-menu-open .page-content,
.profile-menu-open .main-header {
  pointer-events: none;
}

.profile-menu-overlay,
.profile-menu {
  pointer-events: auto;
}

.profile-menu-name {
  padding: 22px 20px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  border-bottom: 1px solid rgba(226, 34, 40, 0.22);
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: #2a0b10;
}

.profile-module-links {
  padding: 2px 0 4px;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}

.profile-menu a.profile-menu-module-link {
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 12px 20px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.profile-menu a.profile-menu-module-link .profile-menu-icon {
  background: rgba(255, 255, 255, 0.12);
}

.profile-menu a.profile-menu-module-link:hover {
  border-color: transparent;
}

.profile-menu a.profile-menu-module-link-finance {
  background: linear-gradient(135deg, #2f8b52, #4ea06b);
}

.profile-menu a.profile-menu-module-link-finance:hover {
  background: linear-gradient(135deg, #2a7d49, #458f60);
}

.profile-menu a.profile-menu-module-link-workflow {
  background: linear-gradient(135deg, #b4474b, #ce676a);
}

.profile-menu a.profile-menu-module-link-workflow:hover {
  background: linear-gradient(135deg, #a33f42, #bd5e61);
}

.profile-menu a.profile-menu-module-link-client-ops {
  background: linear-gradient(135deg, #286c67, #4b9690);
}

.profile-menu a.profile-menu-module-link-client-ops:hover {
  background: linear-gradient(135deg, #235f5b, #428580);
}

.profile-menu a,
.profile-menu .profile-menu-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 0.92rem;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 10px;
  margin: 4px 12px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  z-index: 1;
  cursor: pointer;
  width: calc(100% - 24px);
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  text-align: left;
  border-left-width: 1px;
}

.profile-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
}

.profile-menu-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  fill: none;
}

.profile-menu a:hover,
.profile-menu .profile-menu-action:hover {
  background: linear-gradient(140deg, rgba(226, 34, 40, 0.18), rgba(255, 255, 255, 0.04));
  border-color: rgba(226, 34, 40, 0.35);
  transform: translateX(2px);
}

.profile-menu .profile-menu-action {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-menu-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.8);
}

.update-progress {
  min-width: 32px;
  text-align: right;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-menu-action.updating .update-version {
  display: none;
}

.profile-menu-action.updating .update-progress {
  opacity: 1;
}

.profile-menu-action:disabled {
  opacity: 0.75;
  cursor: progress;
}

.profile-menu-action.updating {
  --update-progress: 0%;
  position: relative;
  overflow: hidden;
  border-color: rgba(226, 34, 40, 0.5);
}

.profile-menu-action.updating::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(226, 34, 40, 0.6), rgba(22, 163, 74, 0.7));
  width: var(--update-progress);
  transition: width 0.18s ease;
  z-index: 0;
}

.profile-menu-action.updating .profile-menu-link,
.profile-menu-action.updating .profile-menu-meta {
  position: relative;
  z-index: 1;
}

/* ========== SUMMARY CARDS (Dashboard) ========== */

.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 28px;
}

.summary-card {
  flex: 1;
  min-width: 220px;
  border-radius: 18px;
  padding: 16px 18px;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card-label {
  font-size: 0.95rem;
  opacity: 0.9;
}

.card-value {
  margin-top: 6px;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Colours for cards */
.card-income   { background: #ff9800; }   /* orange */
.card-expenses { background: #f44336; }   /* red */
.card-net      { background: #4caf50; }   /* green */

/* Chart containers so both charts fit without much scrolling */
.chart-wrapper {
  height: 280px;
  margin-bottom: 24px;
  padding: 12px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 74, 74, 0.18), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(0, 204, 255, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(17, 17, 17, 0.06), rgba(255, 255, 255, 0.6));
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.chart-wrap-net {
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 200, 95, 0.25), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(80, 230, 150, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(46, 200, 95, 0.12), rgba(255, 255, 255, 0.6));
  border-color: rgba(46, 200, 95, 0.2);
}

.chart-wrap-income-expense {
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 180, 255, 0.2), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(220, 53, 69, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(8, 32, 56, 0.08), rgba(255, 255, 255, 0.6));
  border-color: rgba(0, 120, 255, 0.18);
}

.chart-wrap-monthly {
  background:
    radial-gradient(circle at 12% 18%, rgba(46, 200, 95, 0.22), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(120, 230, 170, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(46, 200, 95, 0.08), rgba(255, 255, 255, 0.6));
  border-color: rgba(46, 200, 95, 0.2);
}

.chart-wrap-staff {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 92, 166, 0.24), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(140, 120, 255, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(255, 92, 166, 0.1), rgba(255, 255, 255, 0.6));
  border-color: rgba(255, 92, 166, 0.22);
}

.chart-wrap-salary {
  background:
    radial-gradient(circle at 12% 18%, rgba(220, 53, 69, 0.24), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(255, 120, 120, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(255, 255, 255, 0.6));
  border-color: rgba(220, 53, 69, 0.22);
}

.chart-wrapper canvas {
  background: #ffffff;
  border-radius: 14px;
}

@keyframes chartShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(1px, -1px) rotate(-0.2deg); }
  40% { transform: translate(-1px, 1px) rotate(0.25deg); }
  60% { transform: translate(1px, 0) rotate(0.15deg); }
  80% { transform: translate(-1px, -1px) rotate(-0.2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.chart-shake {
  animation: chartShake 1.6s ease-in-out infinite;
  transform-origin: center;
}

/* ========== TABLES / FORMS (report, add day etc.) ========== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #ffffff;
}

table th,
table td {
  border: 1px solid #e1e1e1;
  padding: 8px 10px;
  font-size: 0.9rem;
}

table th {
  background: #fafafa;
  text-align: left;
}

tfoot th {
  background: #f4f4f4;
}

.actions-cell,
.task-action-cell,
.table-action-cell,
.report-table td[class$="action-cell"],
.report-table td[class$="actions-cell"] {
  white-space: normal;
  vertical-align: middle;
}

.actions-cell > .btn,
.actions-cell > .btn-chip,
.actions-cell > a.btn,
.actions-cell > a.btn-chip,
.actions-cell > button.btn,
.actions-cell > button.btn-chip,
.task-action-cell > .btn,
.task-action-cell > .btn-chip,
.task-action-cell > a.btn,
.task-action-cell > a.btn-chip,
.task-action-cell > button.btn,
.task-action-cell > button.btn-chip,
.table-action-cell > .btn,
.table-action-cell > .btn-chip,
.table-action-cell > a.btn,
.table-action-cell > a.btn-chip,
.table-action-cell > button.btn,
.table-action-cell > button.btn-chip,
.report-table td[class$="action-cell"] > .btn,
.report-table td[class$="action-cell"] > .btn-chip,
.report-table td[class$="action-cell"] > a.btn,
.report-table td[class$="action-cell"] > a.btn-chip,
.report-table td[class$="action-cell"] > button.btn,
.report-table td[class$="action-cell"] > button.btn-chip,
.report-table td[class$="actions-cell"] > .btn,
.report-table td[class$="actions-cell"] > .btn-chip,
.report-table td[class$="actions-cell"] > a.btn,
.report-table td[class$="actions-cell"] > a.btn-chip,
.report-table td[class$="actions-cell"] > button.btn,
.report-table td[class$="actions-cell"] > button.btn-chip {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 6px 6px 0;
}

.actions-cell > form,
.task-action-cell > form,
.table-action-cell > form,
.report-table td[class$="action-cell"] > form,
.report-table td[class$="actions-cell"] > form {
  display: inline-block;
  vertical-align: middle;
  margin: 0 6px 6px 0;
}

.actions-cell > :last-child,
.task-action-cell > :last-child,
.table-action-cell > :last-child,
.report-table td[class$="action-cell"] > :last-child,
.report-table td[class$="actions-cell"] > :last-child {
  margin-right: 0;
}

/* Generic horizontal scroll wrapper for tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 720px; /* tweak if you want smaller/wider */
}

/* Filter forms */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-form input[type="date"],
.filter-form select {
  padding: 4px 6px;
  font-size: 0.9rem;
}

/* Pagination */
.pagination {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.pagination a {
  text-decoration: none;
  border: 1px solid rgba(226, 34, 40, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #b91c1c;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(226, 34, 40, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination span {
  color: #6b7280;
  font-weight: 600;
}

.pagination a:hover {
  transform: translateY(-1px);
  background: rgba(226, 34, 40, 0.12);
  box-shadow: 0 8px 18px rgba(226, 34, 40, 0.18);
}

@media (min-width: 1024px) {
  .table-scroll {
    overflow-x: visible;
  }

  .table-scroll table {
    width: 100%;
  }
}

@media (min-width: 992px) {
  .desktop-dense-card {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .desktop-table-fit {
    overflow-x: visible;
  }

  .desktop-table-fit .report-table,
  .desktop-table-fit .tasks-table {
    width: 100%;
    table-layout: auto;
    font-size: 0.84rem;
  }

  .desktop-table-fit .report-table th,
  .desktop-table-fit .report-table td,
  .desktop-table-fit .tasks-table th,
  .desktop-table-fit .tasks-table td {
    box-sizing: border-box;
    vertical-align: top;
  }

  .desktop-table-fit .report-table th,
  .desktop-table-fit .tasks-table th {
    white-space: nowrap;
  }

  .desktop-table-fit .report-table td,
  .desktop-table-fit .tasks-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .desktop-table-fit .report-table .col-number,
  .desktop-table-fit .report-table .col-date,
  .desktop-table-fit .report-table .col-amount,
  .desktop-table-fit .report-table .col-actions,
  .desktop-table-fit .tasks-table .col-number,
  .desktop-table-fit .tasks-table .col-date,
  .desktop-table-fit .tasks-table .col-amount,
  .desktop-table-fit .tasks-table .col-actions,
  .desktop-table-fit .report-table .col-status,
  .desktop-table-fit .tasks-table .col-status {
    white-space: nowrap;
  }

  .desktop-table-fit .actions-cell,
  .desktop-table-fit .task-action-cell {
    flex-wrap: nowrap;
    gap: 4px;
    white-space: nowrap;
  }

  .desktop-table-fit .btn-chip,
  .desktop-table-fit .btn-link {
    font-size: 0.74rem;
    padding: 4px 7px;
  }
}

/* Highlighted row when coming from a notification */
.highlight-row {
  background-color: transparent !important;
  box-shadow: inset 0 0 0 2px #ffd166;
  transition: box-shadow 0.4s ease;
}

.highlight-row td {
  background: inherit;
}

.task-row-overdue.highlight-row td {
  background: #e22228;
}

.task-row-overdue.highlight-row {
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px rgba(226, 34, 40, 0.5);
}


/* ========== FORMS COMMON ========== */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
  border: 1px solid rgba(31, 41, 55, 0.15);
  border-radius: 12px;
  padding: 9px 12px;
  background: #ffffff;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(226, 34, 40, 0.05);
}

input[type="time"] {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(226, 34, 40, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: #8b8f97;
}

.user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.user-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.user-form input,
.user-form select {
  padding: 4px 6px;
  font-size: 0.9rem;
}

/* Generic vertical form inside cards */
.card-form {
  max-width: 520px;
  margin: 0 auto 24px;
}

.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.form-row label {
  font-weight: 500;
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.15);
  font-size: 0.9rem;
  font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(226, 34, 40, 0.12);
}

.form-actions {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Login page uses .auth-wrapper / .auth-card - override for mobile later */

/* ========== GENERIC CARD STYLE ========== */

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--panel-shadow);
  border: 1px solid var(--panel-border);
  margin-bottom: 24px;
}

.card-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========== BUTTONS ========== */

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #e22228 0%, #ff6b6b 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(226, 34, 40, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #c91f24 0%, #ff5a5a 100%);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(226, 34, 40, 0.5);
  color: #b91c1c;
}

.btn-outline:hover {
  background: rgba(226, 34, 40, 0.08);
}

.btn-outline.btn-danger-outline {
  border-color: #d32f2f;
  color: #d32f2f;
}

.btn-outline.btn-danger-outline:hover {
  background: #fdeaea;
}

.btn-flat {
  background: transparent;
  color: #6b7280;
}

.btn-flat:hover {
  background: rgba(226, 34, 40, 0.06);
}

/* Small button variant */
.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Edit button (green-ish) */
.btn-edit {
  background: #179a3e;
  color: #ffffff;
  border: none;
}

.btn-edit:hover {
  background: #222222;
  color: #ffffff;
}

/* Delete button (red) */
.btn-delete {
  background: #f44336;
  color: #ffffff;
  border: none;
}

.btn-delete:hover {
  background: #c62828;
  color: #ffffff;
}

/* make sure action buttons sit nicely */
.actions-cell .btn {
  text-decoration: none;
}

/* ========== REPORT TOTALS ========== */

.card-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.totals-pill {
  flex: 1;
  min-width: 170px;
  border-radius: 999px;
  padding: 8px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.totals-pill strong {
  font-size: 1.1rem;
}

.totals-income  { background: #ff9800; }
.totals-expenses{ background: #f44336; }
.totals-net     { background: #4caf50; }

/* ========== USER STATUS ========== */

.status-pill {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-active {
  background: #e7f6e9;
  color: #15693b;
}

.status-inactive {
  background: #ffe3e3;
  color: #9c1c1c;
}

/* ========== NOTIFICATIONS ========== */

.notification-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-text {
  font-size: 0.95rem;
}

.notification-meta {
  font-size: 0.8rem;
  color: #777;
}

/* Unread notification styling */
.notification-card.unread {
  background: #e8f1ff;
  border-radius: 10px;
  padding: 10px 12px;
  border-left: 4px solid #1c4f9c;
}

.notification-card.unread:hover {
  background: #dbe7ff;
}

/* Small blue dot for new notifications */
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1c4f9c;
  margin-right: 8px;
  margin-top: 4px;
}

.notification-row {
  display: flex;
  align-items: flex-start;
}

.notification-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.notification-link:hover .notification-card {
  background: #dbe7ff;
}


/* ========== TEXTAREA EXPENSE, EDIT META ========== */
.textarea-expense {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 12px;
  resize: vertical;
  border-radius: 10px;
  border: 1.5px solid #ccc;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border 0.2s ease;
}

.textarea-expense:focus {
  border: 1.5px solid #000;
}

.edit-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #555;
}

/* ========== DASHBOARD FILTER PILL ========== */

.dashboard-filter {
  margin: 8px 0 20px;
  align-items: center;
}

.dashboard-filter .filter-label {
  font-size: 0.85rem;
  margin-right: 8px;
  color: #444;
}

.dashboard-filter .filter-select {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #ffffff;
  font-size: 0.85rem;
  outline: none;
}

.dashboard-filter .filter-select:focus {
  border-color: #000;
}

/* ========== REPORT PAGE SPECIFIC ========== */

.report-filter-card {
  margin-bottom: 18px;
}

.report-filter-form {
  align-items: flex-end;
}

/* put the buttons on one line nicely */
.report-filter-form .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
}

/* make selects/date inputs look like your new style */
.report-filter-form select,
.report-filter-form input[type="date"] {
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.15);
  font-size: 0.9rem;
  background: #ffffff;
}

/* Export button a bit lighter */
.report-export-btn {
  font-size: 0.85rem;
  padding-inline: 12px;
  opacity: 0.9;
}

/* nicer report table */
.report-table {
  border-radius: 16px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(226, 34, 40, 0.12);
  table-layout: auto;
  width: 100%;
}

.report-table thead th {
  background: linear-gradient(135deg, #ffe3e6, #fff4f5);
  border-bottom: 1px solid rgba(226, 34, 40, 0.18);
  font-weight: 600;
}

.report-table tbody tr:nth-child(even):not(.unpaid-row) {
  background: #fff7f8;
}

.report-table tbody tr:hover {
  background: rgba(226, 34, 40, 0.08);
}

.unpaid-row {
  background: #ffe3e3;
}

.unpaid-row:hover {
  background: #ffd2d2;
}

.performance-filter label {
  font-weight: 500;
}

.performance-filter input[type="date"] {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d0d0d0;
  font-size: 0.9rem;
  background: #ffffff;
}

.performance-filter input[type="date"]:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.performance-filter .btn {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.2;
}

.invoice-icon-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.report-table th,
.report-table td,
.tasks-table th,
.tasks-table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.report-table th,
.tasks-table th {
  white-space: nowrap;
}

.report-table td,
.tasks-table td {
  white-space: normal;
}

.actions-cell,
.task-action-cell {
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
}

.wa-menu {
  position: relative;
  display: inline-flex;
}

.wa-menu-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.wa-menu-list {
  position: absolute;
  right: 0;
  top: 26px;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 6px 0;
  min-width: 140px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: none;
  z-index: 20;
}

.wa-menu-list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #222;
  text-decoration: none;
}

.wa-menu-list a:hover {
  background: #f3f3f3;
}

.wa-menu.is-open .wa-menu-list {
  display: block;
}

.invoice-icon-links a {
  color: #222;
  text-decoration: none;
}

.invoice-icon-links a:hover {
  color: #000;
}

.invoice-icon-links .icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

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

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #1fb35a;
  color: #ffffff;
}

.btn-whatsapp .whatsapp-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-reminder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(226, 34, 40, 0.4);
  color: #e22228;
  background: transparent;
  padding: 8px 12px;
}

.btn-reminder svg {
  width: 16px;
  height: 16px;
}

.btn-reminder:hover {
  background: rgba(226, 34, 40, 0.12);
  border-color: rgba(226, 34, 40, 0.7);
  color: #e22228;
}

.whatsapp-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.whatsapp-input {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d0d0d0;
  font-size: 0.9rem;
}

.whatsapp-error {
  color: #c62828;
  font-size: 0.85rem;
}

.invoice-preview-frame {
  width: 100%;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
}

.invoice-preview-frame iframe {
  width: 100%;
  height: 900px;
  border: 0;
  display: block;
}

/* columns */
.report-table .col-date {
  white-space: nowrap;
}

.report-table .col-staff {
  min-width: 150px;
}

.report-table .col-notes {
  max-width: 260px;
}

/* align amounts to the right */
.report-table .col-amount {
  text-align: right;
}

/* totals row */
.report-table tfoot .totals-row {
  background: #fff8e1;
  font-weight: 600;
}

/* net pills (positive / negative) */
.net-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.net-positive {
  background: #e7f6e9;
  color: #15693b;
}

.net-negative {
  background: #ffe3e3;
  color: #9c1c1c;
}

.col-number {
  text-align: center;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

/* Locked rows (staff cannot edit anymore) */
.locked-row {
  opacity: 0.6;
}

/* Little pill saying "Locked" with a clock */
.locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f0f0;
  color: #777;
  font-size: 0.78rem;
}

.locked-icon {
  font-size: 0.9rem;
}


/* no data cell */
.no-data-cell {
  text-align: center;
  padding: 18px 0;
  color: #777;
}

/* Edit/Delete "chips" inside table */
.btn-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-chip svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  stroke: currentColor;
  fill: none;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.attachment-name {
  font-weight: 600;
  color: #334155;
}

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

.attachment-btn {
  display: inline-flex;
  align-items: center;
}

.btn-chip-edit {
  background: rgba(0, 83, 184, 0.08);
  color: #0053b8;
}

/* Invoice search bar */
.invoice-search-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fafafa;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.invoice-search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 320px;
}

.invoice-search-field label {
  font-size: 0.85rem;
  color: #444;
}

.invoice-search-input {
  position: relative;
  padding: 1px;
  border-radius: 12px;
  background: linear-gradient(120deg, #f14a4a, #c8141b);
  box-shadow: 0 6px 16px rgba(193, 20, 27, 0.12);
}

.invoice-search-input input {
  width: 100%;
  padding: 11px 12px 11px 40px;
  border: none;
  border-radius: 11px;
  font-size: 0.95rem;
  background: #fff;
  transition: box-shadow 0.15s ease;
}

.invoice-search-input input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(241, 74, 74, 0.18);
}

.invoice-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #b31319;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.invoice-search-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.invoice-search-status {
  font-size: 0.9rem;
  color: #666;
  min-height: 1.2em;
}

.report-search-bar {
  width: 100%;
}

.report-search-bar .invoice-search-field {
  flex: 1 1 100%;
}

.report-search-bar .invoice-search-input {
  width: 100%;
}

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

.invoice-filter-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.invoice-filter-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #444;
}

.invoice-filter-fields input,
.invoice-filter-fields select {
  padding: 8px 10px;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
}

.finance-mobile-card {
  border-radius: 24px;
  border: 1px solid rgba(226, 34, 40, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 252, 0.96));
  box-shadow:
    0 20px 46px rgba(226, 34, 40, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.finance-mobile-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.finance-mobile-search {
  width: 100%;
  min-width: 0;
  flex: 1 1 100%;
  padding: 12px 14px 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fcfcfd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(15, 23, 42, 0.05);
}

.finance-mobile-form .finance-mobile-search .invoice-search-field {
  min-width: 0;
  flex: 1 1 auto;
}

.finance-mobile-form .finance-mobile-search .invoice-search-status {
  padding-left: 4px;
}

.finance-mobile-row {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.finance-mobile-row--1 .finance-mobile-field {
  flex: 1 1 100%;
}

.finance-mobile-row--2 .finance-mobile-field {
  flex: 1 1 calc(50% - 6px);
}

.finance-mobile-row--3 > * {
  flex: 1 1 calc(33.333% - 8px);
}

.finance-mobile-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  flex: 1 1 180px;
  overflow: hidden;
}

.finance-mobile-field--full {
  flex-basis: 100%;
  width: 100%;
}

.finance-mobile-form .finance-mobile-field input[type="date"],
.finance-mobile-form .finance-mobile-field input[type="text"],
.finance-mobile-form .finance-mobile-field input[type="number"],
.finance-mobile-form .finance-mobile-field select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-inline-size: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(15, 23, 42, 0.05);
}

.finance-mobile-form .finance-mobile-field input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 10px;
}

.finance-mobile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.finance-mobile-btn,
.finance-mobile-btn-secondary,
.finance-mobile-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.finance-mobile-btn {
  border: 1px solid rgba(46, 125, 50, 0.24);
  background: linear-gradient(135deg, #46bb5f 0%, #2e7d32 48%, #256628 100%);
  color: #fff;
  box-shadow:
    0 14px 28px rgba(46, 125, 50, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.finance-mobile-btn-secondary {
  border: 1px solid rgba(46, 125, 50, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 244, 0.96));
  color: #256628;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(46, 125, 50, 0.08);
}

.finance-mobile-btn-ghost {
  border: 1px solid rgba(46, 125, 50, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #2e7d32;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.finance-mobile-btn-secondary:hover,
.finance-mobile-btn-ghost:hover {
  text-decoration: none;
}

.finance-mobile-actions--1 {
  --finance-mobile-action-cols: 1;
}

.finance-mobile-actions--2 {
  --finance-mobile-action-cols: 2;
}

.finance-mobile-actions--3 {
  --finance-mobile-action-cols: 3;
}

.client-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #b33a3a;
}

.duplicate-box {
  border: 1px solid #f2b4b4;
  background: #ffecec;
}

/* Top-client badge (Gold/Silver/Bronze) */
.client-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.2;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #eef2f6 0%, #cfd8e3 55%, #a8b6c6 100%);
  vertical-align: middle;
  animation: dixelBadgePop 420ms ease-out both;
}
.client-badge::after {
  content: "";
  position: absolute;
  inset: -80% -30% -80% -30%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 45%, transparent 60%);
  transform: translateX(-40%) rotate(8deg);
  animation: dixelBadgeShine 2.4s ease-in-out infinite;
  pointer-events: none;
}
.client-badge-1 {
  color: #4a3200;
  border-color: rgba(122, 86, 0, 0.35);
  background: linear-gradient(135deg, #fff1b8 0%, #d4af37 55%, #b58a00 100%);
}
.client-badge-2 {
  color: #2c2f33;
  border-color: rgba(60, 66, 74, 0.28);
  background: linear-gradient(135deg, #f4f6f8 0%, #c0c0c0 55%, #9aa4ad 100%);
}
.client-badge-3 {
  color: #3b1600;
  border-color: rgba(140, 68, 0, 0.34);
  background: linear-gradient(135deg, #ffd0a1 0%, #d07b2f 50%, #8a3a00 100%);
}

/* Ranks 4-10: blue (distinct from top-3). */
.client-badge-4,
.client-badge-5,
.client-badge-6,
.client-badge-7,
.client-badge-8,
.client-badge-9,
.client-badge-10 {
  color: #ffffff;
  border-color: rgba(10, 70, 120, 0.55);
  background: linear-gradient(135deg, #d6f0ff 0%, #4aaeff 55%, #0b4e8f 100%);
}

/* Make ranks 1-3 feel "special" compared to ranks 4-10. */
.client-badge-1,
.client-badge-2,
.client-badge-3 {
  padding: 2px 10px;
  border-width: 2px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

/* Crown for top-3 */
.client-badge-1::before,
.client-badge-2::before,
.client-badge-3::before {
  content: "♛";
  margin-right: 6px;
  font-size: 11px;
  line-height: 1;
  transform: translateY(-0.5px);
}
.client-badge-2::before {
  /* Slightly darker crown for silver to keep contrast */
  opacity: 0.9;
}
.client-badge-3::before {
  opacity: 0.92;
}

/* Ranks 4-10: keep them clean, no shine animation, slightly quieter look. */
.client-badge:not(.client-badge-1):not(.client-badge-2):not(.client-badge-3) {
  font-size: 9px;
  opacity: 0.92;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.06);
}
.client-badge:not(.client-badge-1):not(.client-badge-2):not(.client-badge-3)::after {
  display: none;
}

@keyframes dixelBadgePop {
  from { transform: translateY(1px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes dixelBadgeShine {
  0%, 35% { opacity: 0; transform: translateX(-40%) rotate(8deg); }
  55% { opacity: 0.85; transform: translateX(40%) rotate(8deg); }
  100% { opacity: 0; transform: translateX(60%) rotate(8deg); }
}

/* Shared add-day style inputs (used by client form too) */
.addday-label {
  flex: 1 1 260px;
}

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

.addday-input-wrap input[type="date"],
.addday-input-wrap input[type="number"],
.addday-input-wrap input[type="text"],
.addday-input-wrap input[type="email"],
.addday-input-wrap textarea,
.addday-input-wrap select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.addday-input-wrap input[type="date"]:focus,
.addday-input-wrap input[type="number"]:focus,
.addday-input-wrap input[type="text"]:focus,
.addday-input-wrap input[type="email"]:focus,
.addday-input-wrap textarea:focus,
.addday-input-wrap select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

/* Table action buttons: keep the report-style pill look across table actions */
.report-table .btn,
.report-table .btn-chip,
.report-table a.btn,
.report-table a.btn-chip,
.report-table button.btn,
.report-table button.btn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.24);
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  font-size: clamp(0.68rem, 0.64rem + 0.12vw, 0.78rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  overflow: visible;
  text-overflow: clip;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.report-table .btn:hover,
.report-table .btn-chip:hover,
.report-table a.btn:hover,
.report-table a.btn-chip:hover,
.report-table button.btn:hover,
.report-table button.btn-chip:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
  border-color: rgba(15, 23, 42, 0.4);
}

.report-table .col-actions,
.report-table th.col-actions,
.report-table td.col-actions,
.report-table .actions-cell,
.report-table .task-action-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.report-table .btn-chip-edit,
.report-table a.btn-chip-edit,
.report-table button.btn-chip-edit,
.report-table .archive-view-btn,
.report-table a.archive-view-btn,
.report-table button.archive-view-btn {
  border-color: rgba(15, 23, 42, 0.24);
  background: #ffffff;
  color: #111827;
}

.report-table .btn-chip-edit:hover,
.report-table a.btn-chip-edit:hover,
.report-table button.btn-chip-edit:hover,
.report-table .archive-view-btn:hover,
.report-table a.archive-view-btn:hover,
.report-table button.archive-view-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
  border-color: rgba(15, 23, 42, 0.4);
}

.report-table .btn-chip-delete,
.report-table a.btn-chip-delete,
.report-table button.btn-chip-delete {
  border-color: rgba(226, 34, 40, 0.62);
  background: #ffffff;
  color: #c81e24;
}

.report-table .btn-chip-delete:hover,
.report-table a.btn-chip-delete:hover,
.report-table button.btn-chip-delete:hover {
  background: rgba(226, 34, 40, 0.08);
  color: #b91c1c;
  border-color: rgba(200, 30, 36, 0.78);
}

.report-table .archive-restore-btn,
.report-table a.archive-restore-btn,
.report-table button.archive-restore-btn {
  border-color: rgba(30, 102, 73, 0.38);
  background: #ffffff;
  color: #1e6649;
}

.report-table .archive-restore-btn:hover,
.report-table a.archive-restore-btn:hover,
.report-table button.archive-restore-btn:hover {
  background: rgba(30, 102, 73, 0.08);
  color: #19563d;
  border-color: rgba(30, 102, 73, 0.58);
}

/* make the little pagination text align with your style */
.pagination {
  margin-top: 14px;
}

/* ========== PASSWORD INPUT WITH EYE ICON ========== */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
}

.password-toggle:hover {
  opacity: 1;
}

/* ========== VIEWER ROLE STAFF PILL LIST ========== */
.viewer-staff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.8rem;
}

.checkbox-pill input {
  margin: 0;
}

/* ========== LOGIN CARD MOBILE PADDING ========== */
@media (max-width: 768px) {
  .auth-wrapper {
    padding: 24px 16px;
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-sizing: border-box;
  }
}

/* ========== RESPONSIVE HEADER (MOBILE) ========== */
/* desktop vs mobile account rows */
.header-right-desktop {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-mobile-account {
  display: none;
}

@media (max-width: 768px) {

  /* hide long title text */
  .header-app-name {
    display: none !important;
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between; /* logo left, account right */
    gap: 6px;
  }

  /* row 1 - logo (left) */
  .header-left {
    order: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  .header-logo-circle {
    width: 42px;
    height: 42px;
  }


  /* hide desktop account row on mobile */
  .header-right-desktop {
    display: none;
  }

  /* row 1 - account name + profile icon (right) */
  .header-mobile-account {
    order: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .owner-name-mobile {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .mobile-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    padding: 2px 5px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    z-index: 6;
  }

  .mobile-badge-notif {
    background: #ff3b30;
  }

  .mobile-badge-invoice {
    background: #25d366;
    right: 12px;
  }

  .mobile-badge-settings {
    background: #ffcc00;
    color: #1a1a1a;
    right: 30px;
  }

  /* row 2 - nav in one line, scrollable pills */
  .header-center-nav {
    --mobile-nav-fade-left: 0px;
    --mobile-nav-fade-right: 0px;
    --mobile-nav-side-inset-left: calc(env(safe-area-inset-left) + var(--page-content-gutter-half));
    --mobile-nav-side-inset-right: calc(env(safe-area-inset-right) + var(--page-content-gutter-half));
    order: 3;
    position: static;
    transform: none;
    flex: 0 0 100vw;
    width: 100vw;
    max-width: 100vw;
    margin-top: 10px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 4px var(--mobile-nav-side-inset-right) 4px var(--mobile-nav-side-inset-left);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.8rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding-inline-start: var(--mobile-nav-side-inset-left);
    scroll-padding-inline-end: var(--mobile-nav-side-inset-right);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 var(--mobile-nav-fade-left),
      #000 calc(100% - var(--mobile-nav-fade-right)),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 var(--mobile-nav-fade-left),
      #000 calc(100% - var(--mobile-nav-fade-right)),
      transparent 100%
    );
  }

  .header-center-nav::-webkit-scrollbar {
    display: none;
  }

  .header-center-nav.nav-fade-left {
    --mobile-nav-fade-left: 20px;
  }

  .header-center-nav.nav-fade-right {
    --mobile-nav-fade-right: 20px;
  }

  .header-center-nav .nav-pill {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 8px 16px rgba(0, 0, 0, 0.12);
    scroll-snap-align: start;
    opacity: 1;
    transition:
      background 0.18s ease,
      border-color 0.18s ease,
      box-shadow 0.18s ease,
      opacity 0.18s ease;
  }

  .header-center-nav .nav-pill[data-nav-clone="1"] {
    display: inline-flex;
  }

  .header-center-nav .nav-pill.nav-pill-partial {
    opacity: 0.18;
  }

  .header-center-nav .nav-pill .nav-pill-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
  }

  .header-center-nav .nav-pill .nav-pill-icon svg {
    width: 12px;
    height: 12px;
  }

  .header-center-nav .nav-pill:hover {
    transform: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.24);
  }

  .header-center-nav .nav-pill.nav-pill-active,
  .header-center-nav .nav-pill.active {
    background: linear-gradient(135deg, #fff7f7 0%, #ffd8c2 100%);
    color: #3d0d13;
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow:
      0 14px 24px rgba(226, 34, 40, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
    opacity: 1;
  }

  .header-center-nav .nav-pill.nav-pill-active .nav-pill-icon,
  .header-center-nav .nav-pill.active .nav-pill-icon {
    background: rgba(226, 34, 40, 0.12);
  }

  .header-center-nav .nav-pill .notif-badge,
  .header-center-nav .nav-pill .invoice-badge,
  .header-center-nav .nav-pill .settings-badge {
    margin-left: 4px;
    min-width: 18px;
    padding: 0 5px;
    font-size: 0.64rem;
  }

}


/* Scroll only table, not full page */
.table-scroll-x {
  overflow-x: auto;
  width: 100%;
}

/* Viewer permissions */
.viewer-permissions-box {
  background: #f8f9ff;
  border: 1px solid #dfe6ff;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 10px;
}

.viewer-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin: 2px 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* smoother on phones */
}

.table-scroll table {
  min-width: 700px; /* or 600px if you want tighter */
}


/* ========== DIXEL Password Pills ========== */

.password-grid {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}

.password-grid > div {
  flex: 1;
}

.input-with-eye {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-with-eye input {
  padding: 10px 42px 10px 14px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  background: #ffffff;
}

.input-with-eye input:focus {
  border-color: black;
  outline: none;
}

.eye-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
}

.eye-btn:hover {
  opacity: 1;
}

/* Mobile stacking */
@media (max-width: 768px) {
  .password-grid {
    flex-direction: column;
  }
}

/* ========== OFFLINE PAGE ========== */

.offline-wrapper {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 40px;
}

.offline-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 24px;
  padding: 26px 22px 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Soft gradient strip behind content */
.offline-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left,
    rgba(0,0,0,0.08),
    transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

/* content above gradient */
.offline-icon-wrap,
.offline-title,
.offline-text,
.offline-actions,
.offline-hint {
  position: relative;
  z-index: 1;
}

/* Logo + animated waves */

.offline-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.offline-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e42228;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  animation: offline-float 3s ease-in-out infinite;
}

.offline-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* "Wi-Fi waves" */

.offline-signal {
  position: relative;
  width: 42px;
  height: 42px;
}

.offline-wave {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.18);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: offline-pulse 2.3s infinite;
}

.offline-wave.wave-1 {
  width: 18px;
  height: 18px;
  animation-delay: 0s;
}

.offline-wave.wave-2 {
  width: 26px;
  height: 26px;
  animation-delay: 0.35s;
}

.offline-wave.wave-3 {
  width: 34px;
  height: 34px;
  animation-delay: 0.7s;
}

/* Text */

.offline-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
}

.offline-text {
  margin: 0 0 18px;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

.offline-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.offline-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #888;
}

/* Animations */

@keyframes offline-float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

@keyframes offline-pulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.3);
  }
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .offline-card {
    border-radius: 20px;
    padding: 22px 18px 20px;
  }

  .offline-title {
    font-size: 1.25rem;
  }

  .offline-text {
    font-size: 0.9rem;
  }
}

/* ---------- Splash screen ---------- */
#dixel-splash {
  position: fixed;
  inset: 0;
  background: #e22228;              /* DIXEL red */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 1;
  visibility: visible;
}

/* When splash should be totally gone */
#dixel-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Only for sessions where we never want to show it again */
.hide-splash #dixel-splash {
  display: none !important;
}

/* Inner white circle with logo - keep as you had it */
#dixel-splash .splash-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: #e22228;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

#dixel-splash .splash-logo {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  object-fit: cover;
}

/* ---- Fade animation ---- */
#dixel-splash.fade-out {
  animation: dixelSplashFade 0.45s ease-out forwards;
}

@keyframes dixelSplashFade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.floating-chat-btn {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e22228, #ff5c61);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 18px 30px rgba(226, 34, 40, 0.35);
  z-index: 9999;
  animation: chatPulse 2.4s ease-in-out infinite;
}

.floating-chat-icon svg {
  width: 22px;
  height: 22px;
}

.floating-chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 6px 12px rgba(22, 163, 74, 0.3);
}

@keyframes chatPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 18px 30px rgba(226, 34, 40, 0.35);
  }
  50% {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 22px 34px rgba(226, 34, 40, 0.45);
  }
}

@media (max-width: 768px) {
  .finance-mobile-card {
    padding: 16px 14px;
    border-radius: 24px;
  }

  .finance-mobile-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: end;
  }

  .finance-mobile-form--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-mobile-form .finance-mobile-search,
  .finance-mobile-form .finance-mobile-row,
  .finance-mobile-form .finance-mobile-actions {
    grid-column: 1;
  }

  .finance-mobile-form .finance-mobile-search {
    padding: 12px;
  }

  .finance-mobile-form .invoice-search-field,
  .finance-mobile-form .invoice-search-input,
  .finance-mobile-form .invoice-search-input input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .finance-mobile-form .finance-mobile-field input[type="date"],
  .finance-mobile-form .finance-mobile-field input[type="text"],
  .finance-mobile-form .finance-mobile-field input[type="number"],
  .finance-mobile-form .finance-mobile-field select {
    font-size: 0.9rem;
    padding-inline: 10px;
  }

  .finance-mobile-form .finance-mobile-row {
    display: grid;
    grid-template-columns: repeat(var(--finance-mobile-row-cols, 1), minmax(0, 1fr));
    gap: 12px;
  }

  .finance-mobile-form .finance-mobile-row--1 {
    --finance-mobile-row-cols: 1;
  }

  .finance-mobile-form .finance-mobile-row--2 {
    --finance-mobile-row-cols: 2;
  }

  .finance-mobile-form .finance-mobile-row--3 {
    --finance-mobile-row-cols: 3;
  }

  .finance-mobile-form .finance-mobile-row > * {
    min-width: 0;
  }

  .finance-mobile-form .finance-mobile-actions {
    display: grid;
    grid-template-columns: repeat(var(--finance-mobile-action-cols, 2), minmax(0, 1fr));
    gap: 12px;
    margin-top: 0;
  }

  .finance-mobile-form .finance-mobile-actions > * {
    width: 100%;
    min-width: 0;
  }

  .finance-mobile-form .report-export-btn {
    font-size: 0.82rem;
    padding-inline: 10px;
  }

  .report-table,
  .tasks-table {
    min-width: 520px !important;
    width: max-content !important;
    table-layout: auto !important;
  }

  .report-table th,
  .report-table td,
  .tasks-table th,
  .tasks-table td {
    width: auto;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: top;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .invoice-icon-links,
  .task-action-cell,
  .actions-cell {
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
  }

  .tasks-table .col-deadline {
    width: auto !important;
  }
}

.task-row-overdue .task-action-cell {
  background: #e22228;
}

.task-row-overdue .task-action-cell .btn,
.task-row-overdue .task-action-cell .btn-outline {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  background: transparent !important;
}

.task-row-overdue .task-action-cell .btn svg,
.task-row-overdue .task-action-cell .btn-outline svg {
  stroke: currentColor;
  color: #fff;
}
/* Dashboard chart preview modal removed */
