:root {
  --bg-start: #657181;
  --bg-mid: #4f5b69;
  --bg-end: #45515f;
  --panel: rgba(246, 249, 252, 0.9);
  --panel-border: rgba(65, 78, 94, 0.22);
  --text-main: #1f2730;
  --text-muted: #5f6d7d;
  --accent: #6f859d;
  --accent-soft: rgba(111, 133, 157, 0.18);
  --teal: #7e92a9;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 16px 42px rgba(13, 21, 30, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-main);
  background: var(--bg-mid);
  line-height: 1.42;
}

h1,
h2 {
  margin: 0;
  font-family: 'Roboto Slab', serif;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

h3 {
  font-family: 'Roboto Slab', serif;
}

p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.11;
  background: rgba(14, 20, 28, 0.06);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  position: relative;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
}

.panel-auth {
  margin: 8vh auto;
  max-width: 620px;
  padding: 36px;
  border-top: 4px solid rgba(111, 133, 157, 0.7);
  animation: rise 0.55s ease forwards;
}

.eyebrow {
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--teal);
}

.lead {
  margin-top: 14px;
  margin-bottom: 22px;
  color: var(--text-muted);
  max-width: 52ch;
}

.warning {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  color: #3d4a5a;
  background: #e8eef5;
  font-size: 0.92rem;
}

.btn {
  border: 1px solid rgba(180, 194, 212, 0.5);
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  color: #f2f6fb;
  background: #2f3946;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 24px rgba(8, 14, 22, 0.28);
}

.btn:hover {
  transform: translateY(-2px);
  background: #3d4a5a;
}

.btn-secondary {
  color: #202a35;
  background: rgba(245, 249, 253, 0.95);
  box-shadow: inset 0 0 0 1px rgba(54, 67, 82, 0.24);
}

#app-view {
  display: grid;
  gap: 18px;
  animation: rise 0.45s ease;
}

.page-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 120;
  overflow: visible;
  background: #2a3340;
  border-color: rgba(169, 187, 210, 0.24);
  box-shadow: 0 20px 32px rgba(7, 13, 21, 0.42);
}

.page-header h1 {
  color: #eaf0f8;
}

.page-header .eyebrow {
  color: #b3c3d8;
}

.page-header .btn-secondary {
  color: #e6edf7;
  background: rgba(231, 241, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(180, 198, 221, 0.34);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.settings-wrap {
  position: relative;
  z-index: 121;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 122;
  min-width: 320px;
  border: 1px solid rgba(53, 66, 82, 0.26);
  border-radius: 12px;
  background: rgba(246, 250, 255, 0.98);
  box-shadow: 0 14px 30px rgba(8, 14, 23, 0.22);
  padding: 10px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #1e313b;
}

.settings-item input {
  margin: 0;
}

.settings-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 35, 44, 0.1);
  display: grid;
  gap: 7px;
}

.settings-group-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #203540;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-help {
  margin: 0;
  font-size: 0.76rem;
  color: #4e6570;
}

.settings-help span {
  color: #233944;
  font-weight: 600;
}

.settings-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid rgba(17, 35, 44, 0.16);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  font-size: 0.8rem;
  color: #1e313b;
  background: #fff;
}

.settings-save-btn {
  width: 100%;
}

.settings-supplier-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #213742;
  font-size: 0.78rem;
}

.settings-supplier-item,
.settings-supplier-empty {
  line-height: 1.3;
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.roles-panel,
.calendar-panel,
.role-view,
.event-view {
  padding: 20px;
}

.roles-panel h2,
.calendar-panel h2,
.role-view h2,
.event-view h2 {
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.role-card {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: reveal 0.42s ease both;
}

.role-card:hover {
  transform: translateY(-2px);
}

.role-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 8px 20px rgba(17, 25, 35, 0.14);
  background: #f3f8ff;
}

.role-name {
  font-weight: 700;
}

.role-description {
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 70ch;
}

.role-actions {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #22333c;
}

.sales-pages {
  margin-top: 14px;
  border-top: 1px solid rgba(17, 35, 44, 0.12);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.sales-pages-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sales-page-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 62, 80, 0.22);
  background: rgba(243, 249, 255, 0.95);
  color: #213647;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.sales-page-link:hover {
  background: #fff;
}

