.dashboard-view {
  min-height: 100vh;
  padding-top: 110px;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 110px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(35, 48, 68, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 48, 68, 0.05) 1px, transparent 1px),
    #eef2f6;
  background-size: 32px 32px;
}

.topbar-brand {
  min-width: 0;
}

.brand-home-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-home-button:focus-visible {
  outline: 3px solid rgba(192, 174, 238, 0.36);
  outline-offset: 6px;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-box span {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  min-height: calc(100vh - 110px);
}

.sidebar {
  position: fixed;
  z-index: 10;
  top: 110px;
  bottom: 0;
  left: 0;
  width: 260px;
  overflow: auto;
  padding: 20px;
  background: var(--nav);
}

.nav-item {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--nav-muted);
  text-align: left;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.workspace {
  min-height: calc(100vh - 110px);
  margin-left: 260px;
  padding: clamp(24px, 5vw, 48px);
}

.workspace-header {
  max-width: 760px;
}

.workspace-header-row {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 468px);
  align-items: start;
  gap: 24px;
  min-height: 64px;
}

.workspace-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 16px;
  max-width: 760px;
  margin-top: 28px;
}

.metric-card {
  min-height: 132px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.metric-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.panel-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel-status[data-tone="error"] {
  color: var(--danger);
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  width: 100%;
  min-width: 0;
  justify-self: end;
  align-items: start;
  gap: 8px 10px;
}

.users-toolbar input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.users-toolbar input::placeholder {
  color: var(--muted);
  font-weight: 600;
}

.grids-toolbar {
  grid-template-columns: minmax(220px, 1fr) 44px;
}

.grids-toolbar input {
  grid-column: 1;
  grid-row: 1;
}

.grids-toolbar .compact-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.grids-toolbar .panel-status {
  grid-column: 1 / -1;
}

.notifications-header-row .panel-status {
  text-align: right;
}

.compact-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.compact-action-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.import-panel {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.field-group textarea {
  resize: vertical;
}

.json-drop-zone {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 108px;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: var(--block-radius);
  background: #f8f7ff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.json-drop-zone span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.json-drop-zone.is-dragging,
.json-drop-zone:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(192, 174, 238, 0.22);
  outline: 0;
}

.json-drop-zone.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.json-drop-zone input {
  display: none;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-card {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.notification-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.communications-header-row {
  grid-template-columns: minmax(0, 1fr) 100px;
  align-items: start;
}

.communications-header-row .grids-toolbar {
  grid-template-columns: 44px 44px;
  gap: 10px;
  justify-content: end;
}

.communications-header-row #communications-status {
  text-align: right;
}

.communications-header-row #add-communication-button {
  grid-column: 2;
}

.communication-toggle {
  grid-column: 1;
  grid-row: 1;
  display: inline-grid;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}

.communication-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.communication-toggle span {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid #f1c6be;
  border-radius: var(--block-radius);
  background: #fff4f1;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.communication-toggle span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  content: "";
  transform: translate(-50%, -50%);
  transition: background 0.16s ease;
}

.communication-toggle input:checked + span {
  border-color: #b7e4cf;
  background: #eaf8f1;
}

.communication-toggle input:checked + span::after {
  background: var(--success);
}

.communication-form textarea {
  min-height: 132px;
}

.communication-editor-stack {
  display: grid;
  gap: 14px;
}

.communication-type-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #f8fafc;
}

.communication-type-switch label {
  min-width: 0;
  cursor: pointer;
}

.communication-type-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.communication-type-switch span {
  display: grid;
  min-height: 46px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--block-radius) - 2px);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.communication-type-switch input:focus-visible + span {
  border-color: var(--accent);
  outline: 0;
}

.communication-type-switch input:checked + span {
  background: var(--accent);
  border-color: #bda9ef;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(35, 48, 68, 0.1);
}

.communication-poll-builder {
  display: grid;
  gap: 14px;
}

.poll-options-list {
  display: grid;
  gap: 8px;
}

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

.poll-add-option-button {
  justify-self: start;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
}

