:root {
  --sf-primary: #0c1036;
  --sf-primary-700: #151b4a;
  --sf-accent: #29a29f;
  --sf-accent-soft: rgba(41, 162, 159, 0.12);
  --sf-gold: #e7b019;
  --sf-bg: #f5f7fb;
  --sf-surface: rgba(255, 255, 255, 0.92);
  --sf-surface-solid: #ffffff;
  --sf-border: #e6eaf2;
  --sf-border-strong: #d8deea;
  --sf-muted: #697386;
  --sf-text: #15192c;
  --sf-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --sf-shadow-md: 0 18px 45px rgba(15, 23, 42, 0.09);
  --sf-radius: 16px;
  --sf-radius-sm: 12px;
  --sf-sidebar-width: 292px;
  --sf-topbar-height: 84px;
}

html {
  min-height: 100%;
}

body.sf-admin-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(41, 162, 159, 0.11), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(231, 176, 25, 0.12), transparent 26%),
    var(--sf-bg);
  color: var(--sf-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

a {
  color: var(--sf-primary-700);
  text-decoration: none;
}

a:hover {
  color: var(--sf-accent);
}

.sf-admin-shell {
  display: flex;
  min-height: 100vh;
}

.sf-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sf-sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(230, 234, 242, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 16px 0 40px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(20px);
}

.sf-sidebar-brand {
  padding: 24px 22px 18px;
}

.sf-brand-mark {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--sf-primary);
}

.sf-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--sf-primary), var(--sf-primary-700));
  color: #fff;
  box-shadow: 0 14px 28px rgba(12, 16, 54, 0.22);
}

.sf-brand-title,
.sf-brand-subtitle,
.sf-version-label,
.sf-version-value,
.sf-user-name,
.sf-user-role {
  display: block;
}

