:root {
  --bg: #07111f;
  --panel: rgba(11, 24, 40, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(138, 190, 255, 0.16);
  --line-strong: rgba(138, 190, 255, 0.34);
  --text: #eff6ff;
  --muted: #9db4cf;
  --accent: #75f0c7;
  --accent-strong: #38d39f;
  --danger: #ff8d6b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --header-height: 72px;
  --statusbar-height: 72px;
  --topbar-sticky-offset: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI Variable Display", "Bahnschrift", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(85, 181, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(117, 240, 199, 0.14), transparent 24%),
    linear-gradient(135deg, #06101b 0%, #0a1526 42%, #081523 100%);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.background-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.24;
  pointer-events: none;
}

.background-glow-left {
  top: -10rem;
  left: -12rem;
  background: #37d4ff;
}

.background-glow-right {
  right: -10rem;
  bottom: -10rem;
  background: #4bf0b6;
}

.shell {
  position: relative;
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

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

.auth-panel {
  width: min(520px, 100%);
  margin: 10vh auto 0;
  padding: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(117, 240, 199, 0.08);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.stack-form,
.inline-form,
.workspace-form,
.assign-form {
  display: grid;
  gap: 16px;
}

.stack-form {
  margin-top: 28px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  margin-top: 20px;
}

.workspace-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.assign-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.inline-form input,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.field input:focus,
.inline-form input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.06);
}

select option {
  background: #1a1f2e;
  color: var(--text);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #37d4ff 100%);
  color: #052033;
}

.button-success {
  background: linear-gradient(135deg, #36d48f 0%, #20b36f 100%);
  color: #042214;
}

.button-danger-soft {
  background: linear-gradient(135deg, rgba(255, 122, 122, 0.34) 0%, rgba(255, 92, 92, 0.28) 100%);
  color: #ffd8d8;
  border: 1px solid rgba(255, 122, 122, 0.45);
}

.button-success:hover,
.button-danger-soft:hover {
  opacity: 0.92;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button-danger {
  background: rgba(255, 141, 107, 0.15);
  color: #ffd0c4;
  border: 1px solid rgba(255, 141, 107, 0.22);
}

.compact-button {
  padding: 10px 14px;
  font-size: 12px;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.topbar {
  display: grid;
  grid-template-areas: "nav actions";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: var(--header-height);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-radius: 0;
}

.topbar-mobile-head {
  display: none;
}

.topbar-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 12px;
}

.hamburger-icon .hbar {
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
}

.hamburger-icon .hbar-1 { transform-origin: 10px 1px; }
.hamburger-icon .hbar-2 { transform-origin: 10px 7px; }
.hamburger-icon .hbar-3 { transform-origin: 10px 13px; }

.topbar-menu-toggle[aria-expanded="true"] .hbar-1 {
  transform: translateY(6px) rotate(45deg);
}

.topbar-menu-toggle[aria-expanded="true"] .hbar-2 {
  opacity: 0;
  transform: scaleX(0);
}

.topbar-menu-toggle[aria-expanded="true"] .hbar-3 {
  transform: translateY(-6px) rotate(-45deg);
}

.topbar-menu-panel {
  display: contents;
}

.topbar-main-actions,
.topbar-system-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
}

.topbar-main-actions {
  grid-area: nav;
  justify-content: flex-start;
}

.topbar-main-actions .button {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease, color 220ms ease;
}

.topbar-main-actions .button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  opacity: 0;
  transform: translateX(-22%);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.topbar-main-actions .button.button-primary {
  border-color: rgba(117, 240, 199, 0.5);
  box-shadow: 0 10px 26px rgba(56, 211, 159, 0.22);
}

.topbar-main-actions .button.button-primary::after {
  opacity: 1;
  transform: translateX(0);
}

.topbar-main-actions .button.is-current {
  border-color: rgba(117, 240, 199, 0.26);
  background: rgba(117, 240, 199, 0.08);
}

.topbar-system-actions {
  grid-area: actions;
  justify-content: flex-end;
}

.topbar-mobile-only {
  display: none;
}

.context-strip {
  margin-top: 0;
  padding: 10px 16px;
  min-height: var(--statusbar-height);
  display: flex;
  align-items: center;
  border-radius: 0;
  position: sticky;
  top: var(--topbar-sticky-offset);
  z-index: 490;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-color: rgba(117, 240, 199, 0.24);
  background:
    linear-gradient(135deg, rgba(117, 240, 199, 0.12), rgba(55, 212, 255, 0.08)),
    rgba(7, 22, 36, 0.92);
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.context-strip-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  white-space: nowrap;
  overflow: hidden;
}

.context-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(117, 240, 199, 0.08);
  border: 1px solid rgba(117, 240, 199, 0.2);
  flex-shrink: 0;
}

.context-primary {
  display: none;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.context-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #90a4bf;
  box-shadow: 0 0 0 0 rgba(144, 164, 191, 0.48);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.context-main-value {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #eef7ff;
}

.context-main-value,
.context-label,
.context-value {
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.context-main-value.is-text-swapping,
.context-label.is-text-swapping,
.context-value.is-text-swapping {
  opacity: 0.16;
  transform: translateY(-2px);
  filter: blur(0.2px);
}

.context-segment {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.context-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.92;
}

.context-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-segment-location {
  flex: 1;
  min-width: 180px;
}

.context-metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.context-separator {
  color: rgba(157, 180, 207, 0.45);
}

.context-logout-button {
  margin-left: auto;
  padding: 10px 14px;
  border-radius: 12px;
  flex-shrink: 0;
}

.context-client-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(117, 240, 199, 0.18);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.1), rgba(55, 212, 255, 0.06));
}

.context-location-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(117, 240, 199, 0.14);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.06), rgba(55, 212, 255, 0.04));
}

.context-location-actions .button {
  min-width: 190px;
  min-height: 42px;
}

.context-ads-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(117, 240, 199, 0.14);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.06), rgba(55, 212, 255, 0.04));
}

.context-action-search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 260px;
  max-width: min(460px, 100%);
  flex: 1;
  min-height: 42px;
  padding: 0 14px 0 44px;
  border-radius: 12px;
  border: 1px solid rgba(117, 240, 199, 0.38);
  background:
    linear-gradient(145deg, rgba(117, 240, 199, 0.2), rgba(55, 212, 255, 0.11)),
    rgba(9, 26, 42, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 20px rgba(56, 211, 159, 0.2);
  transition: border-color 200ms ease, box-shadow 220ms ease, transform 200ms ease;
}

.context-action-search-field::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(210, 255, 244, 0.82);
  border-radius: 50%;
  transform: translateY(-58%);
  opacity: 0.9;
}

.context-action-search-field::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 50%;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(210, 255, 244, 0.82);
  transform: translateY(2px) rotate(45deg);
  opacity: 0.9;
}

.context-action-search-field input {
  width: 100%;
  min-height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #e9fff8;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0;
}

.context-action-search-field input::placeholder {
  color: rgba(210, 255, 244, 0.72);
  font-weight: 600;
}

.context-action-search-field:focus-within {
  border-color: rgba(117, 240, 199, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(56, 211, 159, 0.26),
    0 0 0 2px rgba(117, 240, 199, 0.18);
  transform: translateY(-1px);
}

.context-ads-actions .button {
  min-width: 230px;
  min-height: 42px;
}

.context-workspace-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(117, 240, 199, 0.14);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.06), rgba(55, 212, 255, 0.04));
}

