html {
  scrollbar-color: #cccccc #fcfcff;
  position: relative;
  min-height: 100%;
}

/* Layout: flex-based, no absolute footer */
body.sf-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.sf-page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

code {
  font-size: 80%;
}

.hide {
  display: none;
}

/* Messages / alerts (Taskora-style) */
.sf-main-inner .alert {
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid transparent;
}

/* Chrome, Safari, Edge, Opera */

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

.top-buffer {
  margin-top: 20px;
}

.btn-sf {
  width: 100%;
}

.btn-action {
  margin-bottom: 5px;
}

/* Fabricator Cards Styles */
.fabricator-card {
  border: 1px solid #cdcdcd;
  border-radius: 4px;
  overflow: hidden;
}

.fabricator-card:hover {
  transform: none;
  box-shadow: none;
}

.fabricator-card .card-img-top {
  width: 100%;
  height: 120px;
  object-fit: contain;
  padding: 1rem;
  background-color: #ffff;
}

.fabricator-card .card-body {
  border-top: 1px solid #e0e0e0;
  padding: 0.75rem;
  background-color: #fafafa;
}

.fabricator-card .card-title {
  font-size: 0.95rem;
  font-weight: bold;
}

.fabricator-card .card-body p {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Responsive design for mobile */
@media (max-width: 576px) {
  .fabricator-card .card-img-top {
    height: 100px;
    object-fit: contain;
    padding: 0.75rem;
    background-color: #f0f0f0;
  }
  
  .fabricator-card .card-title {
    font-size: 0.85rem;
  }
  
  .fabricator-card .card-body p {
    font-size: 0.75rem;
  }
}

/* =====================================================
   LAYOUT (Taskora-style)
   ===================================================== */

:root {
  --sidebar-expanded-width: 250px;
  --sidebar-collapsed-width: 72px;
  --sidebar-transition: 0.25s ease;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --sidebar-text: #64748b;
  --sidebar-text-hover: #0f172a;
  --sidebar-item-hover: #f0efed;
  --sidebar-item-active-bg: #eeedeb;
  --sidebar-item-active-color: #000000;
  --header-height: 60px;
  --content-bg: #f5f4f2;
}

/* =====================================================
   HEADER
   ===================================================== */

.sf-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 1030;
  display: flex;
  align-items: center;
}

.sf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  padding: 0 1.25rem;
  min-width: 0;
}

.sf-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sf-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}

.sf-header-brand:hover {
  color: #334155;
  text-decoration: none;
}

.sf-header-logo {
  display: block;
}

.sf-header-brand-text {
  white-space: nowrap;
}

/* Header collapse / nav items */
.sf-header-collapse-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  color: #64748b;
  cursor: pointer;
}

.sf-header-collapse-toggle:hover {
  background-color: #f0efed;
  color: #0f172a;
}

.sf-header-collapse {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.sf-header-nav-items {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}

.sf-header-nav-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.sf-header-nav-link:hover {
  color: #0f172a;
  background-color: #f0efed;
  text-decoration: none;
}

.sf-header-nav-dropdown {
  position: relative;
}

.sf-header-tier {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.25rem 0.5rem;
  min-width: 220px;
}

.sf-header-tier-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #475569;
}

.sf-header-tier-progress {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.sf-header-tier-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
}

@media (max-width: 767px) {
  .sf-header-collapse-toggle {
    display: flex;
  }

  .sf-header-collapse {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    padding: 0.75rem 1rem;
    z-index: 1029;
  }

  .sf-header-collapse.show {
    display: block;
  }

  .sf-header-nav-items {
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    gap: 0.25rem;
    width: 100%;
  }

  .sf-header-nav-link {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
  }

  .sf-header-tier {
    min-width: 100%;
    padding: 0.5rem 0.75rem;
  }

  .sf-header-search {
    display: none;
  }
}

.sf-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sf-header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.sf-header-search-icon {
  position: absolute;
  left: 0.75rem;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.sf-header-search-input {
  width: 200px;
  padding: 0.4rem 0.75rem 0.4rem 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: #f8fafc;
  transition: border-color 0.15s, background-color 0.15s;
}

.sf-header-search-input:focus {
  outline: none;
  border-color: #999999;
  background-color: #fff;
}

.sf-header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sf-header-icon-btn:hover {
  background-color: #f0efed;
  color: #0f172a;
}

.sf-header-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  transition: color 0.15s, background-color 0.15s;
}

.sf-header-link:hover {
  color: #000000;
  text-decoration: none;
}

.sf-header-link-cta {
  background-color: #000000;
  color: #fff !important;
  padding: 0.4rem 0.75rem;
}

.sf-header-link-cta:hover {
  background-color: #222222;
  color: #fff !important;
}

.sf-header-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #0f172a;
  transition: background-color 0.15s;
}

.sf-header-avatar-btn:hover {
  background-color: #f0efed;
}

.sf-header-username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-header .dropdown-menu.sf-header-dropdown {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 0.25rem;
  min-width: 10rem;
}

.sf-header-dropdown .dropdown-item {
  border-radius: 0.375rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
  display: block;
}