.sales-page-link.active {
  background: #243142;
  color: #f4f8fd;
  border-color: rgba(36, 49, 66, 0.74);
}

.sales-pages-content {
  border: 1px solid rgba(17, 35, 44, 0.14);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.sales-section-title {
  margin: 0;
  font-size: 1rem;
}

.sales-section-help {
  margin: 0;
  color: #4d6370;
  font-size: 0.84rem;
}

.sales-commissions-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.sales-commissions-controls label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2a404b;
}

.sales-month-input {
  min-width: 180px;
  border: 1px solid rgba(17, 35, 44, 0.2);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  color: #1e313b;
  background: #fff;
}

.sales-commissions-table-wrap {
  overflow-x: auto;
}

.sales-commissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.sales-commissions-table th,
.sales-commissions-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(17, 35, 44, 0.12);
}

.sales-commissions-table th {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4c6271;
}

.sales-commissions-table td strong {
  display: block;
  font-size: 0.86rem;
}

.sales-commissions-table td p {
  margin-top: 2px;
  color: #4d6370;
  font-size: 0.76rem;
}

.sales-empty {
  margin: 0;
  color: #506672;
  font-size: 0.84rem;
}

.role-signoff {
  margin-top: 14px;
  border-top: 1px solid rgba(17, 35, 44, 0.12);
  padding-top: 14px;
}

.role-signoff h3 {
  margin: 0;
  font-size: 1.02rem;
}

.role-signoff-help {
  margin-top: 6px;
  color: #4a606a;
  font-size: 0.86rem;
}

.role-event-list {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.role-event-group {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 12px;
  background: #f7fbfd;
}

.role-event-group-collapsible {
  border: none;
  margin: 0;
}

.role-event-group-summary {
  padding: 10px 12px;
  font-size: 0.9rem;
}

.role-event-group-list {
  padding: 8px 10px 10px;
  display: grid;
  gap: 8px;
}

.role-event-item {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.role-event-item-collapsible {
  padding: 0;
}

.role-event-collapsible {
  border: none;
}

.role-event-summary {
  padding: 10px;
}

.role-event-summary-content {
  display: grid;
  gap: 6px;
}

.role-event-item strong {
  font-size: 0.92rem;
}

.role-event-meta {
  color: #516874;
  font-size: 0.8rem;
}

.role-event-empty {
  color: #506672;
  font-size: 0.86rem;
}

.role-event-body {
  margin-top: 0;
  border-top: 1px solid rgba(17, 35, 44, 0.08);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.role-event-checklist-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #2a404b;
}

.role-event-checklist-container {
  display: grid;
  gap: 8px;
}

.role-event-checklist-loading {
  margin: 0;
  color: #506672;
  font-size: 0.82rem;
}

.event-page-subtitle {
  color: #4b616b;
  margin-top: -4px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.event-cache-panel {
  margin-bottom: 10px;
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 12px;
  background: rgba(250, 253, 255, 0.95);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-cache-summary-wrap {
  display: grid;
  gap: 4px;
}

.event-cache-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f6671;
  font-weight: 700;
}

.event-cache-summary {
  margin: 0;
  font-size: 0.82rem;
  color: #223640;
}

.event-cache-details {
  margin: 0 0 10px;
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 10px;
  background: rgba(250, 253, 255, 0.75);
  padding: 7px 10px;
}

.event-cache-details-summary {
  cursor: pointer;
  color: #314a57;
  font-size: 0.79rem;
  font-weight: 700;
  outline: none;
}

.event-cache-details[open] .event-cache-details-summary {
  margin-bottom: 7px;
}

.event-cache-sources {
  margin: 0;
  display: grid;
  gap: 6px;
}

.event-cache-source-item {
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #223640;
}

.event-cache-source-item-stale {
  border-color: rgba(178, 123, 20, 0.45);
  background: rgba(255, 245, 220, 0.8);
}

.event-cache-source-item-fresh {
  border-color: rgba(31, 108, 61, 0.3);
  background: rgba(235, 252, 240, 0.9);
}

.event-page-signoffs {
  margin-bottom: 10px;
}

.event-signoff-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f6671;
  margin-bottom: 5px;
  font-weight: 700;
}

.event-signoff-controls {
  display: grid;
  gap: 8px;
}

.signoff-row-toggle {
  margin-bottom: 0;
}

.event-role-signoff-panels {
  display: grid;
  gap: 8px;
}

.event-role-signoff-panel {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
}

.event-role-signoff-title {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #1f333d;
}

.event-role-signoff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.event-role-signoff-item {
  margin: 0;
  display: grid;
  gap: 4px;
}

.event-role-signoff-item-not-necessary {
  opacity: 0.72;
}

.event-role-signoff-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #223640;
}

.event-role-signoff-checkbox {
  margin: 0;
}

.event-role-signoff-item-disabled-text {
  color: #617985;
}

.event-role-signoff-link {
  margin-left: 22px;
  font-size: 0.77rem;
  color: #1f5d8d;
  text-decoration: underline;
}

.event-role-signoff-detail {
  margin: 0 0 0 22px;
  font-size: 0.76rem;
  color: #516874;
}

.event-page-sections {
  display: grid;
  gap: 10px;
}

.event-detail-section {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.event-detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.event-collapsible {
  margin: 0;
}

.event-collapsible-summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #1f333d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-collapsible-summary::-webkit-details-marker {
  display: none;
}

.event-collapsible-summary::after {
  content: '+';
  font-size: 0.96rem;
  color: #2f5567;
}

.event-collapsible[open] .event-collapsible-summary::after {
  content: '-';
}

.event-collapsible-body {
  margin-top: 8px;
}

.event-detail-grid {
  margin: 0;
  display: grid;
  gap: 8px;
}

.event-detail-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  font-size: 0.83rem;
}