.sf-brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sf-brand-subtitle {
  margin-top: 2px;
  color: var(--sf-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.sf-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 20px;
}

.sf-nav-link,
.sf-nav-group-toggle,
.sf-nav-sublink {
  border-radius: 13px;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.sf-nav-link,
.sf-nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #4b5567;
  font-weight: 700;
  text-align: left;
}

.sf-nav-link i,
.sf-nav-group-toggle span i {
  width: 20px;
  color: #7a8395;
  text-align: center;
}

.sf-nav-link:hover,
.sf-nav-group-toggle:hover {
  background: #f1f4f9;
  color: var(--sf-primary);
  transform: translateX(2px);
}

.sf-nav-link.active,
.sf-nav-sublink.active {
  background: var(--sf-primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(12, 16, 54, 0.18);
}

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

.sf-nav-group {
  margin-top: 7px;
}

.sf-nav-group-toggle {
  justify-content: space-between;
}

.sf-nav-group-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.sf-nav-group-toggle > .fa-chevron-down {
  font-size: 0.72rem;
  transition: transform 160ms ease;
}

.sf-nav-group-toggle:not(.collapsed) > .fa-chevron-down {
  transform: rotate(180deg);
}

.sf-nav-submenu {
  display: grid;
  gap: 5px;
  margin: 5px 0 10px 31px;
  padding-left: 12px;
  border-left: 1px solid var(--sf-border);
}

.sf-nav-sublink {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 11px;
  color: #626b7f;
  font-size: 0.86rem;
  font-weight: 700;
}

.sf-nav-sublink:hover {
  background: #f1f4f9;
  color: var(--sf-primary);
}

.sf-sidebar-footer {
  padding: 14px;
}

.sf-version-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: linear-gradient(135deg, rgba(12, 16, 54, 0.04), rgba(41, 162, 159, 0.08));
}

.sf-version-label {
  color: var(--sf-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.sf-version-value {
  color: var(--sf-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.sf-main {
  min-width: 0;
  width: calc(100% - var(--sf-sidebar-width));
  max-width: calc(100vw - var(--sf-sidebar-width));
  flex: 0 0 calc(100% - var(--sf-sidebar-width));
  margin-left: var(--sf-sidebar-width);
}

.sf-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--sf-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 34px;
  border-bottom: 1px solid rgba(230, 234, 242, 0.78);
  background: rgba(245, 247, 251, 0.82);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
  backdrop-filter: blur(18px);
}

.sf-topbar-left,
.sf-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.sf-topbar-left {
  flex: 1;
}

.sf-breadcrumb {
  --bs-breadcrumb-divider-color: #9aa3b5;
  color: var(--sf-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sf-breadcrumb a {
  color: #697386;
}

.sf-breadcrumb .active {
  color: var(--sf-primary);
}

.sf-page-title {
  margin: 2px 0 0;
  color: var(--sf-primary);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sf-search {
  width: min(420px, 32vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  background: var(--sf-surface-solid);
  box-shadow: var(--sf-shadow-sm);
}

.sf-search i {
  color: #8b95a8;
}

.sf-search input {
  width: 100%;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--sf-text);
  font-size: 0.9rem;
}

.sf-icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sf-border);
  border-radius: 14px;
  background: var(--sf-surface-solid);
  color: var(--sf-primary);
  box-shadow: var(--sf-shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sf-icon-button:hover {
  border-color: rgba(41, 162, 159, 0.45);
  color: var(--sf-accent);
  transform: translateY(-1px);
  box-shadow: var(--sf-shadow-md);
}

.sf-notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e34b5f;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.sf-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  background: var(--sf-surface-solid);
  color: var(--sf-primary);
  box-shadow: var(--sf-shadow-sm);
}

.sf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--sf-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.sf-user-meta {
  min-width: 118px;
  text-align: left;
}

.sf-user-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--sf-primary);
  font-size: 0.86rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-user-role {
  color: var(--sf-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.sf-dropdown {
  margin-top: 10px;
  border: 1px solid var(--sf-border);
  border-radius: 15px;
  box-shadow: var(--sf-shadow-md);
}

.sf-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #30384d;
  font-weight: 650;
}

.sf-content {
  box-sizing: border-box;
  width: calc(100vw - var(--sf-sidebar-width));
  max-width: 1680px;
  margin: 0 auto;
  overflow-x: hidden;
  padding: 32px 34px 48px;
}

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

.sf-guest-content {
  width: min(100%, 960px);
}

.card {
  border: 1px solid rgba(230, 234, 242, 0.9) !important;
  border-radius: var(--sf-radius) !important;
  background: var(--sf-surface);
  box-shadow: var(--sf-shadow-sm) !important;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  border-color: rgba(41, 162, 159, 0.25) !important;
  box-shadow: var(--sf-shadow-md) !important;
  transform: translateY(-2px);
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--sf-border);
  border-radius: var(--sf-radius) var(--sf-radius) 0 0 !important;
  background: rgba(255, 255, 255, 0.84) !important;
}

.card-body {
  padding: 20px;
}

.card h1,
.card h2,
.card h3,
.card .h5 {
  color: var(--sf-primary);
  font-weight: 800;
}

.display-6,
.h2,
.h3,
h1,
h2,
h3 {
  color: var(--sf-primary);
  font-weight: 800;
  letter-spacing: 0;
}

.text-primary {
  color: var(--sf-accent) !important;
}

.text-muted {
  color: var(--sf-muted) !important;
}

.table-responsive {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface-solid);
  box-shadow: var(--sf-shadow-sm);
}

.card .table-responsive {
  border: 0;
  border-radius: 13px;
  box-shadow: none;
}

.card .table > :not(caption) > * > * {
  padding: 0.74rem 0.7rem;
}

.card .table thead th,
.card .table .table-light th {
  font-size: 0.69rem;
}

.table {
  margin-bottom: 0;
  color: #2f374a;
}

.table > :not(caption) > * > * {
  padding: 0.92rem 1rem;
  border-bottom-color: var(--sf-border);
}

.table-sm > :not(caption) > * > * {
  padding: 0.62rem 0.72rem;
}

.table thead th,
.table .table-light th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--sf-border-strong);
  background: #f8fafd !important;
  color: #596277;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(245, 247, 251, 0.55);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: rgba(41, 162, 159, 0.075);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-sm {
  min-height: 34px;
  border-radius: 10px;
  font-size: 0.8rem;
}

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

.btn-primary {
  border-color: var(--sf-primary);
  background: var(--sf-primary);
  color: #fff;
  box-shadow: 0 12px 22px rgba(12, 16, 54, 0.17);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--sf-primary-700);
  background: var(--sf-primary-700);
  color: #fff;
}

.btn-secondary,
.btn-outline-secondary:hover {
  border-color: #d9dfeb;
  background: #eef2f8;
  color: var(--sf-primary);
}

.btn-outline-primary {
  border-color: rgba(41, 162, 159, 0.45);
  color: #177a78;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--sf-accent);
  background: var(--sf-accent);
  color: #fff;
}

.btn-outline-secondary {
  border-color: var(--sf-border-strong);
  color: #4b5567;
}

.btn-outline-dark {
  border-color: var(--sf-primary);
  color: var(--sf-primary);
}

.btn-outline-dark:hover {
  background: var(--sf-primary);
  color: #fff;
}

.btn-success,
.btn-outline-success:hover {
  border-color: #1f9d6f;
  background: #1f9d6f;
  color: #fff;
}

.btn-warning,
.btn-outline-warning:hover {
  border-color: var(--sf-gold);
  background: var(--sf-gold);
  color: #211a05;
}

.btn-danger,
.btn-outline-danger:hover {
  border-color: #d64557;
  background: #d64557;
  color: #fff;
}

.btn:disabled,
.btn.disabled {
  transform: none;
  box-shadow: none;
}

.form-label {
  margin-bottom: 0.45rem;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
}

.form-control,
.form-select {
  min-height: 44px;
  border: 1px solid var(--sf-border-strong);
  border-radius: 12px;
  background-color: #fff;
  color: var(--sf-text);
  font-weight: 600;
}

.form-control-sm,
.form-select-sm {
  min-height: 36px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 0.22rem rgba(41, 162, 159, 0.14);
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
  background-color: #f8fafd;
  color: #5f687b;
}

.form-floating > .form-control,
.form-floating > .form-select {
  border-radius: 12px;
}

.alert {
  border: 1px solid transparent;
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow-sm);
  font-weight: 650;
}

