:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --panel-border: #2a3a52;
  --text: #e8eef7;
  --muted: #8fa3bf;
  --new: #f0c419;
  --warning: #f59e0b;
  --critical: #ef4444;
  --sla: #8b5cf6;
  --ok: #22c55e;
  --accent: #14b8a6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1b2838 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  justify-self: center;
}

.nav-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0 0.85rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-btn[hidden],
.nav-btn.nav-btn-restricted {
  display: none !important;
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(20, 184, 166, 0.12);
}

.view-panel.hidden {
  display: none;
}

.requests-view {
  padding: 1rem 1.5rem 2rem;
  min-height: calc(100vh - 5.5rem);
}

.requests-panel {
  margin: 0;
}

.requests-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.requests-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.requests-notifications {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.requests-notifications.hidden {
  display: none;
}

.requests-notifications-block {
  flex: 1 1 300px;
  min-width: 260px;
}

.requests-notifications-title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.requests-notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.requests-notification-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}

.requests-notification-item a {
  font-weight: 700;
  white-space: nowrap;
}

.requests-notification-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #79c0ff;
  font-weight: 600;
}

.requests-notification-note .requests-notification-meta {
  color: #d2a8ff;
}

.requests-notification-meta {
  flex: 1 1 180px;
  color: var(--muted);
  word-break: break-word;
}

.requests-notifications-overdue .requests-notifications-title {
  color: #fca5a5;
}

.requests-notifications-today .requests-notifications-title {
  color: #86efac;
}

.requests-notification-overdue {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.45);
}

.requests-notification-today {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.45);
}

.requests-notification-overdue .requests-notification-appointment {
  color: #fecaca;
}

.requests-notification-today .requests-notification-appointment {
  color: #86efac;
}

.requests-notification-appointment {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-work-notes-today {
  background: rgba(163, 113, 247, 0.18);
  border: 1px solid rgba(163, 113, 247, 0.45);
  color: #d2a8ff;
}

.badge-ticket-incident {
  background: rgba(234, 88, 12, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.5);
  color: #ff8c5a;
}

.request-card-incident {
  border-color: rgba(234, 88, 12, 0.4);
}

.request-card-incident .request-card-title a {
  color: #f05a28;
}

.request-card-incident .request-card-title a:hover {
  color: #ff7347;
}

.request-card-priority-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.request-contact-book {
  margin-left: 0.35rem;
  color: #d2a8ff;
  font-weight: 700;
  cursor: help;
}

.contacts-view {
  padding: 1rem 1.5rem 2rem;
  min-height: calc(100vh - 5.5rem);
}

.contacts-panel {
  margin: 0;
}

.contacts-hint {
  margin: 0 1rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.contacts-search-row {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.contacts-search {
  width: min(100%, 360px);
  margin-top: 0.35rem;
}

.contacts-table-wrap {
  overflow-x: auto;
  padding: 0.5rem 0;
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.contacts-table th,
.contacts-table td {
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}

.contacts-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.contacts-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.contacts-name {
  font-weight: 600;
  white-space: nowrap;
}

.contacts-phone {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.contacts-room {
  min-width: 220px;
}

.contacts-actions-col,
.contacts-actions {
  width: 110px;
  white-space: nowrap;
}

.contacts-row-editing {
  background: rgba(56, 139, 253, 0.08);
}

.contacts-input {
  width: 100%;
  min-width: 120px;
  box-sizing: border-box;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(15, 20, 25, 0.55);
  color: var(--text);
  font: inherit;
  padding: 0.4rem 0.5rem;
}

.contacts-input:focus {
  border-color: var(--accent);
  outline: none;
}

.contacts-select {
  cursor: pointer;
}

.contacts-btn {
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.contacts-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
}

.contacts-btn-save {
  margin-bottom: 0.35rem;
  display: block;
  width: 100%;
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.45);
  color: #5eead4;
}

.contacts-btn-edit {
  width: 100%;
}

.contacts-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.panel-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.requests-toolbar {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.requests-toolbar-details {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.requests-toolbar-summary {
  margin: 0;
}

.requests-toolbar-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--panel-border);
}

.requests-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.requests-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  flex: 1;
  min-width: 280px;
}

.requests-location-filter,
.requests-assignee-filter,
.requests-type-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 220px;
  flex: 0 1 280px;
}

.requests-location-select,
.requests-assignee-select,
.requests-type-select {
  background: #0f1419;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  min-width: 220px;
  max-width: 100%;
  cursor: pointer;
}

.requests-location-select:hover,
.requests-location-select:focus,
.requests-assignee-select:hover,
.requests-assignee-select:focus,
.requests-type-select:hover,
.requests-type-select:focus {
  border-color: var(--accent);
  outline: none;
}

.requests-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.requests-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.requests-toggle input {
  margin: 0;
}

.requests-summary {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.requests-today-section {
  margin: 1rem 1rem 0;
  padding: 0;
  border: 1px solid rgba(56, 139, 253, 0.35);
  border-radius: 12px;
  background: rgba(56, 139, 253, 0.06);
  overflow: hidden;
}

.requests-today-section .requests-today-details {
  border: none;
  background: transparent;
  margin: 0;
}

.requests-today-section.hidden {
  display: none;
}

.request-section-details > summary {
  list-style: none;
}

.request-section-details > summary::-webkit-details-marker {
  display: none;
}

.request-section-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.request-section-details[open] > summary .request-section-chevron {
  transform: rotate(45deg);
}

.requests-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  margin-bottom: 0;
}

.requests-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.requests-section-header .panel-meta,
.location-section-header .panel-meta {
  margin-left: auto;
}

#requestsView .requests-section-list,
#requestsView .location-ticket-list {
  max-height: none;
  overflow: visible;
  padding: 0 1rem 1rem;
}

.location-section {
  margin: 1rem 1rem 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.35);
  overflow: hidden;
}

