:root {
  --bg: #07111f;
  --panel: #0f1b2d;
  --panel-soft: #17263b;
  --panel-strong: #0a1423;
  --border: rgba(160, 180, 205, 0.14);
  --text: #e8eff8;
  --muted: #91a4bc;
  --accent: #60d5c2;
  --accent-strong: #25b8ac;
  --accent-soft: rgba(96, 213, 194, 0.12);
  --success: #65d6a8;
  --warning: #f0bd61;
  --danger: #fa7c86;
  --white: #f8fafc;
  --shadow-soft: 0 20px 55px rgba(2, 8, 23, 0.24);
  animation: list-item-in 0.28s both;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 8% -8%, rgba(37, 184, 172, 0.12), transparent 33%),
    radial-gradient(ellipse at 96% 35%, rgba(44, 113, 160, 0.08), transparent 28%),
    linear-gradient(145deg, #07111f 0%, #0b1728 52%, #091423 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
.panel,
.summary-card,
.recent-card,
.module-link {
  transition-timing-function: cubic-bezier(0.2, 0.75, 0.25, 1);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(37, 184, 172, 0.2), transparent 34%),
    radial-gradient(circle at 10% 90%, rgba(37, 157, 228, 0.08), transparent 30%),
    #06101d;
}

.login-card {
  width: min(100%, 420px);
  background: linear-gradient(160deg, rgba(18, 32, 51, 0.98), rgba(11, 21, 36, 0.97));
  border: 1px solid rgba(160, 180, 205, 0.2);
  border-radius: 26px;
  padding: 36px 32px 30px;
  box-shadow: 0 34px 90px rgba(2, 6, 23, 0.46);
  animation: module-appear 0.35s ease-out;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border: 1px solid rgba(96, 213, 194, 0.38);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(96, 213, 194, 0.2), rgba(37, 184, 172, 0.08));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 12px 32px rgba(37, 184, 172, 0.1);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.brand-mark-small {
  width: 48px;
  height: 48px;
  margin: 0;
  flex: 0 0 48px;
  border-radius: 16px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 10px 25px rgba(37, 184, 172, 0.12);
}

.login-header {
  text-align: center;
  margin-bottom: 25px;
}

.login-header h2 {
  margin: 0;
  font-size: 2.15rem;
  letter-spacing: -0.05em;
}

.login-subtitle {
  max-width: 300px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-error {
  margin: 0;
  min-height: 20px;
  color: #fca5a5;
  font-size: 0.9rem;
}

.login-form .field {
  gap: 9px;
}

.login-form .field > span {
  color: #b8c7d9;
}

.login-form input {
  min-height: 48px;
}

.legacy-data-tools {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 180, 205, 0.16);
}

.legacy-import-field {
  gap: 8px;
}

.legacy-import-field > span {
  color: #b8c7d9;
  font-size: 0.82rem;
}

.legacy-import-field input {
  width: 100%;
  color: #b8c7d9;
  font-size: 0.82rem;
}

.legacy-data-tools .form-feedback {
  margin: 0;
}

.full-width {
  width: 100%;
}

.app-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 36px 42px 68px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
  padding: 4px 0 23px;
  border-bottom: 1px solid rgba(160, 180, 205, 0.13);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 17px;
}

.brand-lockup h1 {
  max-width: 100%;
  font-size: clamp(1.8rem, 3.5vw, 2.55rem);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.brand-lockup h1 span {
  color: var(--accent);
  background: linear-gradient(100deg, #8ce6d7 0%, #60d5c2 48%, #48c2c7 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-lockup .eyebrow {
  margin: 0 0 7px;
  color: #90a7bd;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.topbar-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 5px 10px;
  border: 1px solid rgba(160, 180, 205, 0.13);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 27, 45, 0.64);
  font-size: 0.78rem;
}

.topbar-subtitle strong {
  color: #dce9f5;
  font-weight: 650;
}

.module-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 28px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(160, 180, 205, 0.13);
  border-radius: 15px;
  background: rgba(12, 24, 40, 0.82);
  box-shadow: 0 12px 30px rgba(2, 8, 23, 0.12);
}

.module-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid transparent;
  background: transparent;
  color: #a8b7c9;
  white-space: nowrap;
  font-size: 0.88rem;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.module-link-icon,
.interface-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-link-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.module-link:hover {
  background: rgba(96, 213, 194, 0.08);
  box-shadow: none;
  color: var(--text);
  transform: translateY(-1px);
}

.module-link:hover .module-link-icon {
  opacity: 1;
  transform: scale(1.08);
}

.module-link.active {
  background: linear-gradient(140deg, rgba(96, 213, 194, 0.16), rgba(37, 184, 172, 0.08));
  border-color: rgba(96, 213, 194, 0.22);
  color: #8ce6d7;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.module-link.active .module-link-icon {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(96, 213, 194, 0.28));
}

.module-heading h2,
.panel-header h2,
.dashboard-overview h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-heading h2 .interface-icon,
.panel-header h2 .interface-icon,
.dashboard-overview h2 .interface-icon {
  width: 21px;
  height: 21px;
  color: var(--accent);
}

.dashboard-overview h2 .interface-icon {
  width: 23px;
  height: 23px;
}

.panel-header h2 .interface-icon {
  width: 19px;
  height: 19px;
}

.heading-title {
  min-width: 0;
}

.module-view {
  animation: module-appear 0.22s ease-out;
}

.module-view.is-entering > * {
  animation: module-content-in 0.38s both;
}

.module-view.is-entering > *:nth-child(2) { animation-delay: 45ms; }
.module-view.is-entering > *:nth-child(3) { animation-delay: 90ms; }
.module-view.is-entering > *:nth-child(4) { animation-delay: 135ms; }

@keyframes module-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes module-content-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-view.is-entering .summary-card,
.module-view.is-entering .recent-card {
  animation: report-card-in 0.4s both;
}

.module-view.is-entering .summary-card:nth-of-type(2),
.module-view.is-entering .recent-card:nth-child(2) { animation-delay: 55ms; }

.module-view.is-entering .summary-card:nth-of-type(3),
.module-view.is-entering .recent-card:nth-child(3) { animation-delay: 100ms; }