.alert-success {
  border-color: rgba(31, 157, 111, 0.2);
  background: #eefaf5;
  color: #126546;
}

.alert-danger {
  border-color: rgba(214, 69, 87, 0.2);
  background: #fff1f3;
  color: #9f2435;
}

.alert-warning {
  border-color: rgba(231, 176, 25, 0.28);
  background: #fff9e8;
  color: #75520a;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 24px;
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0;
}

.text-bg-secondary {
  background-color: #eef1f6 !important;
  color: #4f5b70 !important;
}

.text-bg-info {
  background-color: var(--sf-accent-soft) !important;
  color: #177a78 !important;
}

.text-bg-success {
  background-color: #eaf8f1 !important;
  color: #13734f !important;
}

.text-bg-danger {
  background-color: #fff0f2 !important;
  color: #b92f42 !important;
}

.text-bg-warning {
  background-color: #fff6d9 !important;
  color: #7a5708 !important;
}

.text-bg-primary {
  background-color: #eceefd !important;
  color: var(--sf-primary) !important;
}

.text-bg-light {
  background-color: #f6f8fb !important;
  color: #4b5567 !important;
}

.modal-content {
  border: 1px solid var(--sf-border);
  border-radius: 18px;
  box-shadow: var(--sf-shadow-md);
}

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

