:root {
  --bg: #f1f6fa;
  --surface: #fff;
  --surface2: #eaf2f7;
  --text: #132b40;
  --muted: #50677a;
  --line: #d2e0ea;
  --accent: #006bc9;
  --mint: #007b66;
  --warning: #805000;
  --shadow: 0 18px 48px #173a5510;
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 75% 0%, #6554c315, transparent 44%), radial-gradient(ellipse at 5% 40%, #20d8c30b, transparent 40%), var(--bg);
}
body.dark {
  --bg: #080e1b;
  --surface: #101b2b;
  --surface2: #18283b;
  --text: #edf6ff;
  --muted: #9caec3;
  --line: #283549;
  --accent: #91b6ff;
  --mint: #68e2cd;
  --warning: #efc47f;
  --shadow: 0 18px 48px #0003;
  color-scheme: dark;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
}
button:hover {
  border-color: var(--accent);
  background: var(--surface2);
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.primary {
  background: #006bc9;
  color: #fff;
  border-color: #006bc9;
}
.primary:hover {
  background: #005cae;
}
.danger {
  color: #b62535;
}
body.dark .danger {
  color: #ff9a9a;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}
select option, select optgroup {
  background: var(--surface);
  color: var(--text);
}
select {
  appearance: none;
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, #718da1 50%),
    linear-gradient(135deg, #718da1 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
label {
  display: grid;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
}
small {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}
fieldset.auth-fields {border:0;padding:0;margin:0;min-width:0;display:grid;gap:16px}
form {
  display: grid;
  gap: 15px;
}
header {
  height: 86px;
  padding: 12px 36px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.identity {
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: #a0c0d2;
}
.identity img {
  width: 150px;
  height: 58px;
  object-fit: contain;
}
.identity span {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  border-left: 1px solid #285670;
  padding-left: 20px;
}
.header-actions {
  display: flex;
  gap: 8px;
}
.header-actions button {
  background: #102c43;
  color: var(--text);
  border-color: var(--line);
}
.welcome {
  max-width: 1190px;
  margin: 65px auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 100px;
  align-items: center;
}
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mint);
}
h1 {
  letter-spacing: -0.04em;
  font-size: 2.5rem;
  line-height: 1.12;
  margin: 14px 0;
}
h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.intro h1 {
  font-size: 3.5rem;
  max-width: 570px;
}
.intro p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 480px;
}
.intro .pilot {
  font-size: 0.875rem;
  margin-top: 40px;
}
.feature {
  display: grid;
  gap: 8px;
  border-left: 3px solid #00bfa0;
  padding: 12px 22px;
  margin-top: 30px;
}
.feature span {
  color: var(--muted);
}
.auth-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  gap: 5px;
}
.tabs button {
  border: 0;
  border-radius: 0;
  flex: 1;
  background: none;
}
.tabs .active {
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
}
details {
  margin-top: 24px;
  font-size: 0.875rem;
}
summary {
  cursor: pointer;
  min-height: 44px;
}
details form {
  margin-top: 12px;
}
#workspace { min-height:calc(100vh - 120px);padding:26px 42px 110px;max-width:1600px;margin:auto; }
#nav {position:fixed;z-index:8;bottom:22px;left:50%;transform:translateX(-50%);display:flex;gap:5px;padding:8px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:0 16px 50px #0004;max-width:calc(100vw - 28px);overflow-x:auto;backdrop-filter:blur(24px);}
#nav button {white-space:nowrap;border:0;background:transparent;padding:13px 17px;border-radius:15px;font-size:14px;font-weight:600;}
#nav button.active {background:var(--mint);color:var(--bg);box-shadow:0 4px 20px #38dab52a;}
.context-capsule{display:flex;align-items:center;gap:10px;margin:4px 0 30px;max-width:100%;flex-wrap:wrap;}
.context-capsule select{width:auto;max-width:320px;border-radius:40px;background:var(--surface);font-size:14px;}
.context-capsule label{display:none;}.context-tag{margin-left:auto;color:var(--muted);font-size:12px;letter-spacing:.08em;}
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--mint);
}
.content {
  flex: 1;
  min-width: 0;
  padding: 0;
  max-width: 1800px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
}
.page-heading h1 {
  font-size: 2rem;
}
.page-heading p {
  color: var(--muted);
  margin: 0;
  font-size: 0.9375rem;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar input,
.toolbar select {
  width: auto;
  max-width: 230px;
}
.toolbar .spacer {
  flex: 1;
}
.table-wrap {
  overflow: auto;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.875rem;
}
th,
td {
  padding: 13px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--muted);
}
th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  min-width: 165px;
}
th:first-child {
  background: var(--surface2);
  z-index: 2;
}
.cell {
  width: 100%;
  min-width: 105px;
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 5px;
  text-align: left;
  padding: 10px;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
}
.cell.empty {
  border: 1px dashed var(--line);
  background: transparent;
  text-align: center;
  color: var(--muted);
}
.cell.assigned {
  background-image: linear-gradient(125deg, #ffffff26, transparent 75%);
  text-shadow: 0 1px 1px #0001;
}
.cell small {
  color: inherit;
  font-size: 0.75rem;
}
.person {
  font-weight: 650;
}
.person small {
  display: block;
  font-weight: 400;
  margin-top: 6px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 14px;
}
.card p {
  color: var(--muted);
  line-height: 1.6;
}
.card .number {
  font-size: 2rem;
  color: var(--accent);
  font-weight: 700;
}
.card button {
  margin-top: 10px;
}
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 45px;
  text-align: center;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 14px;
}
.request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.request-card .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.warning {
  background: var(--surface);
  border-left: 3px solid #cf8515;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 20px;
  color: var(--text);
}
#notice {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  z-index: 60;
  border-radius: 12px;
  padding: 14px 24px;
  background: #123d55;
  color: #fff;
  box-shadow: 0 5px 24px #0004;
}
#notice.error {
  background: #8f2534;
}
#busy {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-radius: 12px;
}
#busy img {
  height: 28px;
  width: 28px;
  object-fit: contain;
}
dialog {
  width: min(480px, calc(100vw - 24px));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  padding: 24px;
  box-shadow: 0 30px 80px #0005;
}
dialog::backdrop {
  background: #06142288;
  backdrop-filter: blur(3px);
}
#menu-content {
  display: grid;
  gap: 10px;
}
.dialog-close {
  float: right;
  margin-bottom: 16px;
}
#form-title {
  clear: both;
}
#dynamic-form {
  clear: both;
}
.legal {
  padding: 15px 25px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
ul {
  padding-left: 20px;
  line-height: 1.8;
}
.menu-group {
  display: grid;
  gap: 8px;
}
.menu-group h3 {
  font-size: 0.875rem;
  margin: 8px 0;
}
.audit {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.audit time {
  color: var(--muted);
  font-size: 0.8125rem;
}
.audit p {
  margin: 6px 0;
}
.mobile-list {
  display: grid;
  gap: 12px;
}
.mobile-list .cell {
  min-width: 0;
}
.mobile-list .card {
  padding: 16px;
}
.menu-desktop {
  display: grid;
  gap: 10px;
}
.menu-desktop details {
  margin: 0;
}
.menu-desktop summary {
  font-weight: 600;
}
.menu-desktop details[open] {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
@media (max-width: 950px) {
  .welcome {
    gap: 35px;
    margin: 35px auto;
  }
  .intro h1 {
    font-size: 2.8rem;
  }

}
@media (max-width: 680px) {
  header {
    padding: 10px 16px;
    height: 74px;
  }
  .identity img {
    width: 115px;
    height: 50px;
  }
  .identity span {
    display: none;
  }
  .header-actions button {
    padding: 8px 12px;
  }
  .welcome {
    display: block;
    padding: 0 18px;
    margin: 30px auto;
  }
  .intro {
    margin-bottom: 26px;
  }
  .intro h1 {
    font-size: 2.5rem;
  }
  .intro .feature,
  .intro .pilot {
    display: none;
  }
  .auth-card {
    padding: 22px;
  }
  #workspace {
    display: block;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 6px;
    margin-top: 0;
    padding-bottom: 2px;
  }
  nav button {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .page-heading {
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 1.8rem;
  }
  .page-heading p {
    font-size: 0.875rem;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar select,
  .toolbar input {
    max-width: 100%;
    flex: 1;
  }
  .toolbar .spacer {
    display: none;
  }
  dialog {
    padding: 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .request-card {
    display: block;
  }
  .request-card .actions {
    margin-top: 14px;
  }
  .legal {
    padding: 12px;
  }
  .empty-state {
    padding: 30px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

#org-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 12px;
}
.intro h1 {
  white-space: pre-line;
}
.menu-desktop button {
  margin: 4px;
}

#busy video{width:65px;height:34px;object-fit:contain}#busy video+img{display:none}@media(prefers-reduced-motion:reduce){#busy video{display:none}#busy video+img{display:block}}

#diagnostic-banner{padding:16px;background:#fff0c2;color:#382900;display:flex;gap:16px;align-items:center;justify-content:center}#diagnostic-banner[hidden]{display:none}.header-actions a{color:inherit;font-size:13px} @media(max-width:600px){.header-actions{flex-wrap:wrap}#diagnostic-banner{flex-direction:column}}