.event-detail-link {
  color: #1f5d8d;
  text-decoration: underline;
}

.event-detail-row dt {
  color: #4f6570;
  font-weight: 700;
}

.event-detail-row dd {
  margin: 0;
  color: #1f333d;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-raw {
  margin-top: 10px;
  border-top: 1px dashed rgba(17, 35, 44, 0.22);
  padding-top: 10px;
}

.service-token-view {
  display: grid;
  gap: 12px;
}

.service-token-help {
  margin: 0;
  color: #4c616b;
  font-size: 0.9rem;
}

.service-token-steps {
  margin: 0;
  padding-left: 20px;
  color: #223640;
  font-size: 0.86rem;
  display: grid;
  gap: 6px;
}

.service-token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-token-status {
  margin: 0;
  color: #4f6671;
  font-size: 0.84rem;
}

.service-token-output {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(17, 35, 44, 0.07);
  color: #11232c;
  min-height: 70px;
  max-height: 320px;
  overflow: auto;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-raw summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #243740;
}

.event-raw pre {
  margin: 8px 0 0;
  max-height: 300px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(17, 35, 44, 0.07);
  font-size: 0.72rem;
  line-height: 1.35;
  color: #11232c;
}

.event-notes-empty {
  margin: 0;
  color: #536a74;
  font-size: 0.84rem;
}

.event-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.event-note-item {
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  padding: 9px;
}

.event-note-text {
  margin: 0;
  font-size: 0.84rem;
  color: #223640;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-note-meta {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: #607782;
}

.event-docs-empty {
  margin: 0;
  color: #536a74;
  font-size: 0.84rem;
}

.event-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.event-doc-item {
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  padding: 9px;
}

.event-doc-link {
  display: inline-block;
  margin-top: 4px;
  color: #1f5d8d;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
}

.event-doc-name {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #223640;
}

.event-doc-meta {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: #607782;
}

.event-custom-empty {
  margin: 0;
  color: #536a74;
  font-size: 0.84rem;
}

.event-custom-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.event-custom-item {
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  padding: 9px;
}

.event-custom-name {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #223640;
}

.event-custom-value {
  margin: 4px 0 0;
  font-size: 0.83rem;
  color: #2f4752;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-custom-meta {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: #607782;
}

.event-addons-source {
  margin: 0 0 8px;
  color: #607782;
  font-size: 0.76rem;
}

.event-addons-empty {
  margin: 0;
  color: #536a74;
  font-size: 0.84rem;
}

.event-addons-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.event-addons-table th {
  text-align: left;
  color: #445b66;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(17, 35, 44, 0.14);
  padding: 7px 8px;
}

.event-addons-table td {
  border-bottom: 1px solid rgba(17, 35, 44, 0.08);
  padding: 8px;
  vertical-align: top;
}

