:root {
  --ct-bg: #f8fafc;
  --ct-card: #ffffff;
  --ct-primary: #2563eb;
  --ct-primary-hover: #1d4ed8;
  --ct-success: #16a34a;
  --ct-warning: #ea580c;
  --ct-danger: #dc2626;
  --ct-border: #e2e8f0;
  --ct-text: #0f172a;
  --ct-text-2: #475569;
  --ct-muted: #94a3b8;
  --ct-shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --ct-shadow-lg: 0 24px 70px rgba(15, 23, 42, .12);
  --ct-radius: 16px;
  --ct-sidebar: 292px;
  --ct-topbar: 76px;
}

* { box-sizing: border-box; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% -12%, rgba(37, 99, 235, .10), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(22, 163, 74, .08), transparent 26rem),
    var(--ct-bg);
  color: var(--ct-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

button, a, input, select, textarea, .card, .dropdown-menu {
  transition: all .2s ease;
}

::selection { background: rgba(37, 99, 235, .18); }
::placeholder { color: var(--ct-muted); opacity: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.app-shell { min-height: 100vh; display: flex; }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--ct-sidebar);
  min-height: 100vh;
  padding: 22px 18px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--ct-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
}

.sidebar-brand { 
/*    margin-bottom: 18px;*/

}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
/*  background: linear-gradient(135deg, var(--ct-primary), #38bdf8);
  box-shadow: 0 14px 26px rgba(37, 99, 235, .24);*/
}

.brand-mark svg { width: 22px; height: 22px; }
.brand-title { display: block; font-size: 1.48rem; line-height: 1.05; font-weight: 800; letter-spacing: 0; }
.brand-subtitle { display: block; margin-top: 3px; font-size: .72rem; font-weight: 700; color: var(--ct-muted); text-transform: uppercase; letter-spacing: .08em; }

.workspace-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: 8px 0 22px;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.workspace-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ct-primary);
  background: rgba(37, 99, 235, .10);
}

.workspace-label { margin: 0; font-size: .72rem; font-weight: 700; color: var(--ct-muted); text-transform: uppercase; }
.workspace-name { margin: 0; font-size: .9rem; font-weight: 700; color: var(--ct-text); }
.workspace-chevron { margin-left: auto; width: 16px; color: var(--ct-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav-section-label { margin: 0 10px 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--ct-muted); letter-spacing: .08em; }

.sidebar-nav .nav-link {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 4px;
  border-radius: 13px;
  color: var(--ct-text-2);
  font-weight: 650;
}

.sidebar-nav .nav-link svg { width: 19px; height: 19px; color: var(--ct-muted); }
.sidebar-nav .nav-link:hover { background: #f1f5f9; color: var(--ct-text); transform: translateX(2px); }
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, .13), rgba(56, 189, 248, .08));
  color: var(--ct-primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .10);
}
.sidebar-nav .nav-link.active svg { color: var(--ct-primary); }

.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 8px; }
.sidebar-user-name, .sidebar-user-role { margin: 0; }
.sidebar-user-name { font-weight: 750; font-size: .92rem; }
.sidebar-user-role { color: var(--ct-muted); font-size: .78rem; }

.app-main {
  width: 100%;
  min-width: 0;
  padding-left: var(--ct-sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--ct-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(248, 250, 252, .82);
  border-bottom: 1px solid rgba(226, 232, 240, .85);
  backdrop-filter: blur(20px);
}

.topbar-search {
  flex: 1;
  max-width: 680px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px 0 16px;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.topbar-search:focus-within {
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10), 0 12px 30px rgba(15, 23, 42, .06);
}

.topbar-search svg { width: 19px; color: var(--ct-text-2); }
.topbar-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ct-text);
  font-weight: 550;
}
.search-shortcut {
  padding: 4px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--ct-muted);
  font-size: .72rem;
  font-weight: 800;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ct-border);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .88);
  color: var(--ct-text-2);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.icon-btn:hover { color: var(--ct-primary); border-color: rgba(37, 99, 235, .28); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

.profile-trigger {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--ct-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.profile-trigger:hover { border-color: rgba(37, 99, 235, .28); transform: translateY(-1px); }
.profile-trigger > svg { width: 16px; color: var(--ct-muted); }

.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, var(--ct-primary));
  font-size: .82rem;
  font-weight: 800;
}
.avatar-lg { width: 44px; height: 44px; flex-basis: 44px; }
.profile-copy { line-height: 1.1; text-align: left; }
.profile-name { display: block; max-width: 120px; font-size: .86rem; font-weight: 800; color: var(--ct-text); }
.profile-role { display: block; margin-top: 2px; color: var(--ct-muted); font-size: .72rem; font-weight: 700; }

