/* App compatibility layer on top of site.css */

/* =========================================================
   GLOBAL APP DECLUTTER (match cleaned home/about direction)
   ========================================================= */

/* Remove decorative eyebrow chip rows across app surfaces. */
.wrap .h-eyebrow,
.o-main .h-eyebrow,
.mx-body .h-eyebrow{
  display:none !important;
}

/* Hide non-essential badges that usually appear in page top bars. */
.wrap .topbar .badge,
.o-main .topbar .badge,
.mx-body .topbar .badge{
  display:none !important;
}

/* Keep page intros cleaner and tighter. */
.wrap .topbar .small,
.o-main .topbar .small,
.mx-body .topbar .small{
  margin-top: 4px !important;
}

/* reuse the marketing design but keep existing app wrapper class */
.wrap{
  width: min(var(--max), calc(100% - 32px));
  margin: 26px auto;
  padding: 0;
}

/* your app uses .super.card, marketing uses .card.
   Keep both working and make .super.card wider */
.super.card{
  max-width: 1200px;
}

table th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
table td{ vertical-align: top; }

/* app pages probably have <button> without .btn */
button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 3px 3px 0 #111;
  font-weight: 800;
  cursor: pointer;
}
button:hover{ transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #111; }
button:active{ transform: translate(0,0); box-shadow: 2px 2px 0 #111; }

/* app errors */
.error{
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #ffe2da;
}

/* muted helper */
.muted{ font-size: 13px; color: var(--muted); }

/* inputs already styled in site.css, keep sizing comfy */
input, select, textarea{ font-size: 14px; }

/* Compact search toggle (owner dashboard / stores) */
.tt-search-headline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 10px;
}
.tt-search-inline{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  overflow:visible;
}
.tt-icon-btn{
  width:40px;
  height:40px;
  padding:0;
  border-radius:999px;
  background:#fff;
  color:var(--ink);
  box-shadow:3px 3px 0 #111;
  flex-shrink:0;
}
.tt-icon-btn svg{
  width:18px;
  height:18px;
  fill:currentColor;
  display:block;
}
.tt-search-pop{
  box-sizing:border-box;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  transform:translateY(-2px) scale(.98);
  transform-origin:right top;
  opacity:0;
  pointer-events:none;
  display:flex;
  align-items:center;
  gap:6px;
  width:min(340px, calc(100vw - 28px));
  min-width:min(340px, calc(100vw - 28px));
  max-width:calc(100vw - 28px);
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:999px;
  box-shadow:3px 3px 0 #111;
  padding:4px 6px 4px 10px;
  transition:opacity .16s ease, transform .16s ease;
  z-index:30;
}
.tt-search-inline.is-open .tt-search-pop,
[data-store-search-root].is-open .tt-search-pop{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0) scale(1);
}
.tt-search-pop input[type="search"]{
  border:none;
  box-shadow:none;
  background:transparent;
  padding:7px 2px;
  width:100%;
  min-width:0;
  border-radius:0;
}
.tt-search-pop input[type="search"]:focus{
  outline:none;
  box-shadow:none;
}
.tt-search-clear{
  width:28px;
  height:28px;
  min-width:28px;
  padding:0;
  border-radius:999px;
  border:1.5px solid rgba(0,0,0,.1);
  background:#f4f6f5;
  color:var(--muted);
  box-shadow:none;
  font-size:18px;
  line-height:1;
}
.tt-search-clear:hover{
  transform:none;
  box-shadow:none;
  background:#ecefee;
  color:var(--ink);
}
.tt-search-clear:active{
  transform:none;
  box-shadow:none;
}

/* Search filter must override component display rules (dashboard cards use display:flex). */
[data-store-search-item][hidden],
[data-store-search-item].tt-search-item-hidden{
  display:none !important;
}

/* Password eye toggle */
.pw-toggle-wrap{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
}
.pw-toggle-wrap > input{
  width:100%;
  min-width:0;
  padding-right:44px !important;
}
.pw-toggle-btn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  min-width:30px;
  padding:0;
  border-radius:999px;
  border:1.5px solid rgba(0,0,0,.08);
  background:#fff;
  color:#475569;
  box-shadow:none;
  gap:0;
}
.pw-toggle-btn:hover{
  transform:translateY(-50%);
  box-shadow:none;
  background:#f3f4f6;
  color:#111827;
}
.pw-toggle-btn:active{
  transform:translateY(-50%);
  box-shadow:none;
}
.pw-toggle-btn svg{
  width:16px;
  height:16px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
  display:block;
}

