html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f6f7f9;
  color: #1f2933;
}

.portal-navbar {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(31, 41, 51, 0.06);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111827;
  font-weight: 800;
  letter-spacing: 0;
}

.portal-brand:hover {
  color: #111827;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.portal-nav {
  gap: 4px;
}

.portal-nav .nav-link {
  color: #334155;
  font-weight: 600;
  padding-left: 10px;
  padding-right: 10px;
}

.portal-nav .nav-link:hover {
  color: #0d6efd;
}

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 6px 10px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  background: #fff;
}

.user-avatar {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e5e7eb;
  color: #111827;
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-page {
  min-height: 100vh;
  margin: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.admin-auth {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 30%),
    linear-gradient(135deg, #020617 0%, #111827 55%, #1f2937 100%);
}

.customer-auth {
  background:
    linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.08)),
    #f8fafc;
}

.auth-card {
  width: min(100%, 430px);
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.admin-login-card {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

.customer-login-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
}

.admin-logo {
  background: #2563eb;
}

.customer-logo {
  background: #198754;
}

.auth-company {
  font-weight: 800;
}

.auth-subtitle,
.auth-copy {
  color: #6b7280;
}

.admin-login-card .auth-subtitle,
.admin-login-card .auth-copy {
  color: #aeb8c7;
}

.auth-card h1 {
  margin-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 800;
}

.auth-copy {
  margin-bottom: 24px;
}

.auth-input {
  min-height: 46px;
  border-radius: 10px;
}

.auth-password-field {
  position: relative;
}

.auth-password-field .auth-input {
  padding-right: 46px;
}

.auth-password-toggle {
  width: 38px;
  height: 38px;
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #667085;
  background: transparent;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  color: #1769e0;
  background: rgba(23, 105, 224, 0.08);
}

.admin-login-card .auth-input {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
}

.admin-login-card .auth-password-toggle {
  color: #aeb8c7;
}

.admin-login-card .auth-password-toggle:hover,
.admin-login-card .auth-password-toggle:focus {
  color: #fff;
  background: rgba(147, 197, 253, 0.12);
}

.admin-login-card .auth-input:focus {
  color: #fff;
  background: rgba(15, 23, 42, 0.94);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  font-weight: 700;
}

.admin-submit {
  background: #2563eb;
  border-color: #2563eb;
}

.auth-link {
  color: #0d6efd;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-login-card .auth-link {
  color: #93c5fd;
}

.auth-validation {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.portal-shell {
  max-width: 1440px;
  padding-left: 24px;
  padding-right: 24px;
}

.portal-entry {
  min-height: calc(100vh - 180px);
  display: grid;
  align-items: center;
  max-width: 720px;
}

.surface {
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.metric {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.text-preline {
  white-space: pre-line;
}

.review-actions {
  min-width: 260px;
}

.stripe-card {
  min-height: 42px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
}

.summary-tile {
  display: grid;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: #f8fafc;
}

#clients-table {
  min-width: 1360px;
}

#clients-table th,
#clients-table td {
  vertical-align: middle;
}

#clients-table .actions-cell {
  min-width: 330px;
  width: 330px;
  white-space: nowrap;
}

#clients-table .action-buttons {
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

#clients-table .action-buttons form {
  flex: 0 0 auto;
  display: inline-flex;
  margin: 0;
}

#clients-table .action-buttons .btn-action {
  min-width: 86px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#clients-table .btn-action-edit {
  min-width: 72px;
}

#clients-table .btn-mark-paid,
#clients-table .btn-paid-disabled {
  min-width: 96px;
}

#clients-table .btn-activate,
#clients-table .btn-deactivate {
  min-width: 104px;
}

.connected-software-table {
  min-width: 1420px;
}

.connected-software-table th,
.connected-software-table td {
  vertical-align: middle;
}