.dropdown-menu {
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: var(--ct-shadow-lg);
  padding: 8px;
  animation: dropdownIn .16s ease both;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-menu { min-width: 270px; }
.profile-menu-head { display: flex; gap: 12px; align-items: center; padding: 12px; }
.profile-menu-name, .profile-menu-role { margin: 0; }
.profile-menu-name { font-weight: 800; }
.profile-menu-role { font-size: .82rem; color: var(--ct-muted); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--ct-text-2);
  font-weight: 650;
}
.dropdown-item:hover { background: #f1f5f9; color: var(--ct-primary); }
.dropdown-item svg { width: 17px; height: 17px; }
.dropdown-divider { border-color: var(--ct-border); margin: 6px 4px; }

.content-wrap {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 32px 28px 48px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ct-primary);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.page-title { margin: 0; font-size: clamp(1.85rem, 2.4vw, 2.65rem); line-height: 1.08; font-weight: 800; color: var(--ct-text); }
.page-subtitle { margin: 10px 0 0; max-width: 680px; color: var(--ct-text-2); font-size: 1rem; }

.ct-card,
.invoice-card-shadow,
.bg-surface-container-lowest {
  background: var(--ct-card) !important;
  border: 1px solid var(--ct-border) !important;
  border-radius: var(--ct-radius) !important;
  box-shadow: var(--ct-shadow) !important;
}
.ct-card { overflow: hidden; }
.ct-card:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(15, 23, 42, .09) !important; }

.btn {
  border-radius: 12px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary-gradient,
.btn-primary,
.bg-primary {
  border: 0 !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--ct-primary), #38bdf8) !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .20);
}
.btn-primary-gradient:hover,
.btn-primary:hover,
.bg-primary:hover {
  color: #fff !important;
  background: linear-gradient(135deg, var(--ct-primary-hover), #0ea5e9) !important;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, .26);
}
.btn-soft {
  color: var(--ct-primary);
  background: rgba(37, 99, 235, .09);
  border: 1px solid rgba(37, 99, 235, .16);
}
.btn-soft:hover { color: var(--ct-primary-hover); background: rgba(37, 99, 235, .13); }

.form-control,
.form-select,
input:not([type=checkbox]):not([type=radio]),
select,
textarea {
  border: 1px solid var(--ct-border) !important;
  border-radius: 14px !important;
  color: var(--ct-text) !important;
  background-color: #fff !important;
  min-height: 46px;
}
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, .58) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .11) !important;
  outline: 0;
}

.table,
table {
  color: var(--ct-text);
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th,
table thead th {
  background: #f8fafc;
  color: var(--ct-text-2);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ct-border);
  white-space: nowrap;
}
.table td,
.table th,
table td,
table th {
  padding: 1rem 1.25rem;

/* Invoice items table layout tweaks */
.invoice-items-table table th:nth-child(1),
.invoice-items-table table td:nth-child(1) {
  width: 30%;
}
.invoice-items-table table th:nth-child(2),
.invoice-items-table table td:nth-child(2) {
  width: 24%;
}
.invoice-items-table table th:nth-child(3),
.invoice-items-table table td:nth-child(3) {
  width: 10%;
}
.invoice-items-table table th:nth-child(4),
.invoice-items-table table td:nth-child(4) {
  width: 8%;
}
.invoice-items-table table th:nth-child(5),
.invoice-items-table table td:nth-child(5) {
  width: 12%;
}
.invoice-items-table table th:nth-child(6),
.invoice-items-table table td:nth-child(6) {
  width: 12%;
}
.invoice-items-table table th:nth-child(7),
.invoice-items-table table td:nth-child(7) {
  width: 4%;
}

.invoice-items-table input,
.invoice-items-table select {
  padding: 10px 14px !important;
  border-radius: 12px !important;
  height: 44px !important;
}

.invoice-items-table .product-select {
  font-weight: 600;
}

.invoice-items-table .quantity {
  max-width: 110px;
  margin-left: auto;
}

.invoice-items-table .unitPrice,
.invoice-items-table .totalPrice {
  max-width: 160px;
  margin-left: auto;
}

.invoice-items-table .remove-item {
  min-width: 40px;
  min-height: 40px;
}
  vertical-align: middle;
  border-color: var(--ct-border);
}
tbody tr { background: #fff; }
tbody tr:hover { background: #f8fafc; }

.badge-soft-success { color: #15803d; background: #dcfce7; }
.badge-soft-warning { color: #c2410c; background: #ffedd5; }
.badge-soft-danger { color: #b91c1c; background: #fee2e2; }
.badge-soft-primary { color: var(--ct-primary); background: rgba(37, 99, 235, .10); }

.text-on-surface-variant { color: var(--ct-text-2) !important; }
.text-error { color: var(--ct-danger) !important; }
.text-green-600 { color: var(--ct-success) !important; }
.text-orange-600 { color: var(--ct-warning) !important; }
.surface-muted { background: #f8fafc; }

.material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-size: 22px;
  font-family: "Material Symbols Outlined";
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--ct-shadow-lg); }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1039;
    background: rgba(15, 23, 42, .34);
    opacity: 0;
    pointer-events: none;
    transition: all .2s ease;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .app-main { padding-left: 0; }
  .topbar { padding: 0 16px; }
  .content-wrap { padding: 24px 16px 40px; }
  .search-shortcut { display: none; }
}

@media (max-width: 575.98px) {
  .topbar-search { max-width: none; height: 42px; }
  .topbar-actions { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .profile-trigger { padding-right: 5px; }
  .profile-trigger > svg { display: none; }
}

@media print {
  .app-sidebar, .topbar { display: none !important; }
  .app-main { padding-left: 0; }
  body { background: #fff; }
}

.login-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #f8fafc;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(440px, .9fr);
}

.login-preview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(37, 99, 235, .88)),
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, .35), transparent 24rem);
}