.event-addons-cell-desc {
  color: #223640;
  word-break: break-word;
  white-space: pre-wrap;
}

.event-addons-cell-qty {
  color: #2f4752;
  width: 88px;
  text-align: right;
  font-weight: 700;
}

.event-addons-table tr:last-child td {
  border-bottom: none;
}

.event-staffing-empty {
  margin: 0;
  color: #536a74;
  font-size: 0.84rem;
}

.event-staffing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.event-staffing-table th {
  text-align: left;
  color: #445b66;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(17, 35, 44, 0.14);
  padding: 7px 8px;
}

.event-staffing-table td {
  border-bottom: 1px solid rgba(17, 35, 44, 0.08);
  padding: 8px;
  vertical-align: top;
  color: #223640;
}

.event-staffing-table tr:last-child td {
  border-bottom: none;
}

.event-staffing-role-cell {
  white-space: nowrap;
}

.event-staffing-role-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-staffing-role-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  border: 1px solid rgba(17, 35, 44, 0.22);
  background: rgba(255, 255, 255, 0.84);
  color: #2a4351;
  flex: 0 0 auto;
}

.event-staffing-role-icon-liaison {
  background: rgba(15, 119, 120, 0.17);
  border-color: rgba(15, 119, 120, 0.42);
  color: #0f5f63;
}

.event-staffing-role-icon-cleaning {
  background: rgba(205, 143, 45, 0.2);
  border-color: rgba(205, 143, 45, 0.44);
  color: #7a4f16;
}

.event-staffing-role-icon-tech {
  background: rgba(68, 106, 151, 0.18);
  border-color: rgba(68, 106, 151, 0.42);
  color: #284f7c;
}

.event-staffing-status-overview {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  margin: 0 0 10px;
}

.event-staffing-timing {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  margin: 0 0 10px;
}

.event-staffing-timing-title {
  margin: 0 0 7px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #425866;
}

.event-staffing-timing-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.event-staffing-timing-row {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.event-staffing-timing-row dt {
  color: #425866;
  font-weight: 700;
}

.event-staffing-timing-row dd {
  margin: 0;
  color: #223640;
}

.event-staffing-status-title {
  margin: 0 0 7px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #425866;
}

.event-staffing-status-list {
  display: grid;
  gap: 7px;
}

.event-staffing-status-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.event-staffing-status-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-staffing-status-label {
  font-size: 0.79rem;
  font-weight: 700;
  color: #223640;
}

.event-staffing-status-reason {
  margin: 0;
  font-size: 0.78rem;
  color: #425866;
  line-height: 1.3;
}

.event-security-rows {
  border: 1px solid rgba(17, 35, 44, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px 10px;
  margin: 0 0 10px;
}

.event-security-rows-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #29414f;
}

.event-security-rows-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #314b59;
  font-size: 0.78rem;
}

.event-addons-name {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #223640;
}

.event-addons-qty {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: #2f4752;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.calendar-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-prefetch-status {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #344b57;
  white-space: nowrap;
  min-width: 128px;
  text-align: right;
  visibility: hidden;
}

.dashboard-prefetch-status.is-visible {
  visibility: visible;
}