.connected-software-table td a {
  max-width: 260px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.connected-software-table .actions-cell {
  min-width: 660px;
}

.connected-software-quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.connected-software-quick-actions form {
  display: inline-flex;
  margin: 0;
}

.connected-software-quick-actions .btn {
  min-height: 38px;
  white-space: nowrap;
}

.connected-software-actions {
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.connected-software-actions form {
  flex: 0 0 auto;
  display: inline-flex;
  margin: 0;
}

.connected-software-actions .btn {
  flex: 0 0 auto;
  min-height: 34px;
  white-space: nowrap;
}

.license-api-test-output {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  color: #dbeafe;
  background: #0f172a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.btn-action-edit {
  color: #475569;
  border: 1px solid #94a3b8;
  background: #fff;
}

.btn-action-edit:hover,
.btn-action-edit:focus {
  color: #0f172a;
  border-color: #64748b;
  background: #f8fafc;
}

.btn-mark-paid,
.btn-activate {
  color: #047857;
  border: 1px solid #047857;
  background: #fff;
}

.btn-mark-paid:hover,
.btn-mark-paid:focus,
.btn-activate:hover,
.btn-activate:focus {
  color: #fff;
  border-color: #047857;
  background: #047857;
}

.btn-paid-disabled,
.btn-paid-disabled:disabled {
  color: #047857;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  opacity: 1;
}

.btn-deactivate {
  color: #dc2626;
  border: 1px solid #ef4444;
  background: #fff;
}

.btn-deactivate:hover,
.btn-deactivate:focus {
  color: #fff;
  border-color: #dc2626;
  background: #dc2626;
}

.notification-panel {
  min-height: 150px;
}

.notification-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.payment-icon {
  background: #198754;
}

.overdue-icon {
  background: #dc3545;
}

.plan-icon {
  background: #7c3aed;
}

.client-icon {
  background: #0d6efd;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notification-list li {
  padding: 10px 0;
  border-top: 1px solid #e5e9f0;
}

.notification-list li:first-child {
  border-top: 0;
}

.header-notifications {
  flex: 0 0 auto;
}

.nav-notification-btn {
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  border: 0;
}

.nav-notification-btn:hover,
.nav-notification-btn:focus {
  color: #fff;
  opacity: 0.9;
}

.notification-count {
  min-width: 18px;
  height: 18px;
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #111827;
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.notification-menu {
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 41, 51, 0.16);
  overflow: hidden;
}

.notification-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid #e5e9f0;
  background: #fff;
}

.notification-menu-body {
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
}

.notification-menu-item {
  display: block;
  padding: 12px 14px;
  border-top: 1px solid #edf0f4;
}

.notification-menu-link {
  color: inherit;
  text-decoration: none;
}

.notification-menu-link:hover,
.notification-menu-link:focus {
  color: inherit;
  background: #eef2ff;
  text-decoration: none;
}

.notification-menu-link.is-read {
  opacity: 0.72;
}

.notification-menu-item:first-child {
  border-top: 0;
}

.notification-message {
  color: #1f2933;
  font-size: 0.86rem;
  line-height: 1.35;
}

.notification-time,
.notification-empty {
  color: #6b7280;
  font-size: 0.78rem;
}

.notification-empty {
  padding: 14px;
}

@media (max-width: 767.98px) {
  .portal-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-notifications {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .portal-userbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 10px;
  }

  .user-chip {
    max-width: 100%;
  }

  .auth-card {
    padding: 24px;
    border-radius: 14px;
  }

  .review-actions {
    min-width: 0;
  }
}

/* TekkBizz SaaS design system */
:root {
  --tb-bg: #f4f6f9;
  --tb-surface: #ffffff;
  --tb-surface-muted: #f8fafc;
  --tb-border: #dce3ec;
  --tb-border-soft: #edf1f5;
  --tb-text: #172033;
  --tb-muted: #667085;
  --tb-heading: #101828;
  --tb-primary: #1769e0;
  --tb-primary-dark: #0f4fb0;
  --tb-info: #2563eb;
  --tb-success: #16865a;
  --tb-warning: #c77700;
  --tb-danger: #d92d20;
  --tb-sidebar: #101828;
  --tb-sidebar-muted: #9aa4b2;
  --tb-shadow: 0 10px 28px rgba(16, 24, 40, 0.07);
  --tb-shadow-soft: 0 2px 10px rgba(16, 24, 40, 0.05);
  --tb-radius: 8px;
  --tb-sidebar-width: 282px;
  --tb-topbar-height: 72px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--tb-bg);
  color: var(--tb-text);
  letter-spacing: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--tb-heading);
  font-weight: 750;
  letter-spacing: 0;
}

a {
  color: var(--tb-primary);
}

.app-body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(23, 105, 224, 0.04), transparent 280px),
    var(--tb-bg);
}