.login-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), transparent);
}

.preview-glow {
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  opacity: .55;
}
.preview-glow-one { top: 8%; right: 8%; background: #38bdf8; }
.preview-glow-two { bottom: 10%; left: 8%; background: #16a34a; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}
.login-brand .brand-subtitle { color: rgba(255,255,255,.68); }
.login-brand .brand-title { color: #fff; }

.preview-copy { max-width: 620px; margin-top: 8vh; }
.preview-copy .page-kicker { color: #bfdbfe; }
.preview-copy h2 {
  margin: 12px 0 18px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: .98;
  font-weight: 500;
  letter-spacing: 0;
}
.preview-copy p {
  max-width: 560px;
  color: rgba(255,255,255,.76);
  font-size: 1.08rem;
  line-height: 1.75;
}

.dashboard-preview-card {
  width: min(100%, 620px);
  margin-top: 48px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 28px;
  background: rgba(255,255,255,.14);
  box-shadow: 0 30px 90px rgba(0,0,0,.24);
  backdrop-filter: blur(22px);
}
.preview-toolbar { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.78); font-size: .82rem; }
.preview-toolbar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.42); }
.preview-toolbar strong { margin-left: auto; font-weight: 700; }
.preview-chart { margin: 20px 0 12px; padding: 14px; border-radius: 22px; background: rgba(255,255,255,.92); }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.14);
}
.preview-grid span, .floating-metric span { display: block; color: rgba(255,255,255,.66); font-size: .78rem; font-weight: 700; }
.preview-grid strong, .floating-metric strong { display: block; margin-top: 4px; color: #fff; font-size: 1rem; font-weight: 800; }

.floating-metric {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  background: rgba(255,255,255,.15);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  backdrop-filter: blur(18px);
}
.floating-metric svg { color: #bfdbfe; }
.metric-one { right: 8%; top: 26%; }
.metric-two { left: 10%; bottom: 9%; }

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
}

.login-card {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(226, 232, 240, .78);
  border-radius: 24px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--ct-shadow-lg);
  backdrop-filter: blur(18px);
}
.login-card-head h2 { margin: 8px 0 8px; font-size: 2rem; font-weight: 800; }
.login-card-head p { margin: 0 0 28px; color: var(--ct-text-2); }
.login-form { display: grid; gap: 18px; }
.form-group label { margin-bottom: 8px; color: var(--ct-text); font-size: .86rem; font-weight: 800; }
.input-with-icon { position: relative; }
.input-with-icon svg {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 20px;
  height: 20px;
  color: var(--ct-muted);
  transform: translateY(-50%);
}
.input-with-icon .form-control {
  height: 56px;
  padding-left: 50px;
  border-radius: 14px !important;
  font-weight: 600;
}
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ct-text-2);
  font-size: .9rem;
}
.login-options a { color: var(--ct-primary); font-weight: 750; }
.login-submit { width: 100%; min-height: 54px; margin-top: 6px; border-radius: 16px; font-size: 1rem; }
.login-footer { margin: 24px auto 0; color: var(--ct-muted); font-size: .86rem; }