.dropdown-menu {
  border: 1px solid var(--sf-border);
  border-radius: 14px;
  box-shadow: var(--sf-shadow-md);
}

.calculation-entry .card {
  border-radius: var(--sf-radius) !important;
}

.calculation-entry .card-header {
  border-radius: var(--sf-radius) var(--sf-radius) 0 0 !important;
}

.calculation-entry .auto-generated-row > * {
  background-color: rgba(41, 162, 159, 0.08) !important;
}

.calculation-entry .readonly-input,
.calculation-entry .summary-input {
  background: #f8fafd;
  color: #475467;
  font-weight: 750;
}

.validation-summary-valid {
  display: none;
}

.field-validation-error,
.text-danger {
  color: #c93b4d !important;
  font-size: 0.8rem;
  font-weight: 700;
}

tr td[colspan] {
  color: var(--sf-muted);
}

.sf-dashboard {
  width: calc(100vw - var(--sf-sidebar-width) - 68px);
  max-width: 100%;
  display: grid;
  gap: 26px;
}

.sf-dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid rgba(230, 234, 242, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgba(41, 162, 159, 0.14), rgba(231, 176, 25, 0.12));
  box-shadow: var(--sf-shadow-sm);
}

.sf-dashboard-hero > div {
  min-width: 0;
}

.sf-dashboard-hero .btn {
  flex: 0 0 auto;
}

.sf-dashboard-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.sf-dashboard-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--sf-muted);
  font-size: 1rem;
  font-weight: 600;
}

.sf-section-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--sf-accent);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

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

.sf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 390px));
  justify-content: start;
  gap: 16px;
}

.sf-kpi-card {
  position: relative;
  min-height: 148px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(230, 234, 242, 0.94);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--sf-shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.sf-kpi-card::after {
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(41, 162, 159, 0.16), rgba(41, 162, 159, 0));
  content: "";
}

.sf-kpi-card:hover,
.sf-action-card:hover,
.sf-activity-item:hover {
  border-color: rgba(41, 162, 159, 0.36);
  box-shadow: var(--sf-shadow-md);
  transform: translateY(-3px);
}

.sf-kpi-icon,
.sf-action-card span,
.sf-empty-state span,
.sf-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sf-accent);
  background: linear-gradient(135deg, rgba(41, 162, 159, 0.14), rgba(12, 16, 54, 0.05));
}

.sf-kpi-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border-radius: 14px;
}

.sf-kpi-value {
  color: var(--sf-primary);
  font-size: 2.1rem;
  font-weight: 850;
  line-height: 1;
}

.sf-kpi-label {
  margin-top: 8px;
  color: var(--sf-muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.sf-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 390px));
  justify-content: start;
  gap: 14px;
}

.sf-action-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(230, 234, 242, 0.94);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--sf-shadow-sm);
  color: var(--sf-primary);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.sf-action-card span {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.sf-action-card strong {
  margin-top: 14px;
  color: var(--sf-primary);
  font-size: 0.96rem;
  font-weight: 850;
}

.sf-action-card small {
  margin-top: 4px;
  color: var(--sf-muted);
  font-weight: 650;
}

.sf-action-card.disabled {
  opacity: 0.62;
  pointer-events: none;
}

.sf-dashboard-panel .card-header {
  min-height: 82px;
}

.sf-table-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.sf-empty-state {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 34px;
  border: 1px dashed var(--sf-border-strong);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #f8fbfd);
  text-align: center;
}

.sf-empty-state-compact {
  min-height: 360px;
}

.sf-empty-state span {
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border-radius: 18px;
  font-size: 1.35rem;
}

.sf-empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 850;
}

.sf-empty-state p {
  max-width: 420px;
  margin: 0 0 18px;
  color: var(--sf-muted);
  font-weight: 600;
}

.sf-activity-timeline {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.sf-activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.sf-activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}

.sf-activity-item h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--sf-primary);
  font-size: 0.92rem;
  font-weight: 850;
}