.location-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.location-section-header::-webkit-details-marker {
  display: none;
}

.location-section-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.location-ticket-list {
  padding: 0 1rem 1rem;
}

#requestsView .ticket-list {
  max-height: none;
  overflow: visible;
}

.request-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ticket-card.request-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.ticket-card.request-card > div {
  margin-left: 0 !important;
  width: 100%;
}

.request-card-layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
}

.request-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.request-card-side {
  flex: 0 0 36%;
  max-width: 440px;
  min-width: 200px;
  padding-left: 1rem;
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.request-card-side-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.request-card-side .request-card-desc {
  flex: 1;
  overflow: visible;
  max-height: none;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.request-card-desc-text {
  flex: 1;
  min-width: 0;
}

.request-card-desc-expanded .request-card-desc-text {
  white-space: pre-wrap;
}

.request-card-desc-collapsed .request-card-desc-text {
  white-space: normal;
}

@media (max-width: 820px) {
  .request-card-layout {
    flex-direction: column;
  }

  .request-card-side {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    padding-left: 0;
    padding-top: 0.65rem;
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }

  .request-card-side .request-card-desc {
    max-height: none;
  }
}

.request-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.request-card-title a {
  font-size: 1rem;
}

.request-card-number-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.request-card-sep {
  color: var(--muted);
  font-weight: 400;
}

.request-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.request-card-location {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.request-location-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.request-location-local {
  margin-left: 0.2rem;
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 700;
}

.request-location-assign {
  background: #0f1419;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  min-width: 220px;
  max-width: 100%;
  cursor: pointer;
}

.request-location-assign:hover,
.request-location-assign:focus {
  border-color: #fbbf24;
  outline: none;
}

.request-location-assign:disabled {
  opacity: 0.6;
  cursor: wait;
}

.request-beneficiary {
  color: var(--muted);
}

.request-room-detail,
.request-contact-phone {
  font-size: 0.86rem;
  line-height: 1.4;
}

.request-extra-label {
  color: var(--muted);
  font-weight: 600;
}

.request-phone-value {
  color: #93c5fd;
  font-weight: 600;
}

.request-card-desc {
  font-size: 0.92rem;
  line-height: 1.4;
}

.request-card-meta {
  line-height: 1.45;
}

.request-appointment {
  color: #79c0ff;
  font-weight: 600;
}

.request-appointment-overdue {
  color: #fecaca;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.7);
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.request-appointment-today {
  color: #86efac;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.55);
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
}

.request-assignee {
  color: #5eead4;
  font-weight: 700;
}

.request-work-notes {
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.request-work-notes-toggle,
.request-desc-toggle {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.2rem;
  border: none;
  background: transparent;
  color: #79c0ff;
  font: inherit;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.request-work-notes-toggle:hover,
.request-desc-toggle:hover {
  color: #a5d6ff;
}

.request-work-notes-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.request-work-notes-expanded .request-work-notes-text {
  white-space: pre-wrap;
}

.request-card-today {
  border-color: rgba(56, 139, 253, 0.55);
  box-shadow: inset 3px 0 0 #388bfd;
}

.request-card-mine {
  background: rgba(34, 197, 94, 0.05);
}

.request-card-mine.request-card-today {
  border-color: rgba(56, 139, 253, 0.55);
  box-shadow: inset 3px 0 0 #388bfd;
}

.request-card-appointment-overdue {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: inset 3px 0 0 #ef4444;
}

.request-card-appointment-overdue.request-card-today {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: inset 3px 0 0 #ef4444;
}

.request-card-onhold {
  background: rgba(210, 153, 34, 0.06);
}

.badge-appointment-today {
  background: rgba(56, 139, 253, 0.2);
  border: 1px solid rgba(56, 139, 253, 0.45);
  color: #79c0ff;
}

.badge-appointment-overdue {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.dashboard-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 5.5rem);
}

.dashboard-layout.hidden {
  display: none;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
}

.unassigned-sidebar {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--panel-border);
  background: rgba(15, 20, 25, 0.6);
  display: flex;
  flex-direction: column;
  align-self: stretch;
  overflow-x: hidden;
}

.unassigned-title {
  margin: 0;
  padding: 1rem 1rem 0.75rem;
  font-size: 1rem;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
  flex-shrink: 0;
}

.unassigned-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--panel-border);
  overflow-x: hidden;
  min-width: 0;
}

.unassigned-section:last-child {
  border-bottom: none;
}

.unassigned-section-title {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(26, 35, 50, 0.85);
  flex-shrink: 0;
}

.ticket-list.ticket-list-sidebar {
  flex: 0 0 auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 0.5rem;
  min-width: 0;
}

.ticket-card.ticket-card-compact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  grid-template-columns: unset;
  padding: 0.65rem 0.75rem;
}

.ticket-compact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ticket-card-compact .badge {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.ticket-card-compact a {
  word-break: break-word;
  max-width: 100%;
}

.ticket-card-compact .ticket-compact-desc {
  margin-left: 0;
  width: 100%;
  text-align: left;
  align-self: stretch;
}

.ticket-compact-desc {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-self: end;
}

.topbar-account {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  min-width: 0;
}

.topbar-account:hover {
  border-color: var(--accent);
  background: rgba(20, 184, 166, 0.08);
}

.topbar-account-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.topbar-account-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar-account.hidden {
  display: none !important;
}

.topbar-status-menu {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

.topbar-status-trigger {
  cursor: pointer;
  border: 1px solid transparent;
  font: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-status-trigger:hover,
.topbar-status-menu.is-open .topbar-status-trigger {
  border-color: var(--accent);
  filter: none;
}

.topbar-status-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 12.5rem;
  z-index: 40;
  background: #1a222d;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  padding: 0.35rem;
}

.topbar-status-dropdown.hidden {
  display: none;
}

.topbar-status-dropdown-meta {
  padding: 0.45rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 0.25rem;
  line-height: 1.35;
  word-break: break-word;
}

.topbar-status-dropdown-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.topbar-status-dropdown-item:hover {
  background: rgba(239, 68, 68, 0.12);
  filter: none;
}

.account-view {
  padding: 1rem 1.5rem 2rem;
}

.account-panel {
  max-width: 920px;
}

.account-hint {
  margin: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.account-table-wrap {
  padding: 0 1rem;
  overflow-x: auto;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.account-table th,
.account-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}

.account-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.account-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  color: #79c0ff;
}

.account-row-current {
  background: rgba(20, 184, 166, 0.08);
}

.account-current-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.12);
  font-weight: 700;
}

.account-actions {
  padding: 1rem;
}

.account-form-section {
  margin: 0 1rem 1rem;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.account-form-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem 1rem;
}

.account-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.account-form input,
.account-form select {
  background: #0f1419;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
}

.account-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.account-form-message {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.account-form-message.ok {
  color: #86efac;
}

.account-form-message.error {
  color: #fca5a5;
}

.account-actions-col {
  white-space: nowrap;
}

.account-btn-edit,
.account-btn-delete {
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.account-btn-edit:hover {
  border-color: var(--accent);
}

.account-btn-delete {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

.account-btn-delete:hover {
  background: rgba(239, 68, 68, 0.12);
}

.account-assignee-empty {
  color: var(--muted);
}

#accountAssigneeField.hidden {
  display: none;
}

.calendar-view {
  padding: 1rem 1.5rem 2rem;
}

.calendar-panel {
  display: grid;
  gap: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.calendar-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.calendar-offline-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  line-height: 1.3;
}

.calendar-offline-badge.hidden {
  display: none;
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-grid-wrap {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

.calendar-grid-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--panel-border);
}

.calendar-grid-head span {
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
}

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

.calendar-day {
  min-height: 88px;
  border: 0;
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
  padding: 0.45rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day-number {
  font-weight: 700;
}

.calendar-day-assignee {
  font-size: 0.73rem;
  color: var(--muted);
}

.calendar-day-assignee-stack {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.calendar-day-swapped .calendar-day-assignee.calendar-assignee-swapped,
.calendar-assignee-swapped {
  color: #f87171;
  font-weight: 700;
}

.calendar-day-assignee-from,
.calendar-detail-roster-from {
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.15;
  text-decoration: line-through;
  opacity: 0.85;
}

.calendar-day-meta {
  font-size: 0.72rem;
  color: #79c0ff;
}

.calendar-day-out {
  opacity: 0.45;
}

.calendar-day-today {
  outline: 1px solid rgba(20, 184, 166, 0.6);
  outline-offset: -1px;
}

.calendar-day-selected {
  background: rgba(20, 184, 166, 0.12);
}

.calendar-day-mine {
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.55);
}

.calendar-day-holiday {
  background: rgba(148, 163, 184, 0.12);
}

.calendar-day-slid {
  box-shadow: inset 0 -3px 0 rgba(245, 158, 11, 0.7);
}

.calendar-detail,
.calendar-requests,
.calendar-swap-form,
.calendar-special-shifts {
  margin: 0;
}

.calendar-appointments {
  padding: 0 1rem 1rem;
  line-height: 1.5;
}

.calendar-actions {
  padding: 0 1rem 1rem;
}

.calendar-swap-list {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.calendar-swap-item {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
}

.calendar-swap-item-mine {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.08);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.2);
}

.calendar-swap-note-action {
  color: #5eead4;
  font-weight: 600;
}

.calendar-swap-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.calendar-swap-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.calendar-swap-shift-info {
  margin: 0 1rem 0.65rem;
  font-size: 0.88rem;
}

.calendar-special-hint {
  margin: 0 1rem 0.65rem;
  font-size: 0.82rem;
}

.calendar-day-special {
  background: rgba(59, 130, 246, 0.08);
}

.calendar-day-meta-special {
  color: #93c5fd;
  font-weight: 600;
}

.calendar-date-label {
  min-width: 0;
}

.calendar-date-fields {
  display: flex;
  align-items: center;
  gap: 0;
  background: #0f1419;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  min-height: 2.35rem;
  padding: 0 0.15rem;
  max-width: 100%;
}

.calendar-date-sep {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  flex: 0 0 auto;
  user-select: none;
  pointer-events: none;
}

.calendar-date-fields select {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.calendar-date-fields .calendar-date-day {
  flex: 0 1 2.6rem;
  text-align: center;
}

.calendar-date-fields .calendar-date-month {
  flex: 1 1 5.5rem;
}

.calendar-date-fields .calendar-date-year {
  flex: 0 1 3.4rem;
}

.calendar-form {
  padding: 0 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.calendar-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.calendar-form input,
.calendar-form select {
  background: #0f1419;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
}

#appShell.access-operator .calendar-swap-colleague-field {
  display: none;
}

.refresh-btn-label-short {
  display: none;
}

.topbar-actions button {
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  line-height: 1;
  font-size: 0.875rem;
}

.topbar-actions button[hidden],
.topbar-actions button.nav-btn-restricted,
.topbar-actions .topbar-action-hidden,
.topbar-actions .status-pill[hidden] {
  display: none !important;
}

.topbar-actions .status-pill {
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  line-height: 1;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

button {
  background: var(--accent);
  color: #042f2e;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.status-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #243044;
  color: var(--muted);
}

.status-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
}

.status-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--critical);
}

.status-pill.countdown {
  background: rgba(20, 184, 166, 0.12);
  color: var(--accent);
  min-width: 5.5rem;
  text-align: center;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 1.5rem 0;
  margin-top: 0.75rem;
}

.panel-new-incidents {
  margin: 1.25rem 1.5rem 1.5rem;
}

.alert-toast-stack {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  pointer-events: none;
}

.alert-toast {
  pointer-events: auto;
  width: min(480px, calc(100vw - 2rem));
  background: linear-gradient(160deg, #1e3a5f 0%, #0f2744 100%);
  border: 2px solid var(--new);
  border-radius: 16px;
  padding: 1.35rem 1.5rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: toast-in 0.4s ease-out;
}

.alert-toast-incident {
  border-color: var(--new);
}

.alert-toast-request {
  border-color: #38bdf8;
  background: linear-gradient(160deg, #1e3a4f 0%, #0f2438 100%);
}

.alert-toast-type {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--new);
  margin-bottom: 0.5rem;
}

.alert-toast-request .alert-toast-type {
  color: #38bdf8;
}

.alert-toast-number {
  display: block;
  font-size: 1.65rem;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 0.65rem;
}

.alert-toast-message {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
}

.alert-toast-meta {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.alert-toast-out {
  animation: toast-out 0.45s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.kpi-card h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.kpi-value {
  margin: 0.5rem 0 0.2rem;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.kpi-critical .kpi-value { color: var(--critical); }
.kpi-sla003 .kpi-value { color: #f59e0b; }
.kpi-sla004 .kpi-value { color: var(--sla); }
.kpi-request .kpi-value { color: #38bdf8; }
.kpi-new .kpi-value { color: var(--new); }
.kpi-warning .kpi-value { color: var(--warning); }
.kpi-sla .kpi-value { color: var(--sla); }

.panel-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.ticket-breach {
  border-left: 3px solid var(--critical);
}

.ticket-risk {
  border-left: 3px solid var(--warning);
}

.badge-severity-breach {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.badge-severity-risk {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.badge-impact {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.badge-urgency {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
}

.panel {
  margin: 1rem 1.5rem 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  overflow: hidden;
}

.panel-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.priority-bars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
}

.priority-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 1fr 40px;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
}

.priority-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  line-height: 1.35;
}

.priority-labels strong {
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.25rem;
}

.priority-number {
  font-weight: 700;
  color: #fff;
  margin-right: 0.35rem;
}

.priority-count {
  text-align: right;
}

.priority-track {
  height: 10px;
  background: #243044;
  border-radius: 999px;
  overflow: hidden;
}

.priority-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
}

.ticket-list {
  padding: 0.5rem;
  max-height: 420px;
  overflow: auto;
}

.ticket-card {
  display: grid;
  grid-template-columns: 110px minmax(140px, max-content) 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  margin-bottom: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
}

.ticket-card > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.ticket-card > div:nth-child(2) > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0 !important;
}

.ticket-card:not(.ticket-card-compact) > div:nth-child(3) {
  margin-left: 50px;
}

.ticket-card:hover {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
}

.ticket-card a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}

.ticket-card a:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-label-short {
  display: none;
}

.badge-state-nuovo { background: rgba(240, 196, 25, 0.2); color: var(--new); }
.badge-state-attivo { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-state-attesa { background: rgba(143, 163, 191, 0.2); color: var(--muted); }
.badge-priority-high { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-priority-mid { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-priority-low { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.badge-assignee { background: rgba(20, 184, 166, 0.15); color: var(--accent); }

.ticket-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.empty {
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .unassigned-sidebar {
    width: 100%;
    min-height: auto;
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }

  .unassigned-section {
    min-height: auto;
  }

  .kpi-grid,
  .columns,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .main-nav {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.75rem 0.85rem;
    gap: 0.6rem;
  }

  .topbar h1 {
    font-size: 1.05rem;
  }

  .subtitle {
    font-size: 0.78rem;
  }

  .main-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    gap: 0.3rem;
    width: 100%;
    justify-self: stretch;
    min-width: 0;
  }

  .topbar-actions button,
  .topbar-actions .status-pill,
  .topbar-account {
    flex: 0 0 auto;
    font-size: 0.68rem;
    padding: 0 0.42rem;
    height: 1.65rem;
    white-space: nowrap;
  }

  .topbar-account {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem;
  }

  .topbar-account-label {
    font-size: 0.62rem;
  }

  .topbar-account-value {
    font-size: 0.68rem;
  }

  .refresh-btn-label-full {
    display: none;
  }

  .refresh-btn-label-short {
    display: inline;
  }

  #connectionStatus {
    max-width: 8.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #updateCooldown {
    flex-shrink: 0;
  }
}

@media (max-width: 932px) {
  #appShell.access-operator .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.45rem;
    padding: 0.75rem 0.85rem;
  }

  #appShell.access-operator .topbar > div:first-child {
    display: contents;
  }

  #appShell.access-operator .topbar > div:first-child h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 1.05rem;
  }

  #appShell.access-operator .topbar > div:first-child .subtitle {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 0.78rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #appShell.access-operator .topbar-actions {
    display: contents;
  }

  #appShell.access-operator .topbar-status-menu {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    max-width: min(58vw, 13.5rem);
    min-width: 0;
  }

  #appShell.access-operator #connectionStatus {
    width: 100%;
    max-width: 100%;
    font-size: 0.68rem;
    padding: 0 0.42rem;
    height: 1.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #appShell.access-operator .main-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #appShell.access-operator .main-nav::-webkit-scrollbar {
    display: none;
  }

  #appShell.access-operator #refreshBtn,
  #appShell.access-operator #updateCooldown,
  #appShell.access-operator .topbar-account {
    display: none !important;
  }
}