@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-preview { min-height: 480px; }
  .floating-metric { display: none; }
  .login-panel { padding-top: 32px; }
}

@media (max-width: 575.98px) {
  .login-preview { min-height: auto; padding: 24px; }
  .preview-copy { margin-top: 42px; }
  .dashboard-preview-card { display: none; }
  .preview-grid { grid-template-columns: 1fr; }
  .login-panel { padding: 18px; }
}

.dashboard-page { display: grid; gap: 24px; }
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--ct-border);
  border-radius: 20px;
  background: var(--ct-card);
  box-shadow: var(--ct-shadow);
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--kpi-color, var(--ct-primary));
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kpi-color, var(--ct-primary)) 13%, transparent);
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 22px 52px rgba(15, 23, 42, .10); }
.kpi-primary { --kpi-color: var(--ct-primary); }
.kpi-danger { --kpi-color: var(--ct-danger); }
.kpi-success { --kpi-color: var(--ct-success); }
.kpi-warning { --kpi-color: var(--ct-warning); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.kpi-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--kpi-color);
  background: color-mix(in srgb, var(--kpi-color) 10%, white);
}
.kpi-icon svg { width: 23px; height: 23px; }
.kpi-pill {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--kpi-color);
  background: color-mix(in srgb, var(--kpi-color) 10%, white);
  font-size: .74rem;
  font-weight: 850;
}
.kpi-card p { margin: 0; color: var(--ct-text-2); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.kpi-card h2 { margin: 8px 0 18px; font-size: clamp(1.6rem, 2vw, 2.05rem); font-weight: 850; letter-spacing: 0; }
.sparkline { display: flex; align-items: flex-end; gap: 6px; height: 34px; }
.sparkline span {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--kpi-color) 60%, white), color-mix(in srgb, var(--kpi-color) 18%, white));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
.dashboard-left, .dashboard-right { display: grid; gap: 24px; min-width: 0; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--ct-border);
}
.card-head h2 { margin: 2px 0 0; font-size: 1.12rem; font-weight: 850; }
.card-eyebrow { color: var(--ct-muted); font-size: .74rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.chart-card { min-height: 430px; }
.revenue-chart { padding: 8px 14px 18px; }

.modern-table .customer-cell { display: flex; align-items: center; gap: 12px; }
.modern-table .customer-cell > span {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--ct-primary);
  background: rgba(37, 99, 235, .10);
  font-weight: 850;
}
.modern-table strong { display: block; font-weight: 800; }
.modern-table small { color: var(--ct-muted); font-weight: 650; }
.rank-badge {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--ct-text-2);
  font-weight: 850;
}
.empty-state { padding: 54px 24px; text-align: center; color: var(--ct-muted); }
.empty-state svg { width: 42px; height: 42px; margin-bottom: 12px; }

.quick-card { background: linear-gradient(180deg, #fff, #f8fafc) !important; }
.quick-actions { display: grid; gap: 12px; padding: 18px; }
.quick-actions a {
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  background: #fff;
}
.quick-actions a:hover {
  border-color: rgba(37, 99, 235, .28);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .07);
}
.quick-actions a > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ct-primary);
  background: rgba(37, 99, 235, .10);
}
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-weight: 850; }
.quick-actions small { color: var(--ct-muted); font-weight: 650; }
.quick-actions a > svg { color: var(--ct-muted); width: 18px; }

.activity-list { display: grid; gap: 6px; padding: 16px 20px 22px; }
.activity-list > div { display: flex; gap: 12px; padding: 11px 0; }
.activity-list p { margin: 0; color: var(--ct-text-2); line-height: 1.55; }
.activity-list strong { color: var(--ct-text); }
.activity-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .10);
}
.activity-dot.primary { background: var(--ct-primary); }
.activity-dot.success { background: var(--ct-success); box-shadow: 0 0 0 5px rgba(22, 163, 74, .10); }
.activity-dot.danger { background: var(--ct-danger); box-shadow: 0 0 0 5px rgba(220, 38, 38, .10); }
.distribution-card #distributionChart { padding: 0 10px 14px; }

@media (max-width: 1199.98px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-right .quick-card { grid-row: span 2; }
}

