/*
 * FasilKiray Product Experience Layer — 03 Nov 2026
 * Shared final layer for the marketplace, role workspaces and system pages.
 * Visual-only rules: no selectors target business state or role permissions.
 */
:root {
  color-scheme: light;
  --bf-x-brand: #176044;
  --bf-x-brand-strong: #104832;
  --bf-x-brand-soft: #eaf4ed;
  --bf-x-gold: #c79555;
  --bf-x-canvas: #f4f7f4;
  --bf-x-surface: #ffffff;
  --bf-x-surface-raised: #fbfdfb;
  --bf-x-text: #1b2b22;
  --bf-x-muted: #718077;
  --bf-x-line: #e2eae3;
  --bf-x-shadow-sm: 0 2px 8px rgba(16, 47, 31, .035), 0 8px 22px rgba(16, 47, 31, .035);
  --bf-x-shadow-md: 0 12px 34px rgba(16, 47, 31, .075), 0 24px 58px rgba(16, 47, 31, .045);
  --bf-x-shadow-lg: 0 28px 82px rgba(7, 28, 17, .24);
  --bf-x-radius-sm: 12px;
  --bf-x-radius-md: 17px;
  --bf-x-radius-lg: 23px;
  --bf-x-radius-xl: 30px;
  --bf-x-ease: cubic-bezier(.2, .75, .25, 1);
  --bf-x-fast: 140ms;
  --bf-x-base: 220ms;
  --bf-x-slow: 420ms;
  --bf-x-focus: 0 0 0 4px rgba(38, 121, 82, .17);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bf-x-brand: #8dc8a6;
  --bf-x-brand-strong: #b5dfc4;
  --bf-x-brand-soft: #203b2c;
  --bf-x-gold: #e0b77c;
  --bf-x-canvas: #101a14;
  --bf-x-surface: #17251c;
  --bf-x-surface-raised: #1b2c21;
  --bf-x-text: #e9f2eb;
  --bf-x-muted: #a7b8ab;
  --bf-x-line: #304438;
  --bf-x-shadow-sm: 0 2px 10px rgba(0, 0, 0, .13), 0 8px 22px rgba(0, 0, 0, .10);
  --bf-x-shadow-md: 0 14px 38px rgba(0, 0, 0, .2), 0 24px 58px rgba(0, 0, 0, .14);
  --bf-x-shadow-lg: 0 30px 84px rgba(0, 0, 0, .42);
  --bf-x-focus: 0 0 0 4px rgba(141, 200, 166, .2);
}

/* Shared interaction and motion foundations */
html { scroll-behavior: smooth; }
body, .app-shell, .topbar, .workspace-app, .workspace-main, .workspace-sidebar,
.workspace-topline, .dashboard-card, .dashboard-stat, .property-card, .modal,
.auth-dialog, .account-menu, .workspace-theme-toggle, .workspace-language-toggle {
  transition-property: color, background-color, border-color, box-shadow;
  transition-duration: var(--bf-x-base);
  transition-timing-function: var(--bf-x-ease);
}
button, .btn, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
button, .btn { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--bf-x-gold) !important;
  outline-offset: 3px !important;
}
.btn, button.btn, .workspace-nav-item, .chip, .workspace-theme-toggle,
.workspace-language-toggle, .workspace-market-link, .workspace-signout,
.workspace-mobile-menu, .icon-btn, .lang-btn, .avatar-btn {
  transition: transform var(--bf-x-fast) var(--bf-x-ease),
              box-shadow var(--bf-x-base) var(--bf-x-ease),
              background-color var(--bf-x-base) var(--bf-x-ease),
              border-color var(--bf-x-base) var(--bf-x-ease),
              color var(--bf-x-base) var(--bf-x-ease);
}
.btn:active, button.btn:active, .workspace-nav-item:active, .chip:active,
.workspace-theme-toggle:active, .workspace-language-toggle:active,
.workspace-mobile-menu:active, .icon-btn:active, .lang-btn:active { transform: scale(.975); }
.btn:disabled, button:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.btn-primary { box-shadow: 0 8px 20px rgba(25, 96, 66, .18); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(25, 96, 66, .24); transform: translateY(-1px); }