.sf-header-dropdown .dropdown-item:hover {
  background-color: #f0efed;
}

.sf-header-dropdown .dropdown-item.sf-header-dropdown-cta {
  background-color: #000000 !important;
  color: #fff !important;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sf-header-dropdown .dropdown-item.sf-header-dropdown-cta:hover,
.sf-header-dropdown .dropdown-item.sf-header-dropdown-cta:focus {
  background-color: #333333 !important;
  color: #fff !important;
  text-decoration: none;
}

.sf-header-dropdown .dropdown-item.sf-header-dropdown-cta:active {
  background-color: #2a2a2a !important;
  color: #fff !important;
}

.sf-header-logout-form {
  margin: 0;
}

.sf-header-link-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
}

.sf-header-link-btn:hover {
  color: #0f172a;
  background-color: #f0efed;
}

.sf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  color: #fff;
  font-weight: 600;
  border-radius: 50%;
}

.sf-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

/* =====================================================
   SIDEBAR (light theme)
   ===================================================== */

.sf-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-expanded-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: width var(--sidebar-transition);
  z-index: 1000;
  border-right: 1px solid var(--sidebar-border);
}

.sf-sidebar.sf-collapsed {
  width: var(--sidebar-collapsed-width);
}

.sf-sidebar-brand {
  flex-shrink: 0;
  padding: 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sf-sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.sf-sidebar-brand-link:hover {
  color: #000000;
  text-decoration: none;
}

.sf-sidebar-brand-logo {
  flex-shrink: 0;
}

.sf-sidebar-brand-text {
  opacity: 1;
}

.sf-collapsed .sf-sidebar-brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sf-sidebar-section {
  padding: 0.5rem 0;
}

.sf-sidebar-section-label {
  display: block;
  padding: 0.35rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-transform: uppercase;
  transition: opacity var(--sidebar-transition);
}

.sf-collapsed .sf-sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.sf-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* Shared item styles — pill-shaped active */
.sf-sidebar-item,
.sf-sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  border-radius: 0.5rem;
  line-height: 1.2;
  font-size: 0.9rem;
  border: none;
}

.sf-sidebar-item:hover,
.sf-sidebar-subitem:hover {
  background-color: var(--sidebar-item-hover);
  color: var(--sidebar-text-hover);
  text-decoration: none;
}

.sf-sidebar-item.sf-active,
.sf-sidebar-subitem.sf-active {
  background-color: var(--sidebar-item-active-bg);
  color: var(--sidebar-item-active-color);
}

.sf-sidebar-item.sf-active .sf-sidebar-icon,
.sf-sidebar-subitem.sf-active .sf-sidebar-icon {
  color: var(--sidebar-item-active-color);
}

.sf-sidebar-icon {
  font-size: 1.1rem;
  min-width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  color: inherit;
}

.sf-sidebar-label {
  transition: opacity var(--sidebar-transition), width var(--sidebar-transition);
  opacity: 1;
  overflow: hidden;
}

.sf-collapsed .sf-sidebar-label {
  opacity: 0;
  width: 0;
}

.sf-sidebar-group-toggle {
  user-select: none;
}

.sf-sidebar-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sf-collapsed .sf-sidebar-chevron {
  opacity: 0;
  width: 0;
}

.sf-sidebar-group.sf-open .sf-sidebar-chevron {
  transform: rotate(180deg);
}

.sf-sidebar-submenu {
  display: none;
  background-color: #f8fafc;
  margin: 0 0.5rem 0.25rem;
  border-radius: 0.5rem;
  padding: 0.25rem 0;
}

.sf-sidebar-group.sf-open .sf-sidebar-submenu {
  display: block;
}

.sf-sidebar-subitem {
  padding-left: 2rem;
  font-size: 0.85rem;
  margin: 0;
}

.sf-sidebar-tier {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  background-color: #f8fafc;
}

.sf-sidebar-tier-inner {
  font-size: 0.8rem;
  color: var(--sidebar-text);
}

.sf-sidebar-tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.sf-sidebar-tier-progress {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.sf-sidebar-tier-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  opacity: 0.9;
}

.sf-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background: #f8fafc;
  border: none;
  border-top: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  flex-shrink: 0;
}

.sf-sidebar-toggle:hover {
  background-color: #f0efed;
  color: #0f172a;
}

#sf-sidebar-toggle-icon {
  transition: transform var(--sidebar-transition);
  font-size: 0.9rem;
}

.sf-collapsed #sf-sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Page content wrapper */
.sf-page-content {
  transition: margin-left var(--sidebar-transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
}

.sf-page-content.sf-has-sidebar {
  margin-left: var(--sidebar-expanded-width);
}

.sf-page-content.sf-has-sidebar.sf-sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

.sf-main {
  flex: 1;
  background-color: var(--content-bg);
  padding: 1.5rem;
}

.sf-main-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.sf-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  background-color: #fff;
  border-top: 1px solid #e5e7eb;
}

.sf-footer a {
  color: #000000;
  text-decoration: none;
}

.sf-footer a:hover {
  text-decoration: underline;
}

