/* RSAapp/assets/app.css
   Minimal 'app mode' overrides on top of RSAadmin admin.css */

:root{
  --accent: #d32f2f; /* rebel red */
  --cardBorder: rgba(17,24,39,0.08);
  --cardShadow: 0 14px 30px rgba(17,24,39,0.12), 0 2px 6px rgba(17,24,39,0.04);
}

/* Force app typography */
html, body{ font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Remove desktop layout assumptions */
.app .layout { display:block; }
.sidebar, .sidebar-overlay, .burger { display:none !important; }

/* Topbar: simpler */
.topbar{ position:sticky; top:0; z-index:50; padding-top: env(safe-area-inset-top); }
.topbar .topbar-left{ gap:10px; }
.topbar .brand-logo-img{ height:36px; }
.topbar .topbar-right{ gap:10px; }
.topbar .topbar-loginas{ display:none; } /* keep clean on mobile */
.topbar .topbar-user-meta{ display:none; }

.icon-btn{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:14px;
  text-decoration:none;
  color:#111827;
}
.icon-btn svg{ width:20px; height:20px; }

.page-title{ margin:0 0 12px 0; font-size:20px; font-weight:900; }

/* Content spacing for mobile */
.content{ padding:10px; max-width: 720px; margin: 0 auto; }
.card{ border-radius:18px; }
.pill, button, input, select, textarea{ border-radius:14px; }

/* Home tiles */
.home-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.tile{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:120px;
  text-decoration:none;
  color:inherit;
  border:1px solid var(--cardBorder);
  background:#fff;
  border-radius:18px;
  box-shadow: var(--cardShadow);
}
.tile .ico{
  width:42px; height:42px;
  display:flex; align-items:center; justify-content:center;
  border-radius:14px;
  background: #f3f4f6;
  margin-bottom:10px;
}
.tile .ico svg{ width:22px; height:22px; }
.tile .title{ font-weight:800; }
.tile .sub{ font-size:12px; color:#6b7280; margin-top:2px; }
.tile.disabled{ opacity:.45; pointer-events:none; }

.tile.wide{
  grid-column: 1 / -1;
  min-height:78px;
  flex-direction:row;
  justify-content:flex-start;
  padding:0 16px;
  gap:12px;
}
.tile.wide .ico{ margin:0; }
.tile.wide .title{ margin-right:auto; }

/* Bottom nav */
.bottom-nav{
  position:fixed;
  left:0; right:0; bottom:0;
  background: rgba(255,255,255,.95);
  border-top:1px solid #e5e7eb;
  display:flex;
  justify-content:space-around;
  padding:10px 8px calc(10px + env(safe-area-inset-bottom));
  z-index:60;
  backdrop-filter: blur(8px);
}
.bottom-nav a{
  text-decoration:none;
  color:#111827;
  font-size:12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:70px;
}
.bottom-nav a.active{ color: var(--accent); font-weight:800; }
.bottom-nav svg{ width:22px; height:22px; }

/* Prevent content being hidden under bottom nav */
body{ padding-bottom: 78px; }

/* Settings */
.settings-list{ display:flex; flex-direction:column; gap:10px; }
.settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  border:1px solid var(--cardBorder);
  background:#fff;
  border-radius:18px;
  box-shadow: var(--cardShadow);
}
.settings-row .meta{ display:flex; flex-direction:column; gap:2px; }
.settings-row .meta .label{ font-weight:900; }
.settings-row .meta .hint{ font-size:12px; color:#6b7280; }

.switch{
  position:relative;
  width:48px;
  height:28px;
  flex:0 0 auto;
}
.switch input{ display:none; }
.switch .track{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#e5e7eb;
  border:1px solid #d1d5db;
}
.switch .thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  border:1px solid #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.switch.disabled{ opacity:.45; }

/* Tables on mobile */
.table-wrap{ overflow:auto; -webkit-overflow-scrolling: touch; }
.table{ min-width: 640px; }
@media (max-width: 720px){
  .home-grid{ grid-template-columns: 1fr 1fr; }
  .table{ min-width: 560px; }
}

/* Better tap targets */
.pill, button{ min-height: 44px; }


/* ------------------------------------------------------------
   TEMP MOBILE TUNING (white → grey → white + bigger tiles)
   ------------------------------------------------------------ */
:root{
  --appGrey: #f3f4f6;
}

html, body{ background:#fff; }
body{ padding-bottom: 84px; }

.topbar{
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}

/* Content: full white background (standard on all pages) */
.content{
  background: #fff;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px;
  padding-left: calc(10px + env(safe-area-inset-left));
  padding-right: calc(10px + env(safe-area-inset-right));
  border-radius: 0;
}

/* Make home screen fill more of the viewport */
.content.home{
  min-height: calc(100dvh - 72px - 84px);
  display:flex;
}
.content.home .home-grid{
  flex:1;
  align-content:stretch;
  grid-auto-rows: 1fr;
}
.tile{
  min-height: clamp(140px, 18vh, 190px);
}
.tile.wide{
  min-height: 88px;
}

/* Bottom nav: solid white, no blur */
.bottom-nav{
  background:#fff;
  backdrop-filter: none;
}

/* ------------------------------------------------------------
   Concept match overrides (pure white + bigger "3D" tiles)
   ------------------------------------------------------------ */

/* Kill RSAadmin grain + grey wash */
body::before{ display:none !important; opacity:0 !important; background-image:none !important; }

/* Stronger elevation */
:root{
  --cardBorder: rgba(11,15,23,0.10);
  --cardShadow: 0 24px 60px rgba(11,15,23,0.14), 0 4px 14px rgba(11,15,23,0.06);
}

/* Pure white surfaces */
html, body{ background:#fff !important; }
.topbar{ background:#fff !important; backdrop-filter:none !important; }

/* Wider to edges */
.content{
  padding: 8px;
  padding-left: calc(8px + env(safe-area-inset-left));
  padding-right: calc(8px + env(safe-area-inset-right));
}

/* Home tiles: bigger, slightly squarer */
.home-grid{ gap:10px; }
.tile{
  border-radius: 22px;
  min-height: clamp(165px, 22vh, 235px);
}
.tile .ico{
  width:52px;
  height:52px;
  border-radius: 18px;
  background:#f3f4f6;
  margin-bottom:12px;
}
.tile .ico svg{ width:24px; height:24px; }
.tile .title{ font-size:20px; }
.tile .sub{ font-size:12px; }
.tile.wide{ border-radius: 26px; }

/* Bottom nav can handle 4 items (admin) */
.bottom-nav a{ min-width: 62px; }

/* Tactile tap feedback */
.tile:active{ transform: scale(.99); }

/* Session cards (training lists) */
.session-list{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.session-card{
  display:block;
  padding:14px;
  border:1px solid var(--cardBorder);
  background:#fff;
  border-radius:18px;
  box-shadow: var(--cardShadow);
  text-decoration:none;
  color:inherit;
}
.session-card .row{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.session-card .date{ font-weight:900; }
.session-card .arena{ font-weight:800; margin-top:6px; }
.session-card .muted{ font-size:12px; }
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  font-size:12px;
  color:#111827;
  white-space:nowrap;
}

/* Timegroup editor: stack nicely on mobile */
.timegroup-row{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  padding:12px;
  border:1px solid var(--cardBorder);
  background:#fff;
  border-radius:18px;
  box-shadow: var(--cardShadow);
  margin-top:10px;
}
.timegroup-row .tg-actions{ display:flex; justify-content:flex-end; }

/* Booking cards */
.booking-list{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.booking-card{
  padding:14px;
  border:1px solid var(--cardBorder);
  background:#fff;
  border-radius:18px;
  box-shadow: var(--cardShadow);
}
.booking-card .top{ display:flex; justify-content:space-between; gap:12px; }
.booking-card .dog{ font-weight:900; }
.booking-card .line{ margin-top:6px; font-size:13px; }
.booking-card .line .muted{ font-size:12px; }
.booking-card .meta{ margin-top:10px; display:flex; flex-wrap:wrap; gap:8px; }
.booking-card .meta a{ text-decoration:none; }


/* ------------------------------------------------------------
   iOS-style square module tiles (locked shape across devices)
   - Always 1:1 squares
   - Auto-fit columns (2 on phones, 3 on iPad, etc.)
   - Consistent rounded-square silhouette like iOS app icons
   ------------------------------------------------------------ */
:root{
  /* On phones this tracks viewport width; on larger screens it caps.
     This produces 2 columns on phones, 3 columns on iPad (with max-width 720). */
  --tileSize: clamp(140px, 44vw, 182px);
  --tileGap: 12px;
}

/* Grid: fixed-size squares that wrap into more columns when space allows */
.home-grid{
  grid-template-columns: repeat(auto-fit, minmax(var(--tileSize), var(--tileSize))) !important;
  gap: var(--tileGap) !important;
  justify-content: center;
}

/* Tile: true square + app-icon silhouette */
.tile{
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0 !important;
  padding: 14px;
  border-radius: 22% !important; /* avoids "pill" look, keeps app-icon feel */
  box-shadow: 0 18px 44px rgba(11,15,23,0.14), 0 3px 12px rgba(11,15,23,0.06) !important;
  transition: transform .08s ease, box-shadow .08s ease;
}

.tile .ico{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #f1f3f5;
  margin-bottom: 12px;
}

.tile .title{
  font-size: 18px;
  line-height: 1.05;
  text-align: center;
}

.tile .sub{
  text-align: center;
}

.tile:active{
  transform: scale(0.985);
}

/* Prevent the special wide tile style from breaking square layout on home */
.home-grid .tile.wide{
  grid-column: auto;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
}

/* Slightly tighten content padding so tiles reach further towards the edges */
.content{
  padding: 10px !important;
  padding-left: calc(10px + env(safe-area-inset-left)) !important;
  padding-right: calc(10px + env(safe-area-inset-right)) !important;
}

@media (min-width: 768px){
  :root{
    --tileSize: 182px; /* lock on iPad so it becomes 3 columns, iOS-style */
    --tileGap: 14px;
  }
}

/* ------------------------------------------------------------
   iOS-style square module tiles (locked shape across devices)
   - Always 1:1 squares
   - Auto-fit columns (2 on phones, 3 on iPad, etc.)
   - Consistent rounded-square silhouette like iOS app icons
   ------------------------------------------------------------ */
:root{
  /* On phones this tracks viewport width; on larger screens it caps.
     This behaves like app icons: same shape, predictable sizing. */
  --tileSize: clamp(140px, 44vw, 182px);
  --tileGap: 12px;
  --tileRadius: 22%;
  --tileShadow: 0 18px 40px rgba(11,15,23,.14), 0 3px 10px rgba(11,15,23,.06);
}

/* Home grid: fixed-size squares (does NOT stretch into rectangles) */
.home-grid{
  grid-template-columns: repeat(auto-fit, minmax(var(--tileSize), var(--tileSize))) !important;
  gap: var(--tileGap) !important;
  justify-content: center;
  align-content: start;
}

/* Tiles: perfect squares */
.tile{
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0 !important;
  padding: 14px;
  border-radius: var(--tileRadius) !important;
  box-shadow: var(--tileShadow) !important;
}

/* Keep the "wide" tile usable elsewhere (lists) */
.tile.wide{
  aspect-ratio: auto;
  height: auto;
  min-height: 88px;
}

/* Icon badge inside tile */
.tile .ico{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #f3f4f6;
  margin-bottom: 12px;
}
.tile .ico svg{ width: 24px; height: 24px; }

/* Typography inside tile */
.tile .title{ font-size: 18px; line-height: 1.1; }
.tile .sub{ font-size: 12px; }

/* On tablets, keep icon size stable and allow 3 columns naturally */
@media (min-width: 768px){
  :root{ --tileSize: 182px; }
}

/* Very small phones: allow slightly smaller tiles (still square) */
@media (max-width: 340px){
  :root{ --tileSize: 132px; }
}


/* ------------------------------------------------------------
   GRID CONTAINER FIX
   Ensures home-grid can actually grow (2 cols phone, 3+ on larger)
   ------------------------------------------------------------ */

/* Let home content use full available width */
.content.home{
  max-width: none !important;
  margin: 0 !important;
  display: block !important; /* avoid flex shrink-wrap issues */
}

.content.home .home-grid{
  width: 100% !important;
  justify-content: center;
}

/* On large screens, allow more columns by not capping content width */
@media (min-width: 1024px){
  .content{ max-width: none !important; }
}