.app-frame {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: var(--tb-sidebar-width);
  display: flex;
  flex-direction: column;
  color: #e7ecf4;
  background: var(--tb-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

@media (min-width: 1200px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none !important;
    visibility: visible !important;
  }
}

.sidebar-header {
  min-height: var(--tb-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
  line-height: 1.15;
}

.sidebar-brand small {
  margin-top: 2px;
  color: var(--tb-sidebar-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--tb-radius);
  background: #1d4ed8;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
}

.sidebar-nav {
  flex: 1 1 auto;
  display: grid;
  gap: 5px;
  padding: 16px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar-groups {
  display: grid;
  gap: 5px;
}

.sidebar-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--tb-radius);
  color: #64748b;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.sidebar-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-sidebar-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.customer-sidebar-link span {
  white-space: normal;
  line-height: 1.18;
}

.customer-sidebar-link:hover {
  color: #0f172a;
  background: #e0f2fe;
}

.customer-sidebar-link.active {
  color: #fff;
  background: #2563eb;
}

.customer-sidebar-link i {
  width: 20px;
  flex: 0 0 20px;
  color: currentColor;
  text-align: center;
}

.sidebar-link i {
  width: 20px;
  flex: 0 0 20px;
  color: #64748b;
  text-align: center;
}

.sidebar-link:hover {
  color: #0f172a;
  background: #e0f2fe;
}

.sidebar-link.active {
  color: #fff;
  background: #2563eb;
}

.sidebar-link:hover i {
  color: #0f172a;
}

.sidebar-link.active i {
  color: #fff;
}

.sidebar-dropdown {
  display: grid;
  gap: 4px;
}

.sidebar-parent {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-parent:focus-visible,
.sidebar-child:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.sidebar-parent .sidebar-chevron {
  margin-left: auto;
  width: 16px;
  flex: 0 0 16px;
  font-size: 0.76rem;
  transition: transform 0.2s ease;
}

.sidebar-parent[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  padding: 2px 0 4px 14px;
}

.sidebar-submenu.show {
  display: grid;
  gap: 3px;
}

.sidebar-child {
  min-height: 36px;
  padding: 8px 10px 8px 14px;
  border-left: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 650;
}

.sidebar-child i {
  width: 18px;
  flex-basis: 18px;
  font-size: 0.82rem;
}

.sidebar-child.active {
  color: #0f172a;
  background: #dbeafe;
  box-shadow: inset 3px 0 0 #2563eb;
}

.sidebar-child.active i {
  color: #2563eb;
}

.sidebar-child:hover {
  background: #e0f2fe;
  transform: translateX(1px);
}

.sidebar-link.disabled,
.sidebar-link[aria-disabled="True"],
.sidebar-link[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-link.disabled:hover,
.sidebar-link[aria-disabled="True"]:hover,
.sidebar-link[aria-disabled="true"]:hover {
  color: #64748b;
  background: transparent;
}

@media (max-width: 1199.98px) {
  .customer-sidebar-nav {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .customer-sidebar-link {
    min-height: 46px;
    padding: 10px 14px;
  }
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px 20px;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--tb-radius);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.84rem;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.app-content {
  min-width: 0;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  min-height: var(--tb-topbar-height);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--tb-border);
  backdrop-filter: blur(16px);
}

.app-page {
  width: min(100%, 1480px);
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 28px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.portal-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--tb-border);
  color: #64748b;
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.86rem;
}

.portal-footer-inner {
  width: min(100%, 1480px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 auto;
  padding: 14px 24px;
  text-align: center;
}

.portal-footer a {
  color: #334155;
  font-weight: 700;
  text-decoration: none;
}

.portal-footer a:hover,
.portal-footer a:focus {
  color: var(--tb-primary);
  text-decoration: underline;
}

.portal-footer-brand {
  color: var(--tb-primary) !important;
  font-weight: 800 !important;
}

.portal-footer-separator {
  color: #cbd5e1;
}

.auth-page > main {
  min-height: calc(100vh - 54px);
}

.auth-page .auth-shell {
  min-height: calc(100vh - 54px);
}

.content-page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 36px 18px 48px;
}

.app-page .content-page {
  padding: 0 0 28px;
}

.content-hero {
  margin-bottom: 18px;
}

.content-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
}

.content-hero p {
  max-width: 760px;
  margin-bottom: 10px;
}

.content-eyebrow {
  margin-bottom: 8px;
  color: var(--tb-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.last-updated {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  color: #475569;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.content-panel {
  padding: 24px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: var(--tb-surface);
  box-shadow: var(--tb-shadow-soft);
}

.content-panel h2,
.policy-section h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.policy-section + .policy-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--tb-border-soft);
}

.policy-section p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
}