.context-workspace-actions .button {
  min-width: 150px;
}

.context-workspace-actions .workspace-assigned-search-field {
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 360px;
}

.context-workspace-actions #saveAssignedSettingsButton {
  min-width: 220px;
}

.context-client-actions .button,
.context-location-actions .button,
.context-ads-actions .button,
.context-workspace-actions .button {
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.context-client-actions .button:hover,
.context-location-actions .button:hover,
.context-ads-actions .button:hover,
.context-workspace-actions .button:hover {
  box-shadow: 0 8px 20px rgba(56, 211, 159, 0.18);
}

.context-client-actions .button {
  min-width: 156px;
}

.context-client-actions .client-status-filter-field {
  min-width: 220px;
}

.context-client-actions,
.context-location-actions,
.context-calendar-actions,
.context-ads-actions,
.context-workspace-actions {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.context-client-actions.is-context-visible,
.context-location-actions.is-context-visible,
.context-calendar-actions.is-context-visible,
.context-ads-actions.is-context-visible,
.context-workspace-actions.is-context-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.context-offer-summary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 18px;
  border-radius: 14px;
  border: 1px solid rgba(117, 240, 199, 0.18);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.1), rgba(55, 212, 255, 0.06));
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.context-offer-summary.is-context-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.context-offer-separator {
  color: rgba(157, 180, 207, 0.45);
  flex-shrink: 0;
}

.context-offer-total-value {
  font-size: 14px;
  font-weight: 800;
  color: rgb(117, 240, 199);
  letter-spacing: 0.01em;
}

.context-strip.is-client-tools .context-strip-line {
  justify-content: center;
  flex-wrap: wrap;
  white-space: normal;
  overflow: visible;
}

.context-strip.is-client-tools .context-logout-button {
  margin-left: 0;
}

.context-strip.is-active {
  border-color: rgba(117, 240, 199, 0.5);
  box-shadow: 0 8px 26px rgba(56, 211, 159, 0.16);
}

.context-strip.is-active .context-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(117, 240, 199, 0.14);
}

.context-strip.is-info {
  border-color: rgba(136, 189, 255, 0.5);
  box-shadow: 0 8px 26px rgba(96, 145, 232, 0.15);
}

.context-strip.is-info .context-dot {
  background: #8fc1ff;
  box-shadow: 0 0 0 6px rgba(143, 193, 255, 0.14);
}

.context-strip.is-neutral .context-dot {
  background: #90a4bf;
}

.context-strip .location-id-chip,
.context-strip .location-block-duration {
  margin-top: 0;
}

.location-id-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.28);
  background: rgba(117, 240, 199, 0.11);
  color: #d7fff1;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.location-block-duration {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.16);
  background: rgba(117, 240, 199, 0.06);
  color: rgba(215, 255, 241, 0.6);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.location-duration-badge {
  border-color: rgba(117, 240, 199, 0.18);
  background: rgba(117, 240, 199, 0.07);
  color: rgba(215, 255, 241, 0.65);
}

.content-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.content-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.workspace {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sidebar-search {
  gap: 8px;
}

.locations-list,
.table-body {
  display: grid;
  gap: 12px;
}

.view-section {
  display: grid;
  gap: 18px;
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}

.view-section.is-view-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.workspace-stack {
  display: grid;
  gap: 18px;
}

.workspace-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-soft);
}

.workspace-active-location-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.workspace-active-location-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(117, 240, 199, 0.34);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.18), rgba(55, 212, 255, 0.08));
}

.workspace-active-location-card.is-active {
  box-shadow: 0 10px 26px rgba(56, 211, 159, 0.2);
}

.workspace-active-location-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(215, 255, 241, 0.82);
}

.workspace-active-location-name {
  color: #d7fff1;
  font-size: 18px;
  line-height: 1.2;
}

.workspace-active-location-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-active-location-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.34);
  background: rgba(117, 240, 199, 0.16);
  color: #d7fff1;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.location-card,
.empty-state,
.table-row {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.location-card {
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.location-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.location-card-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  margin-left: auto;
}

.location-card span {
  display: inline-flex;
  color: var(--muted);
  margin-top: 0;
  font-size: 12px;
}

.location-card-id {
  margin-left: 0;
  font-size: 11px;
  opacity: 0.85;
}

.location-current-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(117, 240, 199, 0.14);
  border: 1px solid rgba(117, 240, 199, 0.24);
  color: var(--accent);
  font-size: 11px;
}

.location-card-meta .location-current-badge {
  margin-top: 0;
}

.location-card.active {
  border-color: var(--accent-strong);
  background: rgba(117, 240, 199, 0.1);
}

.location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.location-delete-button {
  align-self: center;
}

.location-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-left: auto;
}

.location-row-actions .button {
  min-width: 210px;
}

.location-edit-button {
  white-space: nowrap;
}

.table-wrap {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.table-wrap-assigned {
  overflow-x: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.table-toolbar p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.table-toolbar-assigned {
  align-items: flex-end;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(117, 240, 199, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.assigned-ads-toolbar p {
  flex: 1 1 260px;
}

.assigned-search-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.2);
  background: rgba(117, 240, 199, 0.08);
  color: #c6ffea;
  font-size: 12px;
  white-space: nowrap;
}

.assigned-search-field {
  flex: 0 1 320px;
  min-width: 240px;
}

.assigned-search-field input {
  min-height: 44px;
}

.client-status-toolbar {
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(117, 240, 199, 0.2);
  background: rgba(117, 240, 199, 0.06);
}

.client-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-status-actions .button {
  min-width: 170px;
}

.client-status-filter-field {
  display: grid;
  gap: 0;
  min-width: 210px;
}

.client-status-filter-field span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-status-filter-field input,
.client-status-filter-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(143, 193, 255, 0.24);
  border-radius: 12px;
  background: rgba(8, 16, 30, 0.42);
  color: var(--text);
}

.client-status-filter-field input::placeholder {
  color: rgba(200, 214, 235, 0.68);
}

.client-status-filter-field input:focus,
.client-status-filter-field select:focus {
  outline: none;
  border-color: rgba(117, 240, 199, 0.55);
  box-shadow: 0 0 0 3px rgba(117, 240, 199, 0.16);
}

.client-list-grid {
  display: grid;
  gap: 10px;
}

.client-list-panel {
  display: grid;
  gap: 12px;
  transition: padding 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.client-list-panel.is-compact {
  position: sticky;
  top: 8px;
  z-index: 3;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(7, 14, 22, 0.94), rgba(9, 18, 28, 0.9));
  border-color: rgba(117, 240, 199, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.client-selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(117, 240, 199, 0.18);
  background: linear-gradient(135deg, rgba(117, 240, 199, 0.12), rgba(55, 212, 255, 0.08));
}

.client-selected-summary-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.client-selected-summary-eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-selected-summary-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-selected-summary-name-row strong {
  font-size: 18px;
  line-height: 1.1;
}

.client-selected-summary-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-selected-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-list-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.client-list-card:hover {
  border-color: rgba(117, 240, 199, 0.28);
}

.client-list-card.is-selected {
  border-color: rgba(117, 240, 199, 0.42);
  background: rgba(117, 240, 199, 0.1);
}

.client-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.client-list-head-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.client-list-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-edit-button {
  min-width: 112px;
}

.client-contact-inline {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.client-quick-link {
  text-decoration: none;
  min-width: 128px;
}

.client-list-head strong {
  font-size: 15px;
}

.client-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.3);
  background: rgba(117, 240, 199, 0.12);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.client-status-chip.is-green {
  border-color: rgba(80, 220, 150, 0.42);
  background: rgba(80, 220, 150, 0.16);
  color: #87f0c2;
}

.client-status-chip.is-blue {
  border-color: rgba(92, 196, 255, 0.42);
  background: rgba(92, 196, 255, 0.16);
  color: #a9e3ff;
}

.client-status-chip.is-yellow {
  border-color: rgba(245, 208, 88, 0.42);
  background: rgba(245, 208, 88, 0.18);
  color: #ffe497;
}

.client-status-chip.is-red {
  border-color: rgba(255, 106, 106, 0.42);
  background: rgba(255, 106, 106, 0.16);
  color: #ffb0b0;
}

.client-list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.client-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.client-relations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.client-relations-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
}

.client-relations-panel .section-head {
  margin: 0;
  min-height: 30px;
  align-items: center;
}

.client-relations-panel .section-head > div {
  display: grid;
  gap: 0;
}

.client-relations-panel .assign-library-search {
  margin: 0;
}

.client-relations-panel .checkbox-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.client-campaign-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  overflow: auto;
}