.sf-activity-item p {
  margin: 5px 0 8px;
  overflow-wrap: anywhere;
  color: var(--sf-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.sf-activity-item time {
  color: #8a94a8;
  font-size: 0.76rem;
  font-weight: 750;
}

.sf-master-page {
  display: grid;
  gap: 20px;
}

.sf-master-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border: 1px solid rgba(230, 234, 242, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.86)),
    linear-gradient(135deg, rgba(41, 162, 159, 0.1), rgba(12, 16, 54, 0.04));
  box-shadow: var(--sf-shadow-sm);
}

.sf-master-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  line-height: 1.05;
}

.sf-master-header p {
  max-width: 720px;
  margin: 0;
  color: var(--sf-muted);
  font-weight: 650;
}

.sf-master-filter-card .card-body {
  padding: 18px;
}

.sf-filter-input {
  position: relative;
}

.sf-filter-input i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: #8b95a8;
  transform: translateY(-50%);
}

.sf-filter-input .form-control {
  padding-left: 42px;
}

.sf-master-table-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sf-code-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.28rem 0.62rem;
  border: 1px solid rgba(41, 162, 159, 0.22);
  border-radius: 999px;
  background: rgba(41, 162, 159, 0.08);
  color: #157977;
  font-size: 0.78rem;
  font-weight: 850;
}

.sf-master-table-card .sf-table-actions {
  min-width: max-content;
}

.sf-filter-empty {
  margin-top: 16px;
}

.sf-form-page {
  width: min(100%, 1060px);
  display: grid;
  gap: 20px;
}

.sf-form-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border: 1px solid rgba(230, 234, 242, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.86)),
    linear-gradient(135deg, rgba(41, 162, 159, 0.1), rgba(12, 16, 54, 0.04));
  box-shadow: var(--sf-shadow-sm);
}

.sf-form-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 2.4vw, 2.45rem);
  line-height: 1.05;
}

.sf-form-header p {
  max-width: 720px;
  margin: 0;
  color: var(--sf-muted);
  font-weight: 650;
}

.sf-form-card,
.sf-detail-card,
.sf-delete-card {
  overflow: hidden;
}

.sf-form-card > .card-body,
.sf-detail-card > .card-body,
.sf-delete-card > .card-body {
  padding: 26px;
}

.sf-form-section {
  padding: 22px;
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #fbfcff);
}

.sf-form-section + .sf-form-section {
  margin-top: 18px;
}

.sf-form-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.sf-form-section-header > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--sf-accent-soft);
  color: var(--sf-accent);
}

.sf-form-section-header h2 {
  margin: 0 0 4px;
  color: var(--sf-primary);
  font-size: 1rem;
  font-weight: 850;
}

