/* Assemblage – light theme aligned with landing page; with micro-animations & modern inputs */

:root {
  --primary: #0F2743;
  --primary-ink: #ffffff;

  --page: #F3F6F8;
  --card: #FFFFFF;
  --border: #E6EDF2;

  --text: #243447;
  --muted: #6A7A89;

  --accent-cream: #EADFBB;
  --accent-pink: #F6C6CF;
  --accent-green: #9AC3A5;

  --danger-bg: #FFE9EA;
  --danger-ink: #7A0C14;
  --focus-ring: rgba(15, 39, 67, .16);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 6px 18px rgba(15, 39, 67, .06);
  --shadow-md: 0 10px 28px rgba(15, 39, 67, .08);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font-display: "Geologica", "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-body: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  /* New tokens for animated hover pill */
  --pill-bg: #E8FBF0;
  /* light green */
  --pill-border: #C8F0D7;
  --pill-ink: #236B3E;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

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

body.bg {
  margin: 0;
  color: var(--text);
  background: linear-gradient(0deg, rgba(234, 223, 187, .18), transparent 35%), var(--page);
  font-family: var(--font-body);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* >>> Force hero background on login page <<< */
body.bg.login-hero {
  background: #0F2643 !important;
  /* brand dark */
  background-image: none !important;
  color: #ffffff;
  display: grid !important;
  /* Overrides the flexbox for auth pages */
}


.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  /* Pushes the global footer to the bottom via flexbox */
  width: 100%;
  /* Ensure it spans properly */
}

/* Global Footer Layout */
.global-footer {
  margin-top: auto;
  padding: 24px;
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
  padding-bottom: calc(24px + 64px + env(safe-area-inset-bottom));
  /* Clear the mobile nav */
}

.footer-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

@media (min-width: 860px) {
  .global-footer {
    padding-bottom: 24px;
    /* No mobile nav on desktop */
  }
}

.center {
  text-align: center;
}

.tiny {
  font-size: 12px;
  font-weight: 300;
}

.muted {
  color: var(--muted);
  font-weight: 300;
}

.is-hidden {
  display: none !important;
}

/* utility */

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.brand.small {
  justify-content: flex-start;
}

.brand-logo {
  display: block;
  height: 22px;
  width: auto;
  border-radius: 4px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: conic-gradient(from 210deg, var(--accent-cream) 0 33%, var(--accent-green) 33% 66%, var(--accent-pink) 66% 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 39, 67, .18);
}

/* Headings in ROCA */
h1,
h2,
h3 {
  margin: 0 0 10px 0;
  letter-spacing: .2px;
  color: var(--primary);
  font-family: var(--font-display);
}

p {
  margin: 0 0 10px 0;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 24px;
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.topbar .brand span {
  color: var(--primary-ink);
  font-weight: 600;
  font-family: var(--font-display);
}

.topbar .brand .brand-mark {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.topbar .link {
  color: #EAF2FF;
  border-color: transparent;
}

.topbar .btn.ghost {
  background: transparent;
  color: var(--primary-ink);
  border-color: rgba(255, 255, 255, .32);
}

.topbar .btn.ghost:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .5);
}

.topbar .btn.ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}