@media (max-width: 640px){
  .tt-search-pop{
    right:0;
    top:calc(100% + 8px);
    transform:translateY(0) scale(.98);
    min-width:min(320px, calc(100vw - 24px));
    width:min(320px, calc(100vw - 24px));
    max-width:calc(100vw - 24px);
    z-index:12;
  }
  .tt-search-inline.is-open .tt-search-pop,
  [data-store-search-root].is-open .tt-search-pop{
    transform:translateY(0) scale(1);
  }
}

/* =========================================================
   APP SHADOW BUDGET (flat nested surfaces, selective elevation)
   ========================================================= */

/* Reusable utilities */
.tt-flat-surface,
.tt-card-flat,
.tt-panel-flat{
  box-shadow:none !important;
}
.tt-raised-surface{
  box-shadow:var(--shadow) !important;
}
.tt-raised-surface-sm{
  box-shadow:3px 3px 0 #111 !important;
}
.tt-hover-pop{
  box-shadow:none !important;
  transition:transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.tt-hover-pop:hover,
.tt-hover-pop:active,
.tt-hover-pop:focus-within{
  transform:translate(-1px,-1px);
  box-shadow:3px 3px 0 #111 !important;
}
.tt-no-shadow-btn{
  box-shadow:none !important;
}
.tt-no-shadow-btn:hover,
.tt-no-shadow-btn:active{
  box-shadow:none !important;
  transform:none !important;
}

/* Keep compact utility buttons flat (search icon / tabs / segmented controls / toggles) */
.tt-icon-btn{
  box-shadow:none;
  border:1.5px solid var(--border);
  background:#fff;
}
.tt-icon-btn:hover{
  transform:none;
  box-shadow:none;
  background:#f3f4f6;
}
.tt-icon-btn:active{
  transform:none;
  box-shadow:none;
}

/* Floating search field should remain elevated */
.tt-search-pop{
  box-shadow:3px 3px 0 #111;
}

/* App shell shadow budget: nested cards flat by default */
.wrap .card .card,
.o-main .card .card,
.mx-body .card .card{
  box-shadow:none !important;
}

/* Top-level content cards stay raised */
.wrap > .section > .card,
.wrap > .card,
.o-main > .section > .card,
.o-main > .card,
.mx-body > .section > .card,
.mx-body > .card{
  box-shadow:var(--shadow) !important;
}

/* Nested helper surfaces in app UIs should be flat */
.wrap .badge,
.o-main .badge,
.mx-body .badge,
.wrap .icon,
.o-main .icon,
.mx-body .icon{
  box-shadow:none !important;
}

.o-main .notice,
.mx-body .notice,
.wrap .notice{
  box-shadow:none !important;
}

/* Metrics module: flatten most panels/cards, keep only clickable cards popping on interaction */
.mx-body .mxm-kpi,
.mx-body .mxm-panel,
.mx-body .mp-card,
.mx-body .pm-filter-card,
.mx-body .pm-card,
.mx-body .pm-chart-card,
.mx-body .pm-lock-card{
  box-shadow:none !important;
}

/* Metrics clickable cards (flat at rest, pop on hover/press) */
.mx-body .mxs-card,
.mx-body .mxf-card,
.mx-body .pm-store-card{
  box-shadow:none !important;
  transition:transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.mx-body .mxs-card:hover,
.mx-body .mxs-card:active,
.mx-body .mxs-card:focus-visible,
.mx-body .mxf-card:hover,
.mx-body .mxf-card:active,
.mx-body .mxf-card:focus-visible,
.mx-body .pm-store-card:hover,
.mx-body .pm-store-card:active,
.mx-body .pm-store-card:focus-visible{
  transform:translate(-1px,-1px);
  box-shadow:3px 3px 0 #111 !important;
}

/* Metrics shell compact controls should not look like primary CTA buttons */
.mx-body [role="tablist"] button,
.mx-body .seg button,
.mx-body .mxm-tabseg button,
.mx-body .mp-tabseg button,
.mx-body .mxm-tab button,
.mx-body .mp-tab button{
  box-shadow:none !important;
  transform:none !important;
}
.mx-body [role="tablist"] button:hover,
.mx-body .seg button:hover,
.mx-body .mxm-tabseg button:hover,
.mx-body .mp-tabseg button:hover{
  box-shadow:none !important;
  transform:none !important;
}

/* Wizard / schedule editor specifics (most visible clutter) */
.wrap .ss-day-row{
  box-shadow:none !important;
}
.wrap .tt-day-chip span{
  box-shadow:none !important;
}

/* Owner/manager shells: utility pills and tiny action clusters should stay flatter */
.o-main .o-shc-actions a,
.o-main .o-shc-pill,
.o-main .o-shc-badge{
  box-shadow:none;
}

/* Keep raised floating/focus surfaces across app shells */
.o-dropdown,
.mx-dd,
.o-overlay-sheet,
.mx-overlay-sheet{
  box-shadow:var(--shadow);
}

/* =========================================================
   APP-LIKE PAGE TRANSITIONS + NAV PROGRESS
   ========================================================= */

/* Keep transitions respectful for accessibility */
@media (prefers-reduced-motion: reduce) {
  body.tt-motion .wrap,
  body.tt-motion .o-main,
  body.tt-motion .mx-body {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}

body.tt-motion .wrap,
body.tt-motion .o-main,
body.tt-motion .mx-body {
  will-change: opacity, transform, filter;
  transition: opacity .22s ease, transform .22s cubic-bezier(.22,1,.36,1), filter .22s ease;
}

@keyframes tt-page-in {
  from {
    opacity: .01;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

body.tt-motion.tt-enter .wrap,
body.tt-motion.tt-enter .o-main,
body.tt-motion.tt-enter .mx-body {
  animation: tt-page-in .24s cubic-bezier(.22,1,.36,1) both;
}

body.tt-motion.tt-leaving .wrap,
body.tt-motion.tt-leaving .o-main,
body.tt-motion.tt-leaving .mx-body {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(1px);
}

#tt-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  opacity: 0;
  background: linear-gradient(90deg, #1f7a5b 0%, #16a34a 55%, #4ade80 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
  transition: width .18s linear, opacity .18s ease;
  z-index: 1200;
  pointer-events: none;
}
#tt-nav-progress.active {
  opacity: 1;
}

/* =========================================================
   PAGINATION + MOBILE TABLE/CARD UTILITIES (APP ONLY)
   ========================================================= */
.tt-pager-wrap{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.tt-pager{
  display:flex;
  align-items:center;
  gap:8px;
}

.tt-pager-current{
  min-width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid var(--border);
  border-radius:999px;
  background:#eaf6f0;
  font-size:12px;
  font-weight:900;
}

.tt-pager-disabled{
  opacity:.55;
  pointer-events:none;
}

.tt-table-mobile{
  display:none;
}

.tt-mobile-row-card{
  border:1.5px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
  display:grid;
  gap:8px;
}

.tt-mobile-row-card .tt-mobile-row-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.tt-mobile-row-card .tt-mobile-row-title{
  font-weight:900;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.tt-mobile-row-card .tt-mobile-grid{
  display:grid;
  gap:6px;
}

.tt-mobile-row-card .tt-mobile-kv{
  display:grid;
  grid-template-columns:86px minmax(0, 1fr);
  gap:6px;
  align-items:start;
}

.tt-mobile-row-card .tt-mobile-k{
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
}

.tt-mobile-row-card .tt-mobile-v{
  font-size:12px;
  overflow-wrap:anywhere;
}

.tt-mobile-row-card .tt-mobile-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

body[data-app-shell="1"] .o-main,
.tt-mobile-compact .o-main,
body[data-app-shell="1"] .mx-body,
.tt-mobile-compact .mx-body{
  min-width:0;
  overflow-x:hidden;
}

body[data-app-shell="1"] .super.card,
.tt-mobile-compact .super.card{
  max-width:100%;
}

@media (max-width: 768px){
  body[data-app-shell="1"] .section,
  .tt-mobile-compact .section{
    padding: 12px 0 calc(20px + env(safe-area-inset-bottom));
  }

  body[data-app-shell="1"] .card.pad,
  .tt-mobile-compact .card.pad{
    padding: 12px;
  }

  body[data-app-shell="1"] .topbar,
  .tt-mobile-compact .topbar{
    margin-bottom: 10px !important;
  }

  body[data-app-shell="1"] .actions,
  .tt-mobile-compact .actions{
    margin-top: 10px;
    gap: 8px;
  }

  .tt-table-desktop{
    display:none !important;
  }

  .tt-table-mobile{
    display:grid;
    gap:10px;
  }

  .tt-mobile-row-card{
    padding:9px;
    gap:7px;
  }

  .tt-pager-wrap{
    align-items:flex-start;
    flex-direction:column;
  }
}