.communication-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.communication-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.communication-card-title {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-card:has([data-communication-active]:checked) {
  border-color: #b7e4cf;
  box-shadow: 0 0 0 3px rgba(26, 135, 84, 0.12);
}

.communication-preview {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #f8fafc;
  color: var(--ink);
  text-align: center;
}

.communication-preview-image {
  min-height: 0;
  aspect-ratio: 1077 / 500;
  align-self: start;
}

.communication-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.communication-preview-text {
  padding: 18px;
  background: #ffffff;
}

.communication-preview-text strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.12rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.communication-preview-poll {
  align-content: start;
  justify-items: stretch;
  padding: 14px;
  background: #f8f7ff;
  text-align: left;
}

.communication-preview-poll strong {
  color: var(--ink);
}

.poll-choice-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.poll-choice-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-choice-preview b {
  min-width: 22px;
  color: var(--ink);
  text-align: right;
}

.communication-preview-ad {
  background: #fff8e8;
}

.communication-preview-ad strong {
  display: grid;
  place-items: center;
  width: 70px;
  height: 38px;
  border-radius: var(--block-radius);
  background: #fbbf24;
  color: #ffffff;
  font-size: 1.18rem;
}

.communication-card-footer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.ad-height-editor {
  display: grid;
  grid-template-columns: auto 64px auto;
  gap: 6px;
  align-items: center;
  justify-self: start;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.ad-height-editor input {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: calc(var(--block-radius) - 2px);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: right;
}

.ad-height-editor input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.communication-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 3;
}

.icon-action-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.icon-action-button:hover,
.icon-action-button:focus-visible {
  border-color: var(--accent);
  background: #f8f7ff;
  outline: 0;
}

.danger-button {
  color: var(--danger);
}

.ads-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.ad-placement-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.ad-placement-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.ad-placement-main h3,
.ad-placement-main p {
  margin: 0;
}

.ad-placement-main h3 {
  color: var(--ink);
  font-size: 1.05rem;
}

.ad-placement-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.ad-placement-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.notification-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.notification-status-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #f8fafc;
}

.notification-status-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-status-grid strong {
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.year-calendar {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

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

.year-calendar-header h3 {
  min-width: 86px;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  text-align: center;
}

.compact-calendar-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}

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

.calendar-week {
  display: grid;
  align-content: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid #f1c6be;
  border-radius: var(--block-radius);
  background: #fff4f1;
  color: var(--danger);
  text-align: left;
}

.calendar-week:not(:disabled):hover {
  border-color: var(--accent);
}

.calendar-week:disabled {
  cursor: default;
  opacity: 1;
}

.calendar-week[data-status="published"] {
  border-color: #b7e4cf;
  background: #eaf8f1;
  color: #176244;
}

.calendar-week[data-status="scheduled"] {
  border-color: #ffd7a8;
  background: #fff4e6;
  color: #9a5b00;
}

.calendar-week[data-status="empty"],
.calendar-week[data-status="filled"] {
  border-color: #f1c6be;
  background: #fff4f1;
  color: var(--danger);
}

.calendar-week-number {
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-week-title {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.users-table-shell {
  width: 100%;
  margin-top: 28px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.users-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.users-table thead {
  position: sticky;
  z-index: 12;
  top: 110px;
  background: #ffffff;
  box-shadow: 0 1px 0 var(--line);
}

.users-table th,
.users-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.users-table th {
  background: #ffffff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.users-table thead th:first-child {
  border-top-left-radius: var(--block-radius);
}

.users-table thead th:last-child {
  border-top-right-radius: var(--block-radius);
}

.users-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--block-radius);
}

.users-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--block-radius);
}

.users-table td {
  font-size: 1rem;
}

.users-table .current-user-row td {
  background: #f1f4f8;
}

.users-table .current-user-row:hover td {
  background: #edf1f6;
}

.users-table td > strong {
  font-size: 1rem;
}