.spacer {
  flex: 1;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .26s var(--ease), box-shadow .26s var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.elevate {
  box-shadow: var(--shadow-md);
}

/* Appear animation helper */
.appears {
  opacity: 0;
  transform: translateY(8px);
}

.appears.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* Layout */
.stack {
  display: flex;
  flex-direction: column;
}

.gap {
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Inputs */
.field.fancy {
  position: relative;
}

.field.fancy input {
  width: 100%;
  border: 1px solid var(--border);
  background: #FAFCFE;
  color: var(--text);
  padding: 14px 12px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.field.fancy input:focus {
  border-color: #B8C8D8;
  box-shadow: 0 0 0 6px var(--focus-ring);
}

.field.fancy label {
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  transition: transform .18s var(--ease), font-size .18s var(--ease), color .18s;
  background: transparent;
}

.field.fancy input:focus+label,
.field.fancy input:not(:placeholder-shown)+label {
  transform: translateY(-12px);
  font-size: 11px;
  color: var(--primary);
}

/* Buttons (ROCA) */
.btn {
  border: 1px solid var(--border);
  background: #F8FBFF;
  color: var(--primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .04s ease, background .2s ease, border .2s ease, box-shadow .2s ease;
  font-family: var(--font-display);
  letter-spacing: .2px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(15, 39, 67, .18);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.primary:active {
  filter: brightness(0.98);
}

.btn.ghost {
  background: #FFFFFF;
  color: var(--primary);
}

.btn.danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: #F7C6C9;
}

.link {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.link:hover {
  border-bottom-color: var(--primary);
}

.link.subtle {
  color: #ffffff;
  opacity: .9;
}

.link.subtle:hover {
  opacity: 1;
  border-bottom-color: rgba(255, 255, 255, .6);
}

.error {
  color: #B5131C;
}

/* ===================================================== */
/* ===== Minimalist Login (full-bleed hero look) ======= */
/* ===================================================== */

.login-hero {
  --font-display: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  display: grid;
  place-items: center;
  padding: 0 16px;
}

.login-shell {
  width: 100%;
  max-width: 760px;
  text-align: center;
  display: grid;
  gap: 22px;
}

.login-logo {
  height: 64px;
  width: auto;
  margin: 0 auto 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .08)) brightness(0) invert(1);
  opacity: 0.95;
}

.login-title {
  font-family: roca, "Roca", "Roca One", var(--font-display);
  font-family: var(--font-display);
  font-weight: 700;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.18;
  letter-spacing: .2px;
  margin: 0 auto 8px;
  max-width: 22ch;
}

/* Inline login bar */
.login-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0;
  margin: 0 auto;
  max-width: 720px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.login-bar input {
  appearance: none;
  border: 0;
  padding: 14px 14px;
  font-size: 16px;
  color: #ffffff;
  background: transparent;
}

.login-bar input::placeholder {
  color: rgba(255, 255, 255, .8);
}

.login-bar input:focus {
  outline: none;
  background: rgba(255, 255, 255, .06);
}

.login-bar input+input {
  border-left: 1px solid rgba(255, 255, 255, .25);
}

/* WHITE login button with brand text */
.login-btn {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .25);
  height: 100%;
  border-radius: 0;
  padding: 0 18px;
  background: #ffffff;
  color: #0F2643;
  /* brand dark */
  font-weight: 700;
  box-shadow: none;
}

.login-btn:hover {
  filter: none;
  background: #ffffff;
}

.login-btn:active {
  background: #F2F2F2;
}

.login-error {
  margin: 4px auto 0;
  max-width: 720px;
  background: rgba(255, 233, 234, .98);
  color: #7A0C14;
  padding: 8px 12px;
  border-radius: 10px;
}

.login-secondary {
  margin-top: 2px;
  font-size: 14px;
  color: rgba(255, 255, 255, .9);
}

@media (max-width: 560px) {
  .login-bar {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .login-bar input+input {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .25);
  }

  .login-btn {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .25);
    height: auto;
    padding-block: 8px;
    padding-inline: 18px;
  }
}

/* ===================================================== */
/* ====== Order & Admin shared components ============== */
/* ===================================================== */

.line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #FBFDFE;
}

.line label {
  font-weight: 700;
  color: var(--text);
}

/* Product image thumbnail */
.prod-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #F5F7FA;
  box-shadow: inset 0 0 0 1px rgba(15, 39, 67, .10);
}

.icon.placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--accent-cream);
}

.icon.placeholder.pasta {
  background: var(--accent-pink);
}

.icon.placeholder.garlic {
  background: var(--accent-green);
}

.icon.placeholder.egg {
  background: #E4E9F1;
}

/* Quantity stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(15, 39, 67, .02);
}

.stepper .step {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--primary);
  width: 40px;
  height: 36px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}

.stepper .step:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--focus-ring);
}

.stepper .step:hover {
  background: #F3F7FC;
}

.stepper input {
  width: 64px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-feature-settings: "tnum";
  padding: 0 8px;
}

.stepper input:focus {
  outline: none;
}

/* Actions / summary */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.actions.wrap {
  flex-wrap: wrap;
}