.contact-list div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tb-border-soft);
}

.contact-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-list dt {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-list dd {
  margin: 4px 0 0;
  color: #0f172a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-form {
  margin-top: 16px;
}

.contact-form .form-label {
  color: #334155;
  font-weight: 700;
}

.topbar-search {
  max-width: 520px;
  flex: 1 1 280px;
  position: relative;
}

.topbar-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  color: #98a2b3;
  transform: translateY(-50%);
}

.topbar-search .form-control {
  min-height: 42px;
  padding-left: 40px;
  border-radius: var(--tb-radius);
  background: #f8fafc;
  border-color: var(--tb-border);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  color: var(--tb-text);
  background: #fff;
}

.action-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--tb-radius);
  font-weight: 700;
}

.user-profile {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  color: var(--tb-text);
  background: #fff;
}

.user-profile:hover,
.user-profile:focus {
  border-color: #b8c4d2;
}

.user-profile-text {
  display: grid;
  min-width: 0;
  text-align: left;
}

.user-profile-text strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--tb-heading);
  font-size: 0.86rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-text small {
  color: var(--tb-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e7efff;
  color: var(--tb-primary);
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.user-avatar-image {
  object-fit: cover;
  border: 2px solid #e0e7ff;
  background: #fff;
}

.profile-menu {
  min-width: 230px;
  border-color: var(--tb-border);
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow);
}

.portal-alert {
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow-soft);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.page-heading p {
  max-width: 760px;
}

.surface,
.auth-card,
.notification-menu,
.dropdown-menu,
.modal-content {
  border-radius: var(--tb-radius);
}

.surface {
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow-soft);
}

.card-soft {
  padding: 20px;
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: var(--tb-surface);
  box-shadow: var(--tb-shadow-soft);
}

.kpi-card .kpi-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--tb-radius);
  margin-bottom: 12px;
  background: #eff6ff;
  color: var(--tb-primary);
}

.kpi-card .kpi-icon-success {
  color: var(--tb-success);
  background: #ecfdf5;
}

.kpi-card .kpi-icon-danger {
  color: var(--tb-danger);
  background: #fef2f2;
}