@media (max-width: 767.98px) {
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .kpi-grid, .dashboard-right { grid-template-columns: 1fr; }
  .card-head { padding: 18px; align-items: flex-start; flex-direction: column; }
  .hero-actions, .hero-actions .btn { width: 100%; }
}

/* Minimal enterprise refinement */
:root {
  --ct-bg: #f8fafc;
  --ct-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 18px rgba(15, 23, 42, .04);
  --ct-shadow-lg: 0 10px 28px rgba(15, 23, 42, .10);
  --ct-radius: 14px;
  --ct-topbar: 64px;
}

body {
  background: var(--ct-bg);
}

button, a, input, select, textarea, .card, .dropdown-menu,
.ct-card, .kpi-card, .quick-actions a, .icon-btn, .profile-trigger, .sidebar-nav .nav-link {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.topbar {
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(248, 250, 252, .94);
}

.topbar-spacer {
  flex: 1;
}

.topbar-search {
  display: none !important;
}

.content-wrap {
  width: 100%;
  max-width: 1540px;
  margin: 0;
  padding: 24px;
}

.app-sidebar {
  padding: 18px 16px;
  background: rgba(255, 255, 255, .96);
}

.brand-mark {
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}

.workspace-card {
  margin: 6px 0 16px;
  padding: 10px;
  box-shadow: none;
  background: #fff;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  transform: none;
}

.sidebar-nav .nav-link.active {
  background: rgba(37, 99, 235, .10);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}

.icon-btn,
.profile-trigger {
  box-shadow: none;
  background: #fff;
}

.icon-btn:hover,
.profile-trigger:hover {
  transform: none;
  border-color: rgba(37, 99, 235, .28);
  background: #f8fafc;
}

.dropdown-menu {
  animation: dropdownFade .12s ease both;
  box-shadow: var(--ct-shadow-lg);
}

@keyframes dropdownFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-header,
.dashboard-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 16px;
}

.breadcrumb-line {
  margin: 0;
  color: var(--ct-muted);
  font-size: .84rem;
  font-weight: 600;
}

.page-title,
.font-headline-lg.text-headline-lg {
  margin: 0;
  color: var(--ct-text);
  font-size: 1.75rem !important;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: 0;
}

.page-subtitle {
  margin-top: 4px;
  color: var(--ct-text-2);
  font-size: .95rem;
}

.page-kicker {
  margin: 0;
  color: var(--ct-muted);
  font-size: .84rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-page,
.space-y-gutter,
.dashboard-left,
.dashboard-right {
  gap: 8px !important;
}

.kpi-grid,
.dashboard-grid {
  gap: 8px;
}

.kpi-card,
.ct-card,
.invoice-card-shadow,
.bg-surface-container-lowest {
  border-radius: 14px !important;
  box-shadow: var(--ct-shadow) !important;
}

.ct-card:hover,
.kpi-card:hover,
.quick-actions a:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 22px rgba(15, 23, 42, .06) !important;
}

.kpi-card {
  min-height: 150px;
  padding: 18px;
}

.kpi-card::after {
  display: none;
}

.kpi-top {
  margin-bottom: 14px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.kpi-card h2 {
  margin: 6px 0 12px;
  font-size: 1.55rem;
}

.sparkline {
  height: 22px;
  opacity: .72;
}

.card-head {
  padding: 16px 18px;
}

.revenue-chart {
  padding: 0 10px 10px;
}

.chart-card {
  min-height: auto;
}

.quick-actions {
  gap: 8px;
  padding: 12px;
}

.quick-actions a {
  padding: 12px;
}

.btn,
.btn-primary-gradient,
.btn-primary,
.bg-primary {
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06) !important;
  background: var(--ct-primary) !important;
}

.btn:hover,
.btn-primary-gradient:hover,
.btn-primary:hover,
.bg-primary:hover {
  transform: none !important;
  background: var(--ct-primary-hover) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .10) !important;
}

.btn-soft:hover {
  background: rgba(37, 99, 235, .12);
}