.filters-wrap {
  margin: 10px 0 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.filter-group {
  border: 1px solid rgba(17, 35, 44, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #445963;
}

.filter-actions {
  display: flex;
  gap: 6px;
}

.filter-action {
  border: none;
  background: transparent;
  color: #205a87;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.filter-action:hover {
  text-decoration: underline;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #1c313b;
}

.filter-option input {
  margin: 0;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.weekday {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #455b65;
  letter-spacing: 0.04em;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  border-radius: 14px;
  border: 1px solid rgba(17, 35, 44, 0.1);
  background: #fff;
  padding: 12px;
  min-height: 180px;
  animation: reveal 0.45s ease both;
}

.day-card.muted {
  opacity: 0.43;
}

.day-card-today {
  background: #edf3fb;
  border-color: rgba(111, 133, 157, 0.78);
  box-shadow: inset 0 0 0 1px rgba(111, 133, 157, 0.24);
}

.day-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.day-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.day-date {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.event-item {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 8px 9px;
}

.event-item-levee {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.event-item-astoria {
  background: rgba(61, 130, 209, 0.18);
  border-left-color: #2f6cae;
}

.event-item strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.event-title-link {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0 0 4px;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: inherit;
}

.signoff-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.operations-status-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.operations-status-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(17, 35, 44, 0.25);
  background: rgba(255, 255, 255, 0.55);
  color: #2e4651;
  cursor: help;
  user-select: none;
}

.operations-status-badge[data-tooltip]:hover::after,
.operations-status-badge[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 30;
  min-width: 180px;
  max-width: min(300px, 60vw);
  padding: 7px 8px;
  border-radius: 8px;
  background: #1f2d38;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 16px rgba(9, 15, 22, 0.35);
  pointer-events: none;
}

.operations-status-badge[data-tooltip]:hover::before,
.operations-status-badge[data-tooltip]:focus-visible::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  z-index: 29;
  border: 6px solid transparent;
  border-top-color: #1f2d38;
  pointer-events: none;
}

.operations-status-badge.is-complete {
  background: #0f7778;
  border-color: #0f7778;
  color: #fff;
}

.operations-status-badge.is-pending {
  background: #f7e5b4;
  border-color: #cd8f2d;
  color: #6b4716;
}

.operations-status-badge.is-questionable {
  background: #f3e8c8;
  border-color: #a47b24;
  color: #6b4b12;
}

.operations-status-badge.is-blocked {
  background: #8b1d14;
  border-color: #8b1d14;
  color: #fff;
}

.operations-status-badge.is-not-needed {
  opacity: 0.68;
}

.operations-status-badge.is-deferred {
  background: #d8eaf7;
  border-color: #4d87b1;
  color: #244e6a;
}

.operations-status-badge.is-unknown {
  background: rgba(218, 225, 229, 0.9);
  border-color: rgba(97, 121, 133, 0.5);
  color: #415766;
}

.signoff-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(17, 35, 44, 0.25);
  color: #2e4651;
  background: rgba(255, 255, 255, 0.55);
}

.signoff-badge-toggle {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding: 0;
}

.signoff-badge-toggle.is-open {
  box-shadow: 0 0 0 2px rgba(31, 93, 141, 0.28);
}

.signoff-badge.is-complete {
  color: #fff;
  border-color: #0f7778;
  background: #0f7778;
}

.event-meta {
  display: block;
  margin-top: 2px;
  color: #556678;
  font-size: 0.76rem;
  line-height: 1.35;
}

.event-item-operations .event-meta {
  color: #28424f;
}

.event-link {
  margin-top: 7px;
  border: none;
  background: transparent;
  color: #1f5d8d;
  text-decoration: underline;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.event-item-astoria .event-meta {
  color: #1e4e86;
}

.btn-compact {
  width: fit-content;
  padding: 7px 13px;
  font-size: 0.76rem;
}

.event-debug {
  margin-top: 6px;
  border-top: 1px dashed rgba(17, 35, 44, 0.25);
  padding-top: 6px;
}

.event-debug summary {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  color: #22333c;
}

.event-debug pre {
  margin: 6px 0 0;
  max-height: 200px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: rgba(17, 35, 44, 0.07);
  font-size: 0.68rem;
  line-height: 1.3;
  color: #0f1f27;
}

.event-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.operations-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(19, 28, 38, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.operations-overlay-panel {
  width: min(860px, 100%);
  max-height: 86vh;
  overflow: hidden;
  border: 1px solid rgba(61, 74, 90, 0.28);
  border-radius: 16px;
  background: rgba(246, 250, 255, 0.98);
  box-shadow: 0 18px 40px rgba(12, 20, 31, 0.4);
  display: grid;
  grid-template-rows: auto 1fr;
}

.operations-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(61, 74, 90, 0.2);
}

.operations-overlay-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #263240;
}

.operations-overlay-close {
  padding: 7px 14px;
  font-size: 0.78rem;
}

.operations-overlay-body {
  overflow: auto;
  padding: 14px 16px 16px;
}

.operations-overlay-body .event-detail-section {
  margin: 0;
}

.roles-panel,
.calendar-panel,
.role-view,
.event-view {
  border-top: 3px solid rgba(111, 133, 157, 0.48);
}

.role-card,
.day-card,
.role-event-item,
.event-role-signoff-panel,
.event-detail-section,
.event-note-item,
.event-doc-item,
.event-custom-item,
.filter-group {
  border-color: rgba(61, 74, 90, 0.22);
  background: rgba(246, 250, 255, 0.9);
  box-shadow: 0 10px 18px rgba(17, 25, 35, 0.12);
}

.role-card:hover {
  border-color: rgba(111, 133, 157, 0.66);
  box-shadow: 0 14px 22px rgba(17, 25, 35, 0.2);
}

.role-card.active {
  border-color: var(--accent);
  background: #f3f8ff;
  box-shadow: inset 0 0 0 1px rgba(111, 133, 157, 0.68), 0 14px 24px rgba(17, 25, 35, 0.2);
}

.calendar-header p,
.role-description,
.role-signoff-help,
.event-page-subtitle,
.event-note-meta,
.event-doc-meta,
.event-custom-meta,
.event-addons-source,
.event-notes-empty,
.event-docs-empty,
.event-custom-empty,
.event-staffing-empty,
.event-addons-empty,
.event-role-signoff-detail,
.settings-help {
  color: var(--text-muted);
}

.weekday {
  color: #66788c;
}

.day-card-today {
  background: #d6e2f3;
  border-color: #4f6a87;
  box-shadow: inset 0 0 0 2px rgba(79, 106, 135, 0.35), 0 14px 24px rgba(17, 25, 35, 0.22);
}

.event-item {
  background: rgba(90, 134, 117, 0.26);
  border-left-color: #4a7261;
  border-left-width: 4px;
}

.event-item-levee {
  background: rgba(90, 134, 117, 0.26);
  border-left-color: #4a7261;
}

.event-item-astoria {
  background: rgba(87, 118, 162, 0.28);
  border-left-color: #3f5f8a;
}

.event-meta,
.event-item-levee .event-meta {
  color: #3f5f52;
}

.event-item-astoria .event-meta {
  color: #40597a;
}

.event-item strong,
.event-item-levee strong,
.event-item .event-title-link,
.event-item-levee .event-title-link {
  color: #213229;
}

.event-item-astoria strong,
.event-item-astoria .event-title-link {
  color: #243a56;
}

.event-link,
.event-doc-link,
.event-detail-link,
.event-role-signoff-link,
.filter-action {
  color: #516a87;
}

.event-link:hover,
.event-doc-link:hover,
.event-detail-link:hover,
.event-role-signoff-link:hover,
.filter-action:hover {
  color: #42576f;
}

.event-collapsible-summary,
.event-role-signoff-title,
.event-detail-section h3,
.settings-group-title,
.role-event-checklist-title,
.event-addons-name,
.event-custom-name,
.event-doc-name {
  color: #263240;
}

.event-addons-table th,
.event-staffing-table th {
  color: #596d82;
  border-bottom-color: rgba(60, 73, 89, 0.24);
}

.event-addons-table td,
.event-staffing-table td {
  border-bottom-color: rgba(60, 73, 89, 0.12);
}

.event-raw,
.event-debug {
  border-top-color: rgba(60, 73, 89, 0.28);
}

.event-raw pre,
.event-debug pre {
  background: rgba(31, 43, 57, 0.08);
  color: #2a3542;
}

.signoff-badge {
  border-color: rgba(60, 73, 89, 0.36);
  color: #4e6075;
  background: rgba(255, 255, 255, 0.74);
}

.signoff-badge.is-complete {
  background: #4d6b8d;
  border-color: #4d6b8d;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .weekday-row {
    display: none;
  }
}

@media (max-width: 900px) {
  .roles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .panel-auth,
  .roles-panel,
  .calendar-panel,
  .page-header,
  .role-view,
  .event-view {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .roles-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-prefetch-status {
    max-width: 48vw;
    white-space: normal;
    line-height: 1.25;
  }

  .event-detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .event-cache-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-token-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .event-staffing-timing-grid {
    grid-template-columns: 1fr;
  }

  .sales-pages-content {
    padding: 10px;
  }

  .sales-commissions-table th,
  .sales-commissions-table td {
    padding: 7px 8px;
  }

  .operations-overlay {
    padding: 8px;
  }

  .operations-overlay-panel {
    max-height: 92vh;
  }

  .operations-overlay-header {
    padding: 12px;
  }

  .operations-overlay-body {
    padding: 12px;
  }
}