.module-view.is-entering .summary-card:nth-of-type(4),
.module-view.is-entering .recent-card:nth-child(4) { animation-delay: 145ms; }

.module-view.is-entering .recent-card:nth-child(5) { animation-delay: 190ms; }
.module-view.is-entering .recent-card:nth-child(6) { animation-delay: 235ms; }

@keyframes report-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.module-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 4px 0 22px;
}

.module-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  letter-spacing: -0.04em;
}

.module-heading .eyebrow {
  margin-bottom: 8px;
}

.module-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.45fr);
  gap: 20px;
  min-width: 0;
}

.monthly-layout {
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.5fr);
}

.module-layout > *,
.monthly-layout > *,
.content-grid > * {
  min-width: 0;
}

.stack-form .field,
.field select {
  min-width: 0;
}

.module-count {
  padding: 9px 13px;
  border: 1px solid rgba(84, 214, 160, 0.2);
  border-radius: 999px;
  background: rgba(84, 214, 160, 0.08);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.monthly-price-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  border: 1px solid rgba(96, 213, 194, 0.17);
  border-radius: 12px;
  background: rgba(96, 213, 194, 0.07);
}

.monthly-price-preview span {
  color: var(--muted);
  font-size: 0.86rem;
}

.monthly-price-preview strong {
  color: var(--accent);
  font-size: 1.05rem;
}

.field > small {
  color: var(--muted);
  font-size: 0.76rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-active {
  color: var(--success);
  background: rgba(84, 214, 160, 0.1);
}

.status-paused {
  color: var(--warning);
  background: rgba(244, 195, 94, 0.1);
}

.status-cancelled {
  color: #c16a70;
  background: rgba(250, 124, 134, 0.14);
}

.status-overdue {
  color: #ffabb1;
  background: rgba(250, 124, 134, 0.14);
}

.status-due {
  color: #f3d38b;
  background: rgba(240, 189, 97, 0.12);
}

.activate-action {
  color: var(--success);
  border-color: rgba(84, 214, 160, 0.24);
  background: rgba(84, 214, 160, 0.07);
}

.status-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 28px;
  padding: 3px;
  border: 1px solid rgba(160, 180, 205, 0.24);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #b7c5d6;
  font-size: 0;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.status-switch.is-active {
  border-color: rgba(84, 214, 160, 0.48);
  background: rgba(28, 105, 79, 0.18);
  color: #9bf0c9;
}

.status-switch.is-inactive {
  border-color: rgba(244, 195, 94, 0.42);
  background: rgba(120, 82, 22, 0.16);
  color: #f6d38a;
}

.status-switch-track {
  position: relative;
  width: 30px;
  height: 16px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: #59677a;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.status-switch.is-active .status-switch-track {
  background: #16805f;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(84, 214, 160, 0.08);
}

.status-switch-thumb {
  position: absolute;
  top: 2px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(2, 8, 23, 0.32);
  transition: transform 0.22s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.status-switch.is-active .status-switch-thumb {
  transform: translateX(14px);
}

.status-switch:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(2, 8, 23, 0.22);
}

.status-switch:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.status-switch:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.status-switch:focus-visible {
  outline: 3px solid rgba(103, 232, 249, 0.75);
  outline-offset: 2px;
}

.monthly-note {
  margin: 16px 0 0;
}

.overdue-monthly-panel {
  margin: 0 0 20px;
  border-color: rgba(250, 124, 134, 0.27);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(250, 124, 134, 0.07), transparent 38%),
    linear-gradient(155deg, rgba(30, 28, 43, 0.97), rgba(16, 23, 39, 0.98));
}

.overdue-monthly-panel .panel-header {
  margin-bottom: 16px;
}

.overdue-count-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(250, 124, 134, 0.23);
  border-radius: 999px;
  color: #ffabb1;
  background: rgba(250, 124, 134, 0.1);
  font-size: 0.76rem;
  font-weight: 700;
}

.overdue-table-row td {
  border-bottom-color: rgba(250, 124, 134, 0.09);
}

.overdue-table-row td:nth-child(4) {
  color: #ffabb1;
  font-weight: 650;
}

.overdue-amount {
  color: #ffd2d5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.overdue-prepare-btn {
  border-color: rgba(250, 124, 134, 0.24);
  color: #ffd2d5;
  background: rgba(250, 124, 134, 0.09);
  white-space: nowrap;
}

.overdue-prepare-btn:hover {
  border-color: rgba(250, 124, 134, 0.42);
  background: rgba(250, 124, 134, 0.15);
}

.stack-form {
  display: grid;
  gap: 16px;
}

.panel-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.price-input-wrap {
  position: relative;
}

