/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.5.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.5.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
* {
  box-sizing: border-box;
}

:root {
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef4fb;
  --border: #dfe7f1;
  --border-strong: #c8d4e3;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --primary-soft: #e9f1ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --success: #047857;
  --success-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.08);
  --radius-md: 12px;
  --radius-lg: 18px;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family:
    "Aptos",
    "Segoe UI",
    "SF Pro Text",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.75), transparent 32rem),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

button:hover:not(:disabled) {
  background: #ffffff;
  border-color: #9fb0c4;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button[type="submit"] {
  border-color: var(--primary);
  background: linear-gradient(180deg, #2563eb 0%, var(--primary) 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.22);
}

button[type="submit"]:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: linear-gradient(180deg, #1d4ed8 0%, var(--primary-strong) 100%);
  box-shadow: 0 14px 26px rgba(29, 78, 216, 0.26);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 1px;
}

button:disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
  box-shadow: none;
}

input,
textarea,
select {
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 11px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

input:hover:not(:disabled),
textarea:hover:not(:disabled),
select:hover:not(:disabled) {
  border-color: #9fb0c4;
}

input:disabled,
textarea:disabled,
select:disabled {
  background: #f8fafc;
  color: #94a3b8;
}

a {
  color: var(--primary);
  font-weight: 600;
}

a:hover {
  color: var(--primary-strong);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    #ffffff;
  padding: 24px 16px;
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.04);
}

.app-sidebar__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-sidebar__link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #374151;
  font-weight: 650;
  transition:
    background 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.app-sidebar__link:hover {
  background: #eef4fb;
  color: #0f172a;
  transform: translateX(2px);
}

.app-sidebar__link--active {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #0f172a;
  box-shadow: inset 3px 0 0 var(--primary);
}

.app-sidebar__link--chat {
  position: relative;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  color: #1e3a8a;
}

.app-sidebar__link--chat::after {
  content: "live";
  float: right;
  margin-left: 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

.app-header__title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.app-header__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: #6b7280;
}

.app-content {
  width: 100%;
  max-width: 1480px;
  padding: 28px;
  margin: 0 auto;
  min-width: 0;
  overflow-x: hidden;
}

.page-title {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  animation: panel-in 180ms ease-out;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.page-card:hover {
  border-color: #d3deeb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.page-card + .page-card {
  margin-top: 16px;
}

.page-muted {
  color: var(--text-muted);
}

.identity-secondary {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 8px 6px 10px;
  font-size: 12px;
}

.identity-chip small {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
}

.identity-chip button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  box-shadow: none;
}

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

.panel-grid {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(29, 78, 216, 0.09), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(248, 250, 252, 0.75));
}

.hero-card > * {
  position: relative;
}