.kpi-label {
  color: var(--tb-muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 6px;
  color: var(--tb-heading);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.kpi-note {
  margin-top: 8px;
  color: var(--tb-muted);
  font-size: 0.82rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.bank-cash-section {
  margin-bottom: 18px;
}

.bank-cash-title {
  align-items: flex-end;
}

.bank-cash-actions {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.cash-flow-filter-bar {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.cash-flow-filter-bar .form-select {
  flex: 1 1 170px;
  min-width: 150px;
}

.cash-flow-filter-bar .form-control {
  flex: 1 1 140px;
  min-width: 132px;
}

.cash-flow-filter-bar .btn {
  white-space: nowrap;
}

.cash-flow-repair-form .btn {
  white-space: nowrap;
}

.bank-cash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.bank-cash-card {
  min-height: 136px;
}

.bank-cash-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.6fr);
  gap: 16px;
  min-width: 0;
}

.bank-cash-chart,
.bank-breakdown-panel {
  max-width: 100%;
  min-width: 0;
  min-height: 270px;
  padding: 16px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: #fff;
}

.chart-panel-compact {
  min-height: 175px;
}

.chart-panel-compact canvas {
  height: 175px !important;
}

.chart-panel-compact .chart-state {
  min-height: 160px;
}

.bank-breakdown-table {
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
}

.chart-placeholder {
  min-height: 250px;
  position: relative;
  display: grid;
  align-items: end;
  padding: 18px;
  overflow: hidden;
}

.chart-bars {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 10px;
}

.chart-bars span {
  display: block;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #60a5fa, #1769e0);
}

.chart-bar-42 { height: 42%; }
.chart-bar-48 { height: 48%; }
.chart-bar-58 { height: 58%; }
.chart-bar-64 { height: 64%; }
.chart-bar-70 { height: 70%; }
.chart-bar-76 { height: 76%; }
.chart-bar-86 { height: 86%; }
.chart-bar-92 { height: 92%; }

.chart-card {
  max-width: 100%;
  min-width: 0;
  min-height: 300px;
  padding: 18px;
}

.chart-panel {
  min-height: 235px;
  position: relative;
}

.chart-panel canvas {
  width: 100% !important;
  height: 235px !important;
}

.chart-panel-donut {
  max-width: 300px;
  margin: 0 auto;
}

.chart-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--tb-muted);
  font-size: 0.9rem;
  text-align: center;
}

.chart-panel:not(.is-loading):not(.is-empty) .chart-state {
  display: none;
}

.chart-metrics {
  margin-top: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
}

.chart-dot-paid { background: #198754; }
.chart-dot-due-soon { background: #f59f00; }
.chart-dot-overdue { background: #dc3545; }
.chart-dot-failed { background: #7c3aed; }

.donut-placeholder {
  width: 180px;
  height: 180px;
  margin: 12px auto;
  border-radius: 50%;
  background:
    conic-gradient(var(--tb-success) 0 42%, var(--tb-warning) 42% 64%, var(--tb-danger) 64% 82%, var(--tb-primary) 82% 100%);
  position: relative;
}

.donut-placeholder::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fff;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: var(--tb-surface);
}

.search-field {
  min-width: min(100%, 280px);
  position: relative;
  flex: 1 1 280px;
}

.search-field i {
  position: absolute;
  left: 12px;
  top: 50%;
  color: #98a2b3;
  transform: translateY(-50%);
}

.search-field .form-control {
  padding-left: 36px;
}

.payments-filter-bar {
  align-items: flex-end;
}

.payments-filter-bar .search-field {
  flex: 2 1 320px;
}

.payments-filter-bar .filter-field {
  display: flex;
  flex: 1 1 128px;
  flex-direction: column;
  gap: 4px;
  min-width: 128px;
}

.payments-filter-bar .filter-date-field {
  flex-basis: 138px;
  min-width: 138px;
}

.payments-filter-bar .form-label {
  margin: 0;
  color: var(--tb-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.payments-filter-bar .btn {
  align-self: flex-end;
  min-height: 31px;
  white-space: nowrap;
}

.table-responsive.surface {
  overflow: auto;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  color: var(--tb-text);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475467;
  background: #f8fafc;
  border-bottom: 1px solid var(--tb-border);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table tbody td {
  border-color: var(--tb-border-soft);
  vertical-align: middle;
}

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

.table-danger,
.table-warning {
  --bs-table-bg: transparent;
}

.badge {
  border-radius: 999px;
  font-weight: 750;
  letter-spacing: 0;
}

.bg-success {
  background-color: var(--tb-success) !important;
}

.bg-danger {
  background-color: var(--tb-danger) !important;
}

.bg-warning {
  background-color: #f59e0b !important;
}

.bg-primary {
  background-color: var(--tb-primary) !important;
}

.btn {
  border-radius: var(--tb-radius);
  font-weight: 700;
}

.btn-primary {
  background: var(--tb-primary);
  border-color: var(--tb-primary);
}

.btn-primary:hover {
  background: var(--tb-primary-dark);
  border-color: var(--tb-primary-dark);
}

.form-control,
.form-select {
  border-radius: var(--tb-radius);
  border-color: var(--tb-border);
}

.form-control:focus,
.form-select:focus {
  border-color: #9ec5fe;
  box-shadow: 0 0 0 0.2rem rgba(23, 105, 224, 0.15);
}

.metric {
  color: var(--tb-heading);
  font-size: 1.45rem;
  font-weight: 800;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--tb-border-soft);
}

.mini-list li:first-child {
  border-top: 0;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  color: var(--tb-text);
  background: #fff;
  text-decoration: none;
  box-shadow: var(--tb-shadow-soft);
}

.quick-action:hover {
  color: var(--tb-primary);
  border-color: #bad2ff;
  background: #f8fbff;
}

.quick-action i {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--tb-radius);
  background: #eff6ff;
}

.customer-hero {
  padding: 22px;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  background: linear-gradient(135deg, #ffffff 0%, #f1f7ff 100%);
  box-shadow: var(--tb-shadow-soft);
}

.client-software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.client-software-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--tb-border);
  border-left-width: 4px;
  border-radius: var(--tb-radius);
  background: #fff;
}

.client-software-card-active {
  border-left-color: var(--tb-success);
}

.client-software-card-warning {
  border-left-color: var(--tb-warning);
}

.client-software-card-locked {
  border-left-color: var(--tb-danger);
}

.client-software-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-software-main h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.client-software-badges,
.client-software-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-software-badges {
  justify-content: flex-end;
}

.client-software-actions {
  align-items: center;
}

.client-software-actions .btn {
  min-height: 38px;
  white-space: nowrap;
}

.client-software-alert {
  padding: 10px 12px;
  font-size: 0.92rem;
}

.payment-method-card {
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 16px;
  background: #101828;
  color: #fff;
}

.payment-method-card .text-muted {
  color: #cbd5e1 !important;
}

.stripe-card {
  min-height: 46px;
  border-color: var(--tb-border);
  border-radius: var(--tb-radius);
}

.notification-menu {
  border-color: var(--tb-border);
  box-shadow: var(--tb-shadow);
}

.nav-notification-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--tb-radius);
}

.notification-count {
  top: -7px;
  right: -7px;
  border-color: #fff;
}

.topbar-actions {
  gap: 12px;
}

.header-notifications {
  flex: 0 0 auto;
  gap: 10px !important;
}

.header-action {
  min-width: 44px;
  min-height: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #475569;
  background: transparent;
  cursor: pointer;
  transition:
    background-color .2s ease,
    color .2s ease,
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;
}

.header-action:hover,
.header-action:focus {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px) scale(1.02);
}

.header-action:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.notification-icon,
.nav-notification-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.notification-icon-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.payment-icon,
.overdue-icon,
.plan-icon,
.client-icon {
  color: #475569;
  background: transparent;
}

.payment-icon:hover,
.payment-icon:focus,
.overdue-icon:hover,
.overdue-icon:focus,
.plan-icon:hover,
.plan-icon:focus,
.client-icon:hover,
.client-icon:focus {
  color: #2563eb;
  background: #eff6ff;
}

.notification-badge,
.notification-count {
  min-width: 19px;
  height: 19px;
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

.quick-action-btn {
  min-width: auto;
  min-height: 44px;
  gap: 8px;
  padding: 0 16px;
  border-color: #bfdbfe;
  color: #fff;
  background: #2563eb;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.quick-action-btn i {
  font-size: 0.9rem;
}

.quick-action-btn.dropdown-toggle::after {
  margin-left: 6px;
  vertical-align: middle;
}

.quick-action-btn:hover,
.quick-action-btn:focus {
  color: #fff;
  background: #1d4ed8;
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
  filter: brightness(1.04);
}

.user-profile.header-action {
  min-width: 0;
  min-height: 44px;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  border-color: var(--tb-border);
  background: #fff;
}

.user-profile.header-action:hover,
.user-profile.header-action:focus {
  border-color: #bfdbfe;
  color: #2563eb;
  background: #eff6ff;
}

.notification-detail-selected {
  border-left: 4px solid #2563eb;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 36%),
    #fff;
}

.notification-detail-meta,
.notification-card-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #64748b;
  font-size: 0.9rem;
}

.notification-detail-message {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.65;
}

.related-notification-grid {
  display: grid;
  gap: 12px;
}

.related-notification-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.related-notification-card:hover,
.related-notification-card:focus-within {
  border-color: #bfdbfe;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.related-notification-card p {
  color: #475569;
  line-height: 1.55;
}

.notification-card-date {
  color: #64748b;
  font-size: 0.86rem;
  white-space: nowrap;
}

.notification-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-card-action {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.notification-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed var(--tb-border);
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  font-weight: 600;
  text-align: center;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 24px;
}

.profile-hero h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.profile-company-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--tb-border);
  border-radius: 999px;
  color: #0f172a;
  background: #f8fafc;
  font-weight: 700;
  white-space: nowrap;
}

