/* Sundown Desk owner dashboard: the site's dusk theme, with 3D depth */
:root {
  --bg: #14112B; --bg-raised: #1B1736; --card: #221D42; --card-hi: #2A2450;
  --line: rgba(236, 230, 255, .12); --line-2: rgba(236, 230, 255, .22);
  --text: #F4F1FB; --text-2: #C9C2E0; --sun: #FF8A3D; --sun-hi: #FFA463; --rose: #E8577E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 "Red Hat Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: "Red Hat Display", system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--sun); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

.sky { position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; opacity: .55; z-index: 0;
  background:
    radial-gradient(1.4px 1.4px at 7% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 19% 54%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 33% 10%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 48% 36%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 61% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 74% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 88% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 95% 46%, #fff 50%, transparent 51%); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 0; }
.btn.sun { background: var(--sun); color: #221000; }
.btn.sun:hover { background: var(--sun-hi); }
.btn.line { background: transparent; border: 1.5px solid rgba(244, 241, 251, .35); color: var(--text); }
.btn.wide { width: 100%; }
.ghost { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--text-2); font-size: 15px; font-weight: 600; }

.pill { display: inline-block; font-weight: 600; font-size: 12px; line-height: 1.6; padding: 1px 10px; border-radius: 999px; background: #DDD7EE; color: #221000; }
.pill.urgent { background: var(--sun); }
.pill.danger { background: var(--rose); color: #fff; }
.pill.handled { background: rgba(255, 138, 61, .18); color: #FFC9A6; }
.pill.message { background: rgba(236, 230, 255, .16); color: var(--text); }

/* ---------- Dashboard ---------- */
.shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 22px 22px 64px; display: flex; flex-direction: column; gap: 26px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.biz { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mark { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 6px 18px rgba(232, 87, 126, .3); flex: none; }
.biz-text { display: flex; flex-direction: column; min-width: 0; }
.biz-name { font-family: "Red Hat Display", sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-sub { font-size: 14px; color: var(--text-2); }
.top-right { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.title-row h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.03em; }
.title-row p { color: var(--text-2); font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px 22px; box-shadow: 0 18px 40px rgba(5, 3, 18, .4); }
.stat p { font-size: 15px; color: var(--text-2); }
.stat b { display: block; margin: 6px 0 2px; font-family: "Red Hat Display", sans-serif; font-weight: 800; font-size: 46px; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat b i { font-style: normal; font-size: 20px; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.stat small { font-size: 14px; color: var(--text-2); }
.stat.hot { background: #2A1E3E; border-color: rgba(255, 138, 61, .5); box-shadow: 0 0 0 5px rgba(255, 138, 61, .06), 0 18px 40px rgba(5, 3, 18, .4); }
.stat.hot p, .stat.hot small { color: #FFC9A6; }
.stat.hot b { color: var(--sun); }

.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
section { display: flex; flex-direction: column; gap: 14px; }
section h2 { font-size: 28px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; color: var(--text-2); font-weight: 600; font-size: 15px; }
.tabs button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: 20px; padding: 20px; color: var(--text-2); }

.urgent-list { display: flex; flex-direction: column; gap: 14px; }
.u-card { background: #241B3F; border: 1px solid rgba(255, 138, 61, .5); border-radius: 22px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 0 0 5px rgba(255, 138, 61, .06), 0 18px 40px rgba(5, 3, 18, .45); }
.u-card.danger { border-color: rgba(232, 87, 126, .7); box-shadow: 0 0 0 5px rgba(232, 87, 126, .08), 0 18px 40px rgba(5, 3, 18, .45); }
.u-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.u-top strong { font-family: "Red Hat Display", sans-serif; font-weight: 700; font-size: 19px; }
.u-top span.meta { color: var(--text-2); font-size: 15px; }
.u-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.u-actions .btn { min-height: 44px; padding: 0 18px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; color: var(--text); transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .2s, border-color .2s; }
.row:hover { transform: perspective(900px) translateZ(14px) rotateX(3deg); background: var(--card-hi); border-color: rgba(255, 138, 61, .45); }
.row .when { flex: none; width: 72px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.row .what { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .who strong { font-family: "Red Hat Display", sans-serif; font-weight: 700; font-size: 17px; }
.row .sum { font-size: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .len { flex: none; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: 0 24px 50px rgba(5, 3, 18, .45); }
.card.now { background: linear-gradient(160deg, var(--card-hi), var(--bg-raised) 70%); }
.eyebrow { font-size: 14px; color: var(--text-2); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.now-row { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.now-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.now-title { font-family: "Red Hat Display", sans-serif; font-weight: 800; font-size: 23px; letter-spacing: -0.02em; }
.now-time { font-family: "Red Hat Display", sans-serif; font-weight: 700; font-size: 34px; color: var(--sun); font-variant-numeric: tabular-nums; line-height: 1.1; }
.now-sub { font-size: 15px; color: var(--text-2); }

/* The live-call orb: a sunset sphere with two rings orbiting in 3D */
.orbit, .auth-orbit { position: relative; width: 150px; height: 150px; flex: none; perspective: 600px; }
.orb { position: absolute; inset: 30px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFE4B5 0%, #FFB25E 17%, #FF7A3D 40%, #E0507E 66%, #6A2C8C 93%);
  box-shadow: 0 0 46px 8px rgba(255, 110, 70, .32), inset -12px -16px 30px rgba(40, 10, 60, .45); }
.ring { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 190, 140, .7); transform: rotateX(72deg); }
.ring::after { content: ""; position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: #FFC27A; box-shadow: 0 0 12px 3px rgba(255, 160, 90, .7); }
.ring-a { inset: 12px; }
.ring-b { inset: -2px; border-color: rgba(232, 87, 126, .6); transform: rotateX(64deg) rotateY(-18deg); }
.ring-b::after { background: #F28AAB; box-shadow: 0 0 12px 3px rgba(232, 87, 126, .6); }
.ping { position: absolute; inset: 30px; border-radius: 50%; border: 2px solid rgba(255, 150, 90, .55); opacity: 0; }
.orbit.idle .orb { filter: saturate(.45) brightness(.7); }
.orbit.idle .ring { opacity: .45; }

.ring-stage { position: relative; height: 210px; display: flex; align-items: center; justify-content: center; perspective: 700px; }
.donut { --pct: 0%; position: relative; width: 196px; height: 196px; border-radius: 50%; transform: rotateX(56deg);
  background: conic-gradient(var(--sun) 0%, var(--rose) var(--pct), rgba(236, 230, 255, .1) var(--pct) 100%);
  box-shadow: 0 30px 30px rgba(5, 3, 18, .55); }
.hole { position: absolute; inset: 22px; border-radius: 50%; background: var(--card); box-shadow: inset 0 6px 14px rgba(5, 3, 18, .5); }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-label b { font-family: "Red Hat Display", sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -0.04em; line-height: 1; text-shadow: 0 6px 18px rgba(5, 3, 18, .7); }
.donut-label span { font-size: 14px; color: var(--text-2); text-shadow: 0 4px 12px rgba(5, 3, 18, .8); }
.month-sub { text-align: center; font-size: 15px; color: var(--text-2); }

/* Call details: a panel that swings in like a door */
.drawer { position: fixed; inset: 0; z-index: 20; background: rgba(8, 6, 20, .62); display: flex; justify-content: flex-end; perspective: 1400px; }
.panel { width: min(480px, 100%); height: 100%; overflow-y: auto; background: var(--bg-raised); border-left: 1px solid var(--line); padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 16px; box-shadow: -30px 0 60px rgba(5, 3, 18, .5); transform-origin: right center; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h3 { font-size: 28px; margin-top: 6px; }
.panel-head p { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); display: grid; place-items: center; }
.d-summary { font-size: 17px; }
.player { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.player audio { width: 100%; accent-color: var(--sun); }
.wave { height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.wave i { display: block; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--sun), var(--rose)); opacity: .85; }
.panel h4 { font-size: 18px; font-weight: 700; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; font-size: 16px; line-height: 1.5; }
.line-row b { font-weight: 600; font-size: 14px; color: var(--text-2); padding-top: 2px; }
.line-row b.ai { color: var(--sun); }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Sign-in pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card { position: relative; z-index: 1; width: min(420px, 100%); background: linear-gradient(160deg, var(--card-hi), var(--bg-raised) 70%); border: 1px solid var(--line); border-radius: 28px; padding: 28px 26px 26px; box-shadow: 0 40px 80px rgba(5, 3, 18, .55); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.auth-orbit { margin: -6px 0 4px; }
.auth-card h1 { font-size: 34px; }
.auth-lede { color: var(--text-2); }
.auth-msg { color: #FFC9A6; font-size: 15px; }
.auth-fine { color: var(--text-2); font-size: 14px; }

/* Narrow screens: the live call goes first, the month ring last */
@media (max-width: 899px) {
  .cols { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .side { display: contents; }
  .card.now { order: -1; }
  .main { order: 0; }
  .card.month { order: 1; }
}
@media (max-width: 560px) {
  .shell { padding: 18px 16px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; border-radius: 20px; }
  .stat b { font-size: 36px; }
  .row { gap: 12px; padding: 12px 14px; }
  .row .when { width: auto; min-width: 54px; white-space: nowrap; }
  .row .len { display: none; }
  .orbit { width: 120px; height: 120px; }
  .orb { inset: 24px; }
  .ring-a { inset: 10px; }
  .ping { inset: 24px; }
}

/* Motion, only for people who haven't asked their device to reduce it */
@media (prefers-reduced-motion: no-preference) {
  .tilt { transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease; }
  .tilt:hover { transform: perspective(900px) rotateX(7deg) rotateY(-9deg) translateY(-5px); box-shadow: 0 34px 60px rgba(5, 3, 18, .6); }
  .rise { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
  .rise.r2 { animation-delay: .08s; } .rise.r3 { animation-delay: .16s; } .rise.r4 { animation-delay: .24s; }
  .u-card.new { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .live-dot { animation: dot 1.8s ease-out infinite; }
  .orb { animation: breathe 3.2s ease-in-out infinite alternate; }
  .ring-a { animation: spin-a 7s linear infinite; }
  .ring-b { animation: spin-b 11s linear infinite; }
  .orbit:not(.idle) .ping { animation: ping 2.4s ease-out infinite; }
  .orbit.idle .orb { animation: none; }
  .orbit.idle .ring { animation-duration: 40s; }
  .donut { animation: bob 5s ease-in-out infinite alternate; }
  .drawer:not([hidden]) .panel { animation: door .5s cubic-bezier(.2, .8, .2, 1) both; }
  .player.playing .wave i { animation: talk 1.1s ease-in-out infinite; }
  .wave i:nth-child(3n) { animation-delay: -.3s; } .wave i:nth-child(4n+1) { animation-delay: -.7s; } .wave i:nth-child(5n+2) { animation-delay: -.5s; }
}
@keyframes rise { from { opacity: 0; transform: perspective(900px) rotateX(20deg) translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes dot { from { box-shadow: 0 0 0 0 rgba(255, 138, 61, .6); } to { box-shadow: 0 0 0 10px rgba(255, 138, 61, 0); } }
@keyframes breathe { from { scale: .96; } to { scale: 1.04; } }
@keyframes spin-a { from { transform: rotateX(72deg) rotateZ(0deg); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes spin-b { from { transform: rotateX(64deg) rotateY(-18deg) rotateZ(360deg); } to { transform: rotateX(64deg) rotateY(-18deg) rotateZ(0deg); } }
@keyframes ping { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
@keyframes bob { from { transform: rotateX(56deg) translateZ(0); } to { transform: rotateX(50deg) translateZ(14px); } }
@keyframes door { from { opacity: 0; transform: perspective(1200px) rotateY(-24deg) translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes talk { 0%, 100% { scale: 1 .5; } 50% { scale: 1 1; } }