/* ===== Enhanced Order Summary ===== */
.summary-card {
  padding-bottom: 68px;
  position: relative;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pill {
  background: #F1F5FA;
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-display);
}

.summary-table-wrap {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #FFF;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table thead th {
  background: #F6FAFF;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

.summary-table td {
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--border);
}

.summary-table tr:last-child td {
  border-bottom: none;
}

.right {
  text-align: right;
}

.prod {
  display: flex;
  flex-direction: column;
}

.prod-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.prod-unit {
  font-size: 12px;
  color: var(--muted);
}

.summary-table tfoot .label {
  font-weight: 700;
  color: var(--primary);
}

.summary-table tfoot tr.tfoot-total td {
  border-top: 2px solid var(--border);
  padding-top: 14px;
}

.grand-total {
  font-weight: 800;
  font-size: 18px;
  font-family: var(--font-display);
}

/* Sticky total bar (legacy) */
.summary-totalbar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-left: -22px;
  margin-right: -22px;
  margin-bottom: -22px;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(243, 246, 248, 0) 0%, rgba(243, 246, 248, 0.55) 12%, rgba(243, 246, 248, 0.9) 22%, #F3F6F8 35%);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

/* Tables (admin) */
.table-wrap {
  overflow: auto;
}

.shell.is-loading {
  visibility: hidden;
}

#history-card {
  padding: 22px;
  overflow: hidden;
}

#history-card>h2 {
  margin: 0 0 10px;
}

#history-card .table-wrap {
  margin: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

#history-card .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

#history-card .history-table th,
#history-card .history-table td {
  padding-left: 22px;
  padding-right: 22px;
}

#history-card .history-table th:first-child,
#history-card .history-table td:first-child {
  padding-left: 22px;
}

#history-card .history-table th:last-child,
#history-card .history-table td:last-child {
  padding-right: 22px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 700;
}

/* === Locked state (Lottie + flavor texts) === */
.locked-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-top: 4px;
}

.lottie-box {
  width: min(420px, 100%);
  height: 260px;
  margin: 2px auto 0;
}

@media (min-width: 860px) {
  .lottie-box {
    height: 300px;
  }
}

/* === Timeline (current only highlighted; others greyed) === */
.timeline {
  padding: 6px 2px;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.timeline-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #F7F9FC;
  color: var(--muted);
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

.timeline-step .dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #EFF3F7;
  border: 1px solid var(--border);
  font-size: 18px;
}

.timeline-step.is-current {
  opacity: 1;
  border-style: solid;
  transform: translateY(-1px);
  background: #FFFFFF;
  color: var(--primary);
}

.timeline-step.is-current .dot {
  background: #FFFFFF;
  border-color: currentColor;
  box-shadow: 0 4px 14px rgba(15, 38, 67, .10);
}

.timeline-step.is-current.s-aufgeben {
  background: #E8F0FF;
  border-color: #C9DAFF;
  color: #0F2643;
}

.timeline-step.is-current.s-huehner {
  background: #FFF7E6;
  border-color: #F7E7BF;
  color: #8A6A13;
}

.timeline-step.is-current.s-abholbereit {
  background: #E8FBF0;
  border-color: #C8F0D7;
  color: #236B3E;
}

.timeline-step.is-current.s-abgeschlossen {
  background: #EDF4FF;
  border-color: #D8E6FF;
  color: #0F2643;
}

.timeline-step.is-current.s-nichtbezahlt {
  background: #FFF0F0;
  border-color: #F5C4C6;
  color: #7A0C14;
}

.timeline-step:not(.is-current):hover {
  opacity: .75;
}

/* === History list === */
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  gap: 12px;
}

.history-main {
  display: flex;
  flex-direction: column;
}

.history-title {
  font-weight: 700;
}

.history-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-total {
  font-weight: 800;
  min-width: 92px;
  text-align: right;
}