/* Tooltip for collapsed state */
.sf-collapsed .sf-sidebar-item[title],
.sf-collapsed .sf-sidebar-subitem[title] {
  position: relative;
}

.sf-collapsed .sf-sidebar-item[title]::after,
.sf-collapsed .sf-sidebar-subitem[title]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background-color: #1e293b;
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
}

.sf-collapsed .sf-sidebar-item[title]:hover::after,
.sf-collapsed .sf-sidebar-subitem[title]:hover::after {
  opacity: 1;
}

/* Mobile */
@media (max-width: 767px) {
  .sf-sidebar {
    width: var(--sidebar-expanded-width);
    transform: translateX(-100%);
    transition: transform var(--sidebar-transition);
    z-index: 1040;
  }

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

  .sf-page-content.sf-has-sidebar {
    margin-left: 0;
  }

  .sf-page-content.sf-has-sidebar.sf-sidebar-collapsed {
    margin-left: 0;
  }

  .sf-header-search {
    display: none;
  }

  .sf-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1039;
  }

  .sf-sidebar-overlay.sf-active {
    display: block;
  }

  .sf-mobile-toggle {
    display: flex !important;
  }
}

.sf-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f0efed;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sf-mobile-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* DataTables + Tailwind-style card (projects table) */
.sf-datatables-card .dataTables_wrapper {
  width: 100%;
}
.sf-datatables-card .sf-dt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.sf-datatables-card .sf-dt-controls .dataTables_length,
.sf-datatables-card .sf-dt-controls .dataTables_filter {
  margin: 0;
}
.sf-datatables-card .sf-dt-controls .dataTables_length label,
.sf-datatables-card .sf-dt-controls .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.sf-datatables-card .sf-dt-controls .dataTables_filter input {
  padding: 0.375rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.sf-datatables-card .sf-dt-controls .dataTables_filter input:focus {
  outline: none;
  border-color: #999999;
}
.sf-datatables-card .sf-dt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.875rem;
  color: #6b7280;
}
.sf-datatables-card table.dataTable {
  margin-top: 0;
  margin-bottom: 0;
  border-collapse: collapse;
}
.sf-datatables-card table.dataTable thead th {
  border-bottom: 1px solid #e5e7eb;
}
.sf-datatables-card table.dataTable tbody td {
  border-top: none;
}

/* =====================================================
   BOOTSTRAP BUTTON OVERRIDES (Brand 2026)
   ===================================================== */

.btn-primary,
.btn-primary.active,
.btn-primary:disabled {
  background-color: #999999;
  border-color: #999999;
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: #888888;
  border-color: #888888;
  color: #fff;
  box-shadow: none;
}

.btn-outline-primary {
  border-color: #999999;
  color: #666666;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: #999999;
  border-color: #999999;
  color: #fff;
  box-shadow: none;
}

.btn-success,
.btn-success.active,
.btn-success:disabled {
  background-color: #000000;
  border-color: #000000;
  color: #fff;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success:not(:disabled):not(.disabled):active {
  background-color: #222222;
  border-color: #222222;
  color: #fff;
  box-shadow: none;
}

.btn-outline-success {
  border-color: #000000;
  color: #000;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
  background-color: #000000;
  border-color: #000000;
  color: #fff;
  box-shadow: none;
}

.btn-secondary,
.btn-info,
.btn-danger {
  background-color: #fff;
  border-color: #cccccc;
  color: #000;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
  background-color: #f0efed;
  border-color: #bbbbbb;
  color: #000;
  box-shadow: none;
}

/* DataTables / Bootstrap pagination override */
.page-item.active .page-link {
  background-color: #999999;
  border-color: #999999;
  color: #fff;
}

.page-link {
  color: #000;
}

.page-link:hover {
  color: #000;
  background-color: #f0efed;
  border-color: #cccccc;
}

.page-link:focus {
  box-shadow: none;
}

/* Prevent button text from turning blue on hover/click/visit */
.btn:focus,
.btn:active,
.btn.active,
.btn:not(:disabled):not(.disabled):active {
  box-shadow: none;
}

a.btn,
a.btn:hover,
a.btn:visited,
a.btn:active,
a.btn:focus {
  color: inherit;
  text-decoration: none;
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:visited,
a.btn-primary:active,
a.btn-primary:focus {
  color: #fff;
}

a.btn-success,
a.btn-success:hover,
a.btn-success:visited,
a.btn-success:active,
a.btn-success:focus {
  color: #fff;
}

a.btn-secondary,
a.btn-secondary:hover,
a.btn-info,
a.btn-info:hover,
a.btn-danger,
a.btn-danger:hover {
  color: #000;
}

/* Tailwind-styled <a> buttons: prevent blue hover leak */
a[class*="tw-bg-"][class*="tw-text-white"]:hover,
a[class*="tw-bg-"][class*="tw-text-white"]:visited,
a[class*="tw-bg-"][class*="tw-text-white"]:active,
a[class*="tw-bg-"][class*="tw-text-white"]:focus {
  color: #fff;
  text-decoration: none;
}