/* Sundowners Staff Portal — web 3.0 (Supabase + Netlify)
   Two resorts, same backgrounds as before: SBV sand / sea green / gold, SVV pastel blue. Light only. */
:root, html.r-SBV {
  --bg: #f3ead9; --bg-1: #fbf8f1; --bg-2: #f5eee0; --bg-3: #ece0c8;
  --ink: #22312c; --muted: #6f7a75; --faint: #a39a88;
  --sea: #3e8e73; --sea-d: #2f6f5a; --sea-soft: #e3efe8;
  --gold: #b08a3e; --line: rgba(176, 138, 62, .22); --line-soft: rgba(176, 138, 62, .12);
  --card: rgba(255, 255, 255, .72); --card-hover: #ffffff;
  --sun: #e8b45a; --sun-glow: rgba(232, 180, 90, .45); --horizon: #3e8e73;
  --badge-app: var(--sea-soft); --badge-app-ink: var(--sea-d);
}
html.r-SVV {
  --bg: #d9ecf5; --bg-1: #f7fbfd; --bg-2: #eaf5fa; --bg-3: #d5eaf3;
  --ink: #1f3a46; --muted: #5f7b88; --faint: #8fa9b5;
  --sea: #2b93ad; --sea-d: #1f7389; --sea-soft: #e0f1f7;
  --gold: #2b93ad; --line: rgba(43, 147, 173, .24); --line-soft: rgba(43, 147, 173, .12);
  --card: rgba(255, 255, 255, .78); --card-hover: #ffffff;
  --sun: #f1c27d; --sun-glow: rgba(241, 194, 125, .45); --horizon: #2b93ad;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.45; color: var(--ink); min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%) no-repeat;
  transition: background .4s ease;
}
::selection { background: var(--sea-soft); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }

/* ---- the horizon (the one decorative element): the sun on the sea line, low on the screen */
.horizon { position: fixed; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none; z-index: 0; overflow: hidden; }
.horizon .sea { position: absolute; left: 0; right: 0; top: 118px; height: 1px; background: linear-gradient(90deg, transparent, var(--horizon) 20%, var(--horizon) 80%, transparent); opacity: .55; }
.horizon .sun {
  position: absolute; top: 118px; width: 22px; height: 22px; border-radius: 50%; background: var(--sun);
  box-shadow: 0 0 0 10px var(--sun-glow), 0 0 60px 24px var(--sun-glow);
  transform: translate(-50%, var(--sun-y, -50%)); left: var(--sun-x, 50%);
  transition: left 1.6s cubic-bezier(.2, .7, .2, 1), transform 1.6s cubic-bezier(.2, .7, .2, 1), background .4s;
}
.horizon .sun::after { /* its reflection under the line */
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 14px; transform: translateX(-50%); background: var(--sun); opacity: .35; border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) { .horizon .sun { transition: none; } .spin { animation: none; } }

.wrap { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 20px 96px; }

/* ---- header */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 22px; padding: 26px 0 18px; }
.logo { height: 60px; width: auto; display: block; }
.hello h1 { font-size: 30px; font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -.3px; }
.hello p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.rsel { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
.rsel button { font: inherit; font-size: 13.5px; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.rsel button[aria-selected="true"] { background: var(--ink); color: #fff; }

/* ---- tools */
.tools { display: flex; gap: 10px; align-items: center; margin: 22px 0 10px; }
.search { flex: 1; position: relative; display: block; }
.search input { width: 100%; padding: 12px 16px 12px 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); color: var(--ink); font: inherit; outline: none; }
.search input:focus { border-color: var(--sea); background: #fff; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); color: var(--sea-d); cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { background: #fff; border-color: var(--sea); }
.iconbtn.busy svg { animation: s .8s linear infinite; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; }
.chip { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.chip[aria-pressed="true"] { background: var(--sea-soft); color: var(--sea-d); border-color: var(--line-soft); }

/* ---- sections and tiles */
section.group { margin-top: 26px; }
section.group h2 { font-size: 13px; font-weight: 700; letter-spacing: .2px; color: var(--gold); margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
a.tile {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; position: relative; min-height: 70px;
  transition: background .15s, border-color .15s;
}
a.tile:hover { background: var(--card-hover); border-color: var(--sea); }
.ico { width: 44px; height: 44px; border-radius: 11px; background: var(--sea-soft); display: grid; place-items: center; font-size: 21px; }
.tt { font-weight: 700; font-size: 15px; line-height: 1.25; }
.dd { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.type { font-size: 11.5px; font-weight: 700; color: var(--faint); }
.type.TV { color: #a9742a; } .type.Sheet { color: #3f6a93; } .type.App { color: var(--sea-d); } .type.Site { color: #7a4b85; }
.both { font-size: 11px; color: var(--faint); }
.star { font: inherit; font-size: 17px; line-height: 1; color: #cfc8ba; background: none; border: 0; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.star:hover, .star[aria-pressed="true"] { color: var(--gold); }

/* ---- states */
.state { text-align: center; color: var(--muted); padding: 56px 10px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--sea); border-radius: 50%; margin-right: 10px; vertical-align: -4px; animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.card { max-width: 480px; margin: 48px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; }
.card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.card p { color: var(--muted); margin: 0 0 18px; }
.card .fine { font-size: 13px; margin: 12px 0 0; color: #a04a3a; }
.primary { font: inherit; font-weight: 700; font-size: 15px; padding: 12px 20px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; cursor: pointer; }
.primary:hover { background: var(--sea-d); }
.preview { background: #fff6dc; color: #7a5a10; border: 1px solid #ecd48a; padding: 10px 16px; border-radius: 12px; margin-top: 8px; font-size: 14px; }
footer { margin-top: 48px; color: var(--faint); font-size: 12.5px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
footer button { font: inherit; font-size: 12.5px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 680px) {
  .wrap { padding: 0 16px 80px; }
  .top { grid-template-columns: auto 1fr; gap: 14px; padding: 18px 0 12px; }
  .logo { height: 42px; }
  .hello h1 { font-size: 22px; }
  .hello p { font-size: 13px; margin-top: 3px; }
  .rsel { grid-column: 1 / -1; justify-self: start; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .horizon { height: 110px; } .horizon .sea, .horizon .sun { top: 84px; }
}