/* Status pills in history (same palette) */
.pill.neutral {
  background: #F1F5FA;
  border: 1px solid var(--border);
  color: var(--primary);
}

.pill.info {
  background: #E6F0FF;
  border: 1px solid #D4E2F8;
  color: #1F4E9A;
}

.pill.egg {
  background: #FFF7E6;
  border: 1px solid #F7E7BF;
  color: #8A6A13;
}

.pill.ready {
  background: #E8FBF0;
  border: 1px solid #C8F0D7;
  color: #236B3E;
}

.pill.ok {
  background: #EDF4FF;
  border: 1px solid #D8E6FF;
  color: #0F2743;
}

.pill.warn {
  background: #FFF0F0;
  border: 1px solid #F5C4C6;
  color: #7A0C14;
}

/* ===================================================== */
/* ========== PERFORMANCE & POOL UI ENHANCEMENTS ======= */
/* ===================================================== */

/* Help browsers skip work until content scrolls into view */
#product-list .prod-card {
  content-visibility: auto;
  contain-intrinsic-size: 360px 220px;
}

/* Garlic pool inline UI */
.pool-inline {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.pool-inline .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pool-inline .head .title {
  font-weight: 700;
  color: var(--primary);
}

.pool-inline .list {
  display: grid;
  gap: 8px;
}

.pool-line {
  position: relative;
  /* for absolute hover pill placement */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #FBFDFE;
}

/* Pool badge */
.pool-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: #E8F0FF;
  color: #0F2643;
  border: 1px solid #C9DAFF;
  margin-right: 8px;
}

/* Animated hover pill with participant names */
.hover-pill {
  position: absolute;
  left: 8px;
  top: 100%;
  transform: translateY(6px);
  display: inline-block;
  max-width: min(420px, 70vw);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  border: 1px solid var(--pill-border);
  box-shadow: 0 8px 18px rgba(35, 107, 62, .12);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0;
  pointer-events: none;
  transition:
    opacity .25s var(--ease),
    transform .25s var(--ease);
}

/* Show on hover (pool list) */
.pool-line:hover .hover-pill {
  opacity: 1;
  transform: translateY(0);
}

/* Also show inside summary table for pool rows */
.summary-table tr.summary-pool-row .hover-pill {
  position: absolute;
  left: 20px;
  top: calc(100% - 2px);
  transform: translateY(6px);
}

.summary-table tr.summary-pool-row:hover .hover-pill {
  opacity: 1;
  transform: translateY(0);
}

/* Keep the pill within viewport on tiny screens */
@media (max-width: 520px) {
  .hover-pill {
    left: 0;
    right: 0;
    margin-inline: auto;
    text-align: center;
  }
}

/* Small mobile spacing tweak requested earlier */
@media (max-width:640px) {
  .center-mobile {
    text-align: center;
  }

  .center-mobile h2 {
    margin-bottom: 2px;
  }

  .center-mobile #delivery-info {
    margin-top: 0;
    margin-bottom: 16px;
  }
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  /* Default off */
  transition: .3s var(--ease);
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s var(--ease);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

input:checked+.slider {
  background-color: var(--pill-ink);
  /* Green active */
}

input:checked+.slider:before {
  transform: translateX(22px);
}

/* ===================================================== */
/* ================ sidebar redesign =================== */
/* ===================================================== */

@media (min-width: 860px) {
  body.bg:not(.login-hero) {
    display: flex !important;
    flex-direction: column;
    padding-left: 280px;
    background: var(--page);
    min-height: 100vh;
  }

  .shell {
    margin: 0 !important;
    max-width: 1200px;
    padding: 40px;
  }

  /* Hide old topbar if present */
  .topbar {
    display: none !important;
  }
}

/* Admin specific overrides for desktop */
@media (min-width: 860px) {
  body.bg.admin-page .shell {
    padding-top: 0 !important;
    max-width: 100% !important;
    /* Admin dashboard often benefits from full width, or keep it contained but remove top padding */
  }

  .tabs-header {
    top: 0 !important;
    /* Stick to very top since topbar is gone */
    padding-top: 20px;
    /* Add breathing room inside the sticky header instead of body padding */
    background: var(--admin-bg) !important;
    /* Match bg so it looks seamless */
    border-bottom: 1px solid var(--divider);
  }
}