/* Public marketplace: richer cards, calmer sections, responsive controls */
.public-marketplace-page .topbar { box-shadow: 0 8px 30px rgba(5, 24, 17, .13); }
.public-marketplace-page .property-card {
  border: 1px solid rgba(220, 231, 221, .94);
  border-radius: var(--bf-x-radius-lg);
  box-shadow: var(--bf-x-shadow-sm);
  overflow: hidden;
  transition: transform 260ms var(--bf-x-ease), box-shadow 260ms var(--bf-x-ease), border-color 220ms ease;
}
.public-marketplace-page .property-card:hover {
  transform: translateY(-5px);
  border-color: rgba(48, 128, 87, .32);
  box-shadow: var(--bf-x-shadow-md);
}
.public-marketplace-page .property-card .card-image { overflow: hidden; }
.public-marketplace-page .property-card .card-image img {
  transition: transform 650ms var(--bf-x-ease), filter 350ms ease;
}
.public-marketplace-page .property-card:hover .card-image img { transform: scale(1.045); }
.public-marketplace-page .heart { transition: transform 180ms var(--bf-x-ease), background-color 180ms ease, color 180ms ease; }
.public-marketplace-page .heart:active { transform: scale(.88); }
.public-marketplace-page .search-panel { box-shadow: 0 24px 68px rgba(3, 20, 13, .3), 0 3px 12px rgba(3,20,13,.1); }
.public-marketplace-page .search-field:focus-within { box-shadow: var(--bf-x-focus); }
.public-marketplace-page .content-section, .public-marketplace-page .how-section { box-shadow: var(--bf-x-shadow-md); }
.public-marketplace-page .steps article { transition: transform 220ms var(--bf-x-ease), box-shadow 220ms ease; }
.public-marketplace-page .steps article:hover { transform: translateY(-3px); box-shadow: var(--bf-x-shadow-md); }
.public-marketplace-page .mobile-nav a { min-height: 42px; justify-content: center; transition: color 180ms ease, transform 180ms var(--bf-x-ease); }
.public-marketplace-page .mobile-nav a:active { transform: translateY(-2px); }

