:root {
  --brand-crimson: #DC143C;
  --brand-crimson-deep: #B31234;
  --brand-black: #0B0B0B;
  --brand-ink: #111827;
  --brand-ink-soft: #374151;
  --brand-muted: #6B7280;
  --brand-surface: #FFFFFF;
  --brand-surface-soft: #FCFCFD;
  --brand-page: #F7F7F8;
  --brand-border: #E5E7EB;
  --brand-border-strong: #D1D5DB;
  --brand-success: #16A34A;
  --brand-warning: #F59E0B;
  --brand-info: #2563EB;
  --brand-danger: #DC143C;
  --brand-shadow-sm: 0 12px 28px rgba(17, 24, 39, 0.06);
  --brand-shadow-md: 0 20px 48px rgba(17, 24, 39, 0.08);
  --brand-shadow-lg: 0 28px 64px rgba(11, 11, 11, 0.16);
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
  --sidebar-width: 296px;
  --topbar-height: 84px;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --primary: var(--brand-crimson);
  --black: var(--brand-black);
  --white: var(--brand-surface);
  --bg: var(--brand-page);
  --card: var(--brand-surface);
  --border: var(--brand-border);
  --text: var(--brand-ink);
  --muted: var(--brand-muted);
  --success: var(--brand-success);
  --warning: var(--brand-warning);
  --info: var(--brand-info);
  --danger: var(--brand-danger);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(220, 20, 60, 0.06), transparent 24%),
    linear-gradient(180deg, #fafafb 0%, var(--brand-page) 100%);
  color: var(--brand-ink);
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.55;
  min-height: 100vh;
}

body.login-page,
body.public-view {
  background: var(--brand-page);
}

a {
  color: inherit;
}

a:not(.btn):not(.nav-link):not(.dropdown-item) {
  color: var(--brand-crimson);
  text-decoration: none;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover,
a:not(.btn):not(.nav-link):not(.dropdown-item):focus {
  color: var(--brand-crimson-deep);
}

img {
  max-width: 100%;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
  color: var(--brand-ink);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1,
.h1 {
  font-size: clamp(2rem, 2vw + 1.5rem, 2.9rem);
}

h2,
.h2 {
  font-size: clamp(1.55rem, 1vw + 1.3rem, 2.1rem);
}

small,
.small,
.text-muted,
.form-text {
  color: var(--brand-muted) !important;
}

hr {
  border-color: var(--brand-border);
  opacity: 1;
}

::selection {
  background: rgba(220, 20, 60, 0.14);
}

.app-frame {
  display: grid;
  grid-template-columns: minmax(0, var(--sidebar-width)) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at top, rgba(220, 20, 60, 0.12), transparent 22%),
    linear-gradient(180deg, #121212 0%, #090909 100%);
  color: rgba(255, 255, 255, 0.92);
  padding: 22px 18px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.sidebar-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(220, 20, 60, 0.28), rgba(255, 255, 255, 0.08));
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.26);
}

.sidebar-brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sidebar-brand-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-title {
  color: #FFFFFF;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-subtitle {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

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

.sidebar-section-label {
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar .nav-link,
.sidebar-offcanvas .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar .nav-link:hover,
.sidebar-offcanvas .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar-offcanvas .nav-link:focus {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.sidebar .nav-link.active,
.sidebar-offcanvas .nav-link.active {
  color: #FFFFFF;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(220, 20, 60, 0.18), rgba(220, 20, 60, 0.08));
  box-shadow: inset 0 0 0 1px rgba(220, 20, 60, 0.18);
}

.sidebar .nav-link.active::before,
.sidebar-offcanvas .nav-link.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--brand-crimson);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.9;
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout .btn {
  justify-content: center;
}

.sidebar-offcanvas {
  width: min(86vw, 320px);
  background: var(--brand-black);
  color: #FFFFFF;
}

.sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-offcanvas .btn-close {
  filter: invert(1);
}

.app-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--topbar-height);
  padding: 18px 24px;
  background: rgba(11, 11, 11, 0.96);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar .btn-outline-light {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.12);
}

.topbar .btn-outline-light:hover,
.topbar .btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.topbar-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-kicker {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title {
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus,
.user-menu-toggle:active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.9), rgba(179, 18, 52, 1));
  font-weight: 700;
}

.user-menu-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.user-menu-name {
  font-size: 0.94rem;
  font-weight: 600;
}

.user-menu-role {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
}

.app-content {
  flex: 1;
  padding: clamp(20px, 2vw, 28px);
}

.app-content-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.page-header,
.page-content > .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 4px 2px 0;
  margin-bottom: 24px;
}

