/* Hongr UI system v21
   Shared component polish. Intentionally layered after page styles so all surfaces
   use the same interaction language without replacing page-specific layouts.
*/
:root{
  --ui-red:#f04b3f;
  --ui-red-dark:#d83e34;
  --ui-ink:#171b1d;
  --ui-panel:#fff;
  --ui-line:#dfe3e4;
  --ui-muted:#737a7d;
  --ui-green:#1a875b;
  --ui-amber:#d09a36;
  --ui-radius-sm:10px;
  --ui-radius-md:13px;
  --ui-radius-lg:18px;
  --ui-shadow:0 12px 34px rgba(15,20,22,.09);
  --ui-transition:.18s cubic-bezier(.2,.7,.2,1);
}

/* Shared focus language */
:where(button,a,input,select,textarea):focus-visible{
  outline:3px solid rgba(240,75,63,.15)!important;
  outline-offset:2px!important;
}

/* Shared button language */
:where(.dashboard-shell,.owner-main) :where(button,.primary-btn,.primary-action,.secondary-btn,.secondary,.danger-btn,.danger,.table-action),
:where(.content-page,.subpage) :where(.button-red,.button-dark,.apply-submit,.empty-request-form button,.place-order,.checkout-cta){
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--ui-transition),box-shadow var(--ui-transition),border-color var(--ui-transition),background var(--ui-transition),color var(--ui-transition),opacity var(--ui-transition);
}

:where(.dashboard-shell,.owner-main) :where(.primary-btn,.primary-action,.apply-submit),
:where(.content-page,.subpage) .button-red{
  box-shadow:0 8px 22px rgba(240,75,63,.16);
}
:where(.dashboard-shell,.owner-main) :where(.primary-btn,.primary-action,.apply-submit,.button-red):hover:not(:disabled){
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(240,75,63,.21);
}
:where(.dashboard-shell,.owner-main) :where(.secondary-btn,.secondary,.table-action,.danger-btn,.danger){
  border-radius:var(--ui-radius-sm)!important;
}
:where(.dashboard-shell,.owner-main) :where(.secondary-btn,.secondary,.table-action):hover:not(:disabled){
  transform:translateY(-1px);
}
:where(.dashboard-shell,.owner-main) button:disabled,
:where(.dashboard-shell,.owner-main) input:disabled,
:where(.dashboard-shell,.owner-main) select:disabled{
  cursor:not-allowed!important;
  opacity:.55;
  transform:none!important;
  box-shadow:none!important;
}

/* Shared fields/selects. Custom arrow avoids native-browser styling differences. */
:where(.dashboard-shell,.owner-main) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea),
:where(.content-page,.subpage) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  min-height:44px;
  border-radius:11px;
  transition:border-color var(--ui-transition),box-shadow var(--ui-transition),background var(--ui-transition);
}

:where(.dashboard-shell,.owner-main) select,
:where(.content-page,.subpage) select{
  appearance:none!important;
  -webkit-appearance:none!important;
  background-repeat:no-repeat!important;
  background-position:right 13px center!important;
  background-size:14px 14px!important;
}
:where(.dashboard-shell,.owner-main) select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23707876' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  padding-right:40px!important;
}
:where(.content-page,.subpage) select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666d6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  padding-right:40px!important;
}
:where(.dashboard-shell,.owner-main) :where(input,select,textarea):focus,
:where(.content-page,.subpage) :where(input,select,textarea):focus{
  border-color:rgba(240,75,63,.62)!important;
  box-shadow:0 0 0 4px rgba(240,75,63,.08)!important;
  outline:0!important;
}

/* Consistent status/control pills */
:where(.dashboard-shell,.owner-main) :where(.status,.status-pill,.tag,.role-pill,.account-state,.menu-product-state,.availability-chip){
  border-radius:999px;
  line-height:1;
}

