/*
 * Shared Data OS visual language for role-specific desks.
 * Page styles retain workflow layout; this layer keeps both surfaces aligned
 * with Collection Operations.
 */

:root {
  --text: #172033;
  --text-strong: #101828;
  --ink: #172033;
  --ink-strong: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --bg: #f7f8fa;
  --canvas: #f7f8fa;
  --wash: #f7f8fa;
  --surface: #ffffff;
  --paper: #ffffff;
  --soft: #f2f4f7;
  --cream: #f2f4f7;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --blue: #0a66ff;
  --blue-soft: #edf4ff;
  --green: #137a4f;
  --green-2: #137a4f;
  --green-soft: #ecf8f2;
  --amber: #a15c00;
  --amber-soft: #fff7e8;
  --orange: #a15c00;
  --orange-soft: #fff7e8;
  --red: #d92d20;
  --danger: #d92d20;
  --red-soft: #fff1f0;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.09);
  font-family: var(--bb-font-sans, "Avenir Next", Avenir, "Helvetica Neue", "Noto Sans Arabic", Tahoma, Arial, sans-serif);
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(10, 102, 255, 0.24);
  outline-offset: 2px;
}

.worker-shell,
.desk-shell {
  width: min(1500px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 28px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  width: 100%;
  min-height: 72px;
  height: auto;
  padding: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-cluster,
.topbar-actions,
.brand,
.product-context,
.connection-pill,
.topbar nav a,
.topbar nav button {
  display: flex;
  align-items: center;
}

.brand-cluster,
.topbar-actions {
  gap: 12px;
}

.brand {
  gap: 10px;
  color: var(--text-strong);
  font-size: 1.05rem;
  font-weight: 760;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.brand > strong {
  font-size: 1.05rem;
}

.product-context {
  min-height: 38px;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-context strong {
  color: var(--text-strong);
  font-size: 0.88rem;
}

.product-context small {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.connection-pill {
  min-height: 31px;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid #cfe9dc;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.connection-pill.is-preview {
  border-color: #f1d7aa;
  color: var(--amber);
  background: var(--amber-soft);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar nav a,
.topbar nav button {
  min-height: 38px;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav button:hover {
  background: var(--soft);
}

.topbar nav svg,
.topbar svg {
  width: 17px;
  height: 17px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

h1,
h2,
.workspace-hero h1,
.hero h1,
.access-gate h1,
.gate-copy h1 {
  color: var(--text-strong);
  font-family: inherit;
}

.worker-gate,
.access-gate {
  width: min(1180px, 100%);
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 108px) clamp(22px, 5vw, 70px);
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.72fr);
  gap: clamp(40px, 8vw, 110px);
}

.gate-copy h1,
.access-gate h1 {
  max-width: 760px;
  margin: 10px 0 18px;
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.gate-copy > p:not(.eyebrow),
.access-gate > div > p:last-of-type {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.gate-rules,
.gate-points {
  gap: 8px;
  margin-top: 28px;
}

.gate-rules span,
.gate-points span {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
}

.gate-rules svg,
.gate-points svg {
  width: 15px;
  color: var(--blue);
}

.gate-card {
  gap: 12px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gate-icon,
.link-icon {
  width: 46px;
  height: 46px;
  border: 1px solid #cfddf8;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
}

.gate-card h2 {
  margin: 2px 0 12px;
  color: var(--text-strong);
  font-size: 1.6rem;
}

.gate-card label,
.field-grid label,
.field-grid label > span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 720;
}

input,
select,
textarea,
.gate-card input,
.field-grid input,
.field-grid select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text-strong);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus,
.gate-card input:focus,
.field-grid input:focus,
.field-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 255, 0.12);
}

.account-help-link {
  color: var(--blue);
}

.primary-button,
.secondary-button,
.record-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 760;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(10, 102, 255, 0.16);
}

.primary-button:hover {
  background: #005ce6;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

.secondary-button:hover {
  background: var(--soft);
}

.record-button {
  border: 1px solid var(--red);
  color: #fff;
  background: var(--red);
}

.worker-workspace,
.workspace {
  max-width: none;
  margin: 0;
  padding: 52px 0 0;
}

.workspace-hero,
.hero {
  min-height: 210px;
  padding: 20px 0 30px;
  align-items: flex-end;
  gap: 30px;
}

.workspace-hero h1,
.hero h1 {
  max-width: 900px;
  margin: 8px 0 12px;
  font-size: clamp(3rem, 5.2vw, 5.2rem);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 0.97;
}

.workspace-hero p:last-child,
.hero > div > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.48;
}

.hero-actions,
.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-line {
  min-height: 24px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.master-strip,
.booking-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 18px;
  border: 1px solid #cfddf8;
  border-radius: 12px;
  background: var(--blue-soft);
}

.sync-orbit {
  width: 44px;
  height: 44px;
  border: 1px solid #cfddf8;
  color: var(--blue);
  background: #fff;
  box-shadow: none;
}

.sync-orbit span {
  background: var(--blue);
}

.master-strip > a {
  color: var(--blue);
}

.master-strip div > span,
.booking-link-card span {
  color: var(--muted);
}

.metric-grid {
  gap: 10px;
  margin: 16px 0;
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.07em;
}

.metric-card strong {
  margin-top: 10px;
  color: var(--text-strong);
  font-family: inherit;
  font-size: 2rem;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.metric-card.is-attention {
  border-color: #f1d7aa;
  background: var(--amber-soft);
}

.worker-calendar-panel,
.work-panel,
.side-panel,
.calendar-panel,
.agenda-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.worker-calendar-panel {
  margin: 16px 0;
}

.worker-calendar-panel .panel-heading,
.panel-heading {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.side-panel h2 {
  color: var(--text-strong);
  font-size: 1.2rem;
}

.calendar-controls button,
.month-controls button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
}

.calendar-controls button:hover,
.month-controls button:hover {
  background: var(--soft);
}

.calendar-weekdays,
.weekday-row {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.calendar-weekdays span,
.weekday-row span {
  color: var(--muted);
}

.worker-calendar-day,
.calendar-day {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.worker-calendar-day.is-outside,
.calendar-day.is-outside {
  color: var(--subtle);
  background: #fafbfc;
}

.worker-calendar-day.is-today > span,
.calendar-day.is-today .day-number {
  color: #fff;
  background: var(--blue);
}

.calendar-day.is-selected {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.worker-calendar-day button,
.day-event {
  border-left-color: var(--blue);
  color: var(--text);
  background: var(--blue-soft);
}

.worker-calendar-day button.is-attention,
.day-event.is-attention {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.work-grid,
.schedule-layout {
  gap: 14px;
}

.work-panel {
  padding: 20px;
}

.side-stack {
  gap: 14px;
}

.side-panel {
  padding: 18px;
}

.side-panel header > span,
.agenda-panel .panel-heading > span {
  color: var(--blue);
  background: var(--blue-soft);
}

.side-panel header > svg {
  color: var(--blue);
}

.segmented-filter {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.segmented-filter button {
  border-radius: 6px;
  color: var(--muted);
}

.segmented-filter button.is-active {
  color: var(--text-strong);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08);
}

.assignment-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.assignment-card > button,
.available-row button,
.available-row a {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.assignment-card > button:hover,
.available-row button:hover,
.available-row a:hover {
  background: var(--soft);
}

.status-chip {
  color: var(--green);
  background: var(--green-soft);
}

.status-chip.is-orange {
  color: var(--amber);
  background: var(--amber-soft);
}

.feedback-row > i {
  background: var(--blue);
}

.agenda-time {
  color: var(--blue);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.24);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.48);
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}

.privacy-note,
.privacy {
  border: 1px solid #cfddf8;
  border-radius: 8px;
  color: #2459a6;
  background: var(--blue-soft);
}

@media (max-width: 1100px) {
  .connection-pill {
    display: none;
  }

  .topbar nav a,
  .topbar nav button {
    padding-inline: 8px;
  }
}

@media (max-width: 980px) {
  .worker-gate,
  .access-gate,
  .work-grid,
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .worker-gate,
  .access-gate {
    min-height: auto;
  }

  .workspace-hero,
  .hero {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .worker-shell,
  .desk-shell {
    width: 100%;
    padding: 0 14px 48px;
  }

  .topbar {
    min-height: 64px;
  }

  .brand > strong {
    display: none;
  }

  .product-context {
    padding-inline: 9px;
  }

  .product-context small {
    display: none;
  }

  .topbar nav a {
    display: none;
  }

  .topbar nav button {
    min-width: 38px;
    padding: 0 9px;
    font-size: 0;
  }

  .topbar nav button svg {
    width: 18px;
    height: 18px;
  }

  .worker-gate,
  .access-gate {
    padding: 42px 4px;
    gap: 28px;
  }

  .gate-copy h1,
  .access-gate h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .gate-card {
    padding: 24px;
  }

  .worker-workspace,
  .workspace {
    padding-top: 28px;
  }

  .workspace-hero,
  .hero {
    display: grid;
    padding-top: 8px;
  }

  .workspace-hero h1,
  .hero h1 {
    font-size: clamp(2.55rem, 12vw, 4rem);
  }

  .hero-actions,
  .link-actions {
    width: 100%;
  }

  .hero-actions > *,
  .link-actions > * {
    flex: 1;
  }

  .master-strip,
  .booking-link-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .master-strip > a,
  .booking-link-card .link-actions {
    grid-column: 1 / -1;
  }

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

  .metric-card {
    min-height: 104px;
  }

  .work-panel {
    padding: 14px;
  }

  .calendar-weekdays span,
  .weekday-row span {
    padding-inline: 2px;
  }

  .worker-calendar-day,
  .calendar-day {
    min-height: 72px;
  }
}