@media (max-width: 932px), ((orientation: landscape) and (max-height: 500px)) {
  .requests-view {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .calendar-view {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .calendar-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .calendar-header {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .calendar-header h2 {
    font-size: 0.95rem;
  }

  .calendar-month-nav {
    flex-shrink: 0;
  }

  .calendar-grid-wrap {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .calendar-grid-head span {
    padding: 0.4rem 0.1rem;
    font-size: 0.62rem;
    letter-spacing: 0.01em;
  }

  .calendar-day {
    min-height: 4.35rem;
    padding: 0.3rem 0.2rem;
    min-width: 0;
  }

  .calendar-day-number {
    font-size: 0.82rem;
  }

  .calendar-day-assignee,
  .calendar-day-assignee-stack {
    font-size: 0.58rem;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
  }

  .calendar-day-meta {
    font-size: 0.58rem;
  }

  .calendar-detail,
  .calendar-requests,
  .calendar-swap-form,
  .calendar-special-shifts {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .calendar-detail .panel-header,
  .calendar-requests .panel-header,
  .calendar-swap-form .panel-header,
  .calendar-special-shifts .panel-header {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .calendar-swap-shift-info {
    margin: 0 0.85rem 0.65rem;
  }

  .calendar-appointments,
  .calendar-actions,
  .calendar-swap-list,
  .calendar-special-hint {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .calendar-form {
    grid-template-columns: 1fr;
    padding: 0 0.85rem 1rem;
    gap: 0.65rem;
  }

  .requests-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .requests-panel-header {
    width: 100%;
    box-sizing: border-box;
  }

  .requests-panel-title-row {
    padding: 0;
  }

  .requests-notifications {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .requests-notifications-block {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .requests-notification-item {
    width: 100%;
    box-sizing: border-box;
  }

  .requests-toolbar {
    padding: 0 0.75rem 1rem;
  }

  .requests-toolbar-body {
    padding: 0 0.75rem 0.85rem;
  }

  .requests-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .requests-filters {
    min-width: 0;
    width: 100%;
  }

  .requests-location-filter,
  .requests-assignee-filter,
  .requests-type-filter {
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
  }

  .requests-location-select,
  .requests-assignee-select,
  .requests-type-select {
    min-width: 0;
    width: 100%;
  }

  .requests-toggles {
    width: 100%;
  }

  .requests-today-section,
  .location-section {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  #requestsView .requests-section-list,
  #requestsView .location-ticket-list,
  .location-ticket-list {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding-top: 0.55rem;
    padding-bottom: 0.85rem;
  }

  #requestsView .ticket-card.request-card {
    margin-bottom: 0;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  #requestsView .requests-section-list .ticket-card.request-card:nth-child(odd),
  #requestsView .location-ticket-list .ticket-card.request-card:nth-child(odd) {
    background: #161f2e !important;
    border-color: #2a3a52 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  #requestsView .requests-section-list .ticket-card.request-card:nth-child(even),
  #requestsView .location-ticket-list .ticket-card.request-card:nth-child(even) {
    background: #243044 !important;
    border-color: #3a4f6a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  #requestsView .request-card-side {
    border-top: 1px dashed rgba(143, 163, 191, 0.35);
    border-left: none;
    padding-left: 0;
    padding-top: 0.7rem;
    margin-top: 0.15rem;
  }

  #requestsView .request-card-number-row {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #requestsView .request-card-number-row::-webkit-scrollbar {
    display: none;
  }

  #requestsView .request-card-number-row > a {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 1rem;
  }

  #requestsView .request-card-number-row .request-card-sep {
    flex-shrink: 0;
  }

  #requestsView .request-card-number-row .badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    padding: 0.18rem 0.38rem;
  }

  #requestsView .request-card-number-row .badge-label-full {
    display: none;
  }

  #requestsView .request-card-number-row .badge-label-short {
    display: inline;
  }

  .contacts-view {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .contacts-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .contacts-panel .panel-header {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .contacts-hint {
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }

  .contacts-search-row {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .contacts-search {
    width: 100%;
    max-width: 100%;
  }

  .contacts-table-wrap {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .contacts-table th,
  .contacts-table td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #contactsEmpty {
    padding: 1rem 0.85rem 1.25rem;
  }
}

/* Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0;
}

.admin-form-panel,
.admin-mapping-panel {
  margin: 1rem 1.5rem 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.admin-form label,
.mapping-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  cursor: pointer;
}

.admin-checkbox input {
  width: auto;
  margin: 0;
}

.admin-form input,
.mapping-grid input,
.admin-form select {
  background: #0f1419;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #042f2e;
}

.btn-secondary {
  background: #243044;
  color: var(--text);
}

.admin-result {
  margin: 0 1rem 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.admin-result.ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--ok);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.admin-result.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.admin-hint {
  margin: 0;
  padding: 0 1rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.admin-mapping-panel .btn-primary {
  margin: 0 1rem 1rem;
}

.admin-iframe-panel {
  margin: 1rem 1.5rem 2rem;
}

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

.link-btn {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 0.85rem;
  margin-right: 1rem;
}

.sn-iframe {
  width: calc(100% - 2rem);
  height: 520px;
  margin: 0 1rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #fff;
}

.sn-iframe.hidden,
.browser-screenshot.hidden,
.preview-placeholder.hidden {
  display: none;
}

.browser-screenshot {
  width: calc(100% - 2rem);
  margin: 0 1rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
}

.preview-placeholder {
  margin: 0 1rem 1rem;
  padding: 2rem;
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.wizard-panel {
  margin: 1rem 1.5rem 0;
}

.wizard-steps {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.wizard-step {
  background: #243044;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.wizard-step.active {
  background: rgba(20, 184, 166, 0.18);
  color: var(--text);
  border-color: var(--accent);
}

.wizard-site {
  padding: 0 1rem 1rem;
}

.wizard-content {
  margin: 0 1.5rem;
}

.wizard-content.hidden {
  display: none;
}

.admin-actions.inline-actions {
  margin-top: -0.35rem;
  padding-bottom: 0.5rem;
}

.mapping-section {
  padding: 0 1rem 1.25rem;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 1rem;
}

.mapping-section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
}

.detected-columns-wrap.hidden {
  display: none;
}

.detected-title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.detected-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.detected-chip {
  background: #243044;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.detected-chip strong {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, #1b2838 0%, rgba(15, 20, 25, 0.96) 55%);
  backdrop-filter: blur(10px);
}

.access-gate-card {
  width: min(100%, 380px);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.access-gate-lead {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.access-gate-form {
  display: flex;
  gap: 0.5rem;
}

.access-gate-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #0f1419;
  color: var(--text);
  font: inherit;
}

.access-gate-input:focus {
  outline: 2px solid rgba(20, 184, 166, 0.45);
  border-color: var(--accent);
}

.access-gate-btn {
  padding: 0.65rem 1rem;
  border: 1px solid #0d9488;
  border-radius: 8px;
  background: var(--accent);
  color: #042f2e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.access-gate-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.access-gate-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.access-gate-error {
  margin: 0.85rem 0 0;
  color: #f87171;
  font-size: 0.9rem;
}

.access-pwa-install {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--panel-border);
  text-align: center;
}

.access-pwa-lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.access-pwa-install-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #0d9488;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.14);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.access-pwa-install-btn:hover {
  background: rgba(20, 184, 166, 0.22);
}

.access-pwa-ios-help,
.access-pwa-android-help {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
}

.access-pwa-ios-help p {
  margin: 0 0 0.35rem;
  text-align: center;
}

.access-pwa-ios-help ol {
  margin: 0;
  padding-left: 1.2rem;
}

.access-pwa-android-help {
  text-align: center;
}

.desk-network-gate-panel {
  max-width: 520px;
  margin: 2rem auto;
  text-align: center;
}

.desk-network-gate-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.35;
}

.desk-network-gate-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.desk-network-retry-btn {
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--accent);
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}