.sidebar {
  background: #FFFFFF;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  z-index: 900;
  overflow-y: auto;
}

/* Mobile sidebar behavior: Hide sidebar, show topbar? 
   For now, we will hide sidebar on mobile and rely on the existing topbar (which we won't delete, just hide on desktop).
*/
/* Mobile sidebar behavior */
@media (max-width: 859px) {

  /* Prevent bottom nav from covering content */
  body {
    padding-bottom: 90px !important;
  }

  .sidebar {
    display: none !important;
  }

  .topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px !important;
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
    height: auto;
    min-height: 80px;
    width: 100%;
    margin: 0 !important;
    border-radius: 0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Topbar Avatar */
  .topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
  }

  /* Mobile Topbar Styling */
  .topbar .brand {
    display: flex;
    align-items: center;
  }

  .topbar .brand img,
  .topbar .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    /* Paint white */
    filter: brightness(0) invert(1);
  }

  /* Hide Brand Text on mobile topbar as requested */
  .topbar .brand span,
  .topbar .brand-name {
    display: none !important;
  }

  /* Hide Topbar Buttons/Links on Mobile (Logout, Back to Shop, etc) as they are in Bottom Nav */
  .topbar .btn,
  .topbar .link,
  .topbar #logout,
  .topbar #admin-link {
    display: none !important;
  }
}

/* Mobile Header (Top) - REMOVED/HIDDEN */
.mobile-header {
  display: none !important;
}

@media (min-width: 860px) {
  .mobile-header {
    display: none !important;
  }
}

/* Mobile Bottom Nav */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 12px 0;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  /* Safe area for iPhone home bar + extra spacing */
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 20px));
}

@media (min-width: 860px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav .nav-item {
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  padding: 4px 8px;
  text-align: center;
  justify-content: center;
  background: transparent;
  width: auto;
  flex: 1;
}

.mobile-nav .nav-icon {
  width: 24px;
  height: 24px;
}

/* Hide the active indicator bar on mobile, use color only */
.mobile-nav .nav-item.active::before {
  display: none;
}

.mobile-nav .nav-item.active {
  background: transparent;
  color: var(--primary);
}



.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  padding: 0 16px;
}

.sidebar-logo {
  width: 48px;
  height: 32px;
  border-radius: 8px;
  /* Filter removed as per user request (logo is already colored) */
}

.sidebar-app-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.user-greeting-box {
  margin-bottom: 32px;
}

.user-greeting {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-body);
  margin-bottom: 12px;
}

/* Sidebar menu */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Ensure shell fits nicely in grid column */
@media (min-width: 860px) {
  .shell {
    width: 100%;
    margin: 0 !important;
  }

  /* Force 1 column for products on desktop with sidebar */
  #product-list {
    grid-template-columns: 1fr !important;
  }
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 24px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background: #F8FBFF;
  color: var(--primary);
}

.nav-item.active {
  background: #F0F7FF;
  color: var(--primary);
  font-weight: 600;
}

/* Dark Blue indicator */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--page);
  padding: 2px;
  border: 1px solid var(--border);
}

.is-hidden {
  display: none !important;
}

/* Mobile Topbar Greeting */
.mobile-greeting {
  display: none;
}

@media (max-width: 859px) {
  .mobile-greeting {
    display: block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    /* White as requested (implied dark bg) */
    margin-right: 0px;
  }
}


/* Shared Preloader Styles */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--page);
  /* Fallback to page color */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .35s ease, visibility .35s ease;
}

.preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pre-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.pre-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .2px;
  color: #0F2643;
  font-size: 18px;
}

.pre-anim {
  width: 160px;
  height: 160px;
}

/* Active Reservation Card (Responsive) */
.active-res-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 600px) {
  .active-res-card-content {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

.pre-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
}

/* Phase 2: Liquid UI / Investments */

.investment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

.investment-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.investment-card:hover {
  /* transform: translateY(-6px) scale(1.02); Removed scale/move by request */
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f2f5;
  overflow: hidden;
}

.card-image-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) opacity(0.5);
  transition: filter 0.3s ease;
}