/* Action groups: compact, never overflow as an accidental column */
:where(.dashboard-shell,.owner-main) :where(.item-actions,.menu-row-actions,.team-actions,.dialog-actions,.product-dialog-actions,dialog menu){
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
:where(.dashboard-shell,.owner-main) :where(.menu-row-actions,.team-actions){
  min-width:0;
}
:where(.dashboard-shell,.owner-main) :where(.menu-row-actions)>button,
:where(.dashboard-shell,.owner-main) :where(.team-actions)>button{
  flex:0 0 auto;
  white-space:nowrap;
}

/* Duplicate-action suppression: only hidden when the exact same visible action is repeated in one group. */
.ui-duplicate-action{display:none!important}

/* Shared loading indicator */
#hongr-ui-progress{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:2px;
  z-index:100000;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(90deg,transparent 0%,var(--ui-red) 35%,#ff9a8f 52%,var(--ui-red) 70%,transparent 100%);
  transform:translateX(-100%);
  transition:opacity .18s ease;
}
#hongr-ui-progress.is-active{opacity:1;animation:hongrLoadingProgress 1.25s ease-in-out infinite}
@keyframes hongrLoadingProgress{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}

.ui-loading-stack{display:grid;gap:10px;padding:7px 0}
.ui-skeleton{height:13px;border-radius:999px;background:linear-gradient(90deg,#eceff0 20%,#f7f8f8 40%,#eceff0 60%);background-size:220% 100%;animation:uiSkeleton 1.25s ease-in-out infinite}
.ui-skeleton.short{width:42%}.ui-skeleton.medium{width:68%}.ui-skeleton.long{width:92%}
.ui-skeleton-card{height:70px;border:1px solid var(--ui-line);border-radius:12px;background:linear-gradient(90deg,#f1f3f3 20%,#fafafa 40%,#f1f3f3 60%);background-size:220% 100%;animation:uiSkeleton 1.25s ease-in-out infinite}
@keyframes uiSkeleton{0%{background-position:120% 0}100%{background-position:-40% 0}}
.ui-skeleton-row td{padding:15px 18px!important}.ui-skeleton-row td>span{display:block;height:12px;border-radius:99px;background:linear-gradient(90deg,#eceff0 20%,#f7f8f8 40%,#eceff0 60%);background-size:220% 100%;animation:uiSkeleton 1.25s ease-in-out infinite}

/* Empty states */
.ui-empty-state{padding:30px 18px;text-align:center;color:var(--ui-muted);border:1px dashed #d6dcdd;border-radius:14px;background:rgba(255,255,255,.6)}
.ui-empty-state strong{display:block;color:var(--ui-ink);font:800 15px/1.2 Manrope,sans-serif;margin-bottom:5px}
.ui-empty-state p{margin:0;color:var(--ui-muted);font-size:12px}

/* Loading/busy buttons */
[data-ui-busy="1"]{position:relative;pointer-events:none!important;color:transparent!important;--ui-busy-ink:#fff}
:where(.secondary-btn,.secondary,.table-action,.button-dark)[data-ui-busy="1"]{--ui-busy-ink:#171b1d}
[data-ui-busy="1"]::after{content:"";width:15px;height:15px;border:2px solid var(--ui-busy-ink);border-right-color:transparent;border-radius:50%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);animation:uiSpin .7s linear infinite}
@keyframes uiSpin{to{transform:translate(-50%,-50%) rotate(360deg)}}

/* Mobile: never let controls create accidental horizontal scroll */
@media(max-width:760px){
  :where(.dashboard-shell,.owner-main) :where(.item-actions,.menu-row-actions,.team-actions,.dialog-actions,.product-dialog-actions,dialog menu){width:100%;}
  :where(.dashboard-shell,.owner-main) :where(.item-actions,.team-actions,dialog menu)>button,
  :where(.dashboard-shell,.owner-main) :where(.item-actions,.team-actions,dialog menu)>a{max-width:100%;}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Dark-surface loading states */
:where(.owner-main,.owner-sidebar,.subpage:not(.light-content),.dashboard-shell) .ui-skeleton{background:linear-gradient(90deg,#252b2d 20%,#31383a 40%,#252b2d 60%);background-size:220% 100%}
.owner-main .ui-skeleton-card{border-color:#303638;background:linear-gradient(90deg,#202527 20%,#2a3032 40%,#202527 60%);background-size:220% 100%}
.owner-main .ui-skeleton-row td>span{background:linear-gradient(90deg,#242a2c 20%,#303638 40%,#242a2c 60%);background-size:220% 100%}
.owner-main .ui-empty-state{border-color:#343b3d;background:#1a1f21;color:#9aa29f}
.owner-main .ui-empty-state strong{color:#f3f5f3}