.client-campaign-table {
  width: 100%;
  border-collapse: collapse;
}

.client-campaign-table th,
.client-campaign-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.client-campaign-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-campaign-table td {
  font-size: 13px;
}

.client-campaign-table tbody tr:last-child td {
  border-bottom: 0;
}

.client-campaign-table input[type="date"] {
  width: min(100%, 220px);
}

.client-campaign-empty {
  color: var(--muted);
  font-size: 13px;
}

.emission-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.emission-badge--active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.emission-badge--inactive {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.emission-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

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

.emission-action-btn {
  font-size: 11px;
  padding: 4px 8px;
}

.campaign-date-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campaign-cyclic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.campaign-cyclic-toggle input[type="checkbox"] {
  accent-color: var(--accent);
}

.campaign-date-hint {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.campaign-date-hint--active {
  color: var(--accent);
}

.campaign-date-hint--expired {
  color: #e05c3a;
}

.client-notes-field {
  gap: 8px;
}

.client-notes-field textarea {
  width: 100%;
  min-height: 128px;
  max-height: 420px;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
}

.client-notes-field textarea:disabled {
  opacity: 0.72;
}

.client-notes-counter {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.client-details-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.client-details-item strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.client-details-item span {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.client-assigned-ad-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.client-assigned-ad-item.is-clickable {
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.client-assigned-ad-item.is-clickable:hover,
.client-assigned-ad-item.is-clickable:focus-visible {
  border-color: rgba(117, 240, 199, 0.36);
  background: rgba(117, 240, 199, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.client-assigned-ad-item strong {
  font-size: 13px;
  color: var(--text);
}

.client-assigned-ad-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.client-assigned-ad-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.client-assigned-location-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.client-assigned-location-item strong {
  font-size: 13px;
  color: var(--text);
}

.client-assigned-location-item small {
  color: var(--muted);
}

.client-location-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}

.client-location-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 14px;
  border-color: rgba(117, 240, 199, 0.5);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.3), rgba(55, 212, 255, 0.16));
  color: #e7fff6;
}

.client-location-actions .button:only-child {
  grid-column: 1 / -1;
}

.client-location-actions .button:hover {
  border-color: rgba(117, 240, 199, 0.68);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.38), rgba(55, 212, 255, 0.2));
}

.client-inner-panel {
  margin-top: 2px;
  border-radius: 22px;
}

.client-add-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.client-add-form #clientSaveButton {
  width: 100%;
}

@media (max-width: 1120px) {
  .client-add-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .client-selected-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .client-selected-summary-actions {
    width: 100%;
    justify-content: stretch;
  }

  .client-selected-summary .button {
    width: 100%;
    justify-content: center;
  }

  .client-add-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-location-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-status-filter-field {
    min-width: 100%;
  }

  .client-details-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-relations-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.assign-library-panel {
  display: grid;
  gap: 14px;
}

.assign-library-search {
  gap: 8px;
}

.assign-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.assign-library-label {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assign-library-head p {
  margin-top: 8px;
  color: var(--muted);
  max-width: 720px;
}

.workspace-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.workspace-actions .button {
  min-width: 200px;
}

.workspace-add-button {
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(56, 211, 159, 0.2);
}

.workspace-add-button.is-pending {
  position: relative;
  overflow: hidden;
}

.workspace-add-button.is-pending::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.3) 45%, transparent 80%);
  transform: translateX(-120%);
  animation: workspace-btn-sheen 1.1s linear infinite;
}

.workspace-quick-action {
  border-color: rgba(117, 240, 199, 0.28);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.14), rgba(55, 212, 255, 0.08));
  color: #ddfff2;
}

.workspace-quick-action:hover {
  border-color: rgba(117, 240, 199, 0.42);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.2), rgba(55, 212, 255, 0.12));
}

.workspace-upload-dialog {
  width: min(560px, 100%);
  transform-origin: center top;
  animation: workspace-upload-in 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.workspace-upload-file-name {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(117, 240, 199, 0.2);
  background: rgba(117, 240, 199, 0.08);
  color: #d5fff1;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.workspace-upload-footer {
  margin-top: 6px;
}

.ad-create-dialog {
  width: 70vw;
  max-width: 70vw;
}

.ad-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.ad-create-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.ad-create-file-row .button {
  min-width: 170px;
}

.ad-create-selected-file {
  margin: 0;
}

.ad-create-footer {
  justify-content: center;
}

.ad-create-footer .button {
  flex: 0 1 220px;
  max-width: 280px;
}

.location-create-dialog {
  width: min(820px, 96vw);
  max-width: min(820px, 96vw);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.location-create-form-modal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex: 1 1 auto;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.location-create-notes-field {
  grid-column: 1 / -1;
}

.location-create-footer {
  justify-content: center;
}

.location-create-footer .button {
  flex: 0 1 220px;
  max-width: 280px;
}

.client-create-dialog {
  width: min(920px, 100%);
  max-width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.client-create-form-modal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.client-create-footer {
  grid-column: 1 / -1;
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 2px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(8, 18, 30, 0.08) 0%, rgba(8, 18, 30, 0.96) 36%);
}

.client-create-footer .button {
  flex: 1 1 220px;
  max-width: 280px;
}

.checklist-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 4px;
}

.checklist-actions .button {
  width: 100%;
  justify-content: center;
}

.checkbox-card.is-assigned {
  border-color: rgba(117, 240, 199, 0.36);
  background: rgba(117, 240, 199, 0.07);
}

.checkbox-card.is-assigned:hover {
  border-color: rgba(117, 240, 199, 0.58);
  background: rgba(117, 240, 199, 0.16);
  box-shadow: 0 8px 22px rgba(56, 211, 159, 0.2);
}

.checkbox-assigned-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.3);
  background: rgba(117, 240, 199, 0.12);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.location-create-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(117, 240, 199, 0.2);
  background:
    linear-gradient(145deg, rgba(117, 240, 199, 0.1), rgba(117, 240, 199, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.location-create-head {
  display: grid;
  gap: 6px;
}

.location-create-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.location-create-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.location-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.location-create-field {
  margin: 0;
}

.location-create-form .button {
  min-width: 190px;
}

.checkbox-list {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-toggle-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text);
}

.checkbox-toggle-all input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.checkbox-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 160ms ease, background 160ms ease;
}