.price-input-wrap > span {
  position: absolute;
  inset: 0 auto 0 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.price-input-wrap input {
  padding-left: 32px;
}

.inline-link-btn {
  width: fit-content;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
}

.inline-link-btn:hover {
  color: #a5e5ff;
  box-shadow: none;
  transform: none;
}

.form-feedback {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.form-feedback.success {
  color: var(--success);
}

.form-feedback.error {
  color: #fca5a5;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(160, 180, 205, 0.1);
  border-radius: 13px;
  background: rgba(5, 14, 26, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(160, 180, 205, 0.1);
  font-size: 0.88rem;
  white-space: nowrap;
}

th {
  background: rgba(160, 180, 205, 0.035);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

.table-empty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-action {
  padding: 7px 9px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  font-size: 0.78rem;
}

.table-actions {
  display: flex;
  gap: 7px;
}

.table-action:hover {
  box-shadow: none;
}

.danger-action {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.07);
}

.icon-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 7px;
}

.icon-action svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.icon-action.danger-action {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(248, 113, 113, 0.08);
}

.client-row-actions {
  align-items: center;
}

.icon-action.view-client-btn {
  color: #8be6d5;
  border-color: rgba(96, 213, 194, 0.24);
  background: rgba(96, 213, 194, 0.08);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-action.view-client-btn:hover {
  color: #c0fff2;
  border-color: rgba(96, 213, 194, 0.5);
  background: rgba(96, 213, 194, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 212, 191, 0.12);
}

.icon-action.view-client-btn:focus-visible {
  outline: 3px solid rgba(103, 232, 249, 0.75);
  outline-offset: 2px;
}

.icon-action.view-client-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-card.client-details-card {
  width: min(100%, 590px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 32px);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(45, 212, 191, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.99), rgba(11, 20, 35, 0.99));
  border-color: rgba(96, 213, 194, 0.2);
}

.client-details-header,
.client-details-heading {
  display: flex;
  align-items: flex-start;
}

.client-details-header {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(160, 180, 205, 0.14);
}

.client-details-heading {
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.client-details-avatar,
.client-subscriptions-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #8be6d5;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.19), rgba(20, 97, 99, 0.2));
  border: 1px solid rgba(96, 213, 194, 0.22);
}

.client-details-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.client-details-avatar svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-details-heading .eyebrow {
  margin: 0 0 5px;
  color: #71d9c7;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.client-details-heading h2 {
  max-width: 390px;
  margin: 0 0 9px;
  overflow-wrap: anywhere;
  color: var(--white);
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  letter-spacing: -0.035em;
}

.client-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 20px 0;
}

.client-detail-item {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid rgba(160, 180, 205, 0.12);
  border-radius: 13px;
  background: rgba(15, 27, 45, 0.65);
}

.client-registered-item {
  grid-column: 1 / -1;
}

.client-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #93a6ba;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-detail-label svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #75dcca;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-detail-item strong {
  overflow-wrap: anywhere;
  color: #e7eef7;
  font-size: 0.87rem;
  font-weight: 620;
}

.client-subscriptions {
  padding: 18px;
  border: 1px solid rgba(96, 213, 194, 0.16);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(17, 44, 55, 0.48), rgba(12, 25, 42, 0.65));
}

.client-subscriptions-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.client-subscriptions-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.client-subscriptions-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-subscriptions-heading h3 {
  margin: 0;
  color: #e8eff8;
  font-size: 0.94rem;
  letter-spacing: -0.015em;
}

.client-subscriptions-heading p {
  margin: 4px 0 0;
  color: #8fe1d1;
  font-size: 0.76rem;
}

.client-subscriptions-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.client-subscription-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(160, 180, 205, 0.1);
  border-radius: 12px;
  background: rgba(5, 14, 26, 0.3);
  animation: list-item-in 0.28s both;
}

.client-subscription-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.client-subscription-copy strong {
  overflow: hidden;
  color: #e5edf6;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-subscription-copy span {
  color: #9aabba;
  font-size: 0.76rem;
}

.client-subscription-item .client-subscription-amount {
  flex: 0 0 auto;
  color: #8ce6c2;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.client-subscription-empty {
  padding: 14px;
  border: 1px dashed rgba(160, 180, 205, 0.18);
  border-radius: 12px;
  color: #9aabba;
  font-size: 0.83rem;
  line-height: 1.5;
  text-align: center;
}

.client-details-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.report-metric {
  min-height: 148px;
  justify-content: space-between;
}

.report-metric > span {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  padding: 0 2px;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr)) auto;
  align-items: end;
  gap: 14px;
  max-height: 190px;
  margin-bottom: 18px;
  padding: 18px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.3s ease,
    margin 0.3s ease,
    padding 0.3s ease,
    opacity 0.2s ease,
    transform 0.3s ease,
    border-color 0.3s ease,
    visibility 0.3s ease;
}

.report-filters.is-collapsed {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  pointer-events: none;
}

.report-edit-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.report-filters .field {
  min-width: 0;
}

.report-filter-actions {
  display: flex;
  gap: 9px;
}

.report-filter-actions button {
  white-space: nowrap;
}

.report-filters .form-feedback {
  grid-column: 1 / -1;
  margin: 0;
}

.report-period {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.report-chart-panel,
.report-table-panel {
  margin-top: 18px;
}

.report-client-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}

.client-chart-row {
  min-width: 0;
  display: grid;
  gap: 9px;
  animation: list-item-in 0.32s both;
}

.client-chart-row:nth-child(2) { animation-delay: 45ms; }
.client-chart-row:nth-child(3) { animation-delay: 90ms; }
.client-chart-row:nth-child(4) { animation-delay: 135ms; }

.client-chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.client-chart-heading span {
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-chart-heading strong {
  color: var(--text);
  font-size: 0.86rem;
  white-space: nowrap;
}

.client-chart-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
}

.client-chart-bar {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), #7ce1cf);
  transform-origin: left center;
  animation: chart-bar-in 0.6s cubic-bezier(0.2, 0.75, 0.25, 1) both;
  animation-delay: var(--bar-delay);
}

@keyframes chart-bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.chart-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px 0;
  color: var(--muted);
  text-align: center;
}

.report-table-panel table tbody tr {
  animation: table-row-in 0.32s both;
}

.table-wrap tbody tr {
  animation: table-row-in 0.28s both;
}

.table-wrap tbody tr:nth-child(2) { animation-delay: 25ms; }
.table-wrap tbody tr:nth-child(3) { animation-delay: 50ms; }
.table-wrap tbody tr:nth-child(4) { animation-delay: 75ms; }
.table-wrap tbody tr:nth-child(5) { animation-delay: 100ms; }
.table-wrap tbody tr:nth-child(6) { animation-delay: 125ms; }

.report-table-panel table tbody tr:nth-child(2) { animation-delay: 25ms; }
.report-table-panel table tbody tr:nth-child(3) { animation-delay: 50ms; }
.report-table-panel table tbody tr:nth-child(4) { animation-delay: 75ms; }
.report-table-panel table tbody tr:nth-child(5) { animation-delay: 100ms; }

@keyframes table-row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes list-item-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  justify-content: flex-end;
}

