:root { --ink:#1a1d26; --muted:#6b7080; --line:#e6e8ee; --bg:#f4f6fb; --card:#fff; --accent:#1c58d9; --accent-soft:#e8effc; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 500px at 10% -10%, #efe6fb 0, transparent 60%), radial-gradient(1000px 500px at 100% 0, #dff1fb 0, transparent 55%), var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand.dark { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(from 200deg, #7939f2, #1c58d9, #2fb9e6, #7939f2); box-shadow: inset 0 0 0 6px rgba(255,255,255,.55); }
.top-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top-nav .who { color: var(--muted); font-size: 13.5px; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 8px 24px 40px; flex: 1; }
.wrap.narrow { max-width: 900px; }
/* —— signed in: the menu on the left (as the Orbit's), the person on the right —— */
body.is-signed { flex-direction: row; }
.side {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none; box-sizing: border-box;
  padding: 18px 12px; background: #1e2a4f; color: #fff; display: flex; flex-direction: column; gap: 18px;
}
.side .brand { color: #fff; padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: rgba(255, 255, 255, .78); font-size: 15px; transition: background .15s ease, color .15s ease;
}
.side-item svg { width: 19px; height: 19px; flex: none; }
.side-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-item.is-active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 3px 0 0 #8ab4ff; }
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 4px; max-width: 980px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.bar-title { font-size: 26px; font-weight: 700; }
.user { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 999px; cursor: default; outline: none; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #7939f2, #1c58d9); color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.user-email { color: var(--ink); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; padding: 6px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(16, 24, 40, .16);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 10;
}
.user::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } /* the way to the menu */
.user:hover .user-menu, .user:focus-within .user-menu { opacity: 1; visibility: visible; transform: none; }
.user:hover .user-chev, .user:focus-within .user-chev { transform: rotate(180deg); }
.user-menu form { margin: 0; }
.user-menu-item { appearance: none; border: 0; background: none; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; color: #c4323c; cursor: pointer; }
.user-menu-item:hover { background: #fdeeee; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.list-head h2 { margin: 0; }
.search { position: relative; flex: 0 1 340px; }
.search svg { position: absolute; left: 10px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); }
.search input { padding-left: 34px; border-radius: 999px; }
select { font: inherit; color: var(--ink); border: 1px solid #d8dbe3; border-radius: 10px; padding: 9px 12px; background: #fff; width: 100%; }
.badge.is-owner { background: #f3ecfb; color: #6a3fb0; }
.badge.is-admin { background: #e7f0fb; color: #1d5fae; }
.badge.is-manager { background: #eef0f5; color: #4a4f5c; }
@media (max-width: 760px) {
  body.is-signed { flex-direction: column; }
  .side { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto; }
  .side .brand span:last-child { display: none; }
  .side-nav { flex-direction: row; }
  .side-item span { white-space: nowrap; }
  .bar { padding: 12px 16px 0; }
  .bar-title { font-size: 21px; }
  .user-email { max-width: 120px; }
  .wrap { padding: 8px 16px 32px; }
}
h1 { font-size: 26px; margin: 12px 0 16px; }
h2 { font-size: 18px; margin: 0 0 10px; }
.card { background: rgba(255,255,255,.86); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.9); border-radius: 18px; padding: 20px 22px; margin: 0 0 14px; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 30px rgba(38,44,96,.08); }
.login { max-width: 440px; margin: 48px auto; }
.lead { color: var(--muted); margin: 0 0 14px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
input, textarea { font: inherit; color: var(--ink); border: 1px solid #d8dbe3; border-radius: 10px; padding: 9px 12px; background: #fff; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-cells { display: flex; justify-content: center; gap: 8px; }
.code-cell {
  width: 52px; height: 62px; padding: 0; text-align: center; font-size: 28px; font-weight: 600;
  font-variant-numeric: tabular-nums; border-radius: 12px; caret-color: var(--accent);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.code-cell:focus { transform: translateY(-1px); }
.code-gap { width: 6px; }
.code-cells.is-full .code-cell { border-color: #9fc6a9; background: #f4fbf6; }
@media (max-width: 420px) { .code-cell { width: 42px; height: 54px; font-size: 24px; } .code-cells { gap: 6px; } }
.btn { appearance: none; border: 1px solid #cdd6ee; background: #fff; color: var(--accent); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #c4323c; border-color: #f0c4c8; }
.btn.is-done { color: #1f7a4a; border-color: #b9e3c9; background: #eaf7ef; }
.link { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.again { margin-top: 10px; }
.err { color: #b0303a; background: #fdeeee; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.ok { color: #1f7a4a; background: #eaf7ef; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.muted, .empty p { color: var(--muted); }
.lic-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lic-head h2 { margin: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: #eef0f5; color: #4a4f5c; }
.badge.is-active { background: #e6f4ec; color: #1f7a4a; }
.badge.is-soon { background: #fff3d6; color: #8a5a00; }
.badge.is-expired, .badge.is-revoked { background: #fdeaea; color: #b0303a; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.key-label { display: block; font-weight: 600; margin: 4px 0 6px; }
.key-row { display: flex; gap: 10px; align-items: stretch; }
.key { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; resize: none; background: #f8f9fc; }
.hint { color: var(--muted); font-size: 13.5px; margin: 10px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; align-items: end; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.grid label small { color: #9aa0ab; }
.grid .check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.grid .check input { width: auto; }
.actions { grid-column: 1 / -1; }
.count { color: var(--muted); font-weight: 500; font-size: 14px; }
.table { display: flex; flex-direction: column; }
.row { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-child { border-top: 0; }
.row-main { min-width: 0; flex: 1 1 320px; }
.sub { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.inline { display: flex; gap: 4px; align-items: center; }
.small { width: 76px; padding: 6px 8px; }
.foot { text-align: center; color: #9aa0ab; font-size: 12.5px; padding: 16px; }
@media (max-width: 640px) {
  .key-row { flex-direction: column; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 6px; }
}
.warn { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #fff3d6; color: #8a5a00; font-size: 13px; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f3f8; padding: 1px 5px; border-radius: 5px; }

/* —— the calendar (portal.js datePickers) —— */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.grid label.is-muted input { opacity: .45; }
.datepicker { position: relative; }
.date-btn {
  appearance: none; width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  font: inherit; font-size: 15px; color: #9aa0ab; background: #fff; border: 1px solid #d8dbe3; border-radius: 10px; padding: 9px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.date-btn svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.date-btn:hover { border-color: #b9c6e6; }
.date-btn:focus-visible, .date-btn[aria-expanded="true"] { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.datepicker.has-value .date-btn { color: var(--ink); font-weight: 600; }
.dp-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: 316px; padding: 14px; box-sizing: border-box;
  border-radius: 18px; background: #fff;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 20px 50px rgba(38, 44, 96, .22);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top left;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2, .9, .25, 1.1);
}
.dp-pop.is-open { opacity: 1; transform: none; }
.dp-pop.is-closing { opacity: 0; transform: translateY(-4px) scale(.98); transition-duration: .12s; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-weight: 700; font-size: 16px; color: var(--ink); text-transform: capitalize; }
.dp-nav {
  appearance: none; width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
  background: #f1f4fb; color: var(--accent); font-size: 22px; line-height: 1; display: grid; place-items: center;
  transition: background .15s ease, transform .1s ease;
}
.dp-nav:hover { background: var(--accent-soft); }
.dp-nav:active { transform: scale(.92); }
.dp-week, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: 12px; font-weight: 600; color: #9aa0ab; padding: 4px 0 6px; }
.dp-week span.is-weekend { color: #d07a80; }
.dp-grid { overflow: hidden; }
.dp-days.slide-left { animation: dp-in-left .22s ease; }
.dp-days.slide-right { animation: dp-in-right .22s ease; }
@keyframes dp-in-left { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes dp-in-right { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.dp-day {
  appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink);
  height: 36px; border-radius: 10px; font-variant-numeric: tabular-nums; transition: background .12s ease, color .12s ease, transform .1s ease;
}
.dp-day:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.dp-day:active:not(:disabled) { transform: scale(.92); }
.dp-day.is-out { color: #c3c7d0; }
.dp-day.is-past { color: #d5d8de; cursor: default; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 700; }
.dp-day.is-selected { background: linear-gradient(135deg, #3b6ff0, #1c58d9); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(28, 88, 217, .35); }
.dp-day.is-focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp-quick { display: flex; gap: 6px; margin: 10px 0 2px; }
.dp-quick button {
  appearance: none; flex: 1; border: 1px solid #dde4f5; background: #f7f9fe; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 4px; border-radius: 999px; transition: background .15s ease;
}
.dp-quick button:hover { background: var(--accent-soft); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dp-foot button { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--accent); padding: 4px 6px; border-radius: 8px; }
.dp-foot button:hover { background: var(--accent-soft); }
.dp-foot .dp-clear { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .dp-pop, .dp-days { transition: none; animation: none !important; } }
@media (max-width: 420px) { .dp-pop { width: calc(100vw - 48px); } }
.card { position: relative; }
.card.is-raised { z-index: 30; }