.card-image-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The magic clip-path will be set inline via JS */
  /* clip-path: inset(50% 0 0 0); example */
  transition: clip-path 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.face-pile {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  z-index: 5;
}

.face-pile-item {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -10px;
  object-fit: cover;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.face-pile-item:first-child {
  margin-left: 0;
}

.investment-card:hover .card-image-bg {
  filter: grayscale(100%) opacity(0.3);
}

.card-content {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
}

.inv-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.inv-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 12px;
}

.inv-current {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.inv-target {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Modal Enhancements */
.chip-in-preview {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  /* Prevent squeezing */
  aspect-ratio: 1;
  /* Enforce circle */
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.chip-in-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip-in-slider-wrap {
  width: 100%;
  padding: 10px 0;
}

.chip-in-btn {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip-in-btn.shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.stack {
  display: flex;
  flex-direction: column;
}

.gap {
  gap: 16px;
}

.gap.small {
  gap: 8px;
}

.input-field {
  background: #f8f9fa;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary) !important;
  background: white;
}

/* Styled Slider for Investment Gradient */
#chip-in-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  /* Thicker track for better gradient visibility */
  border-radius: 6px;
  /* background is set via JS */
  outline: none;
  margin: 10px 0;
  cursor: pointer;
}

/* --- Admin Tabs --- */
.tabs-header {
  border-bottom: 2px solid var(--border);
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeUp 0.3s;
}

/* --- Admin Inputs --- */
.input-std {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s;
}

.input-std:focus {
  border-color: var(--primary);
  outline: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Table Enhancements --- */
.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  font-size: 14px;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.positive-text {
  color: var(--primary);
  font-weight: 600;
}

.negative-text {
  color: #c25b48;
  font-weight: 600;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Chrome/Safari Thumb */
#chip-in-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: none !important;
  transform: scale(1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#chip-in-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Firefox Thumb */
#chip-in-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: none !important;
  transform: scale(1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#chip-in-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Skeleton Loader for Pitch Cards */
.card-image-skeleton {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  /* Animated Gradient Background */
  background: linear-gradient(-45deg, #232323, #2a2a2a, #1a1a1a, #232323);
  background-size: 400% 400%;
  animation: gradientBG 3s ease infinite;
  overflow: hidden;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.card-image-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0.05) 20%,
      rgba(255, 255, 255, 0.1) 60%,
      rgba(255, 255, 255, 0));
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  z-index: 6;
  margin-top: 8px;
  animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }
}

/* Deadline Badge */
.deadline-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.deadline-badge:empty {
  display: none;
}

/* Modal Skeleton Shimmer */
.skeleton-shimmer {
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(20, 20, 20, 0.1) 20%,
      rgba(20, 20, 20, 0.2) 60%,
      rgba(255, 255, 255, 0));
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Tooltip for Avatars */
.chk-avatar-wrapper {
  position: relative;
  display: inline-flex;
  margin-left: -8px;
  /* Standard Face Pile overlap */
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chk-avatar-wrapper:first-child {
  margin-left: 0;
}

.chk-avatar-wrapper:hover {
  transform: translateY(-4px) scale(1.1);
  z-index: 100 !important;
}

/* Re-styling the image inside wrapper */
.chk-avatar-wrapper .face-pile-item {
  margin-left: 0;
  /* Reset margin on img since wrapper handles it */
  pointer-events: none;
  /* Let clicks pass to wrapper if needed */
  display: block;
}

/* Tooltip Text */
.chk-avatar-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.8);
  opacity: 0;

  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;

  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(15, 39, 67, 0.2);
}

/* Tiny Arrow */
.chk-avatar-wrapper::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px) scale(0);
  opacity: 0;
  transition: all 0.2s ease;

  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--primary);
}

.chk-avatar-wrapper:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px) scale(1);
}

.chk-avatar-wrapper:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Funded Badge */
.funded-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #10B981;
  /* Green */
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