.header-actions .user-badge {
  order: 1;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 7px 9px 7px 8px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(25, 48, 64, 0.92), rgba(13, 29, 45, 0.94));
  border: 1px solid rgba(160, 180, 205, 0.2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.user-badge:hover {
  border-color: rgba(96, 213, 194, 0.45);
  background: linear-gradient(145deg, rgba(30, 59, 72, 0.98), rgba(16, 37, 53, 0.98));
  box-shadow: 0 8px 24px rgba(2, 8, 23, 0.22), 0 0 0 3px rgba(96, 213, 194, 0.06);
  transform: translateY(-1px);
}

.user-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 36px;
  background: linear-gradient(145deg, #c1fff2, #59cfbd 72%, #37a999);
  color: #062923;
  font-weight: 850;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.55), 0 4px 12px rgba(46, 190, 169, 0.16);
}

.avatar img,
.user-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.user-status-label {
  color: #8eacb9;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.user-name {
  color: var(--white);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(160, 180, 205, 0.12);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
  color: #a9c0cc;
  font-size: 0.75rem;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.user-badge[aria-expanded="true"] .caret {
  color: #9af0df;
  background: rgba(96, 213, 194, 0.12);
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.4);
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.user-menu:not(.hidden) {
  animation: menu-enter 0.18s ease-out both;
  transform-origin: top right;
}

.user-menu:not(.hidden) .menu-action,
.user-menu:not(.hidden) .menu-logout {
  animation: menu-item-enter 0.24s both;
}

.user-menu:not(.hidden) .menu-action:nth-child(2) { animation-delay: 25ms; }
.user-menu:not(.hidden) .menu-action:nth-child(3) { animation-delay: 50ms; }
.user-menu:not(.hidden) .menu-action:nth-child(4) { animation-delay: 75ms; }
.user-menu:not(.hidden) .menu-action:nth-child(5) { animation-delay: 100ms; }
.user-menu:not(.hidden) .menu-logout { animation-delay: 125ms; }

@keyframes menu-enter {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menu-item-enter {
  from { opacity: 0; transform: translateX(7px); }
  to { opacity: 1; transform: translateX(0); }
}

.menu-action {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu-action:hover {
  border-color: rgba(96, 213, 194, 0.14);
  background: rgba(96, 213, 194, 0.1);
  color: #c9fff4;
  transform: translateX(3px);
}

.menu-action-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #83dccc;
  opacity: 0.88;
  transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.menu-action:hover .menu-action-icon {
  color: #a5f5e7;
  opacity: 1;
  transform: scale(1.1);
}

.user-menu-message {
  max-width: 230px;
  margin: 2px 4px 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.user-menu-message.success {
  color: #8ce6c2;
}

.user-menu-message.error {
  color: #ffabb1;
}

.menu-logout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.1), rgba(248, 113, 113, 0.05));
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #fecaca;
  padding: 10px 12px;
  min-width: 160px;
  text-align: left;
}

.menu-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  transform: translateX(2px);
}

.menu-logout .menu-action-icon {
  color: #ff9da5;
}

@media (prefers-reduced-motion: reduce) {
  .user-menu:not(.hidden) .menu-action,
  .user-menu:not(.hidden) .menu-logout {
    animation: none;
  }
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

.summary-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 23px;
}

.dashboard-overview {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 1px 0 2px;
}

.dashboard-overview .eyebrow {
  margin: 0 0 7px;
  color: #70d7c5;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.dashboard-overview h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 2.5vw, 1.8rem);
  letter-spacing: -0.045em;
}

.dashboard-overview > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(160, 180, 205, 0.14);
  border-radius: 11px;
  color: #c5d2e1;
  background: rgba(15, 27, 45, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-date::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 213, 194, 0.12);
  content: "";
}

.summary-card {
  --metric-accent: #62d6c2;
  --metric-glow: rgba(96, 213, 194, 0.1);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, var(--metric-glow), transparent 48%),
    linear-gradient(145deg, rgba(19, 33, 52, 0.96), rgba(12, 23, 39, 0.98));
  border: 1px solid rgba(160, 180, 205, 0.16);
  border-radius: 18px;
  padding: 22px 23px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  box-shadow: 0 14px 34px rgba(2, 8, 23, 0.19);
  isolation: isolate;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.summary-grid .summary-card::before {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, transparent, var(--metric-accent), transparent);
  opacity: 0.75;
  content: "";
}

.summary-grid .summary-card::after {
  position: absolute;
  z-index: -1;
  top: -42px;
  right: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--metric-glow);
  filter: blur(6px);
  opacity: 0.55;
  transition: transform 0.35s ease, opacity 0.35s ease;
  content: "";
}

.summary-grid .summary-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--metric-accent) 46%, transparent);
  box-shadow: 0 20px 42px rgba(2, 8, 23, 0.28), 0 0 24px var(--metric-glow);
}

.summary-grid .summary-card:hover::after {
  transform: scale(1.6);
  opacity: 0.9;
}

.summary-icon {
  transition: transform 0.24s cubic-bezier(0.2, 0.75, 0.25, 1), box-shadow 0.24s ease;
}

.summary-grid .summary-card:hover .summary-icon {
  transform: translateY(-2px) rotate(-5deg) scale(1.08);
  box-shadow: 0 8px 22px var(--metric-glow);
}

.summary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-card-top > span:first-child,
.label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.065em;
  font-size: 0.7rem;
}

.summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
}

.summary-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-grid .summary-icon {
  animation: metric-icon-breathe 3.6s ease-in-out infinite;
}

@keyframes metric-icon-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

.income-icon {
  --metric-accent: #65d6a8;
  --metric-glow: rgba(101, 214, 168, 0.14);
  background: rgba(101, 214, 168, 0.12);
  color: var(--success);
}

.services-icon {
  --metric-accent: #60d5c2;
  --metric-glow: rgba(96, 213, 194, 0.14);
  background: rgba(96, 213, 194, 0.12);
  color: var(--accent);
}

.pending-icon {
  --metric-accent: #f0bd61;
  --metric-glow: rgba(240, 189, 97, 0.14);
  background: rgba(240, 189, 97, 0.12);
  color: var(--warning);
}

.summary-card strong {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 730;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aebbd0;
  font-size: 0.82rem;
}

.metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.income-dot { background: var(--success); }
.services-dot { background: var(--accent); }
.pending-dot { background: var(--warning); }