.checkbox-card:hover {
  border-color: rgba(117, 240, 199, 0.26);
  background: rgba(117, 240, 199, 0.08);
}

.checkbox-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.checkbox-card-main strong,
.checkbox-card-main small {
  overflow-wrap: anywhere;
}

.checkbox-card-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.checkbox-list-empty {
  color: var(--muted);
  padding: 8px 4px;
}

.assign-modal-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-card-extra {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.checkbox-card-extra span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkbox-card-extra input[type="date"] {
  width: min(100%, 240px);
}

.library-search-meta {
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.library-control-field {
  min-width: 0;
}

.library-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 52px;
}

.library-page-info {
  min-width: 116px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.table-head,
.table-row {
  display: grid;
  gap: 14px;
  align-items: start;
}

.assigned-head,
.assigned-row {
  grid-template-columns: 56px minmax(0, 1.5fr) 88px 150px 168px;
}

.library-head-row,
.library-row {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 190px) minmax(180px, auto);
  min-width: 0;
  width: 100%;
}

.library-col-name {
  text-align: left;
}

.library-col-preview {
  text-align: center;
}

.library-col-monitors {
  text-align: right;
}

.library-row {
  align-items: stretch;
}

.library-row .table-name {
  display: flex;
  align-items: center;
}

.library-main-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  flex-wrap: nowrap;
}