.hero-title {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 820;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-meta {
  margin-top: 6px;
  color: var(--text-muted);
}

.detail-grid {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.detail-field {
  min-width: 0;
}

.detail-label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.detail-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stat-grid {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: var(--shadow-sm);
}

.stat-card__value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 820;
  letter-spacing: -0.03em;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.section-title {
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.section-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

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

.record-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.record-card:hover {
  border-color: #cbd8e8;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.local-scroll {
  max-height: min(420px, 70vh);
  overflow-y: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.local-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.local-scroll::-webkit-scrollbar-thumb {
  background: #cbd8e8;
  border-radius: 999px;
}

.local-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.local-scroll--sm {
  max-height: min(280px, 60vh);
}

.local-scroll--lg {
  max-height: min(560px, 75vh);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: -moz-fit-content;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  padding: 3px 9px;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.78;
}

.status-pill[data-status="active"],
.status-pill[data-status="completed"],
.status-pill[data-status="closed"],
.status-pill[data-status="in_storage"] {
  border-color: #bbf7d0;
  background: var(--success-soft);
  color: var(--success);
}

.status-pill[data-status="in_progress"],
.status-pill[data-status="assigned_to_object"],
.status-pill[data-status="assigned_to_one_time_order"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
}

.status-pill[data-status="new"],
.status-pill[data-status="planned"],
.status-pill[data-status="assigned"] {
  border-color: #dbe3ee;
  background: #f8fafc;
  color: #475569;
}

.status-pill[data-status="awaiting_confirmation"],
.status-pill[data-status="partially_completed"],
.status-pill[data-status="under_repair"],
.status-pill[data-status="frozen"] {
  border-color: #fde68a;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill[data-status="broken"],
.status-pill[data-status="lost"],
.status-pill[data-status="written_off"],
.status-pill[data-status="cancelled"],
.status-pill[data-status="archived"] {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

td,
th {
  border-bottom: 1px solid #eef2f7;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f8fbff;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

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

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .app-sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .app-sidebar__link {
    white-space: nowrap;
  }

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

@media (max-width: 640px) {
  .app-content {
    padding: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-card {
    padding: 16px;
    border-radius: 14px;
  }
}

.timesheet-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  min-width: 0;
}

.timesheet-card__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 14px;
  color: #334155;
}

.timesheet-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.timesheet-scroll {
  position: relative;
  width: 100%;
  min-width: 0;
}

.timesheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.timesheet-table th,
.timesheet-table td {
  border-bottom: 1px solid #eef2f7;
  padding: 8px 6px;
  text-align: center;
  background: #ffffff;
  white-space: nowrap;
  background-clip: padding-box;
}

.timesheet-table thead th {
  position: relative;
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
  z-index: 1;
}

.timesheet-table tfoot td {
  background: #f8fafc;
  font-weight: 600;
}

.timesheet-table tbody tr:hover td {
  background: #fafcff;
}

.timesheet-table__name {
  text-align: left !important;
  font-weight: 500;
}

.timesheet-table__total,
.timesheet-table__grand-total,
.timesheet-table__footer-label {
  font-weight: 700;
}

.timesheet-table__sticky-left {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 20;
  background: #ffffff !important;
  box-shadow: 10px 0 14px -12px rgba(15, 23, 42, 0.22);
}

.timesheet-table thead .timesheet-table__sticky-left,
.timesheet-table tfoot .timesheet-table__sticky-left {
  background: #f8fafc !important;
  z-index: 30;
}

.timesheet-table__sticky-right {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 20;
  background: #ffffff !important;
  box-shadow: -10px 0 14px -12px rgba(15, 23, 42, 0.22);
}

.timesheet-table thead .timesheet-table__sticky-right,
.timesheet-table tfoot .timesheet-table__sticky-right {
  background: #f8fafc !important;
  z-index: 30;
}

.timesheet-table__fact-cell {
  background: #f8fafc !important;
}

.timesheet-table__changed-cell {
  background: #eff6ff !important;
}

.timesheet-table__fact-cell.timesheet-table__changed-cell {
  background: #dbeafe !important;
}

.timesheet-table__changed-cell .timesheet-table__input {
  border-color: #60a5fa;
  background: #f8fbff;
}

.timesheet-table__fact-cell .timesheet-table__input {
  background: #fcfdff;
}

.timesheet-table__fact-cell.timesheet-table__changed-cell .timesheet-table__input {
  border-color: #2563eb;
  background: #eff6ff;
}

.timesheet-table__input {
  width: 56px;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  font-size: 12px;
  background: #ffffff;
  outline: none;
}

.timesheet-table__input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.timesheet-table__input::-webkit-outer-spin-button,
.timesheet-table__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timesheet-table__input[type='number'] {
  -moz-appearance: textfield;
  -webkit-appearance: textfield;
          appearance: textfield;
}

.timesheet-table__auto-value {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.timesheet-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.timesheet-exception-card {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.rate-policy-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.rate-policy-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.rate-policy-form-grid label,
.attendance-hours-control {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
}

.attendance-hours-control {
  max-width: 130px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.attachment-preview-stack {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.attachment-image-grid {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.attachment-image-grid--1 {
  grid-template-columns: minmax(180px, 320px);
}

.attachment-image-card {
  position: relative;
  display: block;
  min-height: 130px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.attachment-image-card img {
  width: 100%;
  height: 180px;
  display: block;
  object-fit: cover;
}

.attachment-image-card span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  padding: 4px 8px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-list,
.pending-media-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.attachment-file-card,
.pending-media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #ffffff;
  padding: 10px;
  color: inherit;
}

.attachment-file-card__icon,
.pending-media-item__icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.attachment-file-card__body,
.pending-media-item__body {
  min-width: 0;
  display: grid;
  grid-gap: 2px;
  gap: 2px;
}

.attachment-file-card__body strong,
.pending-media-item__body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-card__body span,
.pending-media-item__body span {
  color: var(--text-muted);
  font-size: 12px;
}

.pending-media-item img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
}

.pending-media-item button {
  margin-left: auto;
}

@media (max-width: 900px) {
  .timesheet-card {
    padding: 12px;
  }

  .timesheet-table {
    min-width: 1200px;
  }

  .timesheet-action-card {
    align-items: stretch;
    flex-direction: column;
  }
}

.chat-page-stack {
  min-height: 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  grid-gap: 18px;
  gap: 18px;
  height: calc(100vh - 156px);
  min-height: 620px;
  overflow: hidden;
}

.chat-room-panel,
.chat-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-room-panel.page-card,
.chat-main.page-card {
  padding: 0;
}

.chat-room-panel .section-header,
.chat-header {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.chat-room-panel .section-header {
  align-items: center;
}

.chat-icon-button {
  padding: 8px 11px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
}

.chat-room-list {
  flex: 1 1;
  min-height: 0;
  display: grid;
  align-content: start;
  grid-gap: 8px;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.chat-room-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  box-shadow: none;
}

.chat-room-item:hover:not(:disabled) {
  transform: none;
}

.chat-room-item--active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.chat-room-item__main,
.chat-room-item__meta {
  display: grid;
  grid-gap: 4px;
  gap: 4px;
  min-width: 0;
}

.chat-room-item__main strong,
.chat-room-item__main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-item__main span,
.chat-room-item__meta {
  color: var(--text-muted);
  font-size: 12px;
}

.chat-room-item__type {
  width: -moz-fit-content;
  width: fit-content;
  border-radius: 999px;
  background: #f1f5f9;
  padding: 2px 7px;
  color: #475569;
  font-weight: 700;
}

.chat-unread {
  justify-self: end;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.chat-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chat-header__main,
.chat-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.chat-header__main {
  align-items: flex-start;
}

.chat-header__actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chat-back-button {
  display: none;
  padding: 7px 10px;
  box-shadow: none;
}

.chat-room-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.chat-participants-link {
  margin-left: 8px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  font-size: 13px;
}

.chat-participants-link:hover:not(:disabled) {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  transform: none;
}

.chat-room-settings-panel {
  flex: 0 0 auto;
  display: grid;
  grid-gap: 10px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  background: #fbfdff;
}

.chat-room-settings-panel form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  grid-gap: 10px;
  gap: 10px;
  align-items: end;
}

.chat-room-settings-panel label {
  min-width: 0;
}

.chat-room-settings-panel select {
  min-height: 86px;
}

.chat-message-stage {
  position: relative;
  flex: 1 1;
  min-height: 0;
  display: flex;
}

.chat-message-list {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(219, 234, 254, 0.28), transparent 22rem),
    #f8fafc;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.chat-bottom-sentinel {
  width: 100%;
  height: 1px;
  flex: 0 0 auto;
}

.chat-new-messages-button {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.chat-new-messages-button:hover:not(:disabled) {
  transform: translateX(-50%) translateY(-1px);
}

.chat-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-unread-divider::before,
.chat-unread-divider::after {
  content: '';
  flex: 1 1;
  height: 1px;
  background: #bfdbfe;
}

.chat-unread-divider span {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eff6ff;
}

.chat-message {
  width: min(76%, 680px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.chat-message--own {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #f8fbff;
}

.chat-message--system {
  align-self: center;
  width: min(88%, 720px);
  border-style: dashed;
  background: #ffffff;
  color: var(--text-muted);
  text-align: center;
}

.chat-message__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.chat-message__text {
  margin: 8px 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.chat-image-grid {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.chat-image-attachment {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.chat-image-attachment img {
  width: 100%;
  height: clamp(150px, 28vw, 280px);
  object-fit: cover;
  display: block;
}

.chat-image-grid--1 .chat-image-attachment img {
  height: clamp(220px, 34vw, 360px);
}

.chat-file-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin-top: 10px;
}

.chat-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.chat-file-card__icon {
  flex: 0 0 auto;
  border-radius: 9px;
  background: #e2e8f0;
  color: #334155;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.chat-file-card__body {
  min-width: 0;
  display: grid;
  grid-gap: 2px;
  gap: 2px;
}

.chat-file-card__body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-card__body span {
  color: var(--text-muted);
  font-size: 12px;
}

.chat-composer,
.chat-admin-form,
.chat-management-strip form,
.chat-edit-box {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.chat-admin-form {
  border-bottom: 1px solid var(--border);
  padding: 14px;
  background: #fbfdff;
}

.chat-composer {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding: 14px 18px 16px;
  background: rgba(255, 255, 255, 0.98);
}

.chat-composer textarea {
  min-height: 76px;
  max-height: 150px;
  resize: none;
}

.chat-composer__actions,
.chat-management-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.chat-management-strip {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  background: #ffffff;
}

.chat-management-strip form {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
}

.chat-pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-pending-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 320px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 7px 9px;
  font-size: 12px;
}

.chat-pending-file--image {
  max-width: 360px;
}

.chat-pending-file img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
}

.chat-pending-file__icon {
  flex: 0 0 auto;
  border-radius: 9px;
  background: #e2e8f0;
  color: #334155;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.chat-pending-file__body {
  min-width: 0;
  display: grid;
  grid-gap: 2px;
  gap: 2px;
}

.chat-pending-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pending-file__body span {
  color: var(--text-muted);
}

.chat-pending-file button {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  box-shadow: none;
}

.file-picker-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 9px 14px;
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.file-picker-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.quiet-button {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: none;
}

.chat-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--text-muted);
  text-align: center;
}

.chat-readonly-notice {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding: 16px 18px;
  color: var(--text-muted);
  background: #ffffff;
}

.chat-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
}

.chat-modal {
  width: min(520px, 100%);
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.chat-modal--wide {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
}

.chat-modal .section-header {
  padding-bottom: 6px;
}

.participant-picker {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.participant-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  align-items: center;
}

.participant-picker__options {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.participant-picker__options button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  box-shadow: none;
}

.participant-picker__options small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.chat-participant-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.chat-participant-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
}

.chat-participant-row__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12px;
}

.chat-participant-add-form {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

@media (max-width: 980px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 138px);
    min-height: 0;
    overflow: hidden;
  }

  .chat-layout.chat-layout--room-list-open .chat-main,
  .chat-layout:not(.chat-layout--room-list-open) .chat-room-panel {
    display: none;
  }

  .chat-room-panel,
  .chat-main {
    height: 100%;
    min-height: 0;
  }

  .chat-back-button {
    display: inline-flex;
  }

  .chat-message {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .chat-main {
    height: 100%;
  }

  .chat-message-list {
    padding: 12px;
  }

  .chat-header,
  .chat-composer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-image-grid {
    grid-template-columns: 1fr;
  }

  .chat-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-header__actions {
    justify-content: flex-start;
  }

  .chat-room-settings-panel form {
    grid-template-columns: 1fr;
  }

  .chat-participant-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-composer__actions {
    align-items: stretch;
  }

  .chat-composer__actions button[type="submit"] {
    margin-left: auto;
  }
}