.funded-badge svg {
  width: 13px;
  height: 13px;
}

/* Expired Badge (matches funded design but grey) */
.expired-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #64748b;
  /* Slate 500 */
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.3);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

/* Modern Room Cards Redesign */
.room-card-modern {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 24px;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  min-height: 280px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.room-card-modern::before {
  content: '';
  position: absolute;
  top: 90px;
  /* Adjust top to control where the arc starts */
  left: 50%;
  transform: translateX(-50%);
  width: 180%;
  /* Much wider to Flatten the arc */
  height: 400px;
  background: rgba(255, 255, 255, 0.45);
  /* Slightly more opaque */
  border-radius: 50% 50% 0 0;
  /* Top curve only? Or just huge circle */
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.room-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 39, 67, 0.12);
}

/* Gradients */
.grad-peach {
  background: linear-gradient(135deg, #FFF0E3 0%, #FFD4C4 100%);
  --card-border: #FFCCBC;
}

.grad-mint {
  background: linear-gradient(135deg, #E0F7FA 0%, #CDEFE4 100%);
  --card-border: #B2DFDB;
}

.grad-lilac {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  --card-border: #E1BEE7;
}

.room-card-modern .room-icon-wrapper {
  position: relative;
  z-index: 1;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  border: 4px solid var(--card-border, rgba(0, 0, 0, 0.05));
  transition: transform 0.3s ease;
}

.room-card-modern:hover .room-icon-wrapper {
  transform: scale(1.05);
}

.room-card-modern .room-icon {
  width: 90%;
  height: 90%;
  object-fit: contain;
  border-radius: 50%;
  /* in case image itself is square */
}

.room-card-modern:hover .room-icon {
  transform: scale(1.05);
  /* Slight zoom on hover */
}

.room-card-modern h3,
.room-card-modern .room-location,
.room-card-modern .room-desc,
.room-card-modern .status-check,
.room-card-modern .status-sub {
  position: relative;
  z-index: 1;
}

.room-card-modern h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
  font-family: var(--font-body);
  /* Cleaner sans-serif look for this card style */
}

/* Mobile Compact View */
@media (max-width: 600px) {
  .slot-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Turn card into a horizontal row */
  .room-card-modern {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 12px 16px;
    min-height: auto;
    /* Remove large height */
    overflow: hidden;
  }

  .room-card-modern .room-icon-wrapper {
    width: 72px;
    height: 72px;
    margin-bottom: 0;
    margin-right: 16px;
    flex-shrink: 0;
    border-width: 2px;
    /* Smaller border on mobile */
  }

  .room-card-modern .room-icon {
    /* Reset specific size on inner icon so it fills wrapper */
    width: 100%;
    height: 100%;
    margin: 0;
  }

  /* Adjust circle to sit behind the icon on the left (Top Left corner) */
  .room-card-modern::before {
    left: -40px;
    top: -20px;
    bottom: -20px;
    /* Stretch vertical */
    height: auto;
    /* Override fixed height */
    transform: none;
    width: 180px;
    padding-bottom: 0;
    border-radius: 50%;
    /* Creates a vertical oval if height > width */
  }

  /* Content Container adjustments */
  .room-card-modern .room-details-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .room-card-modern h3 {
    font-size: 18px;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  /* Specificity boost to override desktop styles defined later */
  .room-card-modern .room-location {
    font-size: 11px;
    margin-bottom: 2px;
  }

  /* Hide Description to save space */
  .room-card-modern .room-details-col .room-desc {
    display: none;
  }

  /* Status compact specificity boost */
  .room-card-modern .status-check {
    margin-top: 2px;
    font-size: 13px;
  }

  .room-card-modern .status-sub {
    font-size: 11px;
    margin-top: 0;
  }
}

.room-location {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
}

.room-desc {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: auto;
  /* Pushes status to bottom */
  max-width: 260px;
}

.status-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  color: #2E7D32;
  /* Green */
  margin-top: 24px;
}

.status-check.occupied {
  color: #D32F2F;
  /* Red */
}

.status-sub {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 4px;
  font-weight: 500;
}

/* ===================================================== */
/* ========= Mobile Optimization (Admin) =============== */
/* ===================================================== */

@media (max-width: 600px) {
  .shell {
    padding: 12px;
    overflow-x: hidden;
    /* Prevent horizontal scroll from cards/tables */
  }

  body {
    overflow-x: hidden;
  }

  /* --- Navigation & Toolbar --- */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar>* {
    width: 100%;
  }

  /* --- Topbar Full Width Fix --- */
  .topbar {
    width: 100%;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    border-radius: 0;
    justify-content: space-between;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  /* --- "New Delivery" Accordion logic --- */
  details.mobile-accordion {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
  }

  details.mobile-accordion[open] {
    box-shadow: var(--shadow-md);
  }

  details.mobile-accordion summary {
    padding: 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FBFF;
    color: var(--primary);
  }

  details.mobile-accordion summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
  }

  details.mobile-accordion[open] summary::after {
    content: '–';
  }

  details.mobile-accordion summary::-webkit-details-marker {
    display: none;
  }

  .accordion-content {
    padding: 16px;
    border-top: 1px solid var(--border);
  }

  /* --- History Table -> Cards Transformation --- */
  #history-card .history-table thead {
    display: none;
  }

  #history-card .history-table tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  }

  #history-card .history-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 14px;
    text-align: right;
  }

  #history-card .history-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    margin-right: 12px;
  }

  /* First row in card (Date) - make it a header */
  #history-card .history-table td:first-child {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 8px;
  }

  /* Reset table container styles for card view */
  #history-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  #history-card .table-wrap {
    border: none;
    overflow: visible;
    padding: 0;
  }

  /* Hide empty/admin skeleton in card mode to avoid layout glitches if desired, 
      but we want to show them. Just reset their styles. */

  /* --- Summary Matrix Improvements --- */
  .matrix {
    font-size: 13px;
  }

  .matrix th,
  .matrix td {
    padding: 12px 8px;
  }

  /* Sticky First Col */
  .matrix th:first-child,
  .matrix td:first-child {
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    border-right: 1px solid var(--border);
    min-width: 120px;
    max-width: 120px;
    white-space: normal;
    line-height: 1.2;
  }

  .matrix th:first-child {
    z-index: 10;
    background: #F6FAFF;
  }

  /* --- Manual Entry Grid --- */
  .grid-3 {
    grid-template-columns: 1fr !important;
  }

  /* Make manual inputs nice and big */
  #manual-order-card .field.fancy input {
    font-size: 16px;
    padding: 12px;
  }

  /* General Card Padding adjustment */
  .card {
    padding: 16px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  h2 {
    font-size: 20px;
  }
}

