.clients-layout,
.tickets-layout,
.messages-layout,
.desktop-messages-layout,
.employees-layout,
.reports-layout,
.help-layout {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 10px;
}

.clients-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  height: 100%;
  align-content: start;
  overflow: auto;
}

body[data-view="tickets"] .section-shell {
  gap: 10px;
  padding: 10px;
  background: var(--mobile-page-bg, #f4f3f8);
}

body[data-view="tickets"] .section-toolbar {
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 14px;
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-text, #21133d) 5%, transparent);
}

body[data-view="tickets"] .section-toolbar .search-field input {
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--theme-border, #b8cde2);
  border-radius: 9999px;
  background: var(--theme-panel, #f8fafd);
  color: var(--theme-text, #21133d);
  font-size: 13px;
}

body[data-view="tickets"] .section-toolbar .search-field input:focus {
  border-color: var(--mobile-coral, #ec665c);
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #ec665c) 15%, transparent);
  outline: none;
}

body[data-view="tickets"] .tickets-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-text, #21133d);
}

body[data-view="tickets"] #ticket-sort-select {
  min-height: 34px;
  padding: 0 14px;
  border: 1.5px solid var(--theme-border, #b8cde2);
  border-radius: 9999px;
  background: var(--theme-panel, #ffffff);
  color: var(--theme-text, #21133d);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body[data-view="tickets"] #ticket-sort-select:focus {
  border-color: var(--mobile-coral, #ec665c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #ec665c) 15%, transparent);
  outline: none;
}

body[data-view="tickets"] .section-panel {
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 14px;
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 3px 12px color-mix(in srgb, var(--theme-text, #21133d) 6%, transparent);
  overflow: hidden;
}

body[data-view="tickets"] .panel-caption {
  min-height: 40px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--theme-border, #9bc7df);
  background: var(--mobile-card-blue, #c3e1f2);
  color: var(--mobile-purple, #21133d);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tickets-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  height: 100%;
  padding: 0;
  align-content: stretch;
  overflow: hidden;
}

.tickets-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tickets-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 9999px;
  background: #f0f5fb;
}

.tickets-filter-tab {
  padding: 5px 12px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
  color: #465d78;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tickets-filter-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.72);
  color: var(--theme-text, #21133d);
}

.tickets-filter-tab.is-active {
  background: var(--theme-text, #221d3b);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(34, 29, 59, 0.22);
}

.ticket-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  background: var(--theme-panel, #ffffff);
}

.ticket-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #e8eef6;
  border-left: 3px solid transparent;
  background: var(--theme-panel, #ffffff);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ticket-row:nth-child(even) {
  background: #fafcff;
}

.ticket-row:hover,
.ticket-row:focus-visible {
  background: var(--theme-panel, #f0f6fc);
}

.ticket-row.is-active {
  background: var(--theme-panel, #fff5f3) !important;
  border-left-color: var(--mobile-coral, #ec665c);
}

.ticket-status-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ticket-status-pill.is-status-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ticket-status-pill.is-status-accepted {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ticket-status-pill.is-status-rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ticket-status-pill.is-large {
  font-size: 11.5px;
  padding: 4px 12px;
}

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

.ticket-client-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--theme-text, #21133d);
}

.ticket-price {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e3f7ef;
  border: 1px solid #b8e8d4;
  font-size: 11.5px;
  font-weight: 800;
  color: #0f6c49;
}

.ticket-row-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--theme-quiet, #46617d);
}

.ticket-row-timing {
  font-size: 11px;
  color: #647c96;
}

.ticket-detail-workspace {
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  padding: 16px;
  background: var(--theme-panel, #ffffff);
}

.ticket-detail-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2ebf5;
}

.ticket-detail-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  color: #5c738e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ticket-detail-heading {
  font-size: 19px;
  font-weight: 800;
  margin: 2px 0 0;
  color: var(--theme-text, #21133d);
}

.ticket-hero-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--theme-border, #9bc7df);
  border-radius: 12px;
  background: linear-gradient(135deg, #f2f9fd 0%, #dceef9 100%);
}

.ticket-hero-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-hero-label {
  font-size: 10px;
  font-weight: 800;
  color: #4d6782;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ticket-hero-value {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--theme-text, #21133d);
}

.ticket-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 12px;
  border-bottom: 1px solid #e2ebf5;
}

.ticket-action-bar .toolbar-button {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--theme-border, #b8cde2);
  border-radius: 9999px;
  background: var(--theme-panel, #ffffff);
  color: var(--theme-text, #21133d);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--theme-text, #21133d) 5%, transparent);
}

.ticket-action-bar .toolbar-button:hover {
  border-color: var(--theme-accent, #221d3b);
  background: var(--theme-panel, #f0f6fc);
}

.ticket-btn-accept {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%) !important;
  color: #ffffff !important;
  border-color: #15803d !important;
  font-weight: 700 !important;
}

.ticket-btn-accept:hover {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
}

.ticket-btn-decline {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  font-weight: 700 !important;
}

.ticket-btn-decline:hover {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
}

.ticket-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ticket-card {
  border: 1px solid var(--theme-border, #cad9e6);
  border-radius: 12px;
  background: var(--theme-panel, #ffffff);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 4%, transparent);
  overflow: hidden;
}

.ticket-card-title {
  padding: 8px 12px;
  border-bottom: 1px solid #bfd7ea;
  background: var(--theme-panel, #e6f2fa);
  font-size: 11px;
  font-weight: 800;
  color: var(--theme-text, #21133d);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ticket-card-body {
  padding: 12px;
  display: grid;
  gap: 7px;
  font-size: 12.5px;
  color: var(--theme-text, #21133d);
}

.ticket-field {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.ticket-field-label {
  font-weight: 700;
  color: var(--theme-quiet, #556e8b);
  min-width: 64px;
}

.ticket-field-full {
  flex-direction: column;
  gap: 3px;
}

.messages-layout,
.desktop-messages-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  height: 100%;
  align-content: stretch;
  overflow: hidden;
  --message-zoom: 1;
}

@media (max-width: 960px) {
  .desktop-messages-layout {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }
}

@media (max-width: 720px) {
  .desktop-messages-layout {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }
}

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

.messages-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border: 1px solid #9cb2cb;
  border-radius: var(--radius-tight);
  background: linear-gradient(var(--theme-panel, #eef4fc), #dbe7f7);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.messages-zoom-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--theme-quiet, #3b5a80);
  padding-left: 2px;
  padding-right: 4px;
}

.messages-zoom-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-text, #17385f);
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s ease;
}

.messages-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--theme-text, #0f172a);
}

.messages-zoom-btn:active {
  background: var(--theme-panel, #ffffff);
  transform: scale(0.96);
}

.messages-zoom-level {
  padding: 2px 6px;
  border: 0;
  border-radius: 3px;
  background: var(--theme-panel, #ffffff);
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-text, #17385f);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  min-width: 40px;
  text-align: center;
}

.messages-zoom-level:hover {
  background: var(--theme-panel, #f8fafc);
  color: var(--mobile-accent-text, #ec665c);
}

.messages-list-caption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 8px;
}

.messages-list-caption-header,
.messages-list-caption-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.messages-list-caption-title,
.messages-list-caption-left span:first-child {
  font-weight: 700;
  color: #456385;
  white-space: nowrap;
}

.messages-list-caption .panel-caption-badge {
  font-size: 11px;
  font-weight: 600;
  color: #5d748d;
  white-space: nowrap;
  flex-shrink: 0;
}

.messages-list-caption .messages-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.messages-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #9cb2cb;
  border-radius: var(--radius-tight);
  background: linear-gradient(var(--theme-panel, #eef4fc), #dbe7f7);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.messages-filter-tab {
  padding: 3px 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--theme-quiet, #3b5a80);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.12s ease;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-filter-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--theme-text, #17385f);
}

.messages-filter-tab.is-active {
  background: var(--theme-panel, #ffffff);
  color: var(--theme-text, #17385f);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.desktop-messages-list-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--theme-panel, #ffffff);
}