.page-header-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-crimson);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading {
  margin: 0;
}

.page-summary {
  max-width: 820px;
  color: var(--brand-muted);
  margin: 0;
}

.page-actions,
.listing-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.content-surface,
.card,
.modal-content,
.dropdown-menu,
.table-responsive,
.invoice-sheet,
.invoice-info-card,
.invoice-section-card,
.login-hero-card,
.metric-panel,
.quick-action-card,
.detail-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  box-shadow: var(--brand-shadow-sm);
}

.card,
.metric-panel,
.quick-action-card,
.detail-card,
.invoice-info-card,
.invoice-section-card {
  overflow: hidden;
}

.card-body,
.quick-action-card,
.detail-card,
.metric-panel {
  padding: 20px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--brand-border);
  padding: 18px 20px;
}

.page-content > form.row,
.page-content > form.mb-3,
.page-content > form.mb-4,
.filter-card,
.filters-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  box-shadow: var(--brand-shadow-sm);
}

.form-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  box-shadow: var(--brand-shadow-sm);
  padding: 22px;
}

.form-section-title {
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 700;
}

label,
.form-label {
  color: var(--brand-ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control,
.form-select,
input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--brand-border-strong);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  background: #FFFFFF;
  color: var(--brand-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

textarea,
textarea.form-control {
  min-height: 132px;
}

input::placeholder,
textarea::placeholder {
  color: #9CA3AF;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus,
button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
.dropdown-item:focus,
.dropdown-item:focus-visible {
  outline: none;
  border-color: rgba(220, 20, 60, 0.58);
  box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.14) !important;
}

.form-check-input {
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 6px;
}

.form-check-input:checked {
  background-color: var(--brand-crimson);
  border-color: var(--brand-crimson);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, #E01E45 0%, #C51237 100%) !important;
  border-color: #C51237 !important;
  color: #FFFFFF !important;
  box-shadow: 0 12px 22px rgba(220, 20, 60, 0.18);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: linear-gradient(180deg, #C51237 0%, #A6102E 100%) !important;
  border-color: #A6102E !important;
}

.btn-outline-primary,
.btn-secondary {
  background: #FFFFFF;
  color: var(--brand-ink) !important;
  border-color: var(--brand-border-strong) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-secondary:hover,
.btn-secondary:focus {
  background: rgba(220, 20, 60, 0.06) !important;
  color: var(--brand-crimson) !important;
  border-color: rgba(220, 20, 60, 0.26) !important;
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-ghost {
  background: #FFFFFF;
  color: var(--brand-ink) !important;
  border-color: var(--brand-border) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-ghost:hover,
.btn-ghost:focus {
  background: #F9FAFB !important;
  color: var(--brand-ink) !important;
  border-color: var(--brand-border-strong) !important;
}

.btn-danger,
.btn-outline-danger {
  border-color: rgba(220, 20, 60, 0.2) !important;
  color: var(--brand-danger) !important;
  background: rgba(220, 20, 60, 0.05) !important;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: rgba(220, 20, 60, 0.12) !important;
  border-color: rgba(220, 20, 60, 0.28) !important;
}

.btn-sm {
  min-height: 36px;
  padding: 0.42rem 0.72rem;
  border-radius: 10px;
  font-size: 0.82rem;
}

.dropdown-menu {
  padding: 10px;
  min-width: 220px;
  border-radius: 16px;
}

.dropdown-toggle::after {
  margin-left: 10px;
}

.dropdown-item {
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--brand-ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(220, 20, 60, 0.06);
  color: var(--brand-crimson);
}

.dropdown-divider {
  border-color: var(--brand-border);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 14px 16px;
  box-shadow: var(--brand-shadow-sm);
}

.alert::before {
  font-family: "bootstrap-icons";
  font-size: 1rem;
  margin-top: 1px;
}

.alert-info {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.14);
  color: #1D4ED8;
}

.alert-info::before {
  content: "\f431";
}

.alert-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.16);
  color: #15803D;
}

.alert-success::before {
  content: "\f26a";
}

.alert-warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.18);
  color: #B45309;
}

.alert-warning::before {
  content: "\f333";
}

.alert-danger,
.alert-error {
  background: rgba(220, 20, 60, 0.08);
  border-color: rgba(220, 20, 60, 0.16);
  color: var(--brand-crimson-deep);
}

.alert-danger::before,
.alert-error::before {
  content: "\f62a";
}

.badge,
.status-badge,
[class*="text-bg-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.badge.text-bg-success,
.status-active,
.status-paid,
.status-account-active {
  background: rgba(22, 163, 74, 0.12) !important;
  border-color: rgba(22, 163, 74, 0.15) !important;
  color: #15803D !important;
}

.badge.text-bg-warning,
.status-pending,
.status-unassigned,
.status-no-lease {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.16) !important;
  color: #B45309 !important;
}

.badge.text-bg-info,
.status-upcoming,
.status-info {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(37, 99, 235, 0.14) !important;
  color: #1D4ED8 !important;
}

.badge.text-bg-secondary,
.badge.text-bg-dark,
.status-draft,
.status-inactive,
.status-archived,
.status-expired,
.status-terminated {
  background: rgba(17, 24, 39, 0.08) !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
  color: #4B5563 !important;
}

.badge.text-bg-danger,
.status-overdue,
.status-danger {
  background: rgba(220, 20, 60, 0.10) !important;
  border-color: rgba(220, 20, 60, 0.14) !important;
  color: var(--brand-crimson-deep) !important;
}

.table-responsive {
  width: 100%;
  overflow: auto;
}

.table {
  margin: 0;
  vertical-align: middle;
  color: var(--brand-ink);
}

.table > :not(caption) > * > * {
  padding: 14px 16px;
  border-bottom-color: #EEF2F7;
}

.table thead th {
  background: #111111;
  color: #FFFFFF;
  border-bottom: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody tr:nth-child(even) {
  background: rgba(247, 247, 248, 0.45);
}

.table tbody tr:hover {
  background: rgba(220, 20, 60, 0.05);
}

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

.page-content > .table-responsive,
.page-content > .table-card,
.page-content > .bg-white.table-responsive {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  box-shadow: var(--brand-shadow-sm);
  background: var(--brand-surface);
}

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

.kpi-card {
  grid-column: span 3;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 1));
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  box-shadow: var(--brand-shadow-sm);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.14), rgba(11, 11, 11, 0.08));
  color: var(--brand-crimson);
  font-size: 1.2rem;
}

