:root{
  --bg:#120818;            /* deep purple */
  --card:#1b0f27;          /* purple card */
  --text:#f4efff;
  --muted:#c8b7e6;
  --line:rgba(255,255,255,.10);
  --accent:#b07cff;        /* lavender accent */
  --danger:#ff6b6b;
  --shadow: 0 12px 40px rgba(0,0,0,.40);
  --radius:16px;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  min-height:100vh;
  background-color: var(--bg);
  /* Large, non-repeating gradients + cover to avoid visible seams */
  background-image:
    radial-gradient(1400px 900px at 18% 0%, rgba(176,124,255,.26), transparent 62%),
    radial-gradient(1200px 850px at 92% 12%, rgba(255,124,214,.14), transparent 64%),
    radial-gradient(1600px 1100px at 55% 105%, rgba(120,80,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.025) 0%, rgba(255,255,255,0) 55%, rgba(0,0,0,.18) 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* On mobile, fixed backgrounds can cause visible banding/seams */
@media (max-width: 768px){
  body{ background-attachment: scroll; }
}
a{ color: var(--muted); text-decoration:none; }
a:hover{ color: var(--text); text-decoration:underline; }

.top{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding: 14px 16px; border-bottom:1px solid var(--line); background: rgba(0,0,0,.15); position: sticky; top:0; backdrop-filter: blur(10px); z-index: 1000; }
.brand{ display:flex; gap:10px; align-items:baseline; }
.brandlink{ color: var(--text); font-weight:800; letter-spacing:.2px; }
.muted{ color: var(--muted); font-size: 13px; }
.nav{ display:flex; gap:10px; flex-wrap: wrap; justify-content:flex-end; align-items:center; }
.navlinks{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.navlink{ padding:8px 10px; border-radius: 10px; border:1px solid transparent; }
.navlink:hover{ border-color: var(--line); background: rgba(255,255,255,.03); text-decoration:none; }
.navbtn{ padding:8px 10px; border-radius: 10px; border:1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); cursor:pointer; }

/* mobile dropdown */
.navmenu{ display:none; position: relative; z-index: 999999; }
.navmenu > summary{ list-style:none; }
.navmenu > summary::-webkit-details-marker{ display:none; }

/* Make menu a fixed overlay so it sits above FullCalendar (and everything else) */
.navmenu > summary{ position: relative; z-index: 1000001; }

.navmenu[open]::before{
  content:"";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 999990;
}
.navmenu-panel{
  position: fixed;
  right: 10px;
  top: 58px;
  min-width: 220px;
  max-width: calc(100vw - 20px);
  background-color: #130a1c;
  border:1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 18px 70px rgba(0,0,0,.65);
  z-index: 1000000;
}
.navmenu-item{
  display:block;
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  text-decoration:none;
  font-weight: 800;
  text-align:left;
}
.navmenu-item + .navmenu-item{ margin-top: 8px; }
.navmenu-item:hover{ background: rgba(255,255,255,.06); text-decoration:none; }
.navmenu-item.danger{ border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.12); }

.wrap{ max-width: 1100px; margin: 0 auto; padding: 18px 14px 34px; }

.card{ background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border:1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow:hidden; }
.cardhead{ padding: 16px 16px 10px; border-bottom:1px solid rgba(255,255,255,.08); }
.cardhead h1{ margin:0 0 6px 0; font-size: 18px; }
.cardbody{ padding: 14px 16px 16px; }

.form{ display:flex; flex-direction:column; gap: 12px; }
.field .label{ font-weight: 700; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=datetime-local], input[type=date], input[type=time], select, textarea{
  width:100%;
  background: rgba(10,16,30,.65);
  color: var(--text);
  border:1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px 12px;
  outline:none;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus{ border-color: rgba(176,124,255,.55); box-shadow: 0 0 0 3px rgba(176,124,255,.18); }
textarea{ resize: vertical; min-height: 120px; }

.checks{ display:flex; flex-wrap:wrap; gap: 10px 14px; }
.check{ display:flex; gap:8px; align-items:center; padding:8px 10px; border:1px solid rgba(255,255,255,.10); border-radius: 12px; background: rgba(255,255,255,.03); }

.actions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap: wrap; }
.btn{ display:inline-block; border:0; border-radius: 12px; padding: 10px 14px; font-weight:800; background: linear-gradient(135deg, var(--accent), #7aa7ff); color:#081026; cursor:pointer; }
.btn:hover{ filter: brightness(1.05); }
.btn.ghost{ background: rgba(255,255,255,.06); color: var(--text); border:1px solid var(--line); }
.btn.disabled{ opacity:.55; pointer-events:none; }
.btn.danger{ background: linear-gradient(135deg, var(--danger), #ff9a9a); }

.alert{ padding: 10px 12px; border:1px solid rgba(255,107,107,.35); background: rgba(255,107,107,.10); border-radius: 12px; margin-bottom: 10px; }
.hint{ padding: 10px 12px; border:1px solid rgba(91,140,255,.35); background: rgba(91,140,255,.10); border-radius: 12px; margin-bottom: 10px; }

.badge{ display:inline-flex; align-items:center; border-radius:999px; padding:4px 10px; font-size:12px; font-weight:800; border:1px solid rgba(255,255,255,.15); }
.badge.scheduled{ background: rgba(139,92,246,.18); color:#e9ddff; border-color: rgba(139,92,246,.45); }
.badge.arrived{ background: rgba(34,197,94,.18); color:#d9ffe8; border-color: rgba(34,197,94,.45); }
.badge.completed{ background: rgba(20,184,166,.18); color:#dcfffb; border-color: rgba(20,184,166,.45); }
.badge.no-show{ background: rgba(239,68,68,.18); color:#ffe2e2; border-color: rgba(239,68,68,.45); }

/* suggestions */
.suggest{ display:none; margin-top:8px; border:1px solid rgba(255,255,255,.10); border-radius: 12px; overflow:hidden; background: rgba(10,16,30,.85); }
.suggest-item{ padding: 10px 12px; cursor:pointer; border-bottom:1px solid rgba(255,255,255,.06); }
.suggest-item:last-child{ border-bottom:none; }
.suggest-item:hover{ background: rgba(255,255,255,.05); }

/* modal */
.modal{ position:fixed; inset:0; background: rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; padding: 18px; z-index: 9999; }
.modal.hidden{ display:none; }
.modal-inner{ width: 100%; max-width: 520px; position: relative; background-color: #130a1c !important; opacity: 1 !important; border:1px solid rgba(255,255,255,.14); border-radius: 16px; box-shadow: 0 18px 70px rgba(0,0,0,.65); padding: 16px; filter: none !important; }
.modal-title{ font-weight:900; margin-bottom: 8px; }
.modal-meta{ color: var(--muted); margin-bottom: 12px; }
.modal-details{ margin: 10px 0 14px; border:1px solid rgba(255,255,255,.12); border-radius: 14px; background-color: #1b0f27 !important; opacity: 1 !important; padding: 10px 12px; }
.detail-row{ display:flex; justify-content:space-between; gap:12px; padding: 6px 0; border-bottom:1px solid rgba(255,255,255,.08); }
.detail-row:last-child{ border-bottom:none; }
.detail-k{ color: var(--muted); font-size: 13px; }
.detail-v{ font-weight: 800; }
.detail-v.prewrap{ white-space: pre-wrap; word-break: break-word; }

.modal-actions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap: wrap; }

/* FullCalendar tweaks */
.fc{ --fc-page-bg-color: transparent; --fc-neutral-bg-color: rgba(255,255,255,.03); --fc-border-color: rgba(255,255,255,.10); --fc-today-bg-color: rgba(91,140,255,.10); --fc-event-bg-color: rgba(91,140,255,.85); --fc-event-border-color: rgba(91,140,255,.90); --fc-button-bg-color: rgba(255,255,255,.06); --fc-button-border-color: rgba(255,255,255,.10); --fc-button-text-color: var(--text); --fc-button-hover-bg-color: rgba(255,255,255,.10); --fc-button-hover-border-color: rgba(255,255,255,.18); --fc-button-active-bg-color: rgba(91,140,255,.45); --fc-button-active-border-color: rgba(91,140,255,.55); }

.dtgrid{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items:end; justify-items: stretch; }
.dtgrid > label{ width:100%; display:block; }
/* Some browsers render time inputs narrow unless forced */
.dtgrid input[type="time"], .dtgrid input[type="date"]{ width:100%; min-width: 0; }

/* wheel picker */
.wheel-modal{ max-width: 860px; }
.wheel-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 10px; }
.wheel-title{ font-weight: 900; }
.wheel-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.wheel-col{ min-width: 0; }
.wheel-label{ color: var(--muted); font-size: 12px; margin: 0 0 6px 4px; }
.wheel{
  height: 220px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border:1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(10,16,30,.55);
  position: relative;
}
.wheel-pad{ height: 88px; }
.wheel-item{
  scroll-snap-align: center;
  height: 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  color: rgba(244,239,255,.90);
}
.wheel::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  top:50%;
  transform: translateY(-50%);
  height: 44px;
  border:1px solid rgba(176,124,255,.55);
  border-radius: 12px;
  pointer-events:none;
  background: rgba(176,124,255,.08);
}
.wheel-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top: 12px; }

@media (max-width: 900px){
  .wheel-grid{ grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px){
  .wrap{ padding: 14px 10px 28px; }
  .top{ padding: 12px 10px; }
  .nav{ gap: 6px; }
  .dtgrid{ grid-template-columns: 1fr; }
  .wheel-modal{ max-width: 520px; }

  /* collapse header links into dropdown */
  .navlinks{ display:none; }
  .navmenu{ display:block; }

  /* FullCalendar title: keep readable on mobile */
  .fc .fc-toolbar-title{
    font-size: 16px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 54vw;
  }
  .fc .fc-header-toolbar{ gap: 6px; position: relative; z-index: 1; }
  .fc .fc-toolbar-chunk{ display:flex; align-items:center; gap: 6px; }
  .fc .fc-button{ padding: 6px 8px; font-size: 12px; }
}