.profile-setup-alert {
  border-color: #bfdbfe;
  color: #1e3a8a;
  background: #eff6ff;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.profile-summary {
  align-self: start;
  padding: 22px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  font-size: 1.6rem;
  font-weight: 800;
}

.profile-avatar-image {
  object-fit: cover;
  border: 3px solid #e0e7ff;
  background: #fff;
}

.profile-photo-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--tb-border);
  border-radius: 14px;
  background: #f8fafc;
}

.profile-photo-preview {
  width: 88px;
  height: 88px;
  display: inline-grid;
  place-items: center;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--tb-border);
  color: #2563eb;
  font-size: 1.8rem;
  box-shadow: var(--tb-shadow-soft);
}

.profile-photo-placeholder {
  background: linear-gradient(135deg, #eff6ff, #f0fdfa);
}

.profile-photo-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-summary h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.profile-summary p {
  margin-bottom: 18px;
  color: #64748b;
}

.profile-summary-list {
  display: grid;
  gap: 12px;
}

.profile-summary-list div {
  padding: 12px;
  border: 1px solid var(--tb-border);
  border-radius: 10px;
  background: #f8fafc;
}

.profile-summary-list span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-summary-list strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.profile-edit-panel {
  padding: 24px;
}

.profile-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-section-heading h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.profile-section-heading p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
}