.library-main-line .ad-name-clickable {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-head {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-row {
  padding: 16px 18px;
}

.assigned-row {
  padding: 8px 10px;
  gap: 10px;
}

.table-cell {
  min-width: 0;
}

.table-id {
  display: flex;
  align-items: center;
}

.table-id,
.table-name strong {
  overflow-wrap: anywhere;
}

.table-name {
  display: grid;
  gap: 6px;
}

.assigned-row .table-name {
  gap: 2px;
}

.assigned-row .ad-name-clickable {
  max-width: 100%;
  padding: 0;
  text-align: left;
  line-height: 1.2;
}

.assigned-row .ad-link {
  font-size: 11px;
  line-height: 1.2;
}

.library-ad-duration {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.library-ad-client {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.library-ad-client-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.library-ad-client-link:hover,
.library-ad-client-link:focus-visible {
  color: color-mix(in srgb, var(--accent) 82%, #ffffff 18%);
}

.library-ad-client-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.table-file {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ad-assignment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.22);
  background: rgba(117, 240, 199, 0.09);
  color: #c6ffea;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-assignment-button {
  border: 1px solid rgba(117, 240, 199, 0.32);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.ad-assignment-button:hover {
  transform: translateY(-1px);
  background: rgba(117, 240, 199, 0.16);
  border-color: rgba(117, 240, 199, 0.42);
}

.table-file-name {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

.duration-editor {
  display: grid;
  gap: 6px;
}

.assigned-row .duration-editor,
.assigned-row .order-stack,
.assigned-row .row-actions {
  height: 100%;
}

.assigned-row .duration-editor {
  align-content: center;
}

.assigned-row .field {
  gap: 3px;
}

.assigned-row .field span {
  display: none;
}

.assigned-row .compact-field input {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 13px;
  text-align: center;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assigned-row .row-actions {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.assigned-row .order-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.assigned-row .row-actions .compact-button,
.assigned-row .order-actions .compact-button {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.assigned-row .order-actions .compact-button {
  width: 32px;
  min-width: 32px;
  padding-inline: 0;
  font-size: 14px;
}

.library-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.library-row-actions .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ad-link {
  color: var(--accent);
  text-decoration: none;
}

.ad-link:hover {
  text-decoration: underline;
}

.compact-field input {
  padding: 12px 14px;
}

.order-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.assigned-row .order-stack {
  grid-template-columns: 58px 44px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 4px;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.assigned-row .order-badge {
  overflow: hidden;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.order-position-field {
  min-width: 0;
}

.order-position-field input {
  width: 100%;
}

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

.assigned-row .order-actions .button {
  flex: 0 0 32px;
}

.assigned-row {
  cursor: grab;
  grid-template-columns: 56px minmax(0, 1.5fr) 88px 150px 168px;
  align-items: stretch;
}

.assigned-row.is-dragging {
  opacity: 0.45;
}

.assigned-row.is-drop-target {
  border-color: var(--accent-strong);
  background: rgba(117, 240, 199, 0.12);
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-content: center;
  padding: 28px;
  text-align: center;
  gap: 14px;
  color: var(--muted);
}

.compact-empty {
  min-height: 160px;
}

body.modal-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.82);
  backdrop-filter: blur(6px);
}

.preview-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(90vh, 920px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 18, 30, 0.96);
  box-shadow: var(--shadow);
}

.preview-close {
  justify-self: end;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.preview-content {
  min-height: 240px;
  display: grid;
  place-items: center;
}

.preview-media {
  max-width: 100%;
  max-height: calc(90vh - 120px);
  border-radius: 18px;
  background: #000;
}

.preview-image {
  object-fit: contain;
}

.preview-video {
  width: 100%;
}

.preview-fallback {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.progress-modal {
  position: fixed;
  inset: 0;
  z-index: 910;
  display: grid;
  place-items: center;
  padding: 24px;
}

.progress-dialog {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 18, 30, 0.96);
  box-shadow: var(--shadow);
}

.progress-head {
  display: grid;
  gap: 4px;
}

.progress-head h3 {
  margin: 0;
}

.progress-message {
  margin: 0;
  color: var(--muted);
  min-height: 22px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eead4 0%, #64d2ff 100%);
  transition: width 180ms ease;
}

.progress-bar.is-indeterminate {
  width: 42%;
  animation: progress-indeterminate 1.1s linear infinite;
}

.progress-percent {
  justify-self: end;
  color: var(--text);
  font-weight: 600;
}

.assign-modal {
  position: fixed;
  inset: 0;
  z-index: 920;
  display: grid;
  place-items: center;
  padding: 24px;
}

.assign-dialog {
  position: relative;
  z-index: 1;
  width: min(70vw, 900px);
  max-width: 98vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 32px 18px 32px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 18, 30, 0.96);
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.assign-head {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.assign-dialog > .checkbox-list {
  flex: 1 1 auto;
  min-height: 60px;
  max-height: none;
  overflow-y: auto;
}
.assign-monitor-list {
  display: grid;
  gap: 10px;
  max-height: calc(70vh - 120px);
  min-height: 60px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 0;
}

.assign-monitor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.assign-monitor-item strong {
  overflow-wrap: anywhere;
}

.assign-monitor-item small {
  color: var(--muted);
}

.assign-modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(8, 18, 30, 0) 0%, rgba(8, 18, 30, 0.96) 80%);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

@media (max-width: 900px) {
  .assign-dialog {
    width: 98vw;
    max-width: 98vw;
    padding: 12px 4vw 12px 4vw;
    gap: 12px;
  }

  .assign-monitor-list {
    max-height: 48vh;
  }
}

.assign-modal-footer .button {
  flex: 1;
}

.assign-monitor-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

/* ---- Ad name clickable button in library row ---- */
.ad-name-clickable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color 150ms ease;
}

.ad-name-clickable:hover {
  color: var(--accent);
}

/* ---- Ad detail modal - rename + delete section ---- */
.ad-detail-dialog {
  position: relative;
  max-height: min(92vh, 920px);
  overflow: hidden;
}

.ad-detail-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 14, 0);
  pointer-events: none;
  transition: background 180ms ease;
  z-index: 20;
}

.ad-detail-dialog.is-delete-confirm-open::before {
  background: rgba(3, 8, 14, 0.62);
}

.ad-detail-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ad-detail-rename-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ad-detail-assignment-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(117, 240, 199, 0.22);
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.08), rgba(55, 212, 255, 0.03));
}

.ad-detail-assignment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ad-detail-assignment-table {
  display: grid;
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 15, 25, 0.55);
  overflow: hidden;
}

.ad-detail-assignment-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(140px, 0.7fr);
  gap: 12px;
  padding: 7px 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.ad-detail-assignment-table-head span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-detail-assignment-table-body {
  display: grid;
  gap: 0;
  max-height: 280px;
  overflow: auto;
}

.ad-detail-assignment-row,
.ad-detail-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ad-detail-assignment-row:last-child,
.ad-detail-picker-item:last-child {
  border-bottom: 0;
}

.ad-detail-assignment-row.is-client-assignment {
  background: linear-gradient(145deg, rgba(117, 240, 199, 0.12), rgba(55, 212, 255, 0.06));
  border-color: rgba(117, 240, 199, 0.2);
}

.ad-detail-assignment-row strong,
.ad-detail-picker-item strong {
  font-size: 14px;
  color: var(--text);
}

.ad-detail-assignment-link {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ad-detail-assignment-link:hover,
.ad-detail-assignment-link:focus-visible {
  color: color-mix(in srgb, var(--accent) 82%, #ffffff 18%);
}

.ad-detail-assignment-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.ad-detail-assignment-link.is-client-assignment {
  font-size: 15px;
  font-weight: 700;
}

.ad-detail-assignment-row small,
.ad-detail-picker-item small {
  color: var(--muted);
  font-size: 12px;
}

.ad-detail-assignment-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.ad-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ad-detail-actions .button {
  flex: 1;
  min-width: 120px;
}

.ad-detail-picker-dialog {
  width: min(760px, 96vw);
}

.ad-detail-picker-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ad-detail-picker-hint {
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ad-detail-picker-list {
  display: grid;
  max-height: min(52vh, 440px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 15, 25, 0.55);
}

.ad-detail-picker-list.is-client-mode {
  gap: 8px;
  padding: 10px;
  background: rgba(5, 13, 23, 0.72);
}

.ad-detail-picker-item {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.ad-detail-picker-list.is-client-mode .ad-detail-picker-item {
  border-bottom: 0;
}

.ad-detail-picker-item-client {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(10, 22, 36, 0.7);
  padding: 12px 14px;
}

.ad-detail-picker-item-client:hover {
  border-color: rgba(117, 240, 199, 0.42);
  background: rgba(18, 36, 53, 0.84);
}

.ad-detail-picker-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ad-detail-picker-item-main {
  display: grid;
  gap: 4px;
}

.ad-detail-picker-item-main-client {
  gap: 0;
}

.ad-detail-picker-client-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.ad-detail-picker-client-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-detail-picker-client-id {
  flex: 0 0 auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(85, 120, 160, 0.28);
  border: 1px solid rgba(146, 194, 255, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

.ad-detail-picker-item.is-selected {
  background: rgba(117, 240, 199, 0.08);
}

.ad-detail-picker-item-client.is-selected {
  border-color: rgba(117, 240, 199, 0.64);
  background: rgba(26, 52, 72, 0.94);
  box-shadow: inset 0 0 0 1px rgba(117, 240, 199, 0.22);
}

.ad-detail-dialog .assign-modal-footer {
  position: sticky;
  bottom: 0;
  margin-top: 2px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(8, 18, 30, 0), rgba(8, 18, 30, 0.96) 24%);
  z-index: 2;
}

@media (max-width: 860px) {
  .ad-detail-assignment-grid {
    grid-template-columns: 1fr;
  }

  .ad-detail-assignment-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ad-detail-assignment-head .button {
    width: 100%;
  }
}

/* ---- Delete confirmation panel ---- */
.ad-delete-confirm {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid rgba(255, 80, 60, 0.55);
  background: rgba(80, 10, 10, 0.55);
  text-align: center;
  animation: confirm-shake 0.22s ease;
}

.ad-detail-dialog > .ad-delete-confirm {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  z-index: 35;
  width: min(560px, calc(100% - 40px));
  margin: 0 auto;
  transform: translateY(-50%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
}

@keyframes confirm-shake {
  0%   { transform: scale(0.97); opacity: 0; }
  60%  { transform: scale(1.01); }
  100% { transform: scale(1);    opacity: 1; }
}

.ad-detail-dialog > .ad-delete-confirm:not(.hidden) ~ .assign-modal-footer {
  pointer-events: none;
  opacity: 0.16;
}

.ad-delete-warning-icon {
  font-size: 36px;
  line-height: 1;
  color: #ff6b4a;
  text-shadow: 0 0 20px rgba(255, 80, 50, 0.7);
}

.ad-delete-warning-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #ffd7cc;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ad-delete-warning-body {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.ad-delete-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ad-delete-confirm-actions .button {
  min-width: 120px;
}

@media (max-width: 640px) {
  .ad-detail-dialog > .ad-delete-confirm {
    left: 12px;
    right: 12px;
    width: auto;
    padding: 18px 16px;
  }
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-105%);
  }

  100% {
    transform: translateX(250%);
  }
}

@keyframes workspace-upload-in {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes workspace-btn-sheen {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 24px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(5, 17, 31, 0.9);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(255, 141, 107, 0.4);
  color: #ffd7cc;
}

@media (max-width: 1100px) {
  .dashboard {
    gap: 0;
  }

  .topbar {
    grid-template-areas:
      "nav"
      "actions";
    grid-template-columns: 1fr;
  }

  .topbar-menu-panel {
    display: grid;
    gap: 10px;
  }

  .topbar-main-actions,
  .topbar-system-actions {
    justify-content: center;
  }

  .context-strip-line {
    flex-wrap: wrap;
    white-space: normal;
  }

  .context-segment-location {
    min-width: min(100%, 320px);
  }

  .context-logout-button {
    margin-left: 0;
  }

  .context-client-actions {
    margin-left: 0;
    width: 100%;
  }

  .context-location-actions {
    width: 100%;
    justify-content: center;
  }

  .context-ads-actions {
    width: 100%;
    justify-content: center;
  }

  .context-workspace-actions {
    width: 100%;
    justify-content: center;
  }

  .context-offer-summary {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .context-client-actions .button,
  .context-client-actions .client-status-filter-field {
    width: 100%;
    min-width: 0;
  }

  .context-client-actions {
    padding: 8px;
  }

  .context-location-actions .button {
    width: auto;
    min-width: 190px;
    max-width: 100%;
  }

  .context-action-search-field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .context-ads-actions .button {
    width: auto;
    min-width: 230px;
    max-width: 100%;
  }

  .context-workspace-actions .button {
    width: auto;
    min-width: 150px;
    max-width: 100%;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .library-controls {
    grid-template-columns: 1fr;
  }

  .library-pagination-controls {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .library-pagination-controls .button {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .workspace-form,
  .assign-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .location-create-form {
    grid-template-columns: 1fr;
  }

  .location-create-form .button {
    width: 100%;
    min-width: 0;
  }

  .assign-library-head,
  .workspace-actions {
    align-items: stretch;
  }

  .table-toolbar {
    align-items: stretch;
  }

  .table-toolbar .button {
    width: 100%;
  }

  .assigned-head,
  .assigned-row {
    grid-template-columns: 52px minmax(0, 1fr) 84px 148px 164px;
  }

  .library-head-row,
  .library-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) minmax(160px, auto);
  }

  .library-row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .shell {
    width: 100%;
    padding-top: 0;
  }

  .dashboard {
    gap: 0;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px;
    top: 0;
  }

  .topbar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 48px;
  }

  .topbar-menu-toggle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .topbar-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(6, 18, 31, 0.78);
    backdrop-filter: blur(8px);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease;
  }

  .topbar-menu-panel.is-open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .topbar-main-actions,
  .topbar-system-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: unset;
    gap: 8px;
  }

  .topbar-main-actions .button,
  .topbar-system-actions .button {
    width: 100%;
    min-height: 44px;
    font-weight: 650;
  }

  .topbar-system-actions {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    justify-content: flex-start;
  }

  .topbar-mobile-only {
    display: flex;
  }

  .ad-create-dialog {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  .location-create-dialog {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  .client-create-dialog {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  .client-create-form-modal {
    grid-template-columns: minmax(0, 1fr);
  }

  .ad-create-file-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ad-create-file-row .button {
    width: 100%;
    min-width: 0;
  }

  .context-strip {
    margin-top: 0;
    position: relative;
    top: 0;
    padding: 8px 12px 10px;
    border-top: 0;
    box-shadow: none;
    z-index: auto;
  }

  .context-strip-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 6px;
    overflow: visible;
  }

  .context-separator {
    display: none;
  }

  .context-primary,
  .context-segment,
  .context-metrics {
    min-width: 0;
    width: 100%;
  }

  .context-metrics {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .context-logout-button {
    display: none;
  }

  .location-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .location-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }

  .location-row-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .location-card {
    padding: 12px;
  }

  .location-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .location-card-name {
    white-space: normal;
  }

  .location-card-meta {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .locations-list {
    gap: 10px;
  }

  .content-grid {
    margin-top: 0;
  }

  .workspace {
    padding: 12px;
  }

  .workspace-panel {
    border-radius: 18px;
    padding: 14px;
  }

  .workspace-actions .button {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: 100%;
    padding-top: 0;
  }

  .auth-panel,
  .sidebar,
  .workspace {
    padding: 12px;
  }

  .row-actions,
  .order-actions,
  .workspace-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .assigned-row .row-actions,
  .assigned-row .order-actions {
    flex-direction: row;
    align-items: center;
  }

  .assigned-row .order-stack {
    grid-template-columns: minmax(72px, auto) minmax(72px, 1fr) auto;
  }

  .library-row .table-name,
  .library-row .table-file,
  .library-row .table-actions {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .library-main-line {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 4px;
    column-gap: 10px;
  }

  .library-main-line .ad-name-clickable {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .workspace-actions .button,
  .checklist-actions .button,
  .assign-modal-footer .button {
    min-height: 44px;
  }

  .checklist-actions {
    grid-template-columns: 1fr;
  }

  .location-card {
    padding: 12px;
  }

  .locations-list,
  .table-body {
    gap: 8px;
  }

  .table-head {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-row,
  .assigned-row,
  .library-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .assigned-row {
    padding: 12px;
    gap: 12px;
  }

  .assigned-row .table-actions {
    justify-content: flex-start;
  }

  .assigned-row .row-actions,
  .assigned-row .order-actions {
    justify-content: flex-start;
  }

  .table-actions {
    justify-content: stretch;
  }

  .preview-modal {
    padding: 14px;
  }

  .progress-modal {
    padding: 14px;
  }

  .assign-modal {
    padding: 14px;
  }

  .preview-dialog {
    padding: 14px;
  }

  .progress-dialog {
    padding: 16px;
  }

  .assign-dialog {
    padding: 16px;
  }
}

@keyframes mobile-menu-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.offer-gen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.offer-gen-form-col {
  display: grid;
  gap: 14px;
}

.offer-gen-section {
  display: grid;
  gap: 12px;
}

.offer-gen-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.offer-type-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.offer-type-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 140ms ease;
}

.offer-type-card:hover {
  transform: translateY(-1px);
}

.offer-type-card input[type="radio"] {
  display: none;
}

.offer-type-card:has(input:checked) {
  border-color: rgba(117, 240, 199, 0.55);
  background: rgba(117, 240, 199, 0.12);
}

.offer-type-name {
  font-size: 13px;
  font-weight: 700;
}

.offer-type-desc {
  color: var(--muted);
  font-size: 11px;
}

.offer-slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.offer-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(117, 240, 199, 0.5), rgba(55, 212, 255, 0.35));
  outline: none;
  cursor: pointer;
}

.offer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d8fff3;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(117, 240, 199, 0.18);
}

.offer-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d8fff3;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(117, 240, 199, 0.18);
}

.offer-slider-value-wrap {
  min-width: 58px;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px;
}

.offer-slider-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.offer-slider-ticks {
  position: relative;
  height: 16px;
  color: var(--muted);
  font-size: 11px;
}

.offer-slider-ticks span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.offer-slider-ticks span:first-child {
  transform: translateX(0);
}

.offer-slider-ticks span:last-child {
  transform: translateX(-100%);
}

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

.offer-period-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.offer-period-card input[type="radio"] {
  display: none;
}

.offer-period-card:has(input:checked) {
  border-color: rgba(117, 240, 199, 0.55);
  background: rgba(117, 240, 199, 0.12);
}

.offer-period-months {
  font-weight: 700;
  font-size: 12px;
}

.offer-period-discount {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

/* ── Location card contact info & extras ─────────────────────── */

.location-card-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.location-card-sep {
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
}

.location-card-notes {
  font-size: 11px;
  color: rgba(215, 255, 241, 0.45);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.location-card-tasks {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(117, 240, 199, 0.12);
}

.location-card-task {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(215, 255, 241, 0.6);
}

.location-card-task-date {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 82px;
  flex-shrink: 0;
}

.location-card-task-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.location-card-edit-btn {
  font-size: 11px;
  padding: 3px 10px;
  height: auto;
  line-height: 1.4;
  border-radius: 8px;
}

/* ── Workspace active location card header ───────────────────── */

.workspace-active-location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-active-location-details {
  margin-top: 4px;
}

.workspace-active-location-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.location-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 240, 199, 0.2);
  background: rgba(117, 240, 199, 0.08);
  color: rgba(215, 255, 241, 0.75);
  font-size: 11px;
  line-height: 1.4;
  max-width: 280px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.location-detail-notes {
  font-style: italic;
  max-width: 340px;
  white-space: normal;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Location edit modal ─────────────────────────────────────── */

.location-edit-dialog {
  width: min(820px, 96vw);
  max-width: min(820px, 96vw);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.location-edit-form-modal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex: 1 1 auto;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.location-edit-notes-field {
  grid-column: 1 / -1;
}

.location-edit-footer {
  justify-content: center;
}

.location-edit-footer .button {
  flex: 0 1 200px;
  max-width: 260px;
}

.location-edit-tasks-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.location-edit-tasks-label {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.location-edit-tasks-list {
  display: table-row-group;
}

.location-edit-tasks-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 10px;
}

.location-edit-task-date {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 88px;
  font-size: 11px;
}

.task-relations-table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.task-relations-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.task-relations-table th,
.task-relations-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text);
}

.task-relations-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 94%, #0c1524);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.task-relations-table tbody tr:last-child td {
  border-bottom: 0;
}

.offer-period-discount.no-discount {
  color: var(--muted);
}

.offer-period-discount.best-deal {
  color: #facc15;
}

.offer-period-price {
  color: var(--muted);
  font-size: 11px;
}

.offer-locations-state {
  color: var(--muted);
  font-size: 13px;
}

.offer-location-filters {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.offer-location-filter-field {
  margin: 0;
}

.offer-location-filter-field select,
.offer-location-filter-field input {
  min-height: 48px;
}

.offer-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow: auto;
}

.offer-location-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.offer-location-item:has(input:checked) {
  border-color: rgba(117, 240, 199, 0.55);
  background: rgba(117, 240, 199, 0.12);
}

.offer-location-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin-top: 2px;
}

.offer-location-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.offer-location-city {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.offer-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.offer-contact-field {
  margin: 0;
}

.offer-contact-field-wide {
  grid-column: 1 / -1;
}

.offer-contact-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.offer-gen-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.offer-load-btn {
  cursor: pointer;
}

.offer-gen-pdf-btn {
  margin-left: auto;
  min-width: 180px;
  font-weight: 700;
}

.offer-gen-summary-col {
  position: sticky;
  top: 88px;
}

.offer-summary-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(117, 240, 199, 0.28);
  background:
    linear-gradient(140deg, rgba(117, 240, 199, 0.12), rgba(55, 212, 255, 0.06)),
    rgba(8, 20, 34, 0.95);
}

.offer-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offer-summary-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.offer-summary-logo {
  color: var(--accent);
  letter-spacing: 0.12em;
  font-weight: 800;
}

.offer-summary-company {
  font-size: 16px;
  font-weight: 800;
}

.offer-summary-contact {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.offer-summary-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.offer-summary-table,
.offer-summary-pricing {
  display: grid;
  gap: 8px;
}

.offer-summary-row,
.offer-summary-price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.offer-summary-key {
  color: var(--muted);
  font-size: 12px;
}

.offer-summary-val {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

.offer-summary-discount-row {
  color: var(--accent);
}

.offer-summary-total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 8px;
  font-size: 16px;
  font-weight: 800;
}

.offer-summary-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .offer-gen-layout {
    grid-template-columns: 1fr;
  }

  .offer-gen-summary-col {
    position: static;
  }

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

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

@media (max-width: 640px) {
  .offer-type-cards,
  .offer-period-cards,
  .offer-contact-grid {
    grid-template-columns: 1fr;
  }

  .offer-slider-row {
    gap: 10px;
  }

  .offer-location-filters {
    gap: 10px;
  }

  .offer-gen-pdf-btn {
    margin-left: 0;
    width: 100%;
  }
}

.calendar-panel {
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(117, 240, 199, 0.14), transparent 36%),
    linear-gradient(165deg, rgba(9, 24, 40, 0.96), rgba(8, 19, 33, 0.96));
}

.google-like-calendar-head {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.calendar-head-main {
  display: grid;
  gap: 6px;
}

.calendar-title {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #f6f9ff;
}

.google-like-calendar-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.calendar-today-button {
  border-radius: 14px;
  padding-inline: 14px;
}

.calendar-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-nav-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  font-size: 14px;
}

.calendar-month-label {
  min-width: 170px;
  text-align: center;
  font-size: 18px;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.calendar-month-task-count {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(117, 240, 199, 0.25);
  background: rgba(117, 240, 199, 0.08);
  color: #bbffe8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.calendar-weekdays span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #b4c6dc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.calendar-day {
  min-height: 142px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 19, 33, 0.9);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.calendar-day.is-current-month:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 190, 255, 0.4);
  background: rgba(11, 28, 47, 0.94);
}

.calendar-day.is-weekend.is-current-month {
  background: rgba(10, 23, 39, 0.94);
}

.calendar-day.is-outside-month {
  opacity: 0.42;
  background: rgba(4, 12, 22, 0.7);
}

.calendar-day.is-today {
  border-color: rgba(117, 240, 199, 0.7);
  box-shadow: inset 0 0 0 1px rgba(117, 240, 199, 0.34);
}

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

.calendar-day-number {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #edf4ff;
}

.calendar-day.is-today .calendar-day-number {
  background: linear-gradient(135deg, #75f0c7 0%, #3dc6ff 100%);
  color: #032235;
}

.calendar-today-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8cd7ff;
  border: 1px solid rgba(140, 215, 255, 0.45);
  background: rgba(77, 186, 255, 0.1);
}

.calendar-day-tasks {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.calendar-day-empty {
  margin-top: auto;
  color: #8ca3be;
  font-size: 11px;
}

.calendar-task-chip,
.calendar-more-chip {
  width: 100%;
  border: 0;
  border-radius: 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  color: #f2f7ff;
  background: rgba(73, 169, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(116, 184, 255, 0.35);
}

.calendar-task-chip strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task-chip small {
  font-size: 10px;
  color: #cae6ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task-chip:hover,
.calendar-more-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.calendar-task-chip-variant-1 {
  background: rgba(73, 169, 255, 0.2);
}

.calendar-task-chip-variant-2 {
  background: rgba(117, 240, 199, 0.2);
  box-shadow: inset 0 0 0 1px rgba(117, 240, 199, 0.35);
}

.calendar-task-chip-variant-3 {
  background: rgba(255, 199, 110, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 199, 110, 0.35);
}

.calendar-task-chip-variant-4 {
  background: rgba(255, 138, 158, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 158, 0.35);
}

.calendar-more-chip {
  margin-top: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.calendar-empty-state {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
  color: #93aac5;
}

@media (max-width: 1100px) {
  .google-like-calendar-toolbar {
    justify-content: flex-start;
  }

  .calendar-month-label {
    min-width: 148px;
  }

  .calendar-day {
    min-height: 128px;
  }
}

@media (max-width: 760px) {
  .calendar-panel {
    padding: 16px;
  }

  .calendar-weekdays span {
    min-height: 30px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .calendar-grid {
    gap: 6px;
  }

  .calendar-day {
    min-height: 108px;
    padding: 8px;
    border-radius: 12px;
  }

  .calendar-day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .calendar-task-chip,
  .calendar-more-chip {
    padding: 7px;
    border-radius: 8px;
  }

  .calendar-task-chip strong {
    font-size: 11px;
  }

  .calendar-task-chip small {
    font-size: 10px;
  }
}

/* --- Autocomplete list for client search in adCreateModal --- */
.ad-create-client-field {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 100;
  background: color-mix(in srgb, var(--panel) 92%, #04111f);
  border: 1px solid color-mix(in srgb, var(--line-strong) 86%, #87d8ff 14%);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  margin-top: 2px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
  min-width: 220px;
  display: none;
}
.autocomplete-list.active {
  display: block;
}
.autocomplete-list .autocomplete-item {
  width: 100%;
  display: block;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-bottom: 6px;
}
.autocomplete-list .autocomplete-item:last-child {
  margin-bottom: 0;
}
.autocomplete-list .autocomplete-item:hover,
.autocomplete-list .autocomplete-item.active {
  background: color-mix(in srgb, var(--accent) 18%, #0f2a40);
  border-color: color-mix(in srgb, var(--accent) 65%, #ffffff 35%);
  color: var(--text);
}
.autocomplete-list .autocomplete-item strong {
  font-weight: 600;
  color: var(--text);
}
.autocomplete-list .autocomplete-item span {
  color: inherit;
  opacity: 0.86;
  font-size: 12px;
}
.autocomplete-list .autocomplete-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.autocomplete-list .autocomplete-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.autocomplete-list .autocomplete-item-id {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(145, 196, 255, 0.36);
  background: rgba(74, 138, 214, 0.16);
}
.autocomplete-list .autocomplete-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  background: transparent;
  cursor: default;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

/* ---- Mobile UX system-wide refinements ---- */
@media (max-width: 900px) {
  .context-strip {
    padding-inline: 12px;
  }

  .context-strip-line {
    row-gap: 8px;
  }

  .context-client-actions,
  .context-location-actions,
  .context-ads-actions,
  .context-calendar-actions,
  .context-workspace-actions,
  .context-offer-summary {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    border-radius: 14px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 8px;
  }

  .context-client-actions .button,
  .context-location-actions .button,
  .context-ads-actions .button,
  .context-workspace-actions .button {
    min-height: 44px;
  }

  .table-row {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
  }

  .assigned-row {
    padding: 8px 10px;
  }

  .table-body {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

  .background-glow {
    display: none;
  }

  .shell {
    width: 100%;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .panel {
    border-radius: 18px;
  }

  .topbar {
    padding: 10px 10px 8px;
    backdrop-filter: blur(10px);
    background: rgba(6, 18, 31, 0.92);
  }

  .context-strip {
    padding: 8px 10px 10px;
  }

  .workspace {
    padding: 10px;
  }

  .workspace-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .context-workspace-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .context-workspace-actions .button,
  .context-workspace-actions #saveAssignedSettingsButton,
  .context-workspace-actions .workspace-assigned-search-field {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .context-workspace-actions .context-action-search-field,
  .context-workspace-actions #saveAssignedSettingsButton {
    grid-column: 1 / -1;
  }

  .context-workspace-actions .button {
    justify-content: center;
    text-align: center;
  }

  .section-head {
    gap: 8px;
  }

  .section-head p {
    line-height: 1.45;
  }

  .button,
  .compact-button,
  .workspace-quick-action,
  .topbar-main-actions .button,
  .topbar-system-actions .button {
    min-height: 46px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  input,
  select,
  textarea,
  .field input,
  .field select,
  .field textarea,
  .context-action-search-field input,
  .client-status-filter-field input,
  .client-status-filter-field select {
    min-height: 44px;
    font-size: 16px;
  }

  textarea,
  .field textarea {
    min-height: 96px;
  }

  .table-toolbar {
    gap: 10px;
  }

  .table-toolbar p {
    line-height: 1.42;
  }

  .table-toolbar-assigned {
    padding: 10px;
    border-radius: 14px;
  }

  .assigned-search-meta {
    width: fit-content;
    max-width: 100%;
  }

  .assigned-row {
    padding: 12px;
    border-radius: 16px;
    gap: 12px;
  }

  .assigned-row .table-cell {
    width: 100%;
  }

  .assigned-row .table-id {
    width: fit-content;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(117, 240, 199, 0.24);
    background: rgba(117, 240, 199, 0.08);
    color: #c6ffea;
    font-size: 12px;
  }

  .assigned-row .table-name {
    gap: 5px;
  }

  .assigned-row .ad-name-clickable {
    font-size: 15px;
    line-height: 1.28;
  }

  .assigned-row .ad-link {
    font-size: 12px;
  }

  .assigned-row .table-duration,
  .assigned-row .table-order {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
  }

  .assigned-row .duration-editor,
  .assigned-row .order-stack {
    height: auto;
  }

  .assigned-row .field span {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .assigned-row .compact-field input {
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 16px;
  }

  .assigned-row .order-stack {
    grid-template-columns: minmax(74px, auto) minmax(72px, 1fr) auto;
    gap: 8px;
  }

  .assigned-row .order-badge {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .assigned-row .order-actions {
    gap: 6px;
  }

  .assigned-row .order-actions .compact-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }

  .assigned-row .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .assigned-row .row-actions .compact-button {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    justify-content: center;
  }

  .workspace-actions {
    gap: 8px;
  }

  .workspace-actions .button {
    width: 100%;
  }

  .client-list-card {
    padding: 12px;
  }

  .client-list-head {
    gap: 10px;
  }

  .client-list-head-actions {
    width: 100%;
    gap: 8px;
  }

  .client-list-head-actions .button,
  .client-list-head-actions .client-quick-link {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .client-relations-panel .checkbox-list,
  .ad-detail-assignment-table-body,
  .ad-detail-picker-list,
  .assign-dialog > .checkbox-list,
  .assign-monitor-list {
    max-height: min(42vh, 360px);
  }

  .library-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .library-row-actions > * {
    flex: 0 0 auto;
  }

  .assign-modal,
  .preview-modal,
  .progress-modal {
    padding: 0;
  }

  .assign-dialog,
  .preview-dialog,
  .progress-dialog,
  .ad-create-dialog,
  .location-create-dialog,
  .client-create-dialog,
  .ad-detail-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .assign-modal-footer,
  .workspace-upload-footer,
  .ad-create-footer,
  .location-create-footer {
    padding-top: 10px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(8, 18, 30, 0) 0%, rgba(8, 18, 30, 0.96) 55%);
  }
}

@media (max-width: 560px) {
  .topbar-menu-toggle {
    width: 44px;
    height: 44px;
  }

  .context-workspace-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .context-client-actions .button,
  .context-location-actions .button,
  .context-ads-actions .button,
  .context-workspace-actions .button,
  .context-client-actions .client-status-filter-field,
  .context-location-actions .context-action-search-field,
  .context-ads-actions .context-action-search-field,
  .context-workspace-actions .context-action-search-field {
    width: 100%;
  }

  .client-list-head-actions .button,
  .client-list-head-actions .client-quick-link {
    flex: 1 1 100%;
  }

  .offer-gen-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .assigned-row .order-stack {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .assigned-row .order-badge {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .assigned-row .order-position-field {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .assigned-row .row-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .assigned-row .order-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .assigned-row .order-actions {
    width: 100%;
  }

  .assigned-row .order-actions .compact-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}