.summary-grid .accent {
  --metric-accent: #65d6a8;
  --metric-glow: rgba(101, 214, 168, 0.1);
  border-color: rgba(96, 213, 194, 0.35);
}

.summary-grid .warning {
  --metric-accent: #f0bd61;
  --metric-glow: rgba(240, 189, 97, 0.1);
  border-color: rgba(240, 189, 97, 0.26);
}

.summary-grid .overdue-summary-card {
  --metric-accent: #fa7c86;
  --metric-glow: rgba(250, 124, 134, 0.12);
  border-color: rgba(250, 124, 134, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(250, 124, 134, 0.07), transparent 42%),
    linear-gradient(145deg, rgba(32, 29, 43, 0.96), rgba(18, 23, 39, 0.98));
}

.overdue-summary-card.has-overdue {
  border-color: rgba(250, 124, 134, 0.4);
  box-shadow: 0 14px 34px rgba(2, 8, 23, 0.19), inset 3px 0 rgba(250, 124, 134, 0.7);
}

.summary-grid .overdue-icon {
  --metric-accent: #fa7c86;
  --metric-glow: rgba(250, 124, 134, 0.14);
  background: rgba(250, 124, 134, 0.12);
  color: #ff9da5;
}

.overdue-dot {
  flex: 0 0 7px;
  background: #ff828c;
}

.overdue-summary-card small {
  color: #d6a6ac;
}

.content-grid {
  grid-template-columns: minmax(290px, 0.85fr) minmax(0, 1.35fr);
  margin-bottom: 22px;
}

.panel {
  background:
    linear-gradient(155deg, rgba(17, 30, 48, 0.97), rgba(12, 23, 39, 0.98));
  border: 1px solid rgba(160, 180, 205, 0.15);
  border-radius: 19px;
  padding: 25px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.panel:hover {
  border-color: rgba(160, 180, 205, 0.22);
  box-shadow: 0 24px 62px rgba(2, 8, 23, 0.26);
}

.panel-header h2 .interface-icon,
.module-heading h2 .interface-icon,
.dashboard-overview h2 .interface-icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

.panel:hover .panel-header h2 .interface-icon {
  transform: translateY(-1px) scale(1.08);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

#service-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 550;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid rgba(160, 180, 205, 0.17);
  background: rgba(5, 14, 26, 0.7);
  color: var(--white);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(96, 213, 194, 0.7);
  box-shadow: 0 0 0 3px rgba(96, 213, 194, 0.12);
}

button {
  border: none;
  border-radius: 11px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.15);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.primary-btn {
  background: linear-gradient(135deg, #8be6d5 0%, var(--accent) 42%, var(--accent-strong) 100%);
  color: #062923;
  box-shadow: 0 10px 24px rgba(37, 184, 172, 0.15);
}

.secondary-btn,
.ghost-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  color: var(--white);
}

.secondary-btn:hover,
.ghost-btn:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.9);
}

#create-user-modal .modal-card {
  width: min(100%, 440px);
}

.change-password-card {
  width: min(100%, 460px);
}

.change-password-card .panel-header {
  align-items: flex-start;
  margin-bottom: 20px;
}

.change-password-card .panel-header h3 {
  margin: 0;
}

.change-password-card .eyebrow {
  margin: 0 0 7px;
  color: #71d9c7;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.create-user-form {
  display: grid;
  gap: 14px;
}

.create-user-card {
  padding: 24px 20px 18px;
}

.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;
}

.users-card {
  width: min(100%, 680px);
  max-height: min(88vh, 780px);
  overflow-y: auto;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.users-card .panel-header {
  margin-bottom: 0;
}

.users-card .panel-header h3 {
  margin: 0;
}

.users-card .settings-modal-header {
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.users-card .settings-modal-header .eyebrow {
  margin: 0 0 7px;
  color: #71d9c7;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.users-card .settings-modal-header h3 {
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.users-card .settings-modal-intro {
  max-width: 470px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.settings-close-btn {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  color: #dce7f3;
  background: rgba(15, 23, 42, 0.7);
  font-size: 1.55rem;
  font-weight: 400;
}

.settings-section {
  padding: 22px 0;
}

.settings-section + .settings-section {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-section-heading h4 {
  margin: 0;
  color: var(--white);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.settings-section-heading p {
  margin: 5px 0 0 !important;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.company-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.company-settings-form .field {
  min-width: 0;
  margin: 0;
}

.company-settings-form .field > span {
  color: #d3deeb;
  font-size: 0.82rem;
  font-weight: 650;
}

.company-settings-form input:not([type="file"]) {
  min-height: 46px;
  background: rgba(5, 14, 26, 0.52);
}

.company-logo-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.company-logo-field small {
  color: var(--muted);
  font-size: 0.75rem;
}

.company-logo-field input[type="file"] {
  min-height: 46px;
  padding: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.company-logo-field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #e5edf6;
  background: rgba(30, 41, 59, 0.9);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.company-logo-actions {
  display: flex;
  align-items: center;
  min-width: 190px;
  justify-content: flex-end;
  gap: 10px;
}

.company-logo-frame {
  display: grid;
  width: 104px;
  height: 62px;
  flex: 0 0 104px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(5, 14, 26, 0.42);
}

.company-logo-preview {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.company-logo-placeholder {
  color: var(--muted);
  font-size: 0.72rem;
}

.company-settings-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 2px;
}

.company-settings-actions .secondary-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-color: rgba(96, 213, 194, 0.26);
  background: rgba(14, 116, 106, 0.2);
  color: #b9f3e9;
}

.security-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.38);
  font-size: 0.78rem;
  line-height: 1.45;
}

.users-section-heading {
  margin-bottom: 14px;
}

.users-section-heading .primary-btn {
  min-height: 40px;
  padding: 9px 14px;
  white-space: nowrap;
}

.users-card #manage-users-message {
  margin: 0;
  padding-top: 4px;
}

.users-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.56);
  animation: list-item-in 0.28s both;
}

.user-row-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: #082f49;
  font-weight: 800;
  background: linear-gradient(135deg, #67e8f9, #0ea5e9);
}

.user-row-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-row-copy strong,
.user-row-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.user-role {
  color: var(--accent) !important;
  font-size: 0.72rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-success {
  margin: 12px 0 0;
  color: #34d399;
  font-size: 0.9rem;
}

.remove-user-btn {
  padding: 8px 10px;
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.24);
  background: rgba(248, 113, 113, 0.08);
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 8, 23, 0.7);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.modal-card {
  width: min(100%, 360px);
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.4);
}

.modal:not(.hidden) .modal-card {
  animation: dialog-enter 0.24s ease-out both;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.users-card {
  width: min(100%, 680px);
  padding: 28px clamp(22px, 4vw, 38px);
  background:
    radial-gradient(ellipse at 95% 0%, rgba(45, 212, 191, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.99), rgba(17, 24, 39, 0.98));
}

#create-user-modal {
  z-index: 50;
}

.invoice-modal {
  z-index: 60;
  padding: 24px;
}

.invoice-card {
  width: min(100%, 760px);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid #d8e3eb;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0, #fff 68%, #f8fafc 100%);
  color: #142235;
  box-shadow: 0 32px 90px rgba(2, 8, 23, 0.5);
  animation: module-appear 0.22s ease-out;
}

.invoice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 2px solid #16877f;
}