.content-wrap .mx-auto {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.content-wrap .max-w-2xl,
.content-wrap .max-w-4xl,
.content-wrap .max-w-6xl {
  max-width: none !important;
}

.floating-metric {
  display: none;
}

.login-card,
.dashboard-preview-card {
  box-shadow: var(--ct-shadow) !important;
}

.preview-glow {
  opacity: .22;
}

.table td,
.table th,
table td,
table th {
  padding: .82rem 1rem;
}

@media (max-width: 991.98px) {
  .content-wrap {
    padding: 18px 14px 32px;
  }
}

/* Final ERP-grade consistency pass */
.app-sidebar {
  padding-bottom: 18px;
}

.sidebar-nav {
  padding-bottom: 4px;
}

.btn,
button[class*="px-3"],
button[class*="px-4"],
a[class*="px-3"],
a[class*="px-4"] {
  min-height: 34px;
  border-radius: 10px !important;
  font-weight: 700;
}

.btn-primary,
.btn-primary-gradient,
.bg-primary {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

.btn-primary:hover,
.btn-primary-gradient:hover,
.bg-primary:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
}

.btn-secondary,
.btn-soft,
.bg-secondary,
.btn-light,
button.bg-secondary,
a.bg-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

.btn-secondary:hover,
.btn-soft:hover,
.bg-secondary:hover,
.btn-light:hover,
button.bg-secondary:hover,
a.bg-secondary:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

.btn-success,
.bg-success,
.btn-outline-success {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}

.btn-success:hover,
.bg-success:hover,
.btn-outline-success:hover {
  background: #bbf7d0 !important;
  color: #14532d !important;
}

.btn-danger,
.bg-error,
.bg-danger,
button.bg-error,
a.bg-error {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important;
}

.btn-danger:hover,
.bg-error:hover,
.bg-danger:hover,
button.bg-error:hover,
a.bg-error:hover {
  background: #fecaca !important;
  color: #7f1d1d !important;
}

.btn-warning,
.bg-warning {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.btn-warning:hover,
.bg-warning:hover {
  background: #fde68a !important;
  color: #78350f !important;
}

.btn-outline-secondary,
.btn-outline-primary {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.text-on-primary {
  color: #fff !important;
}

.action-buttons,
.table-actions,
td .flex.items-center.justify-end.gap-2,
td .flex.items-center.justify-end.gap-2.flex-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px !important;
  flex-wrap: wrap;
}

.action-buttons .btn,
.table-actions .btn,
td .flex.items-center.justify-end.gap-2 > *,
td .flex.items-center.justify-end.gap-2.flex-wrap > * {
  min-height: 32px;
  padding: 6px 10px !important;
  border-radius: 9px !important;
  line-height: 1.2;
}

.ct-modal-overlay {
  background: rgba(15, 23, 42, .35) !important;
}

.notification-trigger {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  border: 2px solid #fff;
  font-size: .68rem;
  font-weight: 800;
}

.notification-menu {
  width: min(380px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ct-border);
}

.notification-head strong,
.notification-head span {
  display: block;
}

.notification-head strong {
  color: var(--ct-text);
  font-size: .98rem;
}

.notification-head span {
  margin-top: 2px;
  color: var(--ct-muted);
  font-size: .78rem;
}

.notification-mark-read {
  border: 0;
  background: transparent;
  color: var(--ct-primary);
  font-size: .78rem;
  font-weight: 800;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.notification-item {
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.notification-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.notification-item.unread {
  background: #eff6ff;
  border-color: #dbeafe;
}

.notification-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: #2563eb;
}

.notification-dot.success { background: #16a34a; }
.notification-dot.warning { background: #ea580c; }
.notification-dot.invoice { background: #2563eb; }
.notification-dot.customer { background: #64748b; }

.notification-copy strong,
.notification-copy small,
.notification-copy em {
  display: block;
}

.notification-copy strong {
  color: var(--ct-text);
  font-size: .88rem;
}

.notification-copy small {
  margin-top: 2px;
  color: var(--ct-text-2);
  line-height: 1.35;
}

.notification-copy em {
  margin-top: 5px;
  color: var(--ct-muted);
  font-size: .72rem;
  font-style: normal;
  font-weight: 700;
}

.alertify-notifier {
  z-index: 2000;
}

.alertify-notifier .ajs-message {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 650;
}

.alertify-notifier .ajs-message.ajs-success {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.alertify-notifier .ajs-message.ajs-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.alertify-notifier .ajs-message.ajs-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.alertify .ajs-dialog {
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
}

.alertify .ajs-header,
.alertify .ajs-footer {
  background: #fff;
  border-color: #e2e8f0;
}

.alertify .ajs-button.ajs-ok {
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  border: 0;
}

.alertify .ajs-button.ajs-cancel {
  background: #f1f5f9;
  color: #334155;
  border-radius: 10px;
  border: 0;
}
