/* Layer 5 of 5. Loaded LAST, and only on purpose: everything here
   re-declares a plain selector defined in an earlier layer, so it
   depends on cascade order. Dark-theme overrides do NOT belong here --
   they win on specificity and stay next to their component.
   When you add a rule that overrides another file, put it here and say
   what it overrides. */

/* ── Compact operations refinements ─────────────── */
@media (min-width:801px){
  body.role-admin main > .tile-grid:first-of-type{
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:0;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--card-bg);
    box-shadow:var(--shadow-sm);
  }
  body.role-admin main > .tile-grid:first-of-type .tile-card{
    min-height:76px;
    border:0;
    border-right:1px solid var(--border);
    border-radius:0;
    box-shadow:none;
  }
  body.role-admin main > .tile-grid:first-of-type .tile-card:last-child{border-right:0;}
  body.role-admin main > .tile-grid:first-of-type .tile-card:hover{transform:none;box-shadow:none;background:var(--surface-subtle);}
}

@media (max-width:800px){
  body.role-admin main > .tile-grid:first-of-type{grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;}
  body.role-admin main > .tile-grid:first-of-type .tile-card{border:1px solid var(--border);border-radius:var(--radius);}
  body.role-admin main > .tile-grid:first-of-type .tile-card:last-child{grid-column:1/-1;}
}

@media (max-width:700px){
  body,
  body.role-admin,
  body.role-vendor,
  body.role-delivery_driver,
  body.role-customer,
  body.role-guest{--control-height:38px;}
  main{padding:.7rem .65rem 4.5rem;}
  .topbar{min-height:50px;padding:.35rem .65rem;}
  .tile-grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));}
  .order-card-actions > button,.order-card-actions > .button{flex:1 1 auto;}
  .site-footer{margin-top:.75rem;}
}

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