.profile-edit-panel .form-label {
  color: #334155;
  font-weight: 700;
}

.profile-edit-panel .form-control[readonly] {
  color: #64748b;
  background: #f8fafc;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.auth-card {
  border-radius: var(--tb-radius);
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.table-card {
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow-soft);
  overflow: hidden;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
  min-width: 720px;
}

.table-responsive > .table-sm {
  min-width: 620px;
}

.table th,
.table td {
  overflow-wrap: normal;
}

.table td {
  max-width: 360px;
}

.table .btn,
.table button,
.table .badge,
.actions-cell {
  white-space: nowrap;
}

.actions-cell {
  min-width: 150px;
}

.table .actions-cell .d-flex,
.table .actions-cell .d-inline-flex,
.table .actions-cell form {
  flex-wrap: nowrap;
}

.table .actions-cell input.form-control,
.table .actions-cell select.form-select {
  min-width: 140px;
}

.table td > form {
  margin-bottom: 0;
}

.inline-action-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.inline-action-form .form-control,
.inline-action-form .form-select {
  min-width: 150px;
}

.inline-action-form-wide .form-select {
  min-width: 210px;
}

.filter-bar > *,
.section-title > *,
.page-heading > *,
.profile-hero > *,
.card-soft,
.surface {
  min-width: 0;
}

.filter-bar .btn,
.section-title .btn,
.page-heading .btn {
  white-space: nowrap;
}

.modal-dialog {
  max-width: min(calc(100% - 24px), var(--bs-modal-width, 500px));
}

.modal-lg {
  --bs-modal-width: 800px;
}

.modal-content {
  max-height: calc(100dvh - 24px);
}

.modal-body {
  overflow-y: auto;
}

.modal-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.summary-tile .d-flex {
  gap: 10px;
}