.sf-form-section-header p {
  margin: 0;
  color: var(--sf-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.form-label.required::after {
  margin-left: 4px;
  color: #d64557;
  content: "*";
}

.form-text {
  color: #7b8497;
  font-size: 0.78rem;
  font-weight: 600;
}

.sf-upload-current {
  margin-top: 10px;
  color: var(--sf-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.sf-shape-upload {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.sf-shape-preview,
.sf-shape-detail-preview,
.sf-shape-delete-preview,
.sf-shape-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--sf-border);
  background: #f8fafd;
  color: #7b8497;
}

.sf-shape-preview {
  width: 156px;
  aspect-ratio: 1;
  border-radius: 16px;
}

.sf-shape-detail-preview,
.sf-shape-delete-preview {
  width: min(100%, 360px);
  aspect-ratio: 4 / 3;
  margin-bottom: 18px;
  border-radius: 16px;
}

.sf-shape-delete-preview {
  width: min(100%, 260px);
}

.sf-shape-thumb {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

.sf-shape-preview img,
.sf-shape-detail-preview img,
.sf-shape-delete-preview img,
.sf-shape-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sf-shape-preview i,
.sf-shape-detail-preview i,
.sf-shape-delete-preview i,
.sf-shape-thumb i {
  font-size: 1.25rem;
}

.sf-switch {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 48px;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  background: #fff;
}

.sf-switch .form-check-input {
  width: 2.65rem;
  height: 1.45rem;
  margin-left: -38px;
  border-color: var(--sf-border-strong);
  cursor: pointer;
}

.sf-switch .form-check-input:checked {
  border-color: var(--sf-accent);
  background-color: var(--sf-accent);
}

.sf-switch .form-check-label {
  color: var(--sf-primary);
  font-weight: 800;
  cursor: pointer;
}

.sf-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px;
  border-top: 1px solid var(--sf-border);
  background: rgba(248, 250, 253, 0.88);
}

.sf-detail-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.sf-detail-grid > div,
.sf-delete-summary > div {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--sf-border);
  border-radius: 14px;
  background: #fff;
}

.sf-detail-grid span,
.sf-delete-summary span {
  display: block;
  margin-bottom: 8px;
  color: var(--sf-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sf-detail-grid strong,
.sf-delete-summary strong {
  color: var(--sf-primary);
  font-size: 0.98rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.sf-detail-wide {
  grid-column: 1 / -1;
}

.sf-delete-card {
  border-color: rgba(214, 69, 87, 0.18) !important;
}

.sf-delete-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #fff0f2;
  color: #c93b4d;
  font-size: 1.35rem;
}

.sf-delete-card h2 {
  margin: 4px 0 8px;
  color: var(--sf-primary);
  font-size: 1.6rem;
}

.sf-delete-card p {
  max-width: 700px;
  margin: 0 0 18px;
  color: var(--sf-muted);
  font-weight: 650;
}

.sf-delete-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sf-danger-actions {
  background: #fff8f9;
}

@media (max-width: 1399.98px) {
  .sf-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 1600px) {
  .sf-kpi-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    justify-content: stretch;
  }

  .sf-action-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    justify-content: stretch;
  }
}

@media (min-width: 1400px) and (max-width: 1599.98px) {
  .sf-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .sf-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }
}

@media (max-width: 1199.98px) {
  .sf-search {
    width: min(320px, 28vw);
  }

  .sf-user-meta {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .sf-sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  .sf-sidebar-open .sf-sidebar {
    transform: translateX(0);
  }

  .sf-sidebar-open::after {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(12, 16, 54, 0.28);
    content: "";
  }

  .sf-main {
    width: 100%;
    max-width: 100vw;
    flex-basis: 100%;
    margin-left: 0;
  }

  .sf-topbar {
    padding: 14px 18px;
  }

  .sf-content {
    width: 100vw;
    padding: 24px 18px 42px;
  }

  .sf-dashboard {
    width: 100%;
  }

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

@media (max-width: 767.98px) {
  .sf-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .sf-topbar-left,
  .sf-topbar-actions {
    width: 100%;
  }

  .sf-topbar-actions {
    justify-content: space-between;
  }

  .sf-search {
    width: 100%;
    flex: 1;
  }

  .sf-page-title {
    font-size: 1.22rem;
  }

  .sf-user-menu {
    padding-right: 7px;
  }

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

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

  .sf-dashboard-hero {
    padding: 22px;
  }

  .sf-dashboard-hero .btn,
  .sf-table-actions .btn {
    width: 100%;
  }

  .sf-table-actions {
    min-width: 160px;
    flex-direction: column;
  }

  .sf-master-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .sf-master-header .btn {
    width: 100%;
  }

  .sf-form-header,
  .sf-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sf-form-header .btn,
  .sf-form-actions .btn {
    width: 100%;
  }

  .sf-detail-grid,
  .sf-delete-summary {
    grid-template-columns: 1fr;
  }

  .sf-shape-upload {
    grid-template-columns: 1fr;
  }

  .sf-shape-preview {
    width: 100%;
    max-width: 220px;
  }
}
