:root {
  --size: 1rem;
  --font:
    Inter, Roboto, "Helvetica Neue", "Arial Nova", Noto Sans, Arial, sans-serif;
}
table.stripes > tbody > tr:nth-child(2n + 1) {
  background-color: var(--surface);
}
dialog {
  max-block-size: 90%;
}
dialog#form_dialog {
  /*min-block-size: 50%;*/
}
.scroll > table,
table :is(thead, th) {
  color: var(--primary);
}
table {
  --outline: var(--outline-variant);
}
table:not(.no-hover) tbody tr:hover {
  background-color: var(--surface-container);
}
table tfoot tr td {
  border-top: solid 1px var(--outline);
}
table.full-border {
  border-collapse: collapse;
}
table.full-border td {
  border: solid 1px var(--outline);
  padding: 0.1rem 0.2rem;
}
table.compensation-table th, table.compensation-table td{
  vertical-align: top;
}
[hidden] {
  display: none !important;
}
@media screen and (max-width: 600px) {
  .bottom-fab {
    margin-bottom: 4rem;
  }
  dialog.large-width {
    max-width: 95%;
  }
}
.grid.tiny-space {
  --_gap: 0.5rem;
}
.hidden {
  display: none !important;
}
.textarea.min {
  min-block-size: 2.5lh;
}
.textarea.min.chat {
  min-block-size: 1.8lh;
}
.tabs.chat > a {
  min-block-size: 2rem;
}
.data-form .field {
  margin-top: 0.25rem !important;
}

.slots article {
  background-color: var(--surface-container-lowest);
  margin-top: 4px !important;
  padding: 0.25rem;
  text-align: center;
  cursor: pointer;
}

.slots article[data-off] {
  background-color: var(--surface-dim);
  cursor: not-allowed;
  pointer-events: none;
}
.slots article[selected] {
  background-color: var(--primary) !important;
  color: var(--on-primary);
}

.button.tiny {
  --_size: 2rem;
  font-size: 0.7rem;
}
.task_outer_grid,
.chat_outer_grid {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  overflow: hidden;
}

.task_inner_grid {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr min(360px, 100%);
  gap: 1rem;
  overflow: auto;
}
.chat_inner_grid {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1rem;
  overflow: hidden;
}
.task-badge {
  --_padding: 0.6rem;
  min-block-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--_padding) !important;
  --_round: 2rem;
  border-radius: var(--_round) !important;
  font-size: 0.65rem;
  font-weight: medium;
}
.img-object {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tiny-input {
  width: 15ch;
}
.tiny-input > label {
  font-size: 0.75rem !important;
}

/* Status - Light variant */
.status-todo {
  background-color: #e2e8f0;
  color: #475569;
}
.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}
.status-in-progress {
  background-color: #dbeafe;
  color: #1e40af;
}
.status-exhausted {
  background-color: #fee2e2;
  color: #7f1d1d;
}
.status-rejected {
  background-color: #fee2e2;
  color: #991b1b;
}
.status-declined {
  background-color: #ffedd5;
  color: #9a3412;
}
.status-rescheduled {
  background-color: #ede9fe;
  color: #5b21b6;
}
.status-default {
  background-color: #e2e8f0;
  color: #475569;
}
.status-reflowed {
  background-color: #fce4ec;
  color: #e91e63;
}