.invoice-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.invoice-company-logo {
  width: 72px;
  height: 54px;
  object-fit: contain;
}

.invoice-close-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #dce4ec;
  border-radius: 11px;
  background: #fff;
  color: #526174;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.invoice-close-btn:hover {
  border-color: #b8c5d2;
  background: #f1f6f8;
  color: #142235;
}

.invoice-heading .eyebrow,
.invoice-customer .eyebrow {
  color: #16877f;
}

.invoice-heading > div:first-child > .eyebrow:first-child {
  margin: 0 0 5px;
  color: #142235;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-heading > div:first-child > .eyebrow:nth-of-type(2) {
  margin: 12px 0 4px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.invoice-company-contact {
  margin: -4px 0 8px;
  color: #69788a;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.invoice-company-contact:empty {
  display: none;
}

.invoice-heading h2 {
  margin: 0;
  color: #102c3e;
  font-size: clamp(2rem, 5vw, 2.65rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.invoice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 0;
}

.invoice-meta > div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #e2e9ef;
  border-radius: 11px;
  background: #f7f9fb;
}

.invoice-meta span {
  color: #69788a;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-meta strong,
.invoice-customer > strong {
  color: #142235;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.invoice-paid-status {
  color: #16805f !important;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e6f6ee;
  font-size: 0.78rem !important;
}

.invoice-cancelled-status {
  color: #b42332 !important;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff0f1;
  font-size: 0.78rem !important;
}

.invoice-cancelled-note {
  margin: -8px 0 18px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fff0f1;
  color: #a51d2d;
  font-size: 0.86rem;
  font-weight: 650;
}

.invoice-history-note {
  margin: 16px 0 0;
}

.invoice-row-actions {
  min-width: 290px;
}

.invoices-table th:last-child,
.invoices-table td:last-child {
  white-space: normal;
}

.invoice-customer {
  display: grid;
  gap: 6px;
  margin: 0 0 20px;
  padding: 17px 18px;
  border: 1px solid #d8e8e6;
  border-left: 4px solid #16877f;
  border-radius: 12px;
  background: #f2f8f7;
}

.invoice-customer .eyebrow {
  margin: 0;
  font-size: 0.68rem;
}

.invoice-customer > span {
  color: #69788a;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.invoice-lines-wrap {
  border-color: #dce5ec;
  border-radius: 11px;
  background: #fff;
}

.invoice-details-note {
  margin: -10px 0 16px;
  color: #69788a;
  font-size: 0.8rem;
  line-height: 1.5;
}

.invoice-lines th {
  background: #173748;
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.invoice-lines td {
  color: #142235;
  border-color: #e8edf2;
  font-size: 0.86rem;
}

.invoice-lines tbody tr:nth-child(even) {
  background: #f7f9fb;
}

.invoice-totals {
  display: grid;
  gap: 10px;
  width: min(100%, 350px);
  margin: 20px 0 0 auto;
  padding: 15px;
  border: 1px solid #e0e8ee;
  border-radius: 13px;
  background: #f7f9fb;
}

.invoice-totals .total-row {
  color: #627184;
}

.invoice-totals .total-row strong {
  color: #142235;
}

.invoice-totals .total-highlight {
  margin: 2px -5px -5px;
  padding: 13px 12px;
  border: 1px solid #cbe8e2;
  border-radius: 10px;
  background: #e9f7f4;
  color: #123a3a;
  font-size: 1rem;
}

.invoice-totals .total-highlight strong {
  color: #16877f;
  font-size: 1.2rem;
}

.invoice-thanks {
  margin: 26px 0 0;
  color: #31566a;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.invoice-legal-note {
  margin: 8px 0 0;
  color: #7a8797;
  text-align: center;
  font-size: 0.72rem;
}

.invoice-action-message {
  min-height: 1.25em;
  margin: 12px 0 0;
  color: #16805f;
  text-align: right;
  font-size: 0.78rem;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #dce4ec;
}

.invoice-actions a {
  text-decoration: none;
}

.whatsapp-share-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-color: #1da851;
  background: #25d366;
  color: #073b20;
}

.whatsapp-share-btn:hover {
  background: #20bd5b;
}

.whatsapp-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: currentColor;
}

.modal-card h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.modal-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.selected-service {
  margin-top: 24px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(17, 91, 88, 0.24), rgba(17, 91, 88, 0.08));
  border: 1px solid rgba(96, 213, 194, 0.2);
  display: grid;
  gap: 8px;
}

.selected-service strong {
  font-size: 1.2rem;
}

.invoice-header {
  margin-bottom: 12px;
}