/* Override Card Subheadings */
.card h2,
h2 {
  font-size: 20px !important;
  letter-spacing: -0.2px;
  font-weight: 600 !important;
}

/* --- Avatar Hover Tooltip & Animation --- */

/* The container for the avatar in the sidebar */
.user-profile-col {
  position: relative;
}

/* Avatar Hover Effect */
.user-avatar {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.user-avatar:hover {
  transform: scale(1.08);
  /* Interactive bounce scaling */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  /* Lift shadow */
}

/* Custom CSS Tooltip wrapper */
.user-avatar-wrap {
  position: relative;
  display: inline-block;
}

/* The actual Tooltip */
.user-avatar-wrap::after {
  content: "Profilbild ändern";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* The small arrow on the tooltip */
.user-avatar-wrap::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 6px;
  border-style: solid;
  border-color: var(--text) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

/* Show tooltip on hover */
.user-avatar-wrap:hover::after,
.user-avatar-wrap:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Topbar override to position tooltip on the bottom since topbar is horizontal */
.topbar .user-avatar-wrap::after {
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  bottom: auto;
}

.topbar .user-avatar-wrap::before {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  border-color: transparent transparent var(--text) transparent;
  bottom: auto;
}

.topbar .user-avatar-wrap:hover::after,
.topbar .user-avatar-wrap:hover::before {
  transform: translateX(-50%) translateY(0);
}