.table-link {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.table-link:hover {
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.users-table td > strong,
.users-table td > span {
  display: block;
}

.users-table td > span:not(.status-badge) {
  max-width: 280px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table .role-column,
.users-table .role-cell {
  text-align: center;
}

.users-table .actions-column,
.users-table .actions-cell {
  width: 64px;
  text-align: right;
}

.actions-cell {
  position: relative;
}

.options-menu-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.email-value {
  display: block;
}

.email-pending {
  display: inline-flex !important;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-top: 6px !important;
  padding: 0 8px;
  border: 1px solid #f1c6be;
  border-radius: 6px;
  background: #fff4f1;
  color: var(--danger) !important;
  font-size: 0.74rem !important;
  font-weight: 800;
}

.status-badge {
  display: inline-grid;
  width: fit-content;
  height: 24px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #38465a;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.provider-badge {
  background: #ffffff;
  color: #4f5f76;
}

.status-badge-editor {
  border-color: #f1c6be;
  background: #fff4f1;
  color: var(--danger);
}

.status-badge-user {
  border-color: #c8d9f0;
  background: #f1f7ff;
  color: #245d9d;
}

.status-badge-published {
  border-color: #b9dec8;
  background: #effaf3;
  color: #237346;
}

.status-badge-scheduled {
  border-color: #f2d1a6;
  background: #fff6ea;
  color: #946120;
}

.status-badge-blocked {
  border-color: #f1c6be;
  background: #fff4f1;
  color: var(--danger);
}

.role-cell .status-badge {
  margin: 0 auto;
}

.options-button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.options-button:hover {
  border-color: #c7d2df;
  background: #f7f9fc;
}

.options-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.options-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(35, 48, 68, 0.16);
}

.options-menu button {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.options-menu button:hover {
  background: #f3f6fa;
}

.options-menu button[data-tone="danger"] {
  color: var(--danger);
}

.options-menu button[data-tone="danger"]:hover {
  background: #fff4f1;
}

.options-menu button:disabled {
  color: var(--muted);
  cursor: default;
}

.user-details {
  display: grid;
  grid-template-columns: max-content minmax(180px, 1fr);
  gap: 6px 12px;
  max-height: 220px;
  margin: 0;
  overflow: auto;
}

.user-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.user-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.user-detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.detail-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.detail-panel-wide {
  grid-column: 1 / -1;
}

.detail-panel h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.detail-list {
  display: grid;
  grid-template-columns: max-content minmax(160px, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.detail-list-four {
  grid-template-columns: repeat(3, max-content minmax(52px, 1fr));
}

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

.detail-danger-button {
  border-color: #f1c6be;
  color: var(--danger);
}

.detail-table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
}

.detail-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.detail-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.grids-table {
  min-width: 860px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f7f9fc;
}

.grid-words summary {
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.grid-word-list {
  display: grid;
  gap: 8px;
  width: min(520px, 72vw);
  max-height: 340px;
  margin-top: 10px;
  overflow: auto;
}

.grid-word-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
}

.grid-word-item strong,
.grid-word-item span,
.grid-word-item small {
  display: block;
}

.grid-word-item span {
  color: var(--ink);
  font-size: 0.82rem;
}

.grid-word-item small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.placeholder-panel {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.grid-detail-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.grid-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.grid-detail-left {
  display: grid;
  align-content: start;
  gap: 24px;
}

.grid-detail-right {
  display: grid;
  align-content: start;
  gap: 24px;
}

.grid-meta-panel {
  display: grid;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
}

.grid-preview,
.grid-editor,
.grid-actions-panel,
.grid-replace-panel {
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #ffffff;
  padding: 20px;
}

.grid-meta-panel h3,
.grid-preview h3,
.grid-editor-header h3,
.grid-actions-panel h3,
.grid-replace-panel h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.grid-board {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  width: min(100%, 380px);
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}

.grid-board-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: #ffffff;
  color: var(--ink);
  font-size: clamp(0.55rem, 1.5vw, 0.9rem);
  font-weight: 800;
  text-transform: uppercase;
}

.grid-board-cell.is-black {
  background: var(--ink);
}

.grid-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-editor-header h3 {
  margin: 0;
}

.compact-save-button {
  min-height: 38px;
  padding: 0 14px;
}

.grid-editor-list {
  display: grid;
  gap: 12px;
}

.grid-replace-panel {
  display: grid;
  gap: 0;
}

.sensitive-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  padding: 22px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 31, 48, 0.22);
}

.sensitive-dialog::backdrop {
  background: rgba(20, 31, 48, 0.38);
}

.sensitive-dialog form {
  display: grid;
  gap: 16px;
}

.sensitive-dialog h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.sensitive-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.sensitive-dialog input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.sensitive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.grid-editor-item {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(260px, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: #f7f9fc;
}

.empty-cell {
  height: 90px;
  color: var(--muted);
  text-align: center !important;
  vertical-align: middle !important;
}

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

  #grids-panel .workspace-header-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  #grids-panel .grids-toolbar {
    grid-template-columns: 44px;
  }

  #grids-panel .grids-toolbar label[for="grids-search"],
  #grids-panel #grids-search {
    display: none;
  }

  #grids-panel .grids-toolbar .compact-button {
    grid-column: 1;
  }
}

@media (max-width: 820px) {
  .dashboard-view {
    height: auto;
    overflow: visible;
    padding-top: 0;
  }

  .topbar {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .account-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    display: flex;
    gap: 8px;
    width: auto;
    overflow-x: auto;
    padding: 12px;
  }

  .workspace {
    height: auto;
    margin-left: 0;
    overflow: visible;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    margin-bottom: 0;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .workspace-header-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .communication-list {
    grid-template-columns: 1fr;
  }

  .field-row,
  .grid-detail-layout,
  .grid-detail-right,
  .user-detail-layout,
  .grid-editor-item {
    grid-template-columns: 1fr;
  }

  .year-calendar-grid {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }
}