/* Workspaces: one coherent product shell for renter, landlord and admin */
.workspace-route { background: var(--bf-x-canvas) !important; color: var(--bf-x-text); }
.workspace-route .workspace-app { background: var(--bf-x-canvas); }
.workspace-route .workspace-sidebar {
  border-right: 1px solid rgba(17, 55, 35, .08);
  box-shadow: 10px 0 36px rgba(14, 43, 27, .055);
}
.workspace-route .workspace-brand { letter-spacing: -.035em; }
.workspace-route .workspace-side-profile {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--bf-x-radius-md);
  background: rgba(255, 255, 255, .075);
}
.workspace-route .workspace-nav-item {
  min-height: 48px;
  border-radius: 14px;
  font-size: 13px;
  letter-spacing: -.01em;
}
.workspace-route .workspace-nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, .105);
  transform: translateX(2px);
}
.workspace-route .workspace-nav-item.active {
  box-shadow: inset 3px 0 0 var(--bf-x-gold), 0 6px 18px rgba(4, 22, 13, .13);
}
.workspace-route .workspace-nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .09);
}
.workspace-route .workspace-nav-item.active .workspace-nav-icon { background: rgba(255, 255, 255, .15); }
.workspace-route .workspace-topline {
  min-height: 78px;
  border-bottom-color: var(--bf-x-line);
  box-shadow: 0 6px 24px rgba(15, 43, 27, .035);
  backdrop-filter: blur(18px) saturate(145%);
}
.workspace-route .workspace-mobile-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--bf-x-line);
  border-radius: 13px;
  background: var(--bf-x-surface);
  color: var(--bf-x-brand);
  box-shadow: var(--bf-x-shadow-sm);
}
.workspace-route .workspace-mobile-menu:hover { transform: translateY(-1px); box-shadow: var(--bf-x-shadow-md); }
.workspace-route .workspace-mobile-menu svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.workspace-route .workspace-page { animation: bfProductPageIn 360ms var(--bf-x-ease) both; }
.workspace-route .dashboard-welcome {
  border: 1px solid var(--bf-x-line);
  border-radius: var(--bf-x-radius-xl);
  box-shadow: var(--bf-x-shadow-sm);
}
.workspace-route .dashboard-welcome h1 { letter-spacing: -.045em; text-wrap: balance; }
.workspace-route .dashboard-stat-grid { align-items: stretch; }
.workspace-route .dashboard-stat {
  border: 1px solid var(--bf-x-line);
  border-radius: var(--bf-x-radius-lg);
  box-shadow: var(--bf-x-shadow-sm);
  transition: transform 230ms var(--bf-x-ease), box-shadow 230ms ease, background-color 220ms ease;
}
.workspace-route .dashboard-stat:hover { transform: translateY(-3px); box-shadow: var(--bf-x-shadow-md); }
.workspace-route .dashboard-card, .workspace-route .area-editor-panel,
.workspace-route .area-directory-panel, .workspace-route .place-manager-card,
.workspace-route .bf-analytics-panel {
  border-color: var(--bf-x-line);
  border-radius: var(--bf-x-radius-lg);
  box-shadow: var(--bf-x-shadow-sm);
}
.workspace-route .dashboard-card:hover, .workspace-route .area-editor-panel:hover,
.workspace-route .area-directory-panel:hover, .workspace-route .place-manager-card:hover {
  box-shadow: var(--bf-x-shadow-md);
}
.workspace-route .dashboard-listing, .workspace-route .dashboard-person,
.workspace-route .dashboard-report, .workspace-route .admin-account-row,
.workspace-route .area-manager-row {
  transition: transform 180ms var(--bf-x-ease), border-color 180ms ease, background-color 180ms ease;
}
.workspace-route .dashboard-listing:hover, .workspace-route .dashboard-person:hover { transform: translateY(-1px); }
.workspace-route .workspace-page button:not(:disabled):focus-visible,
.workspace-route .workspace-page a:focus-visible { outline-color: var(--bf-x-gold) !important; }
.workspace-route .workspace-page input, .workspace-route .workspace-page select,
.workspace-route .workspace-page textarea {
  min-height: 43px;
  border-radius: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.workspace-route .workspace-page input:focus, .workspace-route .workspace-page select:focus,
.workspace-route .workspace-page textarea:focus { border-color: var(--bf-x-brand); box-shadow: var(--bf-x-focus); outline: 0; }
.workspace-route .workspace-page table { border-collapse: separate; border-spacing: 0; }
.workspace-route .workspace-page th { font-size: 11px; font-weight: 850; letter-spacing: .06em; }
.workspace-route .workspace-page td { vertical-align: middle; }

/* Reusable skeleton primitives and realistic workspace loading composition */
@keyframes bfExperienceShimmer {
  0% { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}
@keyframes bfExperiencePageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bfExperiencePulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}
.bf-skeleton-title, .bf-skeleton-line, .bf-skeleton-card,
.bf-skeleton-label, .bf-skeleton-stat-value, .bf-skeleton-stat-label,
.bf-skeleton-panel-title, .bf-skeleton-row, .bf-skeleton-row::before,
.bf-skeleton-row::after, .bf-skeleton-intro::before {
  position: relative;
  overflow: hidden;
  background: linear-gradient(105deg, #e8eee9 20%, #f7faf7 38%, #e8eee9 58%);
  background-size: 240% 100%;
  animation: bfExperienceShimmer 1.55s ease-in-out infinite;
}
.bf-skeleton-title::after, .bf-skeleton-line::after, .bf-skeleton-card::after,
.bf-skeleton-label::after, .bf-skeleton-stat-value::after, .bf-skeleton-stat-label::after,
.bf-skeleton-panel-title::after, .bf-skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-100%);
  animation: bfExperienceSweep 1.7s ease-in-out infinite;
}
@keyframes bfExperienceSweep { to { transform: translateX(100%); } }
.bf-workspace-skeleton { display: grid; gap: 22px; width: min(100%, 1260px); margin-inline: auto; padding: clamp(18px, 3vw, 36px); }
.bf-skeleton-intro { display: grid; gap: 13px; padding: 23px; border: 1px solid var(--bf-x-line); border-radius: var(--bf-x-radius-lg); background: var(--bf-x-surface); }
.bf-skeleton-label { width: 132px; height: 10px; border-radius: 999px; }
.bf-skeleton-title { width: min(430px, 78%); height: 35px; border-radius: 10px; }
.bf-skeleton-line { width: min(650px, 94%); height: 13px; border-radius: 8px; }
.bf-skeleton-line.short { width: min(390px, 58%); }
.bf-skeleton-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bf-skeleton-stat { display: grid; gap: 12px; min-height: 122px; padding: 20px; border: 1px solid var(--bf-x-line); border-radius: var(--bf-x-radius-md); background: var(--bf-x-surface); }
.bf-skeleton-stat-value { width: 62%; height: 29px; border-radius: 8px; }
.bf-skeleton-stat-label { width: 80%; height: 11px; border-radius: 8px; }
.bf-skeleton-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .8fr); gap: 16px; }
.bf-skeleton-panel { display: grid; align-content: start; gap: 17px; min-height: 245px; padding: 22px; border: 1px solid var(--bf-x-line); border-radius: var(--bf-x-radius-lg); background: var(--bf-x-surface); }
.bf-skeleton-panel-title { width: 48%; height: 18px; border-radius: 8px; }
.bf-skeleton-row { height: 58px; border-radius: 12px; }
.bf-workspace-skeleton .bf-skeleton-panel:last-child .bf-skeleton-row { height: 74px; }
.property-skeleton-card { border: 1px solid var(--bf-x-line); border-radius: var(--bf-x-radius-lg); overflow: hidden; background: var(--bf-x-surface); box-shadow: var(--bf-x-shadow-sm); }
.property-skeleton-media { background: linear-gradient(105deg, #e8eee9 20%, #f7faf7 38%, #e8eee9 58%); background-size: 240% 100%; animation: bfExperienceShimmer 1.55s ease-in-out infinite; }
.property-skeleton-body span, .property-skeleton-body strong, .property-skeleton-body i { animation: bfExperiencePulse 1.6s ease-in-out infinite; }

/* Toasts, dialogs and empty/error states */
.modal, .auth-dialog, .admin-mfa-dialog { border-radius: var(--bf-x-radius-xl); box-shadow: var(--bf-x-shadow-lg); }
.modal::backdrop, .auth-dialog::backdrop { background: rgba(7, 24, 15, .62); backdrop-filter: blur(5px); }
.toast { border-radius: 15px; box-shadow: var(--bf-x-shadow-lg); }
.workspace-error, .workspace-auth-required { border: 1px solid var(--bf-x-line); border-radius: var(--bf-x-radius-xl); box-shadow: var(--bf-x-shadow-md); }
.dashboard-empty { border-radius: var(--bf-x-radius-md); line-height: 1.75; }

/* Dark theme coverage for dynamically rendered workspace components */
html[data-theme="dark"] .workspace-route .workspace-app,
html[data-theme="dark"] .workspace-route .workspace-main { background: var(--bf-x-canvas) !important; color: var(--bf-x-text); }
html[data-theme="dark"] .workspace-route .workspace-sidebar {
  border-right-color: rgba(255,255,255,.08);
  box-shadow: 10px 0 36px rgba(0,0,0,.18);
}
html[data-theme="dark"] .workspace-route .workspace-topline {
  background: rgba(20, 34, 25, .91);
  border-bottom-color: var(--bf-x-line);
}
html[data-theme="dark"] .workspace-route .workspace-theme-toggle,
html[data-theme="dark"] .workspace-route .workspace-language-toggle,
html[data-theme="dark"] .workspace-route .workspace-market-link,
html[data-theme="dark"] .workspace-route .workspace-signout,
html[data-theme="dark"] .workspace-route .workspace-mobile-menu {
  border-color: var(--bf-x-line);
  background: var(--bf-x-surface-raised);
  color: var(--bf-x-text);
}
html[data-theme="dark"] .workspace-route .dashboard-welcome,
html[data-theme="dark"] .workspace-route .dashboard-stat,
html[data-theme="dark"] .workspace-route .dashboard-card,
html[data-theme="dark"] .workspace-route .area-editor-panel,
html[data-theme="dark"] .workspace-route .area-directory-panel,
html[data-theme="dark"] .workspace-route .place-manager-card,
html[data-theme="dark"] .workspace-route .bf-analytics-panel,
html[data-theme="dark"] .workspace-route .workspace-page .profile-card {
  border-color: var(--bf-x-line);
  background: var(--bf-x-surface);
  color: var(--bf-x-text);
  box-shadow: var(--bf-x-shadow-sm);
}
html[data-theme="dark"] .workspace-route .dashboard-welcome h1,
html[data-theme="dark"] .workspace-route .dashboard-card-heading h2,
html[data-theme="dark"] .workspace-route .dashboard-stat strong { color: var(--bf-x-text); }
html[data-theme="dark"] .workspace-route .dashboard-welcome p,
html[data-theme="dark"] .workspace-route .dashboard-card-heading p,
html[data-theme="dark"] .workspace-route .dashboard-stat span,
html[data-theme="dark"] .workspace-route .dashboard-stat small { color: var(--bf-x-muted); }
html[data-theme="dark"] .workspace-route .dashboard-listing,
html[data-theme="dark"] .workspace-route .dashboard-person,
html[data-theme="dark"] .workspace-route .dashboard-report,
html[data-theme="dark"] .workspace-route .admin-account-row,
html[data-theme="dark"] .workspace-route .area-manager-row,
html[data-theme="dark"] .workspace-route .inquiry-thread-list,
html[data-theme="dark"] .workspace-route .inquiry-message-list,
html[data-theme="dark"] .workspace-route .inquiry-conversation-card {
  border-color: var(--bf-x-line);
  background: var(--bf-x-surface-raised);
  color: var(--bf-x-text);
}
html[data-theme="dark"] .workspace-route .workspace-page input,
html[data-theme="dark"] .workspace-route .workspace-page select,
html[data-theme="dark"] .workspace-route .workspace-page textarea {
  border-color: var(--bf-x-line);
  background: #122018;
  color: var(--bf-x-text);
}
html[data-theme="dark"] .workspace-route .workspace-page th { background: #203429; color: #d6e5d9; }
html[data-theme="dark"] .workspace-route .workspace-page td { border-color: var(--bf-x-line); color: #d1dfd4; }
html[data-theme="dark"] .bf-workspace-skeleton .bf-skeleton-intro,
html[data-theme="dark"] .bf-workspace-skeleton .bf-skeleton-stat,
html[data-theme="dark"] .bf-workspace-skeleton .bf-skeleton-panel { border-color: var(--bf-x-line); background: var(--bf-x-surface); }
html[data-theme="dark"] .bf-skeleton-title,
html[data-theme="dark"] .bf-skeleton-line,
html[data-theme="dark"] .bf-skeleton-card,
html[data-theme="dark"] .bf-skeleton-label,
html[data-theme="dark"] .bf-skeleton-stat-value,
html[data-theme="dark"] .bf-skeleton-stat-label,
html[data-theme="dark"] .bf-skeleton-panel-title,
html[data-theme="dark"] .bf-skeleton-row,
html[data-theme="dark"] .property-skeleton-media {
  background: linear-gradient(105deg, #26382c 20%, #344b3a 38%, #26382c 58%);
  background-size: 240% 100%;
}
html[data-theme="dark"] .bf-skeleton-title::after,
html[data-theme="dark"] .bf-skeleton-line::after,
html[data-theme="dark"] .bf-skeleton-card::after,
html[data-theme="dark"] .bf-skeleton-label::after,
html[data-theme="dark"] .bf-skeleton-stat-value::after,
html[data-theme="dark"] .bf-skeleton-stat-label::after,
html[data-theme="dark"] .bf-skeleton-panel-title::after,
html[data-theme="dark"] .bf-skeleton-row::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.075), transparent);
}

@keyframes bfProductPageIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  .bf-skeleton-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-skeleton-columns { grid-template-columns: 1fr; }
  .bf-skeleton-panel { min-height: 190px; }
}
@media (max-width: 560px) {
  .bf-workspace-skeleton { gap: 13px; padding: 13px 10px; }
  .bf-skeleton-intro { gap: 10px; padding: 17px 15px; border-radius: 17px; }
  .bf-skeleton-title { height: 28px; }
  .bf-skeleton-line { height: 11px; }
  .bf-skeleton-stats { gap: 9px; }
  .bf-skeleton-stat { min-height: 94px; padding: 14px; gap: 10px; }
  .bf-skeleton-stat-value { height: 23px; }
  .bf-skeleton-panel { min-height: 160px; padding: 15px; gap: 12px; }
  .property-skeleton-media { height: 190px; }
  .workspace-route .workspace-page { padding-bottom: calc(38px + env(safe-area-inset-bottom)); }
  .workspace-route .dashboard-card, .workspace-route .dashboard-stat { box-shadow: 0 4px 16px rgba(15, 44, 27, .045); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