/* Status */
body.dark .status-todo {
  background-color: #64748b;
  color: #ffffff;
}
body.dark .status-completed {
  background-color: #10b981;
  color: #ffffff;
}
body.dark .status-in-progress {
  background-color: #3b82f6;
  color: #ffffff;
}
body.dark .status-exhausted {
  background-color: #991b1b;
  color: #ffffff;
}
body.dark .status-rejected {
  background-color: #dc2626;
  color: #ffffff;
}
body.dark .status-declined {
  background-color: #f97316;
  color: #ffffff;
}
body.dark .status-rescheduled {
  background-color: #8b5cf6;
  color: #ffffff;
}
body.dark .status-default {
  background-color: #64748b;
  color: #ffffff;
}
body.dark .status-reflowed {
  background-color: #e91e63;
  color: #fce4ec;
}
.tiny-text {
  font-size: 0.7em;
}
.chip.tiny {
  --_size: 1.5rem;
}
.equal-height {
  /*height: calc(100% - 34px);*/
  height: 100%;
}
.h100 {
  height: 100%;
}
.expansion-group[data-hidden] .expansion-indicator {
  transform: rotate(-90deg);
}
.task-details[open] .task-details-indicator {
  transform: rotate(90deg);
}
.bold-text {
  font-weight: bold !important;
}
.calendar-table td {
  vertical-align: top;
}
.chat > textarea {
  /*word-break: break-all;*/
  overflow-wrap: break-word;
}
@media (max-width: 800px) {
  .task_inner_grid {
    grid-template-columns: 1fr !important;
    overflow: auto;
    height: auto !important;
  }
  #chat_area {
    height: 500px !important;
  }
  main {
    overflow-y: auto;
  }
}
@media print {
  :root,
  body {
    --surface: #ffffff !important;
    --on-surface: #000000 !important;
  }
  table {
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  .no-print {
    display: none !important;
  }
}

/* Mention Autocomplete Dropdown Styles */
.mention-autocomplete-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

.mention-autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--outline-variant);
}

.mention-autocomplete-item:last-child {
  border-bottom: none;
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.selected {
  background-color: var(--surface-container-highest);
}

.mention-user-name {
  font-weight: 500;
  color: var(--on-surface);
  font-size: 0.875rem;
}

.mention-user-username {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  margin-top: 0.125rem;
}

.mention-autocomplete-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
}

/* Mention Highlight Styles */
.mention {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  font-weight: 500;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

body.dark .mention {
  background-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}
.field > :is(input, textarea, select) {
  width: 100%;
}

.customer-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 100px);
  background-color: var(--surface);
  border: 1px solid var(--surface-variant);
  border-radius: 0.75rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.customer-chat-header {
  padding: 1rem;
  /*border-bottom: 1px solid var(--outline);*/
  border-radius: 0.75rem 0.75rem 0 0 !important;
}

.customer-chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.customer-chat-widget .surface-container {
  border-radius: 0 0 0.75rem 0.75rem;
}

.customer-chat-fab {
  position: fixed;
  bottom: 40px;
  right: 20px;
  z-index: 999;
}

@media (max-width: 600px) {
  .customer-chat-widget {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 10px;
    height: calc(100vh - 100px);
  }

  .customer-chat-fab {
    right: 20px;
    bottom: 20px;
  }
}

.customer-chat-fab .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
  background-color: var(--error);
  color: var(--on-error);
  border-radius: 10px;
}

.invoice-picker {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--outline);
  border-radius: 0.5rem;
  padding: 0.375rem;
  margin-top: 0.25rem;
}

.invoice-picker-card {
  display: block;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.375rem;
  cursor: pointer;
  background-color: var(--surface-container-lowest);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.invoice-picker-card:hover {
  background-color: var(--surface-container);
  border-color: var(--outline);
}

.invoice-picker-card.selected {
  background-color: var(--primary-container);
  border-color: var(--primary);
}

.invoice-picker-row {
  display: grid;
  grid-template-columns: 5.5rem 2fr 5.5rem 1fr;
  gap: 0.125rem 0.5rem;
  align-items: baseline;
  line-height: 1.5;
}

.invoice-picker-row + .invoice-picker-row {
  margin-top: 0.2rem;
}

.invoice-picker-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.invoice-picker-value {
  font-size: 0.8rem;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-picker-card.selected .invoice-picker-label {
  color: var(--on-primary-container);
  opacity: 0.75;
}

.invoice-picker-card.selected .invoice-picker-value {
  color: var(--on-primary-container);
}
