*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #070709;
  color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #38bdf8;
  color: #000;
  padding: 8px 14px;
  z-index: 9999;
  font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar .who {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 8px;
  margin-left: auto;
}

main#content {
  padding: 24px 28px 64px;
  min-width: 0;
  overflow-x: hidden;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar > div {
  flex: 1 1 150px;
  min-width: 140px;
}
.meta { font-size: 0.82rem; color: #94a3b8; }
.empty {
  padding: 28px;
  text-align: center;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}
.kpi-sub { font-size: 0.76rem; color: #94a3b8; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.b-live { background: rgba(34, 197, 94, 0.14); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.35); }
.b-beta { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.b-prototype { background: rgba(234, 179, 8, 0.14); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.35); }
.b-planned { background: rgba(168, 85, 247, 0.14); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.35); }
.b-evaluation { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.b-unavailable { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

.notice {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.notice.ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.notice.warn { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.35); color: #fef08a; }
.notice.error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: #f8fafc;
  background: #14161f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
}
input, select, textarea { width: 100%; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 10px 0 4px;
}
button {
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.btn-sm { padding: 6px 12px; min-height: 36px; font-size: 0.8rem; }
button.ok-btn { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.45); color: #4ade80; }
button.danger { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.45); color: #f87171; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
}
.scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.cal-day {
  background: #101218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  min-height: 110px;
}
.cal-day-head {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 6px;
}
.cal-event {
  font-size: 0.72rem;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.cal-event.holiday { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.cal-event.sick { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.cal-event.pending { background: rgba(234, 179, 8, 0.15); color: #facc15; }

dialog {
  width: min(460px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
dialog.modal-lg { width: min(760px, 95vw); }
dialog::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(6px); }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { flex: 1; }
.tabs button[aria-selected="true"] {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}
.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wfm-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.wfm-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 950;
}
.wfm-mobile-backdrop.active { display: block; }

@media (max-width: 1024px) {
  .wfm-mobile-menu-btn { display: inline-flex; }
  .shell { grid-template-columns: 1fr !important; }
  .nav#mainSidebarNav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.85);
  }
  .nav#mainSidebarNav.mobile-open { transform: translateX(0); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .safety { padding: 8px 14px !important; font-size: 0.72rem !important; }
  .topbar { padding: 10px 14px !important; }
  .brand small { display: none; }
  .public { margin: 16px 12px !important; padding: 22px 16px !important; }
  .public h1 { font-size: 1.85rem !important; }
  main#content { padding: 14px 12px 48px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .panel-head { padding: 12px 14px; }
  .card, .kpi-card, .filter-bar { padding: 14px !important; }
}

/* v2.12.0: WFM Platform Support tab */
.wfm-support-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.wfm-support-cat { display: inline-flex; align-items: center; gap: 6px; }
.wfm-support-cat.active { border-color: #38bdf8 !important; color: #38bdf8 !important; background: rgba(56, 189, 248, 0.12) !important; }
.wfm-support-list { display: flex; flex-direction: column; gap: 10px; }
.wfm-support-item { cursor: pointer; }
.wfm-support-item:hover, .wfm-support-item:focus { border-color: rgba(56, 189, 248, 0.45) !important; outline: none; }
.wfm-support-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.wfm-support-history { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.wfm-support-history li { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
@media (max-width: 768px) { .wfm-support-cats { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; } .wfm-support-cat { flex: 0 0 auto; } }

/* ===== v2.13: Operational calendar — shifts, meetings, today panel; Meetings tab ===== */
.cal-day { cursor: pointer; transition: border-color .15s ease; }
.cal-day:hover { border-color: rgba(56, 189, 248, 0.45); }
.cal-day.cal-today { border-color: rgba(56, 189, 248, 0.8); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35) inset; }
.cal-day.cal-today .cal-day-head span:first-child { color: #38bdf8; font-weight: 700; }
.cal-event.shift { background: rgba(129, 140, 248, 0.16); color: #a5b4fc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.meeting { background: rgba(244, 114, 182, 0.16); color: #f9a8d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-today { margin-bottom: 16px; border-color: rgba(56, 189, 248, 0.35); }
.ops-today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ops-h { margin: 0 0 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.ops-person { display: flex; gap: 10px; padding: 10px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; background: #0d1017; margin-bottom: 8px; }
.ops-person.poc { border-color: rgba(250, 204, 21, .35); background: linear-gradient(90deg, rgba(250, 204, 21, .06), transparent); }
.ops-avatar { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #0b1020;
  background: linear-gradient(135deg, #38bdf8, #818cf8); }
.ops-person.poc .ops-avatar { background: linear-gradient(135deg, #facc15, #fb923c); }
.ops-person-body { min-width: 0; flex: 1; }
.ops-person-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-live { font-size: .7rem; color: #4ade80; }
.ops-contact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ops-contact a.btn-sm, .ops-contact button.btn-sm { text-decoration: none; display: inline-flex; align-items: center; width: auto !important; }
.ops-meet-list { margin: 0; padding-left: 18px; }
.ops-meet-list li { margin: 4px 0; }
.ops-day-h { margin: 18px 0 8px; font-size: 1rem; }
.ops-meeting { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.ops-meeting-time { flex: 0 0 56px; font-size: 1rem; color: #38bdf8; }
.ops-meeting .row a.btn-sm { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 640px) { .ops-grid { grid-template-columns: 1fr; } .cal-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
a.btn-sm { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; min-height: 36px; font-size: 0.8rem; font-weight: 600; color: #e2e8f0;
  background: #14161f; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; text-decoration: none; transition: border-color .15s, background .15s; }
a.btn-sm:hover, a.btn-sm:focus-visible { border-color: #38bdf8; background: rgba(56, 189, 248, 0.1); outline: none; }
a.btn-sm.primary { background: linear-gradient(135deg, #38bdf8, #4ade80); color: #001018; border: 0; }
.ops-meet-list a, .ops-today a:not(.btn-sm) { color: #38bdf8; }
.cal-day-head .cal-count-zero { opacity: .35; }

/* Release 4.1: left-panel tags only on the tab that is open. Other tabs show just their name,
   except a red/amber count that needs attention (open issues, high-risk cases, meetings today). */
[data-nav]:not([aria-current="page"]) > .badge:not(.b-evaluation) { display: none !important; }
[data-nav] > .badge:empty { display: none !important; }