.kpi-label {
  margin: 0 0 6px;
  color: var(--brand-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.kpi-value {
  margin: 0;
  color: var(--brand-ink);
  font-size: clamp(1.4rem, 1vw + 1rem, 2.05rem);
  font-weight: 800;
  line-height: 1.08;
}

.kpi-meta {
  margin-top: 8px;
  color: var(--brand-muted);
  font-size: 0.8rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(220, 20, 60, 0.16), transparent 18%),
    linear-gradient(135deg, #171717 0%, #0D0D0D 58%, #1A1A1A 100%);
  color: #FFFFFF;
  box-shadow: var(--brand-shadow-lg);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 20, 60, 0.22), transparent 70%);
}

.hero-panel h1,
.hero-panel h2,
.hero-panel h3,
.hero-panel h4,
.hero-panel h5,
.hero-panel h6,
.hero-panel p,
.hero-panel span,
.hero-panel small,
.hero-panel .text-muted {
  color: inherit !important;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-actions .btn-outline-secondary,
.hero-actions .btn-outline-dark,
.hero-actions .btn-outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.hero-actions .btn-outline-secondary:hover,
.hero-actions .btn-outline-dark:hover,
.hero-actions .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.metric-tile {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.metric-tile-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-tile-value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

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

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.form-layout-wide {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.72fr);
}

.form-sidebar,
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  grid-column: span 6;
}

.detail-card h5,
.detail-card h6 {
  margin-bottom: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.summary-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--brand-border);
  background: rgba(247, 247, 248, 0.78);
}

.summary-card-label {
  color: var(--brand-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card-value {
  margin-top: 8px;
  color: var(--brand-ink);
  font-size: 1.15rem;
  font-weight: 700;
}

.panel-muted {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--brand-border-strong);
  background: rgba(247, 247, 248, 0.78);
}

.data-list {
  display: flex;
  flex-direction: column;
}

.data-list-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--brand-border);
}

.data-list-row:first-child {
  padding-top: 0;
}

.data-list-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.data-list-label {
  color: var(--brand-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.data-list-value {
  color: var(--brand-ink);
  font-weight: 600;
  text-align: right;
}

.data-list-value-subtle {
  color: var(--brand-muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.note-list,
.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-list li {
  display: flex;
  gap: 10px;
  color: var(--brand-muted);
}

.note-list li i {
  color: var(--brand-crimson);
  margin-top: 2px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--brand-border);
  background: #FFFFFF;
}

.attachment-item-title {
  font-weight: 600;
  color: var(--brand-ink);
}

.attachment-item-meta {
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.listing-toolbar,
.section-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.inline-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.05);
  color: var(--brand-ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--brand-muted);
}

.page-link {
  border: 1px solid var(--brand-border);
  color: var(--brand-ink);
  border-radius: 12px !important;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}

.page-item.active .page-link,
.page-link:hover,
.page-link:focus {
  background: rgba(220, 20, 60, 0.08);
  color: var(--brand-crimson);
  border-color: rgba(220, 20, 60, 0.2);
}

.invoice-sheet {
  padding: 0;
}

.invoice-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--brand-border);
}