.clear-services-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.clear-services-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  min-height: 150px;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(25, 38, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.service-item:hover {
  background: rgba(29, 44, 68, 0.8);
  border-color: rgba(96, 201, 250, 0.18);
}

.service-summary {
  display: grid;
  gap: 4px;
}

.service-summary strong {
  font-size: 1rem;
}

.service-summary span {
  color: var(--muted);
  font-size: 0.8rem;
}

.service-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delete-btn {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.28);
  padding: 8px 10px;
  font-size: 0.86rem;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.totals {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.tax-settings {
  display: grid;
  grid-template-columns: auto minmax(120px, 160px);
  align-items: end;
  gap: 10px 16px;
  padding: 13px 14px;
  border: 1px solid rgba(160, 180, 205, 0.12);
  border-radius: 13px;
  background: rgba(5, 14, 26, 0.28);
}

.tax-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.tax-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.tax-rate-field {
  gap: 5px;
}

.tax-rate-field span {
  font-size: 0.74rem;
}

.tax-rate-field input {
  padding: 9px 10px;
}

.tax-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.total-row strong {
  color: var(--text);
}

.total-highlight {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--white);
  font-size: 1.1rem;
}

.total-highlight strong {
  color: var(--success);
  font-size: 1.4rem;
}

.total-highlight {
  padding: 16px 14px 0;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.recent-card {
  position: relative;
  padding: 17px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(25, 38, 59, 0.72), rgba(16, 26, 43, 0.76));
  border: 1px solid rgba(160, 180, 205, 0.13);
  display: grid;
  gap: 9px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.recent-card:hover {
  transform: translateY(-3px);
  border-color: rgba(96, 213, 194, 0.38);
  background: linear-gradient(145deg, rgba(27, 48, 67, 0.88), rgba(16, 29, 46, 0.9));
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.2), inset 0 1px rgba(96, 213, 194, 0.08);
}

.recent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recent-card-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 8px;
  border: 1px solid rgba(96, 213, 194, 0.19);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(96, 213, 194, 0.15), rgba(96, 213, 194, 0.06));
  color: #80e1d0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.24s ease, color 0.24s ease, background 0.24s ease;
}

.recent-card:hover .recent-card-icon {
  transform: rotate(-5deg) scale(1.07);
  background: rgba(96, 213, 194, 0.2);
  color: #a0f2e2;
}

.recent-card-date {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(160, 180, 205, 0.11);
  border-radius: 999px;
  color: #aab9ca;
  background: rgba(5, 14, 26, 0.4);
  font-size: 0.72rem;
}