@media (max-width: 1399.98px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .bank-cash-kpi-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .kpi-grid,
  .bank-cash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid,
  .section-grid,
  .bank-cash-detail-grid {
    grid-template-columns: 1fr;
  }

  .bank-cash-title,
  .bank-cash-actions,
  .cash-flow-filter-bar {
    align-items: stretch;
    justify-content: flex-start;
  }

  .bank-cash-title {
    flex-direction: column;
  }

  .cash-flow-filter-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .bank-cash-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .quick-action-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1199.98px) {
  .app-sidebar {
    max-width: min(86vw, var(--tb-sidebar-width));
  }

  .app-topbar {
    padding: 12px 16px;
  }

  .app-page {
    padding: 18px 14px;
  }

  .topbar-search {
    max-width: 360px;
    flex: 1 1 180px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .header-notifications {
    gap: 8px !important;
  }

  .quick-action-btn {
    padding-inline: 12px;
  }
}

@media (max-width: 991.98px) {
  .user-profile-text,
  .quick-action-btn span {
    display: none;
  }

  .quick-action-btn {
    width: 44px;
    padding-inline: 0;
  }

  .quick-action-btn.dropdown-toggle::after {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .app-body,
  .app-frame,
  .app-content,
  .app-page {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-heading {
    display: block;
  }

  .page-heading > :not(:first-child) {
    width: 100%;
    margin-top: 12px;
  }

  .page-heading .btn,
  .page-heading .btn-group,
  .page-heading > a {
    margin-top: 12px;
  }

  .page-heading > :not(:first-child) .btn,
  .page-heading > a.btn {
    width: 100%;
  }

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

  .bank-cash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .cash-flow-filter-bar .form-select,
  .cash-flow-filter-bar .form-control,
  .cash-flow-filter-bar .btn,
  .cash-flow-repair-form,
  .cash-flow-repair-form .btn {
    flex: 1 1 100%;
  }

  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .topbar-search {
    display: none;
  }

  .user-profile-text,
  .action-pill span {
    display: none;
  }

  .quick-action-btn span {
    display: none;
  }

  .quick-action-btn {
    width: 44px;
    padding-inline: 0;
  }

  .quick-action-btn.dropdown-toggle::after {
    display: none;
  }

  .header-notifications {
    margin: 0;
  }

  .app-topbar {
    gap: 10px;
    justify-content: space-between;
    padding-inline: 12px;
  }

  .table-responsive.surface {
    border-radius: var(--tb-radius);
  }

  .table-responsive > .table {
    min-width: 680px;
  }

  .table-responsive > .table-sm {
    min-width: 560px;
  }

  .table {
    font-size: 0.86rem;
  }

  .table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
  }

  .filter-bar,
  .payments-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar .search-field,
  .payments-filter-bar .search-field,
  .payments-filter-bar .filter-field,
  .payments-filter-bar .filter-date-field,
  .filter-bar .form-control,
  .filter-bar .form-select,
  .filter-bar .btn,
  .payments-filter-bar .btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .filter-bar .ms-auto {
    margin-left: 0 !important;
  }

  .cash-flow-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

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

  .cash-flow-filter-bar .form-select,
  .cash-flow-filter-bar .form-control,
  .cash-flow-filter-bar .btn,
  .cash-flow-repair-form,
  .cash-flow-repair-form .btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .surface form .row > [class*="col-"],
  .card-soft form .row > [class*="col-"] {
    width: 100%;
  }

  .col-12.d-flex.gap-2,
  .col-12.d-flex.gap-3,
  .surface form .d-flex.gap-2:not(.inline-action-form),
  .surface form .d-flex.gap-3:not(.inline-action-form) {
    align-items: stretch;
    flex-direction: column;
  }

  .col-12.d-flex.gap-2 .btn,
  .col-12.d-flex.gap-3 .btn,
  .surface form .d-grid .btn,
  .card-soft form .d-grid .btn {
    width: 100%;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .section-title .btn,
  .section-title > .badge {
    align-self: flex-start;
  }

  .mini-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .chart-card,
  .bank-cash-chart,
  .bank-breakdown-panel,
  .card-soft,
  .surface.p-4,
  .surface.p-3 {
    padding: 16px !important;
  }

  .chart-panel,
  .chart-panel canvas {
    min-height: 210px;
    height: 210px !important;
  }

  .chart-panel-donut {
    max-width: 100%;
  }

  .modal-dialog {
    max-width: calc(100% - 16px);
    margin: 8px auto;
  }

  .modal-content {
    max-height: calc(100dvh - 16px);
  }

  .profile-hero,
  .profile-photo-upload,
  .profile-section-heading,
  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-company-pill {
    justify-content: center;
    white-space: normal;
  }

  .portal-footer-inner {
    padding: 14px 16px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 24px 12px;
  }

  .auth-card .d-flex.justify-content-between {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 8px !important;
  }
}

@media (max-width: 575.98px) {
  .client-software-main {
    display: grid;
  }

  .client-software-badges,
  .client-software-actions {
    justify-content: stretch;
  }

  .client-software-actions .btn {
    width: 100%;
  }

  .portal-footer-inner {
    flex-direction: column;
    gap: 6px;
  }

  .portal-footer-separator {
    display: none;
  }

  .content-page {
    padding: 28px 14px 40px;
  }

  .content-panel {
    padding: 20px;
  }
}

@media (max-width: 479.98px) {
  :root {
    --tb-topbar-height: 62px;
  }

  .app-sidebar {
    max-width: min(92vw, var(--tb-sidebar-width));
  }

  .app-page {
    padding: 14px 10px;
  }

  .icon-btn,
  .header-action,
  .notification-icon,
  .nav-notification-btn,
  .quick-action-btn,
  .user-profile.header-action {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
  }

  .user-profile.header-action {
    padding: 4px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
  }

  .notification-menu,
  .profile-menu {
    width: calc(100vw - 20px);
    min-width: 0;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-card h1,
  .profile-hero h1 {
    font-size: 1.45rem;
  }

  .kpi-card,
  .quick-action {
    min-height: auto;
    padding: 14px;
  }

  .kpi-value {
    font-size: 1.3rem;
    overflow-wrap: anywhere;
  }

  .nav-pills {
    gap: 6px;
  }

  .nav-pills .nav-item,
  .nav-pills .nav-link {
    width: 100%;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