.invoice-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.invoice-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(220, 20, 60, 0.10);
  color: var(--brand-crimson);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(220, 20, 60, 0.14);
}

.invoice-info-card,
.invoice-section-card {
  padding: 18px;
}

.invoice-line-table thead th {
  background: #111111;
  color: #FFFFFF;
}

.invoice-financials {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invoice-financials-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.invoice-total-row {
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--brand-border);
  font-size: 1.12rem;
  font-weight: 700;
}

.app-footer {
  padding: 16px 28px 28px;
  color: var(--brand-muted);
}

.app-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--brand-shadow-sm);
}

.login-experience {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, rgba(11, 11, 11, 0.94), rgba(11, 11, 11, 0.82));
}

.login-showcase,
.login-form-panel {
  position: relative;
  z-index: 2;
}

.login-showcase {
  display: flex;
  align-items: flex-end;
  padding: 40px;
  color: #FFFFFF;
}

.login-showcase-card {
  max-width: 620px;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  padding: 0;
}

.login-form-card {
  width: 100%;
  max-width: 460px;
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--brand-shadow-lg);
}

.login-form-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-form-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.login-form-brand-title {
  color: var(--brand-ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.login-form-brand-subtitle {
  color: var(--brand-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.login-brand-pill img {
  width: 26px;
  height: 26px;
}

.login-form-card .alert {
  box-shadow: none;
}

.login-highlight-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.login-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.login-highlight-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(220, 20, 60, 0.16);
}

.modal-header,
.modal-footer {
  border-color: var(--brand-border);
}

@media (max-width: 1399.98px) {
  .kpi-card {
    grid-column: span 4;
  }
}

@media (max-width: 1199.98px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .topbar {
    padding: 16px 18px;
  }

  .detail-card {
    grid-column: span 12;
  }

  .form-layout,
  .form-layout-wide {
    grid-template-columns: 1fr;
  }

  .login-experience {
    padding: 32px 20px;
  }
}

@media (max-width: 991.98px) {
  .kpi-card {
    grid-column: span 6;
  }

  .page-header,
  .listing-toolbar,
  .section-toolbar,
  .app-footer-inner,
  .data-list-row,
  .attachment-item,
  .topbar-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-meta {
    justify-content: space-between;
  }

  .login-form-panel {
    max-width: 100%;
  }
}

@media (max-width: 767.98px) {
  .app-content {
    padding: 18px 14px 24px;
  }

  .card-body,
  .page-content > form.row,
  .page-content > form.mb-3,
  .page-content > form.mb-4,
  .form-card,
  .panel-muted,
  .invoice-info-card,
  .invoice-section-card,
  .hero-panel,
  .login-form-card {
    padding: 18px;
  }

  .kpi-card {
    grid-column: span 12;
  }

  .table-responsive table,
  .table-responsive thead,
  .table-responsive tbody,
  .table-responsive th,
  .table-responsive td,
  .table-responsive tr {
    display: block;
    width: 100%;
  }

  .table-responsive thead {
    display: none;
  }

  .table-responsive tbody tr {
    padding: 14px 14px 8px;
    border-bottom: 1px solid var(--brand-border);
    background: #FFFFFF;
  }

  .table-responsive tbody tr:nth-child(even) {
    background: #FFFFFF;
  }

  .table-responsive tbody td {
    border: 0;
    padding: 8px 0;
    text-align: left !important;
  }

  .table-responsive tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--brand-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .table-responsive tbody td .btn,
  .table-responsive tbody td form {
    margin-top: 6px;
  }

  .table-responsive tbody td form.d-inline {
    display: inline-flex !important;
  }

  .hero-actions,
  .page-actions,
  .listing-actions,
  .action-row {
    width: 100%;
  }

  .hero-actions .btn,
  .page-actions .btn,
  .listing-actions .btn,
  .action-row .btn {
    flex: 1 1 100%;
  }

  .login-form-panel {
    padding: 0;
  }

  .login-experience {
    padding: 20px 14px;
  }

  .login-form-brand {
    gap: 12px;
  }
}

@media (max-width: 575.98px) {
  .login-form-brand {
    align-items: flex-start;
  }

  .login-btn {
    min-height: 48px;
  }
}