.recent-card-client {
  overflow: hidden;
  color: #edf3fa;
  font-size: 0.98rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card-service {
  overflow: hidden;
  color: #a9b9c9;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card-amount {
  margin-top: 3px;
  color: #8ce6c2;
  font-size: 1.12rem;
  font-weight: 730;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 30px 24px 44px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .monthly-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-grid > *,
  .module-layout > *,
  .monthly-layout > * {
    min-width: 0;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #manage-users-modal {
    padding: 12px;
  }

  .users-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
    border-radius: 18px;
  }

  .company-settings-form {
    grid-template-columns: 1fr;
  }

  .company-logo-row {
    grid-template-columns: 1fr;
  }

  .company-logo-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .users-card .settings-modal-header {
    padding-bottom: 18px;
  }

  .users-card .settings-modal-header h3 {
    font-size: 1.45rem;
  }

  .settings-section {
    padding: 18px 0;
  }

  .users-section-heading {
    align-items: flex-start;
  }

  .app-shell {
    padding: 20px 14px 36px;
  }

  .topbar {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 18px;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-mark-small {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 13px;
  }

  .brand-lockup h1 {
    font-size: clamp(1.55rem, 7vw, 1.8rem);
  }

  .topbar-subtitle {
    font-size: 0.84rem;
  }

  .dashboard-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2px;
  }

  .dashboard-date {
    padding: 7px 10px;
    font-size: 0.74rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions .user-badge {
    align-self: flex-end;
    margin-left: auto;
  }

  .module-nav {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 13px;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .module-link {
    flex: 0 0 auto;
    gap: 7px;
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .module-link-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 17px;
  }

  .summary-card {
    padding: 20px;
  }

  .module-heading {
    gap: 14px;
    margin-bottom: 18px;
  }

  .module-heading h2 {
    font-size: 1.75rem;
  }

  .service-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .service-item-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tax-settings {
    grid-template-columns: 1fr;
  }

  .tax-hint {
    grid-column: auto;
  }

  .recent-grid {
    grid-template-columns: 1fr;
  }

  .report-summary {
    grid-template-columns: 1fr;
  }

  .report-client-chart {
    grid-template-columns: 1fr;
  }

  .report-filter-toolbar {
    align-items: flex-start;
    gap: 10px;
  }

  .report-filters {
    grid-template-columns: 1fr;
    max-height: 420px;
  }

  .report-filters.is-collapsed {
    max-height: 0;
  }

  .report-filter-actions {
    flex-wrap: wrap;
  }

  .module-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1 1 auto;
  }

  .login-card {
    padding: 30px 22px 24px;
    border-radius: 23px;
  }

  .invoice-modal {
    padding: 12px;
  }

  .invoice-card {
    max-height: 94vh;
    border-radius: 17px;
    padding: 22px 18px;
  }

  .invoice-heading {
    gap: 10px;
  }

  .invoice-company-logo {
    width: 56px;
    height: 44px;
  }

  .invoice-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-meta > div {
    padding: 10px;
  }

  .invoice-meta > div:first-child {
    grid-column: 1 / -1;
  }

  .invoice-lines th,
  .invoice-lines td {
    padding: 9px 7px;
    font-size: 0.76rem;
  }

  .invoice-actions {
    flex-wrap: wrap;
  }

  .invoice-actions button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media screen and (max-width: 560px) {
  .module-nav {
    position: sticky;
    top: 10px;
    z-index: 10;
    box-shadow: 0 12px 30px rgba(2, 8, 23, 0.38);
    backdrop-filter: blur(14px);
  }
}

/* Visual refinements for a clearer, more cohesive dashboard. */
.app-shell {
  max-width: 1460px;
  padding-top: 28px;
}

.topbar {
  position: relative;
  padding: 19px 22px;
  border: 1px solid rgba(160, 180, 205, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 0 0, rgba(96, 213, 194, 0.08), transparent 44%),
    linear-gradient(145deg, rgba(15, 28, 46, 0.86), rgba(10, 21, 36, 0.72));
  box-shadow: 0 18px 42px rgba(2, 8, 23, 0.16), inset 0 1px rgba(255, 255, 255, 0.035);
}

.module-nav {
  width: 100%;
  justify-content: space-between;
  gap: 4px;
  border-color: rgba(160, 180, 205, 0.16);
  border-radius: 17px;
  background: rgba(13, 26, 43, 0.84);
  backdrop-filter: blur(16px);
}

.module-link {
  flex: 1 1 auto;
  min-height: 46px;
  border-radius: 11px;
  font-weight: 650;
}

.dashboard-overview {
  align-items: center;
  margin: 0 0 2px;
  padding: 21px 23px;
  border: 1px solid rgba(160, 180, 205, 0.14);
  border-radius: 19px;
  background:
    radial-gradient(ellipse at 95% 0, rgba(96, 213, 194, 0.09), transparent 36%),
    linear-gradient(135deg, rgba(17, 32, 51, 0.8), rgba(11, 23, 39, 0.54));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.dashboard-overview h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

.dashboard-date {
  padding: 10px 14px;
  border-color: rgba(160, 180, 205, 0.18);
  border-radius: 999px;
  background: rgba(6, 16, 29, 0.56);
}

.summary-grid {
  gap: 15px;
}

.summary-card {
  min-height: 178px;
  justify-content: space-between;
  padding: 23px;
  border-radius: 20px;
}

.overdue-summary-card[role="button"] {
  cursor: pointer;
}

.overdue-summary-card[role="button"]:focus-visible {
  outline: 3px solid rgba(250, 124, 134, 0.76);
  outline-offset: 4px;
}

.overdue-monthly-panel {
  scroll-margin-top: 20px;
}

.overdue-empty-cell {
  padding: 28px 14px !important;
  color: var(--muted);
  text-align: center;
}

.summary-card-top > span:first-child {
  max-width: 72%;
  line-height: 1.45;
}

.summary-card strong {
  line-height: 1.05;
}

.recent-panel {
  min-height: 250px;
  padding: 27px;
  border-color: rgba(160, 180, 205, 0.16);
  background:
    radial-gradient(ellipse at 100% 0, rgba(57, 105, 143, 0.08), transparent 38%),
    linear-gradient(155deg, rgba(16, 30, 49, 0.97), rgba(10, 21, 36, 0.98));
}

.recent-panel .panel-header {
  margin-bottom: 18px;
}

.recent-grid > .empty-state {
  grid-column: 1 / -1;
  width: min(100%, 620px);
  min-height: 150px;
  margin: 2px auto 0;
  padding: 24px;
  border-color: rgba(160, 180, 205, 0.2);
  background: linear-gradient(135deg, rgba(21, 38, 59, 0.48), rgba(13, 26, 43, 0.32));
  line-height: 1.65;
}

.panel {
  border-radius: 20px;
  box-shadow: 0 16px 42px rgba(2, 8, 23, 0.2), inset 0 1px rgba(255, 255, 255, 0.025);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select {
  min-height: 47px;
  border-color: rgba(160, 180, 205, 0.2);
  background-color: rgba(6, 16, 29, 0.58);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.field select:hover {
  border-color: rgba(160, 180, 205, 0.34);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.field select:focus {
  border-color: rgba(96, 213, 194, 0.68);
  box-shadow: 0 0 0 4px rgba(96, 213, 194, 0.09);
}

@media (max-width: 900px) {
  .app-shell {
    padding-top: 22px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 17px;
    border-radius: 19px;
  }

  .module-link {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-top: 14px;
  }

  .topbar {
    border-radius: 17px;
  }

  .dashboard-overview {
    padding: 19px 17px;
    border-radius: 17px;
  }

  .summary-card {
    min-height: 160px;
    border-radius: 17px;
  }

  .recent-panel {
    min-height: 0;
    padding: 21px 16px;
    border-radius: 18px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 15mm;
  }

  body {
    background: #fff;
    color: #111827;
  }

  .secondary-btn,
  .ghost-btn,
  .primary-btn,
  .delete-btn,
  .table-action,
  .module-nav,
  .header-actions,
  .report-filter-toolbar,
  .report-filters {
    display: none;
  }

  .module-view.hidden {
    display: none !important;
  }

  body:has(#invoice-modal:not(.hidden)) * {
    visibility: hidden !important;
  }

  body:has(#invoice-modal:not(.hidden)) #invoice-modal,
  body:has(#invoice-modal:not(.hidden)) #invoice-modal * {
    visibility: visible !important;
  }

  body:has(#invoice-modal:not(.hidden)) #invoice-modal {
    display: block !important;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    background: #fff;
    backdrop-filter: none;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-card {
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-meta > div {
    background: #f7f9fb !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-heading,
  body:has(#invoice-modal:not(.hidden)) .invoice-meta,
  body:has(#invoice-modal:not(.hidden)) .invoice-customer,
  body:has(#invoice-modal:not(.hidden)) .invoice-totals,
  body:has(#invoice-modal:not(.hidden)) .invoice-thanks,
  body:has(#invoice-modal:not(.hidden)) .invoice-legal-note {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-customer {
    background: #f2f8f7 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-lines-wrap {
    overflow: visible;
    border: 0;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-lines thead {
    display: table-header-group;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-lines tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-lines th {
    background: #173748 !important;
    color: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-lines tbody tr:nth-child(even),
  body:has(#invoice-modal:not(.hidden)) .invoice-totals,
  body:has(#invoice-modal:not(.hidden)) .invoice-totals .total-highlight {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-totals .total-highlight {
    background: #e9f7f4 !important;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-actions {
    display: none !important;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-action-message {
    display: none !important;
  }

  body:has(#invoice-modal:not(.hidden)) .invoice-close-btn {
    display: none !important;
  }

  .app-shell {
    max-width: 100%;
    padding: 0;
  }

  .panel,
  .summary-card {
    box-shadow: none;
    border-color: rgba(15, 23, 42, 0.2);
  }
}
